CVS: main/libmpcodecs vf_spp.c,1.4,1.5
Update of /cvsroot/mplayer/main/libmpcodecs In directory mail:/var/tmp.root/cvs-serv27074 Modified Files: vf_spp.c Log Message: different / faster / simpler "quantization" filtered images look like with the old quantization (to me at least) if anyone notices a difference then tell me ASAP Index: vf_spp.c =================================================================== RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_spp.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- vf_spp.c 27 Oct 2003 19:14:38 -0000 1.4 +++ vf_spp.c 27 Oct 2003 21:12:29 -0000 1.5 @@ -86,28 +86,20 @@ static inline void requantize(DCTELEM dst[64], DCTELEM src[64], int qp, uint8_t *permutation){ int i; const int qmul= qp<<1; - const int qadd= (qp-1)|1; - const int qinv= ((1<<(SHIFT-3)) + qmul/2)/ qmul; int bias= 0; //FIXME unsigned int threshold1, threshold2; - - threshold1= (1<<SHIFT) - bias - 1; + + threshold1= qmul*((1<<3) - bias) - 1; threshold2= (threshold1<<1); memset(dst, 0, 64*sizeof(DCTELEM)); - dst[0]= (src[0] + 4)>>3;; + dst[0]= (src[0] + 4)>>3; - for(i=1; i<64; i++){ - int level= qinv*src[i]; + for(i=1; i<64; i++){ + int level= src[i]; if(((unsigned)(level+threshold1))>threshold2){ const int j= permutation[i]; - if(level>0){ - level= (bias + level)>>SHIFT; - dst[j]= level*qmul + qadd; - }else{ - level= (bias - level)>>SHIFT; - dst[j]= -level*qmul - qadd; - } + dst[j]= (level + 4)>>3; } } }
participants (1)
-
Michael Niedermayer CVS