diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-06-11 14:05:20 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2024-06-20 18:58:39 +0200 |
commit | 66709df4036b51c29d451de9621e76dfb898caf0 (patch) | |
tree | 9c7fb4b02faa78cd8f0b0bdf2dc8c645bb414455 | |
parent | 2e5287e519dc0f99ade473096c9b6742f0d8114b (diff) | |
download | ffmpeg-66709df4036b51c29d451de9621e76dfb898caf0.tar.gz |
avcodec/mpegvideo_dec: Remove unnecessary FFMIN
No mpegvideo-based decoder supports lowres > 3,
so the FFMIN here are unnecessary.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/mpegvideo_dec.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index 4e279d9fa8..684f31947c 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -483,11 +483,13 @@ static inline int hpel_motion_lowres(MpegEncContext *s, int motion_x, int motion_y) { const int lowres = s->avctx->lowres; - const int op_index = FFMIN(lowres, 3); + const int op_index = lowres; const int s_mask = (2 << lowres) - 1; int emu = 0; int sx, sy; + av_assert2(op_index <= 3); + if (s->quarter_sample) { motion_x /= 2; motion_y /= 2; @@ -536,12 +538,15 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s, int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, sx, sy, uvsx, uvsy; ptrdiff_t uvlinesize, linesize; const int lowres = s->avctx->lowres; - const int op_index = FFMIN(lowres - 1 + s->chroma_x_shift, 3); + const int op_index = lowres - 1 + s->chroma_x_shift; const int block_s = 8 >> lowres; const int s_mask = (2 << lowres) - 1; const int h_edge_pos = s->h_edge_pos >> lowres; const int v_edge_pos = s->v_edge_pos >> lowres; int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h; + + av_assert2(op_index <= 3); + linesize = s->cur_pic.linesize[0] << field_based; uvlinesize = s->cur_pic.linesize[1] << field_based; @@ -666,7 +671,7 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s, int mx, int my) { const int lowres = s->avctx->lowres; - const int op_index = FFMIN(lowres, 3); + const int op_index = lowres; const int block_s = 8 >> lowres; const int s_mask = (2 << lowres) - 1; const int h_edge_pos = s->h_edge_pos >> lowres + 1; @@ -675,6 +680,8 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s, ptrdiff_t offset; const uint8_t *ptr; + av_assert2(op_index <= 3); + if (s->quarter_sample) { mx /= 2; my /= 2; |