You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-04 22:03:09 +02:00
avcodec/hqxvlc: Include implicit +1 run in RL VLC tables
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
@ -115,7 +115,7 @@ static int decode_block(GetBitContext *gb, VLC *vlc,
|
||||
{
|
||||
int q, dc;
|
||||
int ac_idx;
|
||||
int run, lev, pos = 1;
|
||||
int run, lev, pos = 0;
|
||||
|
||||
memset(block, 0, 64 * sizeof(*block));
|
||||
dc = get_vlc2(gb, vlc->table, HQX_DC_VLC_BITS, 2);
|
||||
@ -140,10 +140,10 @@ static int decode_block(GetBitContext *gb, VLC *vlc,
|
||||
do {
|
||||
hqx_get_ac(gb, &ff_hqx_ac[ac_idx], &run, &lev);
|
||||
pos += run;
|
||||
if (pos >= 64)
|
||||
if (pos > 63)
|
||||
break;
|
||||
block[ff_zigzag_direct[pos++]] = lev * q;
|
||||
} while (pos < 64);
|
||||
block[ff_zigzag_direct[pos]] = lev * q;
|
||||
} while (pos < 63);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -726,7 +726,8 @@ HQXAC ff_hqx_ac[NUM_HQX_AC] = {
|
||||
};
|
||||
|
||||
// level is in -255..255 range, run 0..64, so it fits into 16 bits.
|
||||
#define E(level, run) ((level * 128) | run)
|
||||
// We offset run by 1 in order to include the implicit run of 1.
|
||||
#define E(level, run) ((level * 128) | (run + 1))
|
||||
|
||||
static const int16_t hqx_ac_run_level[] = {
|
||||
// AC table Q0 - 815 elements
|
||||
|
Reference in New Issue
Block a user