summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-12 19:17:21 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2022-10-20 07:56:17 +0200
commit77f8d2da9de33b791a7d6b88fe89e77b25daca5c (patch)
tree51c5e1e66ea0e0f4547752190120f0dab33f703c /libavcodec
parente19d10645cf43e536c4116822e7736d1696ee378 (diff)
avcodec/mpeg4videodec: Remove always-true checks
codec_id is always AV_CODEC_ID_MPEG4 for mpeg4_decode_mb(), as the MPEG-4 decoder is the only decoder for which ff_mpeg4_decode_picture_header() as well as decode_init() are ever called and these are the only places where the decode_mb function pointer is ever set to mpeg4_decode_mb(). ff_mpeg4_workaround_bugs() is also only called for the MPEG-4 decoder (the caller checks the codec id). (ff_mpeg4_decode_picture_header() is also called for the MPEG-4 parser, but it never uses the decode_mb function pointer.) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpeg4videodec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index aeb0d003ec..b4e2c09706 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -1648,6 +1648,7 @@ static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64])
int16_t *mot_val;
static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
const int xy = s->mb_x + s->mb_y * s->mb_stride;
+ int next;
av_assert2(s == (void*)ctx);
av_assert2(s->h263_pred);
@@ -1999,8 +2000,7 @@ intra:
end:
/* per-MB end of slice check */
- if (s->codec_id == AV_CODEC_ID_MPEG4) {
- int next = mpeg4_is_resync(ctx);
+ next = mpeg4_is_resync(ctx);
if (next) {
if (s->mb_x + s->mb_y*s->mb_width + 1 > next && (s->avctx->err_recognition & AV_EF_AGGRESSIVE)) {
return AVERROR_INVALIDDATA;
@@ -2019,7 +2019,6 @@ end:
return SLICE_END;
}
- }
return SLICE_OK;
}
@@ -3084,7 +3083,6 @@ int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
ctx->divx_version, ctx->divx_build, s->divx_packed ? "p" : "");
if (CONFIG_MPEG4_DECODER && ctx->xvid_build >= 0 &&
- s->codec_id == AV_CODEC_ID_MPEG4 &&
avctx->idct_algo == FF_IDCT_AUTO) {
avctx->idct_algo = FF_IDCT_XVID;
ff_mpv_idct_init(s);