const int qlog= clip(s->qlog + b->qlog, 0, 128); const int qmul= qexp[qlog&7]<<(qlog>>3);
const int qlog= clip(s->qlog + b->qlog, 0, QROOT*16); const int qmul= qexp[qlog&(QROOT-1)]<<(qlog>>QSHIFT);
static void dequantize_buffered(SnowContext *s, slice_buffer * sb, SubBand *b, DWTELEM *src, int stride){    const int w= b->width;    const int h= b->height;    const int qlog= clip(s->qlog + b->qlog, 0, 128);    const int qmul= qexp[qlog&7]<<(qlog>>3);    const int qadd= (s->qbias*qmul)>>QBIAS_SHIFT;    int x,y;    START_TIMER        if(s->qlog == LOSSLESS_QLOG) return;        assert(QROOT==8);        for(y=0; y<h; y++){//        DWTELEM * line = slice_buffer_get_line_from_address(sb, src + (y * stride));        DWTELEM * line = slice_buffer_get_line(sb, (y * b->stride_line) + b->buf_y_offset) + b->buf_x_offset;        for(x=0; x<w; x++){            int i= line[x];            if(i<0){                line[x]= -((-i*qmul + qadd)>>(QEXPSHIFT)); //FIXME try different bias            }else if(i>0){                line[x]=  (( i*qmul + qadd)>>(QEXPSHIFT));            }        }    }    if(w > 200 /*level+1 == s->spatial_decomposition_count*/){        STOP_TIMER("dquant")    }}