summaryrefslogtreecommitdiff
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-08-22 07:55:34 +0200
committerAnton Khirnov <anton@khirnov.net>2011-08-24 14:31:55 +0200
commitd4b967131842e7c225e5f83cb82337d4474a0bb7 (patch)
tree34dda9a88eb314c8db28417ed959e4a314c14968 /libavcodec/libx264.c
parent2a44a8f6091913bad14c4df318ceeb68dc4a9258 (diff)
libx264: add 'rc_lookahead' private option.
Deprecate corresponding global option.
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 30bbfe6bc6..72033b9310 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -47,6 +47,7 @@ typedef struct X264Context {
float aq_strength;
float psy_rd;
float psy_trellis;
+ int rc_lookahead;
} X264Context;
static void X264_log(void *p, int level, const char *fmt, va_list args)
@@ -238,8 +239,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.i_me_method = X264_ME_TESA;
else x4->params.analyse.i_me_method = X264_ME_HEX;
- x4->params.rc.i_lookahead = avctx->rc_lookahead;
-
x4->params.analyse.b_psy = avctx->flags2 & CODEC_FLAG2_PSY;
x4->params.analyse.i_me_range = avctx->me_range;
@@ -317,6 +316,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.f_psy_rd = avctx->psy_rd;
if (avctx->psy_trellis >= 0)
x4->params.analyse.f_psy_trellis = avctx->psy_trellis;
+ if (avctx->rc_lookahead >= 0)
+ x4->params.rc.i_lookahead = avctx->rc_lookahead;
#endif
if (x4->aq_mode >= 0)
@@ -327,6 +328,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.f_psy_rd = x4->psy_rd;
if (x4->psy_trellis >= 0)
x4->params.analyse.f_psy_trellis = x4->psy_trellis;
+ if (x4->rc_lookahead >= 0)
+ x4->params.rc.i_lookahead = x4->rc_lookahead;
if (x4->fastfirstpass)
@@ -410,6 +413,7 @@ static const AVOption options[] = {
{ "aq_strength", "AQ strength. Reduces blocking and blurring in flat and textured areas.", OFFSET(aq_strength), FF_OPT_TYPE_FLOAT, {-1}, -1, FLT_MAX, VE},
{ "pdy_rd", "Psy RD strength.", OFFSET(psy_rd), FF_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE},
{ "psy_trellis", "Psy trellis strength", OFFSET(psy_trellis), FF_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE},
+ { "rc_lookahead", "Number of frames to look ahead for frametype and ratecontrol", OFFSET(rc_lookahead), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE },
{ NULL },
};