mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-19 05:49:09 +02:00
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>
This commit is contained in:
parent
e19d10645c
commit
77f8d2da9d
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user