History

avcodec/mpegvideo_motion: Optimize check away

Only MPEG-2 can have field motion vectors with coded fields.

Andreas Rheinhardt committed 2 years ago

Commit 5f505991 parent f44d2121 file · +6 −1Browse files

Unified · Split

libavcodec/mpegvideo_motion.c+6−1
@@ -719,7 +719,11 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, · 718 unmodified lines
719 dir, ref_picture, qpix_op, pix_op);719 dir, ref_picture, qpix_op, pix_op);
720 break;720 break;
721 case MV_TYPE_FIELD:721 case MV_TYPE_FIELD:
722 if (s->picture_structure == PICT_FRAME) {722 // Only MPEG-1/2 can have a picture_structure != PICT_FRAME here.
723 if (!CONFIG_SMALL)
724 av_assert2(is_mpeg12 || s->picture_structure == PICT_FRAME);
725 if ((!CONFIG_SMALL && !is_mpeg12) ||
726 s->picture_structure == PICT_FRAME) {
723 if (!is_mpeg12 && s->quarter_sample) {727 if (!is_mpeg12 && s->quarter_sample) {
724 for (i = 0; i < 2; i++)728 for (i = 0; i < 2; i++)
725 qpel_motion(s, dest_y, dest_cb, dest_cr,729 qpel_motion(s, dest_y, dest_cb, dest_cr,
@@ -739,6 +743,7 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, · 13 unmodified lines
739 s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y);743 s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y);
740 }744 }
741 } else {745 } else {
746 av_assert2(s->out_format == FMT_MPEG1);
742 if (s->picture_structure != s->field_select[dir][0] + 1 &&747 if (s->picture_structure != s->field_select[dir][0] + 1 &&
743 s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) {748 s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) {
744 ref_picture = s->current_picture_ptr->f->data;749 ref_picture = s->current_picture_ptr->f->data;

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