static int decode_block(MJpegDecodeContext *s, DCTELEM *block,

                        int component, int dc_index, int ac_index, int16_t *quant_matrix)

{

    int code, i, j, level, val;



    /* DC coef */

    val = mjpeg_decode_dc(s, dc_index);

    if (val == 0xffff) {

        av_log(s->avctx, AV_LOG_ERROR, "error dc\n");

        return -1;

    }

    val = val * quant_matrix[0] + s->last_dc[component];

    s->last_dc[component] = val;

    block[0] = val;

    /* AC coefs */

    i = 0;

    {OPEN_READER(re, &s->gb)

    for(;;) {

        UPDATE_CACHE(re, &s->gb);

        GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2)



        /* EOB */

        if (code == 0x10)

            break;

        i += ((unsigned)code) >> 4;

            code &= 0xf;

        if(code){

            if(code > MIN_CACHE_BITS - 16){

                UPDATE_CACHE(re, &s->gb)

            }

            {

                int cache=GET_CACHE(re,&s->gb);

                int sign=(~cache)>>31;

                level = (NEG_USR32(sign ^ cache,code) ^ sign) - sign;

            }



            LAST_SKIP_BITS(re, &s->gb, code)



            if (i >= 63) {

                if(i == 63){

                    j = s->scantable.permutated[63];

                    block[j] = level * quant_matrix[j];

                    break;

                }

                av_log(s->avctx, AV_LOG_ERROR, "error count: %d\n", i);

                return -1;

            }

            j = s->scantable.permutated[i];

            block[j] = level * quant_matrix[j];

        }

    }

    CLOSE_READER(re, &s->gb)}



    return 0;

}

static int decode_block(MJpegDecodeContext *s, DCTELEM *block,

                        int component, int dc_index, int ac_index, int16_t *quant_matrix)

{

    int code, i, j, level, val;



    

    val = mjpeg_decode_dc(s, dc_index);

    if (val == 0xffff) {

        av_log(s->avctx, AV_LOG_ERROR, "error dc\n");

        return -1;

    }

    val = val * quant_matrix[0] + s->last_dc[component];

    s->last_dc[component] = val;

    block[0] = val;

    

    i = 0;

    {OPEN_READER(re, &s->gb)

    for(;;) {

        UPDATE_CACHE(re, &s->gb);

        GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2)



        

        if (code == 0x10)

            break;

        i += ((unsigned)code) >> 4;

            code &= 0xf;

        if(code){

            if(code > MIN_CACHE_BITS - 16){

                UPDATE_CACHE(re, &s->gb)

            }

            {

                int cache=GET_CACHE(re,&s->gb);

                int sign=(~cache)>>31;

                level = (NEG_USR32(sign ^ cache,code) ^ sign) - sign;

            }



            LAST_SKIP_BITS(re, &s->gb, code)



            if (i >= 63) {

                if(i == 63){

                    j = s->scantable.permutated[63];

                    block[j] = level * quant_matrix[j];

                    break;

                }

                av_log(s->avctx, AV_LOG_ERROR, "error count: %d\n", i);

                return -1;

            }

            j = s->scantable.permutated[i];

            block[j] = level * quant_matrix[j];

        }

    }

    CLOSE_READER(re, &s->gb)}



    return 0;

}

    for(;;) {
static int FUNC_0(MJpegDecodeContext *VAR_0, DCTELEM *VAR_1,

                        int VAR_2, int VAR_3, int VAR_4, int16_t *VAR_5)

{

    int VAR_6, VAR_7, VAR_8, VAR_9, VAR_10;



    

    VAR_10 = mjpeg_decode_dc(VAR_0, VAR_3);

    if (VAR_10 == 0xffff) {

        av_log(VAR_0->avctx, AV_LOG_ERROR, "error dc\n");

        return -1;

    }

    VAR_10 = VAR_10 * VAR_5[0] + VAR_0->last_dc[VAR_2];

    VAR_0->last_dc[VAR_2] = VAR_10;

    VAR_1[0] = VAR_10;

    

    VAR_7 = 0;

    {OPEN_READER(re, &VAR_0->gb)

    for(;;) {

        UPDATE_CACHE(re, &VAR_0->gb);

        GET_VLC(VAR_6, re, &VAR_0->gb, VAR_0->vlcs[1][VAR_4].table, 9, 2)



        

        if (VAR_6 == 0x10)

            break;

        VAR_7 += ((unsigned)VAR_6) >> 4;

            VAR_6 &= 0xf;

        if(VAR_6){

            if(VAR_6 > MIN_CACHE_BITS - 16){

                UPDATE_CACHE(re, &VAR_0->gb)

            }

            {

                int cache=GET_CACHE(re,&VAR_0->gb);

                int sign=(~cache)>>31;

                VAR_9 = (NEG_USR32(sign ^ cache,VAR_6) ^ sign) - sign;

            }



            LAST_SKIP_BITS(re, &VAR_0->gb, VAR_6)



            if (VAR_7 >= 63) {

                if(VAR_7 == 63){

                    VAR_8 = VAR_0->scantable.permutated[63];

                    VAR_1[VAR_8] = VAR_9 * VAR_5[VAR_8];

                    break;

                }

                av_log(VAR_0->avctx, AV_LOG_ERROR, "error count: %d\n", VAR_7);

                return -1;

            }

            VAR_8 = VAR_0->scantable.permutated[VAR_7];

            VAR_1[VAR_8] = VAR_9 * VAR_5[VAR_8];

        }

    }

    CLOSE_READER(re, &VAR_0->gb)}



    return 0;

}

static int FUNC_0(MJpegDecodeContext *VAR_0, DCTELEM *VAR_1,
int VAR_2, int VAR_3, int VAR_4, int16_t *VAR_5)
{ int VAR_6, VAR_7, VAR_8, VAR_9, VAR_10; VAR_10 = mjpeg_decode_dc(VAR_0, VAR_3); if (VAR_10 == 0xffff) { av_log(VAR_0->avctx, AV_LOG_ERROR, "error dc\n"); return -1; } VAR_10 = VAR_10 * VAR_5[0] + VAR_0->last_dc[VAR_2]; VAR_0->last_dc[VAR_2] = VAR_10; VAR_1[0] = VAR_10; VAR_7 = 0; {OPEN_READER(re, &VAR_0->gb) for(;;) { UPDATE_CACHE(re, &VAR_0->gb); GET_VLC(VAR_6, re, &VAR_0->gb, VAR_0->vlcs[1][VAR_4].table, 9, 2)
if (VAR_6 == 0x10)
break; VAR_7 += ((unsigned)VAR_6) >> 4; VAR_6 &= 0xf; if(VAR_6){ if(VAR_6 > MIN_CACHE_BITS - 16){ UPDATE_CACHE(re, &VAR_0->gb)
} { int cache=GET_CACHE(re,&VAR_0->gb); int sign=(~cache)>>31; VAR_9 = (NEG_USR32(sign ^ cache,VAR_6) ^ sign) - sign; } LAST_SKIP_BITS(re, &VAR_0->gb, VAR_6)
if (VAR_7 >= 63) { if(VAR_7 == 63){ VAR_8 = VAR_0->scantable.permutated[63]; VAR_1[VAR_8] = VAR_9 * VAR_5[VAR_8]; break; } av_log(VAR_0->avctx, AV_LOG_ERROR, "error count: %d\n", VAR_7); return -1; } VAR_8 = VAR_0->scantable.permutated[VAR_7]; VAR_1[VAR_8] = VAR_9 * VAR_5[VAR_8]; } } CLOSE_READER(re, &VAR_0->gb)} return 0; }