# HG changeset patch # User michael # Date 1067289149 0 # Node ID 86916e46d4451ab5c334641954653c8b4eca210e # Parent 8b9ae87aff0f513feb00f67b2d5239c62347fa81 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 diff -r 8b9ae87aff0f -r 86916e46d445 libmpcodecs/vf_spp.c --- a/libmpcodecs/vf_spp.c Mon Oct 27 19:14:38 2003 +0000 +++ b/libmpcodecs/vf_spp.c Mon Oct 27 21:12:29 2003 +0000 @@ -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<>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; } } }