static void dct_unquantize_mpeg2_c(MpegEncContext *s, 

                                   DCTELEM *block, int n, int qscale)

{

    int i, level, nCoeffs;

    const UINT16 *quant_matrix;



    if(s->alternate_scan) nCoeffs= 64;

    else nCoeffs= s->block_last_index[n]+1;

    

    if (s->mb_intra) {

        if (n < 4) 

            block[0] = block[0] * s->y_dc_scale;

        else

            block[0] = block[0] * s->c_dc_scale;

        quant_matrix = s->intra_matrix;

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

            int j= zigzag_direct[i];

            level = block[j];

            if (level) {

                if (level < 0) {

                    level = -level;

                    level = (int)(level * qscale * quant_matrix[j]) >> 3;

                    level = -level;

                } else {

                    level = (int)(level * qscale * quant_matrix[j]) >> 3;

                }

#ifdef PARANOID

                if (level < -2048 || level > 2047)

                    fprintf(stderr, "unquant error %d %d\n", i, level);

#endif

                block[j] = level;

            }

        }

    } else {

        int sum=-1;

        i = 0;

        quant_matrix = s->non_intra_matrix;

        for(;i<nCoeffs;i++) {

            int j= zigzag_direct[i];

            level = block[j];

            if (level) {

                if (level < 0) {

                    level = -level;

                    level = (((level << 1) + 1) * qscale *

                             ((int) (quant_matrix[j]))) >> 4;

                    level = -level;

                } else {

                    level = (((level << 1) + 1) * qscale *

                             ((int) (quant_matrix[j]))) >> 4;

                }

#ifdef PARANOID

                if (level < -2048 || level > 2047)

                    fprintf(stderr, "unquant error %d %d\n", i, level);

#endif

                block[j] = level;

                sum+=level;

            }

        }

        block[63]^=sum&1;

    }

}

static void dct_unquantize_mpeg2_c(MpegEncContext *s, 

                                   DCTELEM *block, int n, int qscale)

{

    int i, level, nCoeffs;

    const UINT16 *quant_matrix;



    if(s->alternate_scan) nCoeffs= 64;

    else nCoeffs= s->block_last_index[n]+1;

    

    if (s->mb_intra) {

        if (n < 4) 

            block[0] = block[0] * s->y_dc_scale;

        else

            block[0] = block[0] * s->c_dc_scale;

        quant_matrix = s->intra_matrix;

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

            int j= zigzag_direct[i];

            level = block[j];

            if (level) {

                if (level < 0) {

                    level = -level;

                    level = (int)(level * qscale * quant_matrix[j]) >> 3;

                    level = -level;

                } else {

                    level = (int)(level * qscale * quant_matrix[j]) >> 3;

                }

#ifdef PARANOID

                if (level < -2048 || level > 2047)

                    fprintf(stderr, "unquant error %d %d\n", i, level);

#endif

                block[j] = level;

            }

        }

    } else {

        int sum=-1;

        i = 0;

        quant_matrix = s->non_intra_matrix;

        for(;i<nCoeffs;i++) {

            int j= zigzag_direct[i];

            level = block[j];

            if (level) {

                if (level < 0) {

                    level = -level;

                    level = (((level << 1) + 1) * qscale *

                             ((int) (quant_matrix[j]))) >> 4;

                    level = -level;

                } else {

                    level = (((level << 1) + 1) * qscale *

                             ((int) (quant_matrix[j]))) >> 4;

                }

#ifdef PARANOID

                if (level < -2048 || level > 2047)

                    fprintf(stderr, "unquant error %d %d\n", i, level);

#endif

                block[j] = level;

                sum+=level;

            }

        }

        block[63]^=sum&1;

    }

}

        quant_matrix = s->non_intra_matrix;         quant_matrix = s->non_intra_matrix;         i = 0; #endif #endif #endif     } else {     } else { #ifdef PARANOID #endif         quant_matrix = s->non_intra_matrix;         quant_matrix = s->non_intra_matrix;
static void FUNC_0(MpegEncContext *VAR_0, 

                                   DCTELEM *VAR_1, int VAR_2, int VAR_3)

{

    int VAR_4, VAR_5, VAR_6;

    const UINT16 *VAR_7;



    if(VAR_0->alternate_scan) VAR_6= 64;

    else VAR_6= VAR_0->block_last_index[VAR_2]+1;

    

    if (VAR_0->mb_intra) {

        if (VAR_2 < 4) 

            VAR_1[0] = VAR_1[0] * VAR_0->y_dc_scale;

        else

            VAR_1[0] = VAR_1[0] * VAR_0->c_dc_scale;

        VAR_7 = VAR_0->intra_matrix;

        for(VAR_4=1;VAR_4<VAR_6;VAR_4++) {

            int VAR_10= zigzag_direct[VAR_4];

            VAR_5 = VAR_1[VAR_10];

            if (VAR_5) {

                if (VAR_5 < 0) {

                    VAR_5 = -VAR_5;

                    VAR_5 = (int)(VAR_5 * VAR_3 * VAR_7[VAR_10]) >> 3;

                    VAR_5 = -VAR_5;

                } else {

                    VAR_5 = (int)(VAR_5 * VAR_3 * VAR_7[VAR_10]) >> 3;

                }

#ifdef PARANOID

                if (VAR_5 < -2048 || VAR_5 > 2047)

                    fprintf(stderr, "unquant error %d %d\VAR_2", VAR_4, VAR_5);

#endif

                VAR_1[VAR_10] = VAR_5;

            }

        }

    } else {

        int VAR_9=-1;

        VAR_4 = 0;

        VAR_7 = VAR_0->non_intra_matrix;

        for(;VAR_4<VAR_6;VAR_4++) {

            int VAR_10= zigzag_direct[VAR_4];

            VAR_5 = VAR_1[VAR_10];

            if (VAR_5) {

                if (VAR_5 < 0) {

                    VAR_5 = -VAR_5;

                    VAR_5 = (((VAR_5 << 1) + 1) * VAR_3 *

                             ((int) (VAR_7[VAR_10]))) >> 4;

                    VAR_5 = -VAR_5;

                } else {

                    VAR_5 = (((VAR_5 << 1) + 1) * VAR_3 *

                             ((int) (VAR_7[VAR_10]))) >> 4;

                }

#ifdef PARANOID

                if (VAR_5 < -2048 || VAR_5 > 2047)

                    fprintf(stderr, "unquant error %d %d\VAR_2", VAR_4, VAR_5);

#endif

                VAR_1[VAR_10] = VAR_5;

                VAR_9+=VAR_5;

            }

        }

        VAR_1[63]^=VAR_9&1;

    }

}

static void FUNC_0(MpegEncContext *VAR_0,
DCTELEM *VAR_1, int VAR_2, int VAR_3)
{ int VAR_4, VAR_5, VAR_6; const UINT16 *VAR_7; if(VAR_0->alternate_scan) VAR_6= 64; else VAR_6= VAR_0->block_last_index[VAR_2]+1; if (VAR_0->mb_intra) { if (VAR_2 < 4)
VAR_1[0] = VAR_1[0] * VAR_0->y_dc_scale; else
VAR_1[0] = VAR_1[0] * VAR_0->c_dc_scale; VAR_7 = VAR_0->intra_matrix; for(VAR_4=1;VAR_4<VAR_6;VAR_4++) { int VAR_10= zigzag_direct[VAR_4]; VAR_5 = VAR_1[VAR_10]; if (VAR_5) { if (VAR_5 < 0) { VAR_5 = -VAR_5; VAR_5 = (int)(VAR_5 * VAR_3 * VAR_7[VAR_10]) >> 3; VAR_5 = -VAR_5; } else { VAR_5 = (int)(VAR_5 * VAR_3 * VAR_7[VAR_10]) >> 3; } #ifdef PARANOID
if (VAR_5 < -2048 || VAR_5 > 2047)
fprintf(stderr, "unquant error %d %d\VAR_2", VAR_4, VAR_5); #endif
VAR_1[VAR_10] = VAR_5; } } } else { int VAR_9=-1; VAR_4 = 0; VAR_7 = VAR_0->non_intra_matrix; for(;VAR_4<VAR_6;VAR_4++) { int VAR_10= zigzag_direct[VAR_4]; VAR_5 = VAR_1[VAR_10]; if (VAR_5) { if (VAR_5 < 0) { VAR_5 = -VAR_5; VAR_5 = (((VAR_5 << 1) + 1) * VAR_3 *
((int) (VAR_7[VAR_10]))) >> 4; VAR_5 = -VAR_5; } else { VAR_5 = (((VAR_5 << 1) + 1) * VAR_3 *
((int) (VAR_7[VAR_10]))) >> 4; } #ifdef PARANOID
if (VAR_5 < -2048 || VAR_5 > 2047)
fprintf(stderr, "unquant error %d %d\VAR_2", VAR_4, VAR_5); #endif
VAR_1[VAR_10] = VAR_5; VAR_9+=VAR_5; } } VAR_1[63]^=VAR_9&1; } }