History

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().

Andreas Rheinhardt committed 1 year ago

Commit a1e4be51 parent e12cbf63 files · +8 −10Browse files

Showing the changes to libavcodec (3 of 3 files). Show all

Unified · Split

3 files
  1. libavcodec/h263dec.c +8 −2
  2. libavcodec/mpegvideo_dec.c +0 −7
  3. libavcodec/mpegvideodec.h +0 −1
libavcodec/h263dec.c+8−2
@@ -174,6 +174,12 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) · 173 unmodified lines
174174 return 0;
175175 }
176176
177+static void report_decode_progress(MpegEncContext *s)
178+{
179+ if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->er.error_occurred)
180+ ff_thread_progress_report(&s->cur_pic.ptr->progress, s->mb_y);
181+}
182+
177183 static int decode_slice(MpegEncContext *s)
178184 {
179185 const int part_mask = s->partitioned_frame
@@ -278,8 +284,8 @@ static int decode_slice(MpegEncContext *s) · 98 unmodified lines
278284
279285 if (++s->mb_x >= s->mb_width) {
280286 s->mb_x = 0;
287+ report_decode_progress(s);
281288 ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
282− ff_mpv_report_decode_progress(s);
283289 s->mb_y++;
284290 }
285291 return 0;
@@ -305,8 +311,8 @@ static int decode_slice(MpegEncContext *s) · 19 unmodified lines
305311 ff_h263_loop_filter(s);
306312 }
307313
314+ report_decode_progress(s);
308315 ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
309− ff_mpv_report_decode_progress(s);
310316
311317 s->mb_x = 0;
312318 }
libavcodec/mpegvideo_dec.c+0−7
@@ -424,13 +424,6 @@ av_cold void ff_mpeg_flush(AVCodecContext *avctx) · 423 unmodified lines
424424 s->pp_time = 0;
425425 }
426426
427−void ff_mpv_report_decode_progress(MpegEncContext *s)
428−{
429− if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->er.error_occurred)
430− ff_thread_progress_report(&s->cur_pic.ptr->progress, s->mb_y);
431−}
432−
433−
434427 static inline int hpel_motion_lowres(MpegEncContext *s,
435428 uint8_t *dest, const uint8_t *src,
436429 int field_based, int field_select,
libavcodec/mpegvideodec.h+0−1
@@ -57,7 +57,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx); · 56 unmodified lines
5757 */
5858 int ff_mpv_alloc_dummy_frames(MpegEncContext *s);
5959 void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]);
60−void ff_mpv_report_decode_progress(MpegEncContext *s);
6160 void ff_mpv_frame_end(MpegEncContext *s);
6261
6362 int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t