Browse Source

avcodec/qdm2: Apply offsets when initializing VLCs

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
tags/n4.4
Andreas Rheinhardt 5 years ago
parent
commit
760217f469
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      libavcodec/qdm2.c
  2. +1
    -1
      libavcodec/qdm2_tablegen.h

+ 1
- 1
libavcodec/qdm2.c View File

@@ -205,7 +205,7 @@ static int qdm2_get_vlc(GetBitContext *gb, const VLC *vlc, int flag, int depth)
value = get_vlc2(gb, vlc->table, vlc->bits, depth); value = get_vlc2(gb, vlc->table, vlc->bits, depth);


/* stage-2, 3 bits exponent escape sequence */ /* stage-2, 3 bits exponent escape sequence */
if (value-- == 0)
if (value < 0)
value = get_bits(gb, get_bits(gb, 3) + 1); value = get_bits(gb, get_bits(gb, 3) + 1);


/* stage-3, optional */ /* stage-3, optional */


+ 1
- 1
libavcodec/qdm2_tablegen.h View File

@@ -122,7 +122,7 @@ static av_cold void build_vlc(VLC *vlc, int nb_bits, int nb_codes, int idx,
vlc->table_allocated = qdm2_vlc_offs[idx + 1] - qdm2_vlc_offs[idx]; vlc->table_allocated = qdm2_vlc_offs[idx + 1] - qdm2_vlc_offs[idx];
ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes, ff_init_vlc_from_lengths(vlc, nb_bits, nb_codes,
&tab[0][1], 2, &tab[0][0], 2, 1, &tab[0][1], 2, &tab[0][0], 2, 1,
0, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE, NULL);
-1, INIT_VLC_USE_NEW_STATIC | INIT_VLC_LE, NULL);
} }


static av_cold void qdm2_init_vlc(void) static av_cold void qdm2_init_vlc(void)


Loading…
Cancel
Save