From 6083244881a2617795f41d8601e973eb85f55454 Mon Sep 17 00:00:00 2001 From: Fabrice Bellard Date: Tue, 7 Aug 2001 22:47:08 +0000 Subject: [PATCH] changed quant matrix order (should fix mmx mpeg decoding bug) Originally committed as revision 49 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/mpeg12.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 182c341..381fafa 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1172,32 +1172,36 @@ static void mpeg_decode_sequence_extension(MpegEncContext *s) static void mpeg_decode_quant_matrix_extension(MpegEncContext *s) { - int i, v; + int i, v, j; if (get_bits1(&s->gb)) { for(i=0;i<64;i++) { v = get_bits(&s->gb, 8); - s->intra_matrix[i] = v; - s->chroma_intra_matrix[i] = v; + j = block_permute_op(i); + s->intra_matrix[j] = v; + s->chroma_intra_matrix[j] = v; } } if (get_bits1(&s->gb)) { for(i=0;i<64;i++) { v = get_bits(&s->gb, 8); - s->non_intra_matrix[i] = v; - s->chroma_non_intra_matrix[i] = v; + j = block_permute_op(i); + s->non_intra_matrix[j] = v; + s->chroma_non_intra_matrix[j] = v; } } if (get_bits1(&s->gb)) { for(i=0;i<64;i++) { v = get_bits(&s->gb, 8); - s->chroma_intra_matrix[i] = v; + j = block_permute_op(i); + s->chroma_intra_matrix[j] = v; } } if (get_bits1(&s->gb)) { for(i=0;i<64;i++) { v = get_bits(&s->gb, 8); - s->chroma_non_intra_matrix[i] = v; + j = block_permute_op(i); + s->chroma_non_intra_matrix[j] = v; } } } @@ -1345,7 +1349,7 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, { Mpeg1Context *s1 = avctx->priv_data; MpegEncContext *s = &s1->mpeg_enc_ctx; - int width, height, i, v; + int width, height, i, v, j; init_get_bits(&s->gb, buf, buf_size); @@ -1389,8 +1393,9 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, if (get_bits1(&s->gb)) { for(i=0;i<64;i++) { v = get_bits(&s->gb, 8); - s->intra_matrix[i] = v; - s->chroma_intra_matrix[i] = v; + j = block_permute_op(i); + s->intra_matrix[j] = v; + s->chroma_intra_matrix[j] = v; } } else { for(i=0;i<64;i++) { @@ -1402,8 +1407,9 @@ static int mpeg1_decode_sequence(AVCodecContext *avctx, if (get_bits1(&s->gb)) { for(i=0;i<64;i++) { v = get_bits(&s->gb, 8); - s->non_intra_matrix[i] = v; - s->chroma_non_intra_matrix[i] = v; + j = block_permute_op(i); + s->non_intra_matrix[j] = v; + s->chroma_non_intra_matrix[j] = v; } } else { for(i=0;i<64;i++) { -- 2.7.4