From 3eb1e65f5f69a73b9b59a10eefb57cff402207a4 Mon Sep 17 00:00:00 2001 From: Andrew Wason Date: Mon, 12 Sep 2011 15:08:45 -0400 Subject: [PATCH] libx264: fix overwriting preset rc_lookahead This fixes https://ffmpeg.org/trac/ffmpeg/ticket/448 - at least for rc_lookahead. A similar problem still exists for the flags2 based options. --- libavcodec/libx264.c | 1 + libavcodec/options.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 4fd117f9ab..e1096bba17 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -584,6 +584,7 @@ static const AVCodecDefault x264_defaults[] = { { "qdiff", "-1" }, { "qblur", "-1" }, { "qcomp", "-1" }, + { "rc_lookahead", "-1" }, { "refs", "-1" }, { "sc_threshold", "-1" }, { "trellis", "-1" }, diff --git a/libavcodec/options.c b/libavcodec/options.c index b3c562eb2d..549d04a76c 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -472,7 +472,7 @@ static const AVOption options[]={ {"psy_trellis", "specify psycho visual trellis", OFFSET(psy_trellis), FF_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, V|E}, {"aq_mode", "specify aq method", OFFSET(aq_mode), FF_OPT_TYPE_INT, {.dbl = -1 }, -1, INT_MAX, V|E}, {"aq_strength", "specify aq strength", OFFSET(aq_strength), FF_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1, FLT_MAX, V|E}, -{"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), FF_OPT_TYPE_INT, {.dbl = 40 }, 0, INT_MAX, V|E}, +{"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), FF_OPT_TYPE_INT, {.dbl = 40 }, -1, INT_MAX, V|E}, {"ssim", "ssim will be calculated during encoding", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SSIM }, INT_MIN, INT_MAX, V|E, "flags2"}, {"intra_refresh", "use periodic insertion of intra blocks instead of keyframes", 0, FF_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_REFRESH }, INT_MIN, INT_MAX, V|E, "flags2"}, {"crf_max", "in crf mode, prevents vbv from lowering quality beyond this point", OFFSET(crf_max), FF_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 51, V|E},