static void unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)

{

    int i;

    int dc_y_table;

    int dc_c_table;

    int ac_y_table;

    int ac_c_table;

    int residual_eob_run = 0;



    /* fetch the DC table indices */

    dc_y_table = get_bits(gb, 4);

    dc_c_table = get_bits(gb, 4);



    /* unpack the Y plane DC coefficients */

    debug_vp3("  vp3: unpacking Y plane DC coefficients using table %d\n",

        dc_y_table);

    residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_y_table], 0, 

        s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);



    /* unpack the C plane DC coefficients */

    debug_vp3("  vp3: unpacking C plane DC coefficients using table %d\n",

        dc_c_table);

    residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_c_table], 0,

        s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);



    /* fetch the AC table indices */

    ac_y_table = get_bits(gb, 4);

    ac_c_table = get_bits(gb, 4);



    /* unpack the group 1 AC coefficients (coeffs 1-5) */

    for (i = 1; i <= 5; i++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            i, ac_y_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_y_table], i, 

            s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            i, ac_c_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_c_table], i, 

            s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);

    }



    /* unpack the group 2 AC coefficients (coeffs 6-14) */

    for (i = 6; i <= 14; i++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            i, ac_y_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_y_table], i, 

            s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            i, ac_c_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_c_table], i, 

            s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);

    }



    /* unpack the group 3 AC coefficients (coeffs 15-27) */

    for (i = 15; i <= 27; i++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            i, ac_y_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_y_table], i, 

            s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            i, ac_c_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_c_table], i, 

            s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);

    }



    /* unpack the group 4 AC coefficients (coeffs 28-63) */

    for (i = 28; i <= 63; i++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            i, ac_y_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_y_table], i, 

            s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            i, ac_c_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_c_table], i, 

            s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);

    }

}

static void unpack_dct_coeffs(Vp3DecodeContext *s, GetBitContext *gb)

{

    int i;

    int dc_y_table;

    int dc_c_table;

    int ac_y_table;

    int ac_c_table;

    int residual_eob_run = 0;



    

    dc_y_table = get_bits(gb, 4);

    dc_c_table = get_bits(gb, 4);



    

    debug_vp3("  vp3: unpacking Y plane DC coefficients using table %d\n",

        dc_y_table);

    residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_y_table], 0, 

        s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);



    

    debug_vp3("  vp3: unpacking C plane DC coefficients using table %d\n",

        dc_c_table);

    residual_eob_run = unpack_vlcs(s, gb, &s->dc_vlc[dc_c_table], 0,

        s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);



    

    ac_y_table = get_bits(gb, 4);

    ac_c_table = get_bits(gb, 4);



    

    for (i = 1; i <= 5; i++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            i, ac_y_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_y_table], i, 

            s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            i, ac_c_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_1[ac_c_table], i, 

            s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);

    }



    

    for (i = 6; i <= 14; i++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            i, ac_y_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_y_table], i, 

            s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            i, ac_c_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_2[ac_c_table], i, 

            s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);

    }



    

    for (i = 15; i <= 27; i++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            i, ac_y_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_y_table], i, 

            s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            i, ac_c_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_3[ac_c_table], i, 

            s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);

    }



    

    for (i = 28; i <= 63; i++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            i, ac_y_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_y_table], i, 

            s->first_coded_y_fragment, s->last_coded_y_fragment, residual_eob_run);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            i, ac_c_table);

        residual_eob_run = unpack_vlcs(s, gb, &s->ac_vlc_4[ac_c_table], i, 

            s->first_coded_c_fragment, s->last_coded_c_fragment, residual_eob_run);

    }

}

static void FUNC_0(Vp3DecodeContext *VAR_0, GetBitContext *VAR_1)

{

    int VAR_2;

    int VAR_3;

    int VAR_4;

    int VAR_5;

    int VAR_6;

    int VAR_7 = 0;



    

    VAR_3 = get_bits(VAR_1, 4);

    VAR_4 = get_bits(VAR_1, 4);



    

    debug_vp3("  vp3: unpacking Y plane DC coefficients using table %d\n",

        VAR_3);

    VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->dc_vlc[VAR_3], 0, 

        VAR_0->first_coded_y_fragment, VAR_0->last_coded_y_fragment, VAR_7);



    

    debug_vp3("  vp3: unpacking C plane DC coefficients using table %d\n",

        VAR_4);

    VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->dc_vlc[VAR_4], 0,

        VAR_0->first_coded_c_fragment, VAR_0->last_coded_c_fragment, VAR_7);



    

    VAR_5 = get_bits(VAR_1, 4);

    VAR_6 = get_bits(VAR_1, 4);



    

    for (VAR_2 = 1; VAR_2 <= 5; VAR_2++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            VAR_2, VAR_5);

        VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_1[VAR_5], VAR_2, 

            VAR_0->first_coded_y_fragment, VAR_0->last_coded_y_fragment, VAR_7);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            VAR_2, VAR_6);

        VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_1[VAR_6], VAR_2, 

            VAR_0->first_coded_c_fragment, VAR_0->last_coded_c_fragment, VAR_7);

    }



    

    for (VAR_2 = 6; VAR_2 <= 14; VAR_2++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            VAR_2, VAR_5);

        VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_2[VAR_5], VAR_2, 

            VAR_0->first_coded_y_fragment, VAR_0->last_coded_y_fragment, VAR_7);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            VAR_2, VAR_6);

        VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_2[VAR_6], VAR_2, 

            VAR_0->first_coded_c_fragment, VAR_0->last_coded_c_fragment, VAR_7);

    }



    

    for (VAR_2 = 15; VAR_2 <= 27; VAR_2++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            VAR_2, VAR_5);

        VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_3[VAR_5], VAR_2, 

            VAR_0->first_coded_y_fragment, VAR_0->last_coded_y_fragment, VAR_7);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            VAR_2, VAR_6);

        VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_3[VAR_6], VAR_2, 

            VAR_0->first_coded_c_fragment, VAR_0->last_coded_c_fragment, VAR_7);

    }



    

    for (VAR_2 = 28; VAR_2 <= 63; VAR_2++) {



        debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",

            VAR_2, VAR_5);

        VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_4[VAR_5], VAR_2, 

            VAR_0->first_coded_y_fragment, VAR_0->last_coded_y_fragment, VAR_7);



        debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",

            VAR_2, VAR_6);

        VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_4[VAR_6], VAR_2, 

            VAR_0->first_coded_c_fragment, VAR_0->last_coded_c_fragment, VAR_7);

    }

}

static void FUNC_0(Vp3DecodeContext *VAR_0, GetBitContext *VAR_1)
{ int VAR_2; int VAR_3; int VAR_4; int VAR_5; int VAR_6; int VAR_7 = 0; VAR_3 = get_bits(VAR_1, 4); VAR_4 = get_bits(VAR_1, 4); debug_vp3("  vp3: unpacking Y plane DC coefficients using table %d\n",
VAR_3); VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->dc_vlc[VAR_3], 0,
VAR_0->first_coded_y_fragment, VAR_0->last_coded_y_fragment, VAR_7); debug_vp3("  vp3: unpacking C plane DC coefficients using table %d\n",
VAR_4); VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->dc_vlc[VAR_4], 0,
VAR_0->first_coded_c_fragment, VAR_0->last_coded_c_fragment, VAR_7); VAR_5 = get_bits(VAR_1, 4); VAR_6 = get_bits(VAR_1, 4); for (VAR_2 = 1; VAR_2 <= 5; VAR_2++) { debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",
VAR_2, VAR_5); VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_1[VAR_5], VAR_2,
VAR_0->first_coded_y_fragment, VAR_0->last_coded_y_fragment, VAR_7); debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",
VAR_2, VAR_6); VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_1[VAR_6], VAR_2,
VAR_0->first_coded_c_fragment, VAR_0->last_coded_c_fragment, VAR_7); } for (VAR_2 = 6; VAR_2 <= 14; VAR_2++) { debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",
VAR_2, VAR_5); VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_2[VAR_5], VAR_2,
VAR_0->first_coded_y_fragment, VAR_0->last_coded_y_fragment, VAR_7); debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",
VAR_2, VAR_6); VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_2[VAR_6], VAR_2,
VAR_0->first_coded_c_fragment, VAR_0->last_coded_c_fragment, VAR_7); } for (VAR_2 = 15; VAR_2 <= 27; VAR_2++) { debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",
VAR_2, VAR_5); VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_3[VAR_5], VAR_2,
VAR_0->first_coded_y_fragment, VAR_0->last_coded_y_fragment, VAR_7); debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",
VAR_2, VAR_6); VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_3[VAR_6], VAR_2,
VAR_0->first_coded_c_fragment, VAR_0->last_coded_c_fragment, VAR_7); } for (VAR_2 = 28; VAR_2 <= 63; VAR_2++) { debug_vp3("  vp3: unpacking level %d Y plane AC coefficients using table %d\n",
VAR_2, VAR_5); VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_4[VAR_5], VAR_2,
VAR_0->first_coded_y_fragment, VAR_0->last_coded_y_fragment, VAR_7); debug_vp3("  vp3: unpacking level %d C plane AC coefficients using table %d\n",
VAR_2, VAR_6); VAR_7 = unpack_vlcs(VAR_0, VAR_1, &VAR_0->ac_vlc_4[VAR_6], VAR_2,
VAR_0->first_coded_c_fragment, VAR_0->last_coded_c_fragment, VAR_7); } }