[FFmpeg-devel] [PATCH 04/11] avcodec/mdec: allow/use permuted IDCTs

James Darnley jdarnley at obe.tv
Mon Jun 19 18:10:57 EEST 2017


From: "Ronald S. Bultje" <rsbultje at gmail.com>

---
 libavcodec/mdec.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c
index 97bfebbeb7..1e1c8f4c55 100644
--- a/libavcodec/mdec.c
+++ b/libavcodec/mdec.c
@@ -94,7 +94,7 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
                     return AVERROR_INVALIDDATA;
                 }
                 j     = scantable[i];
-                level = (level * qscale * quant_matrix[j]) >> 3;
+                level = (level * qscale * quant_matrix[ff_zigzag_direct[i]]) >> 3;
                 level = (level ^ SHOW_SBITS(re, &a->gb, 1)) - SHOW_SBITS(re, &a->gb, 1);
                 LAST_SKIP_BITS(re, &a->gb, 1);
             } else {
@@ -111,11 +111,11 @@ static inline int mdec_decode_block_intra(MDECContext *a, int16_t *block, int n)
                 j = scantable[i];
                 if (level < 0) {
                     level = -level;
-                    level = (level * (unsigned)qscale * quant_matrix[j]) >> 3;
+                    level = (level * (unsigned)qscale * quant_matrix[ff_zigzag_direct[i]]) >> 3;
                     level = (level - 1) | 1;
                     level = -level;
                 } else {
-                    level = (level * (unsigned)qscale * quant_matrix[j]) >> 3;
+                    level = (level * (unsigned)qscale * quant_matrix[ff_zigzag_direct[i]]) >> 3;
                     level = (level - 1) | 1;
                 }
             }
-- 
2.13.1



More information about the ffmpeg-devel mailing list