diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-10-20 10:07:46 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-10-24 00:47:06 +0200 |
commit | 9f64b067580105afa82dc04fa3b985c20ef17971 (patch) | |
tree | f441a37c5b97ec09b9fe76f1daa963a4fa728745 /libavcodec/g2meet.c | |
parent | f1a7bf0227d2979a0b8acf2f3c972da665713ee2 (diff) | |
download | ffmpeg-9f64b067580105afa82dc04fa3b985c20ef17971.tar.gz |
avcodec/g2meet: Pre-permute quantization tables
Allows to avoid a permutation lateron.
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/g2meet.c')
-rw-r--r-- | libavcodec/g2meet.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/libavcodec/g2meet.c b/libavcodec/g2meet.c index 1973ed0741..761fd22fc3 100644 --- a/libavcodec/g2meet.c +++ b/libavcodec/g2meet.c @@ -59,22 +59,23 @@ enum Compression { COMPR_KEMPF_J_B, }; +/* These tables are already permuted according to ff_zigzag_direct */ static const uint8_t luma_quant[64] = { - 8, 6, 5, 8, 12, 20, 26, 31, - 6, 6, 7, 10, 13, 29, 30, 28, - 7, 7, 8, 12, 20, 29, 35, 28, - 7, 9, 11, 15, 26, 44, 40, 31, - 9, 11, 19, 28, 34, 55, 52, 39, - 12, 18, 28, 32, 41, 52, 57, 46, - 25, 32, 39, 44, 52, 61, 60, 51, - 36, 46, 48, 49, 56, 50, 52, 50 + 8, 6, 6, 7, 6, 5, 8, 7, + 7, 7, 9, 9, 8, 10, 12, 20, + 13, 12, 11, 11, 12, 25, 18, 19, + 15, 20, 29, 26, 31, 30, 29, 26, + 28, 28, 32, 36, 46, 39, 32, 34, + 44, 35, 28, 28, 40, 55, 41, 44, + 48, 49, 52, 52, 52, 31, 39, 57, + 61, 56, 50, 60, 46, 51, 52, 50, }; static const uint8_t chroma_quant[64] = { - 9, 9, 12, 24, 50, 50, 50, 50, - 9, 11, 13, 33, 50, 50, 50, 50, - 12, 13, 28, 50, 50, 50, 50, 50, - 24, 33, 50, 50, 50, 50, 50, 50, + 9, 9, 9, 12, 11, 12, 24, 13, + 13, 24, 50, 33, 28, 33, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, + 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, @@ -250,7 +251,7 @@ static int jpg_decode_block(JPGContext *c, GetBitContext *gb, int nbits = val; val = get_xbits(gb, nbits); - val *= qmat[ff_zigzag_direct[pos]]; + val *= qmat[pos]; block[c->permutated_scantable[pos]] = val; } } |