aboutsummaryrefslogtreecommitdiffstats
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:32:24 +0200
commitc5dd0bc4ca977924825a74080ff1c294dda01427 (patch)
treef3a5e105ff0a9e18f490f4db607c31eaa45966d5 /libavcodec/libx264.c
parentd4b967131842e7c225e5f83cb82337d4474a0bb7 (diff)
downloadffmpeg-c5dd0bc4ca977924825a74080ff1c294dda01427.tar.gz
libx264: add 'weightp' private option.
Deprecate corresponding global option.
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 72033b9310..435f228b80 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -48,6 +48,7 @@ typedef struct X264Context {
float psy_rd;
float psy_trellis;
int rc_lookahead;
+ int weightp;
} X264Context;
static void X264_log(void *p, int level, const char *fmt, va_list args)
@@ -225,7 +226,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.i_direct_mv_pred = avctx->directpred;
x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED;
- x4->params.analyse.i_weighted_pred = avctx->weighted_p_pred;
if (avctx->me_method == ME_EPZS)
x4->params.analyse.i_me_method = X264_ME_DIA;
@@ -318,6 +318,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.f_psy_trellis = avctx->psy_trellis;
if (avctx->rc_lookahead >= 0)
x4->params.rc.i_lookahead = avctx->rc_lookahead;
+ if (avctx->weighted_p_pred >= 0)
+ x4->params.analyse.i_weighted_pred = avctx->weighted_p_pred;
#endif
if (x4->aq_mode >= 0)
@@ -330,6 +332,9 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.analyse.f_psy_trellis = x4->psy_trellis;
if (x4->rc_lookahead >= 0)
x4->params.rc.i_lookahead = x4->rc_lookahead;
+ if (x4->weightp >= 0)
+ x4->params.analyse.i_weighted_pred = x4->weightp;
+
if (x4->fastfirstpass)
@@ -414,6 +419,10 @@ static const AVOption options[] = {
{ "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 },
+ { "weightp", "Weighted prediction analysis method.", OFFSET(weightp), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "weightp" },
+ { "none", NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_NONE}, INT_MIN, INT_MAX, VE, "weightp" },
+ { "simple", NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_SIMPLE}, INT_MIN, INT_MAX, VE, "weightp" },
+ { "smart", NULL, 0, FF_OPT_TYPE_CONST, {X264_WEIGHTP_SMART}, INT_MIN, INT_MAX, VE, "weightp" },
{ NULL },
};