summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorVittorio Giovara <vittorio.giovara@gmail.com>2016-01-28 11:38:27 -0500
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-28 18:45:40 +0100
commitb340bd8a58c32453172404a8e4240e3317e341da (patch)
treef9b8d36a5ab0bb82e4ef53080a4ad43f8a43c3e4 /libavcodec
parentcb06be6136dd9860743e2e5ef7bc31f0cfb6c456 (diff)
libx264: Make sure to preserve default option values
The private options chromaoffset, sc_threshold, and noise_reduction were set to 0 rather than -1, and were always initializing values in libx264 rather than letting the library use its default. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libx264.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 3d175adde1..07756d0278 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -536,12 +536,11 @@ static av_cold int X264_init(AVCodecContext *avctx)
#if FF_API_PRIVATE_OPT
FF_DISABLE_DEPRECATION_WARNINGS
- if (avctx->chromaoffset)
+ if (avctx->chromaoffset >= 0)
x4->chroma_offset = avctx->chromaoffset;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
-
- if (x4->chroma_offset)
+ if (x4->chroma_offset >= 0)
x4->params.analyse.i_chroma_qp_offset = x4->chroma_offset;
if (avctx->gop_size >= 0)
@@ -989,9 +988,9 @@ static const AVOption options[] = {
{ "vlc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, INT_MIN, INT_MAX, VE, "coder" },
{ "ac", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, INT_MIN, INT_MAX, VE, "coder" },
{ "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 = -1 }, -1, INT_MAX, VE },
- { "noise_reduction", "Noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, { .i64 = -1 }, 0, INT_MAX, VE },
+ { "chromaoffset", "QP difference between chroma and luma", OFFSET(chroma_offset), AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, VE },
+ { "sc_threshold", "Scene change threshold", OFFSET(scenechange_threshold), AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, INT_MAX, VE },
+ { "noise_reduction", "Noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, { .i64 = -1 }, INT_MIN, 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 },