]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegvideo_enc.c
Merge commit '8d918a98aa24134a043d578ef45bae363dbed9db'
[ffmpeg] / libavcodec / mpegvideo_enc.c
index a7e3206737fb4ffca9188f035a0c39151dad61a4..297ff788404139d58c04a03915f19019358a9e8c 100644 (file)
@@ -353,6 +353,10 @@ 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;
+    if (avctx->pre_me)
+        s->me_pre = avctx->pre_me;
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 
@@ -3729,10 +3733,11 @@ 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){
+            if ((s->me_pre && s->last_non_b_pict_type == AV_PICTURE_TYPE_I) ||
+                s->me_pre == 2) {
                 s->avctx->execute(s->avctx, pre_estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*));
             }
         }