static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
{
    uint8_t symbols[256];
    uint8_t bits[256];
    uint16_t codes[256];
    int num_lens, num_codes, num_codes_sum, prefix;
    int i, j, count;
    prefix        = 0;
    count         = 0;
    num_codes_sum = 0;
    num_lens = get_bits(gb, 5);
    for (i = 0; i < num_lens; i++) {
        num_codes      = get_bits(gb, 9);
        num_codes_sum += num_codes;
        if (num_codes_sum > 256) {
            av_log(ctx->avctx, AV_LOG_ERROR,
                   "Too many VLCs (%d) to be read.\n", num_codes_sum);
        for (j = 0; j < num_codes; j++) {
            symbols[count] = get_bits(gb, 8);
            bits[count]    = i + 1;
            codes[count]   = prefix++;
            count++;
        if (prefix > (65535 - 256)/2) {
        prefix <<= 1;
    return ff_init_vlc_sparse(vlc, VLC_BITS, count, bits, 1, 1,
                              codes, 2, 2, symbols, 1, 1, 0);
static int read_code_table(CLLCContext *ctx, GetBitContext *gb, VLC *vlc)
{
    uint8_t symbols[256];
    uint8_t bits[256];
    uint16_t codes[256];
    int num_lens, num_codes, num_codes_sum, prefix;
    int i, j, count;
    prefix        = 0;
    count         = 0;
    num_codes_sum = 0;
    num_lens = get_bits(gb, 5);
    for (i = 0; i < num_lens; i++) {
        num_codes      = get_bits(gb, 9);
        num_codes_sum += num_codes;
        if (num_codes_sum > 256) {
            av_log(ctx->avctx, AV_LOG_ERROR,
                   "Too many VLCs (%d) to be read.\n", num_codes_sum);
        for (j = 0; j < num_codes; j++) {
            symbols[count] = get_bits(gb, 8);
            bits[count]    = i + 1;
            codes[count]   = prefix++;
            count++;
        if (prefix > (65535 - 256)/2) {
        prefix <<= 1;
    return ff_init_vlc_sparse(vlc, VLC_BITS, count, bits, 1, 1,
                              codes, 2, 2, symbols, 1, 1, 0);
static int FUNC_0(CLLCContext *VAR_0, GetBitContext *VAR_1, VLC *VAR_2)
{
    uint8_t symbols[256];
    uint8_t bits[256];
    uint16_t codes[256];
    int VAR_3, VAR_4, VAR_5, VAR_6;
    int VAR_7, VAR_8, VAR_9;
    VAR_6        = 0;
    VAR_9         = 0;
    VAR_5 = 0;
    VAR_3 = get_bits(VAR_1, 5);
    for (VAR_7 = 0; VAR_7 < VAR_3; VAR_7++) {
        VAR_4      = get_bits(VAR_1, 9);
        VAR_5 += VAR_4;
        if (VAR_5 > 256) {
            av_log(VAR_0->avctx, AV_LOG_ERROR,
                   "Too many VLCs (%d) to be read.\n", VAR_5);
        for (VAR_8 = 0; VAR_8 < VAR_4; VAR_8++) {
            symbols[VAR_9] = get_bits(VAR_1, 8);
            bits[VAR_9]    = VAR_7 + 1;
            codes[VAR_9]   = VAR_6++;
            VAR_9++;
        if (VAR_6 > (65535 - 256)/2) {
        VAR_6 <<= 1;
    return ff_init_vlc_sparse(VAR_2, VLC_BITS, VAR_9, bits, 1, 1,
                              codes, 2, 2, symbols, 1, 1, 0);
static int FUNC_0(CLLCContext *VAR_0, GetBitContext *VAR_1, VLC *VAR_2)
{ uint8_t symbols[256]; uint8_t bits[256]; uint16_t codes[256]; int VAR_3, VAR_4, VAR_5, VAR_6; int VAR_7, VAR_8, VAR_9; VAR_6        = 0; VAR_9         = 0; VAR_5 = 0; VAR_3 = get_bits(VAR_1, 5); for (VAR_7 = 0; VAR_7 < VAR_3; VAR_7++) { VAR_4      = get_bits(VAR_1, 9); VAR_5 += VAR_4; if (VAR_5 > 256) { av_log(VAR_0->avctx, AV_LOG_ERROR,
"Too many VLCs (%d) to be read.\n", VAR_5); for (VAR_8 = 0; VAR_8 < VAR_4; VAR_8++) { symbols[VAR_9] = get_bits(VAR_1, 8); bits[VAR_9]    = VAR_7 + 1; codes[VAR_9]   = VAR_6++; VAR_9++; if (VAR_6 > (65535 - 256)/2) { VAR_6 <<= 1; return ff_init_vlc_sparse(VAR_2, VLC_BITS, VAR_9, bits, 1, 1,
codes, 2, 2, symbols, 1, 1, 0);