It is its only user. Also make it static and call it before ff_mpeg_draw_horiz_band().
Unified · Split
| @@ -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 | ||
| 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 | |||
| 177 | static int decode_slice(MpegEncContext *s) | 183 | static int decode_slice(MpegEncContext *s) |
| 178 | { | 184 | { |
| 179 | const int part_mask = s->partitioned_frame | 185 | 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 | } |
| @@ -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 | ||
| 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 | |||
| 434 | static inline int hpel_motion_lowres(MpegEncContext *s, | 427 | static 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, |
| @@ -57,7 +57,6 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx); · 56 unmodified lines | |||
| 57 | */ | 57 | */ |
| 58 | int ff_mpv_alloc_dummy_frames(MpegEncContext *s); | 58 | int ff_mpv_alloc_dummy_frames(MpegEncContext *s); |
| 59 | void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]); | 59 | void ff_mpv_reconstruct_mb(MpegEncContext *s, int16_t block[12][64]); |
| 60 | void ff_mpv_report_decode_progress(MpegEncContext *s); | ||
| 61 | void ff_mpv_frame_end(MpegEncContext *s); | 60 | void ff_mpv_frame_end(MpegEncContext *s); |
| 62 | 61 | ||
| 63 | int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, | 62 | int ff_mpv_export_qp_table(const MpegEncContext *s, AVFrame *f, |