const int qlog= clip(s->qlog + b->qlog, 0, 128); int qmul= qexp[qlog&7]<<(qlog>>3);
const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16); int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
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 x,y;    const int qlog= clip(s->qlog + b->qlog, 0, 128);    int qmul= qexp[qlog&7]<<(qlog>>3);    int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;    int new_index = 0;        START_TIMER    if(b->buf == s->spatial_dwt_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;        DWTELEM * line = slice_buffer_get_line(sb, y * b->stride_line + b->buf_y_offset) + b->buf_x_offset;        memset(line, 0, b->width*sizeof(DWTELEM));        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;        }    }    if(w > 200 && start_y != 0/*level+1 == s->spatial_decomposition_count*/){        STOP_TIMER("decode_subband")    }            /* Save our variables for the next slice. */    save_state[0] = new_index;            return;}