assert(QROOT==8);
static void quantize(SnowContext *s, SubBand *b, DWTELEM *src, int stride, int bias){    const int level= b->level;    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);    int x,y, thres1, thres2;    START_TIMER    assert(QROOT==8);    if(s->qlog == LOSSLESS_QLOG) return;     bias= bias ? 0 : (3*qmul)>>3;    thres1= ((qmul - bias)>>QEXPSHIFT) - 1;    thres2= 2*thres1;        if(!bias){        for(y=0; y<h; y++){            for(x=0; x<w; x++){                int i= src[x + y*stride];                                if((unsigned)(i+thres1) > thres2){                    if(i>=0){                        i<<= QEXPSHIFT;                        i/= qmul; //FIXME optimize                        src[x + y*stride]=  i;                    }else{                        i= -i;                        i<<= QEXPSHIFT;                        i/= qmul; //FIXME optimize                        src[x + y*stride]= -i;                    }                }else                    src[x + y*stride]= 0;            }        }    }else{        for(y=0; y<h; y++){            for(x=0; x<w; x++){                int i= src[x + y*stride];                                 if((unsigned)(i+thres1) > thres2){                    if(i>=0){                        i<<= QEXPSHIFT;                        i= (i + bias) / qmul; //FIXME optimize                        src[x + y*stride]=  i;                    }else{                        i= -i;                        i<<= QEXPSHIFT;                        i= (i + bias) / qmul; //FIXME optimize                        src[x + y*stride]= -i;                    }                }else                    src[x + y*stride]= 0;            }        }    }    if(level+1 == s->spatial_decomposition_count){//        STOP_TIMER("quantize")    }}