Only MPEG-2 can have field motion vectors with coded fields.
Unified · Split
| @@ -719,7 +719,11 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, · 718 unmodified lines | ||
| 719 | 719 | dir, ref_picture, qpix_op, pix_op); |
| 720 | 720 | break; |
| 721 | 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 | 727 | if (!is_mpeg12 && s->quarter_sample) { |
| 724 | 728 | for (i = 0; i < 2; i++) |
| 725 | 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 | 743 | s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y); |
| 740 | 744 | } |
| 741 | 745 | } else { |
| 746 | + av_assert2(s->out_format == FMT_MPEG1); | |
| 742 | 747 | if (s->picture_structure != s->field_select[dir][0] + 1 && |
| 743 | 748 | s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { |
| 744 | 749 | ref_picture = s->current_picture_ptr->f->data; |