static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],

                           int qsel, int is_chroma, int is_hqa)

{

    const int32_t *q;

    int val, pos = 1;



    memset(block, 0, 64 * sizeof(*block));



    if (!is_hqa) {

        block[0] = get_sbits(gb, 9) << 6;

        q = ff_hq_quants[qsel][is_chroma][get_bits(gb, 2)];

    } else {

        q = ff_hq_quants[qsel][is_chroma][get_bits(gb, 2)];

        block[0] = get_sbits(gb, 9) << 6;

    }



    for (;;) {

        val  = get_vlc2(gb, c->hq_ac_vlc.table, 9, 2);

        pos += ff_hq_ac_skips[val];

        if (pos >= 64)

            break;

        block[ff_zigzag_direct[pos]] = (ff_hq_ac_syms[val] * q[pos]) >> 12;

        pos++;

    }



    return 0;

}

static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],

                           int qsel, int is_chroma, int is_hqa)

{

    const int32_t *q;

    int val, pos = 1;



    memset(block, 0, 64 * sizeof(*block));



    if (!is_hqa) {

        block[0] = get_sbits(gb, 9) << 6;

        q = ff_hq_quants[qsel][is_chroma][get_bits(gb, 2)];

    } else {

        q = ff_hq_quants[qsel][is_chroma][get_bits(gb, 2)];

        block[0] = get_sbits(gb, 9) << 6;

    }



    for (;;) {

        val  = get_vlc2(gb, c->hq_ac_vlc.table, 9, 2);

        pos += ff_hq_ac_skips[val];

        if (pos >= 64)

            break;

        block[ff_zigzag_direct[pos]] = (ff_hq_ac_syms[val] * q[pos]) >> 12;

        pos++;

    }



    return 0;

}

static int FUNC_0(HQContext *VAR_0, GetBitContext *VAR_1, int16_t VAR_2[64],

                           int VAR_3, int VAR_4, int VAR_5)

{

    const int32_t *VAR_6;

    int VAR_7, VAR_8 = 1;



    memset(VAR_2, 0, 64 * sizeof(*VAR_2));



    if (!VAR_5) {

        VAR_2[0] = get_sbits(VAR_1, 9) << 6;

        VAR_6 = ff_hq_quants[VAR_3][VAR_4][get_bits(VAR_1, 2)];

    } else {

        VAR_6 = ff_hq_quants[VAR_3][VAR_4][get_bits(VAR_1, 2)];

        VAR_2[0] = get_sbits(VAR_1, 9) << 6;

    }



    for (;;) {

        VAR_7  = get_vlc2(VAR_1, VAR_0->hq_ac_vlc.table, 9, 2);

        VAR_8 += ff_hq_ac_skips[VAR_7];

        if (VAR_8 >= 64)

            break;

        VAR_2[ff_zigzag_direct[VAR_8]] = (ff_hq_ac_syms[VAR_7] * VAR_6[VAR_8]) >> 12;

        VAR_8++;

    }



    return 0;

}

static int FUNC_0(HQContext *VAR_0, GetBitContext *VAR_1, int16_t VAR_2[64],
int VAR_3, int VAR_4, int VAR_5)
{ const int32_t *VAR_6; int VAR_7, VAR_8 = 1; memset(VAR_2, 0, 64 * sizeof(*VAR_2)); if (!VAR_5) { VAR_2[0] = get_sbits(VAR_1, 9) << 6; VAR_6 = ff_hq_quants[VAR_3][VAR_4][get_bits(VAR_1, 2)]; } else { VAR_6 = ff_hq_quants[VAR_3][VAR_4][get_bits(VAR_1, 2)]; VAR_2[0] = get_sbits(VAR_1, 9) << 6; } for (;;) { VAR_7  = get_vlc2(VAR_1, VAR_0->hq_ac_vlc.table, 9, 2); VAR_8 += ff_hq_ac_skips[VAR_7]; if (VAR_8 >= 64)
break; VAR_2[ff_zigzag_direct[VAR_8]] = (ff_hq_ac_syms[VAR_7] * VAR_6[VAR_8]) >> 12; VAR_8++; } return 0; }