diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-04-28 12:36:58 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-06-12 10:50:57 +0200 |
commit | 5f505995db8f80867bd70f7b632ec0bb9879a3d5 (patch) | |
tree | 7766a76cb691c1ab96f08d762b8e3781ed2b2044 | |
parent | f44d212e0e4e7def30dd60a7f700f019a49450b7 (diff) | |
download | ffmpeg-5f505995db8f80867bd70f7b632ec0bb9879a3d5.tar.gz |
avcodec/mpegvideo_motion: Optimize check away
Only MPEG-2 can have field motion vectors with coded fields.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/mpegvideo_motion.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/mpegvideo_motion.c b/libavcodec/mpegvideo_motion.c index 01c8d82e98..5b72196395 100644 --- a/libavcodec/mpegvideo_motion.c +++ b/libavcodec/mpegvideo_motion.c @@ -719,7 +719,11 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, dir, ref_picture, qpix_op, pix_op); break; case MV_TYPE_FIELD: - if (s->picture_structure == PICT_FRAME) { + // Only MPEG-1/2 can have a picture_structure != PICT_FRAME here. + if (!CONFIG_SMALL) + av_assert2(is_mpeg12 || s->picture_structure == PICT_FRAME); + if ((!CONFIG_SMALL && !is_mpeg12) || + s->picture_structure == PICT_FRAME) { if (!is_mpeg12 && s->quarter_sample) { for (i = 0; i < 2; i++) qpel_motion(s, dest_y, dest_cb, dest_cr, @@ -739,6 +743,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y); } } else { + av_assert2(s->out_format == FMT_MPEG1); if (s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { ref_picture = s->current_picture_ptr->f->data; |