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>
This commit is contained in:
Andreas Rheinhardt 2022-10-20 10:07:46 +02:00
parent f1a7bf0227
commit 9f64b06758
1 changed files with 14 additions and 13 deletions

View File

@ -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;
}
}