static void process_subpacket_9 (QDM2Context *q, QDM2SubPNode *node)

{

    GetBitContext gb;

    int i, j, k, n, ch, run, level, diff;



    init_get_bits(&gb, node->packet->data, node->packet->size*8);



    n = coeff_per_sb_for_avg[q->coeff_per_sb_select][QDM2_SB_USED(q->sub_sampling) - 1] + 1; // same as averagesomething function



    for (i = 1; i < n; i++)

        for (ch=0; ch < q->nb_channels; ch++) {

            level = qdm2_get_vlc(&gb, &vlc_tab_level, 0, 2);

            q->quantized_coeffs[ch][i][0] = level;



            for (j = 0; j < (8 - 1); ) {

                run = qdm2_get_vlc(&gb, &vlc_tab_run, 0, 1) + 1;

                diff = qdm2_get_se_vlc(&vlc_tab_diff, &gb, 2);



                for (k = 1; k <= run; k++)

                    q->quantized_coeffs[ch][i][j + k] = (level + ((k*diff) / run));



                level += diff;

                j += run;

            }

        }



    for (ch = 0; ch < q->nb_channels; ch++)

        for (i = 0; i < 8; i++)

            q->quantized_coeffs[ch][0][i] = 0;

}

static void process_subpacket_9 (QDM2Context *q, QDM2SubPNode *node)

{

    GetBitContext gb;

    int i, j, k, n, ch, run, level, diff;



    init_get_bits(&gb, node->packet->data, node->packet->size*8);



    n = coeff_per_sb_for_avg[q->coeff_per_sb_select][QDM2_SB_USED(q->sub_sampling) - 1] + 1; 



    for (i = 1; i < n; i++)

        for (ch=0; ch < q->nb_channels; ch++) {

            level = qdm2_get_vlc(&gb, &vlc_tab_level, 0, 2);

            q->quantized_coeffs[ch][i][0] = level;



            for (j = 0; j < (8 - 1); ) {

                run = qdm2_get_vlc(&gb, &vlc_tab_run, 0, 1) + 1;

                diff = qdm2_get_se_vlc(&vlc_tab_diff, &gb, 2);



                for (k = 1; k <= run; k++)

                    q->quantized_coeffs[ch][i][j + k] = (level + ((k*diff) / run));



                level += diff;

                j += run;

            }

        }



    for (ch = 0; ch < q->nb_channels; ch++)

        for (i = 0; i < 8; i++)

            q->quantized_coeffs[ch][0][i] = 0;

}

static void FUNC_0 (QDM2Context *VAR_0, QDM2SubPNode *VAR_1)

{

    GetBitContext gb;

    int VAR_2, VAR_3, VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9;



    init_get_bits(&gb, VAR_1->packet->data, VAR_1->packet->size*8);



    VAR_5 = coeff_per_sb_for_avg[VAR_0->coeff_per_sb_select][QDM2_SB_USED(VAR_0->sub_sampling) - 1] + 1; 



    for (VAR_2 = 1; VAR_2 < VAR_5; VAR_2++)

        for (VAR_6=0; VAR_6 < VAR_0->nb_channels; VAR_6++) {

            VAR_8 = qdm2_get_vlc(&gb, &vlc_tab_level, 0, 2);

            VAR_0->quantized_coeffs[VAR_6][VAR_2][0] = VAR_8;



            for (VAR_3 = 0; VAR_3 < (8 - 1); ) {

                VAR_7 = qdm2_get_vlc(&gb, &vlc_tab_run, 0, 1) + 1;

                VAR_9 = qdm2_get_se_vlc(&vlc_tab_diff, &gb, 2);



                for (VAR_4 = 1; VAR_4 <= VAR_7; VAR_4++)

                    VAR_0->quantized_coeffs[VAR_6][VAR_2][VAR_3 + VAR_4] = (VAR_8 + ((VAR_4*VAR_9) / VAR_7));



                VAR_8 += VAR_9;

                VAR_3 += VAR_7;

            }

        }



    for (VAR_6 = 0; VAR_6 < VAR_0->nb_channels; VAR_6++)

        for (VAR_2 = 0; VAR_2 < 8; VAR_2++)

            VAR_0->quantized_coeffs[VAR_6][0][VAR_2] = 0;

}

static void FUNC_0 (QDM2Context *VAR_0, QDM2SubPNode *VAR_1)
{ GetBitContext gb; int VAR_2, VAR_3, VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9; init_get_bits(&gb, VAR_1->packet->data, VAR_1->packet->size*8); VAR_5 = coeff_per_sb_for_avg[VAR_0->coeff_per_sb_select][QDM2_SB_USED(VAR_0->sub_sampling) - 1] + 1; for (VAR_2 = 1; VAR_2 < VAR_5; VAR_2++) for (VAR_6=0; VAR_6 < VAR_0->nb_channels; VAR_6++) { VAR_8 = qdm2_get_vlc(&gb, &vlc_tab_level, 0, 2); VAR_0->quantized_coeffs[VAR_6][VAR_2][0] = VAR_8; for (VAR_3 = 0; VAR_3 < (8 - 1); ) { VAR_7 = qdm2_get_vlc(&gb, &vlc_tab_run, 0, 1) + 1; VAR_9 = qdm2_get_se_vlc(&vlc_tab_diff, &gb, 2); for (VAR_4 = 1; VAR_4 <= VAR_7; VAR_4++) VAR_0->quantized_coeffs[VAR_6][VAR_2][VAR_3 + VAR_4] = (VAR_8 + ((VAR_4*VAR_9) / VAR_7)); VAR_8 += VAR_9; VAR_3 += VAR_7; } } for (VAR_6 = 0; VAR_6 < VAR_0->nb_channels; VAR_6++) for (VAR_2 = 0; VAR_2 < 8; VAR_2++) VAR_0->quantized_coeffs[VAR_6][0][VAR_2] = 0; }