1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/hq_hqa: Include implicit +1 run in RL VLC table

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-04-09 19:01:18 +02:00
parent ce0074f97b
commit 9c0d6145c9
2 changed files with 3 additions and 4 deletions

View File

@ -88,7 +88,7 @@ static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],
} }
OPEN_READER(re, gb); OPEN_READER(re, gb);
for (int pos = 1;;) { for (int pos = 0;;) {
int level, run; int level, run;
UPDATE_CACHE(re, gb); UPDATE_CACHE(re, gb);
GET_RL_VLC(level, run, re, gb, hq_ac_rvlc, 9, 2, 0); GET_RL_VLC(level, run, re, gb, hq_ac_rvlc, 9, 2, 0);
@ -101,7 +101,6 @@ static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],
if (pos >= 64) if (pos >= 64)
break; break;
block[ff_zigzag_direct[pos]] = (int)(level * (unsigned)q[pos]) >> 12; block[ff_zigzag_direct[pos]] = (int)(level * (unsigned)q[pos]) >> 12;
pos++;
} }
CLOSE_READER(re, gb); CLOSE_READER(re, gb);
@ -387,7 +386,7 @@ static av_cold void hq_init_static(void)
if (len > 0) { if (len > 0) {
level = hq_ac_syms[sym]; level = hq_ac_syms[sym];
run = hq_ac_skips[sym]; run = hq_ac_skips[sym] + 1;
} else if (len < 0) { // More bits needed } else if (len < 0) { // More bits needed
run = 0; run = 0;
} else { // Invalid code } else { // Invalid code

View File

@ -1155,7 +1155,7 @@ static const uint8_t hq_quant_map[NUM_HQ_QUANTS][2][4] =
{ { QMAT3A, QMAT48, QMAT4C, QMAT4C }, { QMAT3B, QMAT49, QMAT4D, QMAT4D } }, { { QMAT3A, QMAT48, QMAT4C, QMAT4C }, { QMAT3B, QMAT49, QMAT4D, QMAT4D } },
}; };
#define HQ_AC_INVALID_RUN 128 #define HQ_AC_INVALID_RUN 0
static const uint8_t hq_ac_bits[NUM_HQ_AC_ENTRIES] = { static const uint8_t hq_ac_bits[NUM_HQ_AC_ENTRIES] = {
3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6,