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

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
174 return 0;174 return 0;
175}175}
176 176
177static 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
177static int decode_slice(MpegEncContext *s)183static int decode_slice(MpegEncContext *s)
178{184{
179 const int part_mask = s->partitioned_frame185 const int part_mask = s->partitioned_frame
@@ -278,8 +284,8 @@ static int decode_slice(MpegEncContext *s) · 98 unmodified lines
278 284
279 if (++s->mb_x >= s->mb_width) {285 if (++s->mb_x >= s->mb_width) {
280 s->mb_x = 0;286 s->mb_x = 0;
287 report_decode_progress(s);
281 ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);288 ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
282 ff_mpv_report_decode_progress(s);
283 s->mb_y++;289 s->mb_y++;
284 }290 }
285 return 0;291 return 0;
@@ -305,8 +311,8 @@ static int decode_slice(MpegEncContext *s) · 19 unmodified lines
305 ff_h263_loop_filter(s);311 ff_h263_loop_filter(s);
306 }312 }
307 313
314 report_decode_progress(s);
308 ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);315 ff_mpeg_draw_horiz_band(s, s->mb_y * mb_size, mb_size);
309 ff_mpv_report_decode_progress(s);
310 316
311 s->mb_x = 0;317 s->mb_x = 0;
312 }318 }
libavcodec/mpegvideo_dec.c+0−7
@@ -424,13 +424,6 @@ av_cold void ff_mpeg_flush(AVCodecContext *avctx) · 423 unmodified lines
424 s->pp_time = 0;424 s->pp_time = 0;
425}425}
426 426
427void 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
434static inline int hpel_motion_lowres(MpegEncContext *s,427static inline int hpel_motion_lowres(MpegEncContext *s,
435 uint8_t *dest, const uint8_t *src,428 uint8_t *dest, const uint8_t *src,
436 int field_based, int field_select,429 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
57 */57 */
58int ff_mpv_alloc_dummy_frames(MpegEncContext *s);58int ff_mpv_alloc_dummy_frames(MpegEncContext *s);
59void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]);59void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]);
60void ff_mpv_report_decode_progress(MpegEncContext *s);
61void ff_mpv_frame_end(MpegEncContext *s);60void ff_mpv_frame_end(MpegEncContext *s);
62 61
63int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f,62int 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