Commit 2e8ad2d6 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpeg12: Remove duplicate block_last_index setting code

Based on 7c25ffe0 and 58dd885fSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5c02c95f
...@@ -51,7 +51,6 @@ typedef struct TqiContext { ...@@ -51,7 +51,6 @@ typedef struct TqiContext {
int last_dc[3]; int last_dc[3];
DECLARE_ALIGNED(16, int16_t, block)[6][64]; DECLARE_ALIGNED(16, int16_t, block)[6][64];
int block_last_index[12];
} TqiContext; } TqiContext;
static av_cold int tqi_decode_init(AVCodecContext *avctx) static av_cold int tqi_decode_init(AVCodecContext *avctx)
...@@ -79,7 +78,7 @@ static int tqi_decode_mb(TqiContext *t, int16_t (*block)[64]) ...@@ -79,7 +78,7 @@ static int tqi_decode_mb(TqiContext *t, int16_t (*block)[64])
int ret = ff_mpeg1_decode_block_intra(&t->gb, int ret = ff_mpeg1_decode_block_intra(&t->gb,
t->intra_matrix, t->intra_matrix,
t->intra_scantable.permutated, t->intra_scantable.permutated,
t->last_dc, block[n], n, 1, t->block_last_index); t->last_dc, block[n], n, 1);
if (ret < 0) if (ret < 0)
return -1; return -1;
} }
......
...@@ -248,8 +248,7 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, ...@@ -248,8 +248,7 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size,
int ff_mpeg1_decode_block_intra(GetBitContext *gb, int ff_mpeg1_decode_block_intra(GetBitContext *gb,
const uint16_t *quant_matrix, const uint16_t *quant_matrix,
uint8_t *const scantable, int last_dc[3], uint8_t *const scantable, int last_dc[3],
int16_t *block, int index, int qscale, int16_t *block, int index, int qscale)
int block_last_index[12])
{ {
int dc, diff, i = 0, component; int dc, diff, i = 0, component;
RLTable *rl = &ff_rl_mpeg1; RLTable *rl = &ff_rl_mpeg1;
...@@ -335,8 +334,7 @@ end: ...@@ -335,8 +334,7 @@ end:
} }
if (i > MAX_INDEX) if (i > MAX_INDEX)
return AVERROR_INVALIDDATA; i = AVERROR_INVALIDDATA;
block_last_index[index] = i; return i;
return 0;
} }
...@@ -53,8 +53,7 @@ static inline int decode_dc(GetBitContext *gb, int component) ...@@ -53,8 +53,7 @@ static inline int decode_dc(GetBitContext *gb, int component)
int ff_mpeg1_decode_block_intra(GetBitContext *gb, int ff_mpeg1_decode_block_intra(GetBitContext *gb,
const uint16_t *quant_matrix, const uint16_t *quant_matrix,
uint8_t *const scantable, int last_dc[3], uint8_t *const scantable, int last_dc[3],
int16_t *block, int index, int qscale, int16_t *block, int index, int qscale);
int block_last_index[12]);
void ff_mpeg1_clean_buffers(MpegEncContext *s); void ff_mpeg1_clean_buffers(MpegEncContext *s);
int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s); int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, AVCodecParserContext *s);
......
...@@ -792,7 +792,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64]) ...@@ -792,7 +792,7 @@ static int mpeg_decode_mb(MpegEncContext *s, int16_t block[12][64])
s->intra_matrix, s->intra_matrix,
s->intra_scantable.permutated, s->intra_scantable.permutated,
s->last_dc, *s->pblocks[i], s->last_dc, *s->pblocks[i],
i, s->qscale, s->block_last_index); i, s->qscale);
if (ret < 0) { if (ret < 0) {
av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n", av_log(s->avctx, AV_LOG_ERROR, "ac-tex damaged at %d %d\n",
s->mb_x, s->mb_y); s->mb_x, s->mb_y);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment