From 5b6f42da98c26a8aee8d2c2edfcbd0633ad1c607 Mon Sep 17 00:00:00 2001 From: Vittorio Giovara Date: Mon, 9 Nov 2015 03:15:06 +0100 Subject: lavc: Move me_penalty_compensation to codec private options This option is only used by mpegvideoenc. It is a very codec-specific options, so deprecate the global variant. Signed-off-by: Vittorio Giovara --- libavcodec/mpegvideo_enc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'libavcodec/mpegvideo_enc.c') diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 599cd065fa..213367a84e 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -298,6 +298,8 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) FF_DISABLE_DEPRECATION_WARNINGS if (avctx->rtp_payload_size) s->rtp_payload_size = avctx->rtp_payload_size; + if (avctx->me_penalty_compensation) + s->me_penalty_compensation = avctx->me_penalty_compensation; FF_ENABLE_DEPRECATION_WARNINGS #endif @@ -3460,8 +3462,8 @@ static int encode_picture(MpegEncContext *s, int picture_number) /* Estimate motion for every MB */ if(s->pict_type != AV_PICTURE_TYPE_I){ - s->lambda = (s->lambda * s->avctx->me_penalty_compensation + 128)>>8; - s->lambda2= (s->lambda2* (int64_t)s->avctx->me_penalty_compensation + 128)>>8; + s->lambda = (s->lambda * s->me_penalty_compensation + 128) >> 8; + s->lambda2 = (s->lambda2 * (int64_t) s->me_penalty_compensation + 128) >> 8; if (s->pict_type != AV_PICTURE_TYPE_B) { if((s->avctx->pre_me && s->last_non_b_pict_type==AV_PICTURE_TYPE_I) || s->avctx->pre_me==2){ s->avctx->execute(s->avctx, pre_estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*)); -- cgit v1.2.3