1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-04 06:08:26 +02:00

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>
This commit is contained in:
Andreas Rheinhardt 2024-06-11 14:05:20 +02:00
parent 2e5287e519
commit 66709df403

View File

@ -483,11 +483,13 @@ static inline int hpel_motion_lowres(MpegEncContext *s,
int motion_x, int motion_y) int motion_x, int motion_y)
{ {
const int lowres = s->avctx->lowres; 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; const int s_mask = (2 << lowres) - 1;
int emu = 0; int emu = 0;
int sx, sy; int sx, sy;
av_assert2(op_index <= 3);
if (s->quarter_sample) { if (s->quarter_sample) {
motion_x /= 2; motion_x /= 2;
motion_y /= 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; int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, sx, sy, uvsx, uvsy;
ptrdiff_t uvlinesize, linesize; ptrdiff_t uvlinesize, linesize;
const int lowres = s->avctx->lowres; 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 block_s = 8 >> lowres;
const int s_mask = (2 << lowres) - 1; const int s_mask = (2 << lowres) - 1;
const int h_edge_pos = s->h_edge_pos >> lowres; const int h_edge_pos = s->h_edge_pos >> lowres;
const int v_edge_pos = s->v_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; 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; linesize = s->cur_pic.linesize[0] << field_based;
uvlinesize = s->cur_pic.linesize[1] << 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) int mx, int my)
{ {
const int lowres = s->avctx->lowres; 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 block_s = 8 >> lowres;
const int s_mask = (2 << lowres) - 1; const int s_mask = (2 << lowres) - 1;
const int h_edge_pos = s->h_edge_pos >> 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; ptrdiff_t offset;
const uint8_t *ptr; const uint8_t *ptr;
av_assert2(op_index <= 3);
if (s->quarter_sample) { if (s->quarter_sample) {
mx /= 2; mx /= 2;
my /= 2; my /= 2;