Commit d4b96713 authored by Anton Khirnov's avatar Anton Khirnov

libx264: add 'rc_lookahead' private option.

Deprecate corresponding global option.
parent 2a44a8f6
......@@ -2756,7 +2756,6 @@ typedef struct AVCodecContext {
* - decoding: unused
*/
attribute_deprecated float psy_trellis;
#endif
/**
* RC lookahead
......@@ -2764,7 +2763,8 @@ typedef struct AVCodecContext {
* - encoding: Set by user
* - decoding: unused
*/
int rc_lookahead;
attribute_deprecated int rc_lookahead;
#endif
/**
* Constant rate factor maximum
......
......@@ -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 },
};
......
......@@ -442,8 +442,8 @@ 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},
#endif
{"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},
#endif
{"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},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment