aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2015-09-13 23:45:24 +0200
committerVittorio Giovara <vittorio.giovara@gmail.com>2016-01-21 15:33:19 -0500
commit1482aff2048511b821ff9feac19426113cc641a2 (patch)
treeb8254bb7874f24fe6f368afc7c0a37dba8175d3c /libavcodec/libx264.c
parent7c79587d7407dab4b9445d66b5f111fe657c8c4d (diff)
downloadffmpeg-1482aff2048511b821ff9feac19426113cc641a2.tar.gz
lavc: Move noise_reduction to codec private options
This option is only used by mpegvideoenc, x264, xavs, and vpx. It is a very codec-specific option, so deprecate the global variant. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 205fb3d5ce..187506aafe 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -82,6 +82,7 @@ typedef struct X264Context {
int b_frame_strategy;
int chroma_offset;
int scenechange_threshold;
+ int noise_reduction;
char *x264_params;
} X264Context;
@@ -454,8 +455,13 @@ FF_ENABLE_DEPRECATION_WARNINGS
x4->params.analyse.i_trellis = avctx->trellis;
if (avctx->me_range >= 0)
x4->params.analyse.i_me_range = avctx->me_range;
- if (avctx->noise_reduction >= 0)
- x4->params.analyse.i_noise_reduction = avctx->noise_reduction;
+#if FF_API_PRIVATE_OPT
+ FF_DISABLE_DEPRECATION_WARNINGS
+ if (!x4->noise_reduction)
+ x4->noise_reduction = avctx->noise_reduction;
+ FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ x4->params.analyse.i_noise_reduction = x4->noise_reduction;
if (avctx->me_subpel_quality >= 0)
x4->params.analyse.i_subpel_refine = avctx->me_subpel_quality;
#if FF_API_PRIVATE_OPT
@@ -759,6 +765,7 @@ static const AVOption options[] = {
{ "b_strategy", "Strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 2, VE },
{ "chromaoffset", "QP difference between chroma and luma", OFFSET(chroma_offset), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, VE },
{ "sc_threshold", "Scene change threshold", OFFSET(scenechange_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
+ { "noise_reduction", "Noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
{ "x264-params", "Override the x264 configuration using a :-separated list of key=value parameters", OFFSET(x264_params), AV_OPT_TYPE_STRING, { 0 }, 0, 0, VE },
{ NULL },
@@ -779,7 +786,9 @@ static const AVCodecDefault x264_defaults[] = {
{ "sc_threshold", "-1" },
#endif
{ "trellis", "-1" },
+#if FF_API_PRIVATE_OPT
{ "nr", "-1" },
+#endif
{ "me_range", "-1" },
#if FF_API_MOTION_EST
{ "me_method", "-1" },