static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, slice_buffer * sb, int start_y, int h, int save_state[1]){

    const int w= b->width;

    int y;

    const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);

    int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);

    int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;

    int new_index = 0;



    if(b->ibuf == s->spatial_idwt_buffer || s->qlog == LOSSLESS_QLOG){

        qadd= 0;

        qmul= 1<<QEXPSHIFT;

    }



    /* If we are on the second or later slice, restore our index. */

    if (start_y != 0)

        new_index = save_state[0];





    for(y=start_y; y<h; y++){

        int x = 0;

        int v;

        IDWTELEM * line = slice_buffer_get_line(sb, y * b->stride_line + b->buf_y_offset) + b->buf_x_offset;

        memset(line, 0, b->width*sizeof(IDWTELEM));

        v = b->x_coeff[new_index].coeff;

        x = b->x_coeff[new_index++].x;

        while(x < w){

            register int t= ( (v>>1)*qmul + qadd)>>QEXPSHIFT;

            register int u= -(v&1);

            line[x] = (t^u) - u;



            v = b->x_coeff[new_index].coeff;

            x = b->x_coeff[new_index++].x;

        }

    }



    /* Save our variables for the next slice. */

    save_state[0] = new_index;



    return;

}

static inline void decode_subband_slice_buffered(SnowContext *s, SubBand *b, slice_buffer * sb, int start_y, int h, int save_state[1]){

    const int w= b->width;

    int y;

    const int qlog= av_clip(s->qlog + b->qlog, 0, QROOT*16);

    int qmul= ff_qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);

    int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;

    int new_index = 0;



    if(b->ibuf == s->spatial_idwt_buffer || s->qlog == LOSSLESS_QLOG){

        qadd= 0;

        qmul= 1<<QEXPSHIFT;

    }



    

    if (start_y != 0)

        new_index = save_state[0];





    for(y=start_y; y<h; y++){

        int x = 0;

        int v;

        IDWTELEM * line = slice_buffer_get_line(sb, y * b->stride_line + b->buf_y_offset) + b->buf_x_offset;

        memset(line, 0, b->width*sizeof(IDWTELEM));

        v = b->x_coeff[new_index].coeff;

        x = b->x_coeff[new_index++].x;

        while(x < w){

            register int t= ( (v>>1)*qmul + qadd)>>QEXPSHIFT;

            register int u= -(v&1);

            line[x] = (t^u) - u;



            v = b->x_coeff[new_index].coeff;

            x = b->x_coeff[new_index++].x;

        }

    }



    

    save_state[0] = new_index;



    return;

}

            register int t= ( (v>>1)*qmul + qadd)>>QEXPSHIFT;
static inline void FUNC_0(SnowContext *VAR_0, SubBand *VAR_1, slice_buffer * VAR_2, int VAR_3, int VAR_4, int VAR_5[1]){

    const int VAR_6= VAR_1->width;

    int VAR_7;

    const int VAR_8= av_clip(VAR_0->VAR_8 + VAR_1->VAR_8, 0, QROOT*16);

    int VAR_9= ff_qexp[VAR_8&(QROOT-1)]<<(VAR_8>>QSHIFT);

    int VAR_10= (VAR_0->qbias*VAR_9)>>QBIAS_SHIFT;

    int VAR_11 = 0;



    if(VAR_1->ibuf == VAR_0->spatial_idwt_buffer || VAR_0->VAR_8 == LOSSLESS_QLOG){

        VAR_10= 0;

        VAR_9= 1<<QEXPSHIFT;

    }



    

    if (VAR_3 != 0)

        VAR_11 = VAR_5[0];





    for(VAR_7=VAR_3; VAR_7<VAR_4; VAR_7++){

        int VAR_12 = 0;

        int VAR_13;

        IDWTELEM * line = slice_buffer_get_line(VAR_2, VAR_7 * VAR_1->stride_line + VAR_1->buf_y_offset) + VAR_1->buf_x_offset;

        memset(line, 0, VAR_1->width*sizeof(IDWTELEM));

        VAR_13 = VAR_1->x_coeff[VAR_11].coeff;

        VAR_12 = VAR_1->x_coeff[VAR_11++].VAR_12;

        while(VAR_12 < VAR_6){

            register int VAR_14= ( (VAR_13>>1)*VAR_9 + VAR_10)>>QEXPSHIFT;

            register int VAR_15= -(VAR_13&1);

            line[VAR_12] = (VAR_14^VAR_15) - VAR_15;



            VAR_13 = VAR_1->x_coeff[VAR_11].coeff;

            VAR_12 = VAR_1->x_coeff[VAR_11++].VAR_12;

        }

    }



    

    VAR_5[0] = VAR_11;



    return;

}

static inline void FUNC_0(SnowContext *VAR_0, SubBand *VAR_1, slice_buffer * VAR_2, int VAR_3, int VAR_4, int VAR_5[1]){ const int VAR_6= VAR_1->width; int VAR_7; const int VAR_8= av_clip(VAR_0->VAR_8 + VAR_1->VAR_8, 0, QROOT*16); int VAR_9= ff_qexp[VAR_8&(QROOT-1)]<<(VAR_8>>QSHIFT); int VAR_10= (VAR_0->qbias*VAR_9)>>QBIAS_SHIFT; int VAR_11 = 0; if(VAR_1->ibuf == VAR_0->spatial_idwt_buffer || VAR_0->VAR_8 == LOSSLESS_QLOG){ VAR_10= 0; VAR_9= 1<<QEXPSHIFT; } if (VAR_3 != 0)
VAR_11 = VAR_5[0]; for(VAR_7=VAR_3; VAR_7<VAR_4; VAR_7++){ int VAR_12 = 0; int VAR_13; IDWTELEM * line = slice_buffer_get_line(VAR_2, VAR_7 * VAR_1->stride_line + VAR_1->buf_y_offset) + VAR_1->buf_x_offset; memset(line, 0, VAR_1->width*sizeof(IDWTELEM)); VAR_13 = VAR_1->x_coeff[VAR_11].coeff; VAR_12 = VAR_1->x_coeff[VAR_11++].VAR_12; while(VAR_12 < VAR_6){ register int VAR_14= ( (VAR_13>>1)*VAR_9 + VAR_10)>>QEXPSHIFT; register int VAR_15= -(VAR_13&1); line[VAR_12] = (VAR_14^VAR_15) - VAR_15; VAR_13 = VAR_1->x_coeff[VAR_11].coeff; VAR_12 = VAR_1->x_coeff[VAR_11++].VAR_12; } } VAR_5[0] = VAR_11; return; }