|
|
|
@ -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 }, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|