From 1482aff2048511b821ff9feac19426113cc641a2 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Sun, 13 Sep 2015 23:45:24 +0200 Subject: 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 --- libavcodec/libx264.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'libavcodec/libx264.c') 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" }, -- cgit v1.2.3