ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Fri May 16 19:46:40 2025 +0200| [a1e4be574083ae0ccb05257c5d12f9df59ea8339] | 
committer: Andreas Rheinhardt

avcodec/mpegvideo_dec: Move ff_mpv_report_decode_progress() to h263dec.c

It is its only user. Also make it static and call it
before ff_mpeg_draw_horiz_band().

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a1e4be574083ae0ccb05257c5d12f9df59ea8339
---

 libavcodec/h263dec.c       | 10 ++++++++--
 libavcodec/mpegvideo_dec.c |  7 -------
 libavcodec/mpegvideodec.h  |  1 -
 3 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 2f8bd73665..c36070e23c 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -174,6 +174,12 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
     return 0;
 }
 
+static void report_decode_progress(MpegEncContext *s)
+{
+    if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && 
!s->er.error_occurred)
+        ff_thread_progress_report(&s->cur_pic.ptr->progress, s->mb_y);
+}
+
 static int decode_slice(MpegEncContext *s)
 {
     const int part_mask = s->partitioned_frame
@@ -278,8 +284,8 @@ static int decode_slice(MpegEncContext *s)
 
                     if (++s->mb_x >= s->mb_width) {
                         s->mb_x = 0;
+                        report_decode_progress(s);
                         ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
-                        ff_mpv_report_decode_progress(s);
                         s->mb_y++;
                     }
                     return 0;
@@ -305,8 +311,8 @@ static int decode_slice(MpegEncContext *s)
                 ff_h263_loop_filter(s);
         }
 
+        report_decode_progress(s);
         ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
-        ff_mpv_report_decode_progress(s);
 
         s->mb_x = 0;
     }
diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c
index b8b84ffd8d..4aefe6e047 100644
--- a/libavcodec/mpegvideo_dec.c
+++ b/libavcodec/mpegvideo_dec.c
@@ -424,13 +424,6 @@ av_cold void ff_mpeg_flush(AVCodecContext *avctx)
     s->pp_time = 0;
 }
 
-void ff_mpv_report_decode_progress(MpegEncContext *s)
-{
-    if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && 
!s->er.error_occurred)
-        ff_thread_progress_report(&s->cur_pic.ptr->progress, s->mb_y);
-}
-
-
 static inline int hpel_motion_lowres(MpegEncContext *s,
                                      uint8_t *dest, const uint8_t *src,
                                      int field_based, int field_select,
diff --git a/libavcodec/mpegvideodec.h b/libavcodec/mpegvideodec.h
index bc4bc90590..8bc70b02c0 100644
--- a/libavcodec/mpegvideodec.h
+++ b/libavcodec/mpegvideodec.h
@@ -57,7 +57,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext 
*avctx);
  */
 int ff_mpv_alloc_dummy_frames(MpegEncContext *s);
 void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]);
-void ff_mpv_report_decode_progress(MpegEncContext *s);
 void ff_mpv_frame_end(MpegEncContext *s);
 
 int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f,

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to