]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mpegvideo_enc.c
Merge commit '5fd553d31272d5ed42a7a5a0ecaab7b3452da83a'
[ffmpeg] / libavcodec / mpegvideo_enc.c
index 71ea9faba6eaa6d31ae3bb80317c2bec46783ad9..f837b3f29d9664c951d4e871cb5c5cf62de78152 100644 (file)
@@ -857,8 +857,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
     ff_pixblockdsp_init(&s->pdsp, avctx);
     ff_qpeldsp_init(&s->qdsp);
 
-    s->avctx->coded_frame = s->current_picture.f;
-
     if (s->msmpeg4_version) {
         FF_ALLOCZ_OR_GOTO(s->avctx, s->ac_stats,
                           2 * 2 * (MAX_LEVEL + 1) *
@@ -1619,8 +1617,11 @@ static void frame_end(MpegEncContext *s)
     if (s->pict_type!= AV_PICTURE_TYPE_B)
         s->last_non_b_pict_type = s->pict_type;
 
-    s->avctx->coded_frame = s->current_picture_ptr->f;
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
+    av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f);
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 }
 
 static void update_noise_reduction(MpegEncContext *s)
@@ -1784,6 +1785,8 @@ vbv_retry:
 
         frame_end(s);
 
+        ff_side_data_set_encoder_stats(pkt, s->current_picture.f->quality, NULL, 0, s->pict_type);
+
         if (CONFIG_MJPEG_ENCODER && s->out_format == FMT_MJPEG)
             ff_mjpeg_encode_picture_trailer(&s->pb, s->header_bits);