1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avcodec/vmixdec: improve quality factors

This commit is contained in:
Paul B Mahol 2023-09-17 12:51:16 +02:00
parent 9e1ea3caba
commit 5acc3c4cff

View File

@ -55,22 +55,17 @@ typedef struct VMIXContext {
IDCTDSPContext idsp;
} VMIXContext;
static const uint8_t quality[256] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 64, 56, 52, 48, 44,
12, 36, 32, 28, 24, 22, 20, 18, 16, 14, 12, 10, 8, 7, 6, 5,
4, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
static const uint8_t quality[] = {
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1,64,63,62,61,
60,59,58,57,56,55,54,53,52,51,
50,49,48,47,46,45,44,43,42,41,
40,39,38,37,36,35,34,33,32,31,
30,29,28,27,26,25,24,23,22,21,
20,19,18,17,16,15,14,13,12,11,
10, 9, 8, 7, 6, 5, 4, 3, 2, 1,
};
static const uint8_t quant[64] = {
@ -240,7 +235,7 @@ static int decode_frame(AVCodecContext *avctx,
else if (offset != 3)
return AVERROR_INVALIDDATA;
q = quality[avpkt->data[offset - 2]];
q = quality[FFMIN(avpkt->data[offset - 2], FF_ARRAY_ELEMS(quality)-1)];
for (int n = 0; n < 64; n++)
s->factors[n] = quant[n] * q;