From 9c684feadc063473da3f9e341fa07e6c17b75154 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 1 Sep 2011 13:15:09 +0200 Subject: libx264: add 'direct-pred' private option Deprecate AVCodecContext.directpred --- libavcodec/libx264.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'libavcodec/libx264.c') diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 10cb32eda2..d915735a76 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -63,6 +63,7 @@ typedef struct X264Context { char *deblock; float cplxblur; char *partitions; + int direct_pred; } X264Context; static void X264_log(void *p, int level, const char *fmt, va_list args) @@ -208,8 +209,6 @@ static av_cold int X264_init(AVCodecContext *avctx) x4->params.b_deblocking_filter = avctx->flags & CODEC_FLAG_LOOP_FILTER; - x4->params.analyse.i_direct_mv_pred = avctx->directpred; - if (avctx->me_method == ME_EPZS) x4->params.analyse.i_me_method = X264_ME_DIA; else if (avctx->me_method == ME_HEX) @@ -307,6 +306,8 @@ static av_cold int X264_init(AVCodecContext *avctx) x4->params.i_deblocking_filter_beta = avctx->deblockbeta; if (avctx->complexityblur >= 0) x4->params.rc.f_complexity_blur = avctx->complexityblur; + if (avctx->directpred >= 0) + x4->params.analyse.i_direct_mv_pred = avctx->directpred; if (avctx->partitions) { if (avctx->partitions & X264_PART_I4X4) x4->params.analyse.inter |= X264_ANALYSE_I4x4; @@ -386,6 +387,8 @@ static av_cold int X264_init(AVCodecContext *avctx) x4->params.b_aud = x4->aud; if (x4->mbtree >= 0) x4->params.rc.b_mb_tree = x4->mbtree; + if (x4->direct_pred >= 0) + x4->params.analyse.i_direct_mv_pred = x4->direct_pred; if (x4->fastfirstpass) x264_param_apply_fastfirstpass(&x4->params); @@ -488,6 +491,11 @@ static const AVOption options[] = { { "cplxblur", "Reduce fluctuations in QP (before curve compression)", OFFSET(cplxblur), FF_OPT_TYPE_FLOAT, {-1 }, -1, FLT_MAX, VE}, { "partitions", "A comma-separated list of partitions to consider. " "Possible values: p8x8, p4x4, b8x8, i8x8, i4x4, none, all", OFFSET(partitions), FF_OPT_TYPE_STRING, { 0 }, 0, 0, VE}, + { "direct-pred", "Direct MV prediction mode", OFFSET(direct_pred), FF_OPT_TYPE_INT, {-1 }, -1, INT_MAX, VE, "direct-pred" }, + { "none", NULL, 0, FF_OPT_TYPE_CONST, { X264_DIRECT_PRED_NONE }, 0, 0, VE, "direct-pred" }, + { "spatial", NULL, 0, FF_OPT_TYPE_CONST, { X264_DIRECT_PRED_SPATIAL }, 0, 0, VE, "direct-pred" }, + { "temporal", NULL, 0, FF_OPT_TYPE_CONST, { X264_DIRECT_PRED_TEMPORAL }, 0, 0, VE, "direct-pred" }, + { "auto", NULL, 0, FF_OPT_TYPE_CONST, { X264_DIRECT_PRED_AUTO }, 0, 0, VE, "direct-pred" }, { NULL }, }; -- cgit v1.2.3