Only MPEG-2 can have field motion vectors with coded fields.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -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; |