These references now always exist due to dummy frames. Also remove the corresponding checks in the lowres code in mpegvideo_dec.c.
Unified · Split
| @@ -862,8 +862,8 @@ static inline void MPV_motion_lowres(MpegEncContext *s, · 861 unmodified lines | ||
| 862 | 862 | s->mv[dir][1][0], s->mv[dir][1][1], |
| 863 | 863 | block_s, mb_y); |
| 864 | 864 | } else { |
| 865 | − if ( s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field | |
| 866 | − || !ref_picture[0]) { | |
| 865 | + if (s->picture_structure != s->field_select[dir][0] + 1 && | |
| 866 | + s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { | |
| 867 | 867 | ref_picture = s->current_picture_ptr->f->data; |
| 868 | 868 | } |
| 869 | 869 | mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, |
| @@ -877,9 +877,8 @@ static inline void MPV_motion_lowres(MpegEncContext *s, · 7 unmodified lines | ||
| 877 | 877 | for (int i = 0; i < 2; i++) { |
| 878 | 878 | uint8_t *const *ref2picture; |
| 879 | 879 | |
| 880 | − if ((s->picture_structure == s->field_select[dir][i] + 1 || | |
| 881 | − s->pict_type == AV_PICTURE_TYPE_B || s->first_field) && | |
| 882 | − ref_picture[0]) { | |
| 880 | + if (s->picture_structure == s->field_select[dir][i] + 1 || | |
| 881 | + s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { | |
| 883 | 882 | ref2picture = ref_picture; |
| 884 | 883 | } else { |
| 885 | 884 | ref2picture = s->current_picture_ptr->f->data; |
| @@ -910,9 +909,6 @@ static inline void MPV_motion_lowres(MpegEncContext *s, · 24 unmodified lines | ||
| 910 | 909 | pix_op = s->h264chroma.avg_h264_chroma_pixels_tab; |
| 911 | 910 | } |
| 912 | 911 | } else { |
| 913 | − if (!ref_picture[0]) { | |
| 914 | − ref_picture = s->current_picture_ptr->f->data; | |
| 915 | − } | |
| 916 | 912 | for (int i = 0; i < 2; i++) { |
| 917 | 913 | mpeg_motion_lowres(s, dest_y, dest_cb, dest_cr, |
| 918 | 914 | 0, 0, s->picture_structure != i + 1, |
| @@ -739,8 +739,8 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, · 738 unmodified lines | ||
| 739 | 739 | s->mv[dir][1][0], s->mv[dir][1][1], 8, mb_y); |
| 740 | 740 | } |
| 741 | 741 | } else { |
| 742 | − if ( s->picture_structure != s->field_select[dir][0] + 1 && s->pict_type != AV_PICTURE_TYPE_B && !s->first_field | |
| 743 | − || !ref_picture[0]) { | |
| 742 | + if (s->picture_structure != s->field_select[dir][0] + 1 && | |
| 743 | + s->pict_type != AV_PICTURE_TYPE_B && !s->first_field) { | |
| 744 | 744 | ref_picture = s->current_picture_ptr->f->data; |
| 745 | 745 | } |
| 746 | 746 | |
| @@ -755,9 +755,8 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, · 8 unmodified lines | ||
| 755 | 755 | for (i = 0; i < 2; i++) { |
| 756 | 756 | uint8_t *const *ref2picture; |
| 757 | 757 | |
| 758 | − if ((s->picture_structure == s->field_select[dir][i] + 1 || | |
| 759 | − s->pict_type == AV_PICTURE_TYPE_B || s->first_field) && | |
| 760 | − ref_picture[0]) { | |
| 758 | + if (s->picture_structure == s->field_select[dir][i] + 1 || | |
| 759 | + s->pict_type == AV_PICTURE_TYPE_B || s->first_field) { | |
| 761 | 760 | ref2picture = ref_picture; |
| 762 | 761 | } else { |
| 763 | 762 | ref2picture = s->current_picture_ptr->f->data; |
| @@ -787,9 +786,6 @@ static av_always_inline void mpv_motion_internal(MpegEncContext *s, · 23 unmodified lines | ||
| 787 | 786 | pix_op = s->hdsp.avg_pixels_tab; |
| 788 | 787 | } |
| 789 | 788 | } else { |
| 790 | − if (!ref_picture[0]) { | |
| 791 | − ref_picture = s->current_picture_ptr->f->data; | |
| 792 | − } | |
| 793 | 789 | for (i = 0; i < 2; i++) { |
| 794 | 790 | mpeg_motion(s, dest_y, dest_cb, dest_cr, |
| 795 | 791 | s->picture_structure != i + 1, |