changeset 32:cb746db3fd32 libpostproc

Rename ABS macro to FFABS.
author diego
date Wed, 11 Oct 2006 23:17:58 +0000
parents 81ad3274583c
children b5cf29aef709
files postprocess.c postprocess_template.c
diffstat 2 files changed, 27 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/postprocess.c	Wed Oct 11 22:59:37 2006 +0000
+++ b/postprocess.c	Wed Oct 11 23:17:58 2006 +0000
@@ -330,13 +330,13 @@
         {
                 const int middleEnergy= 5*(dst[4] - dst[3]) + 2*(dst[2] - dst[5]);
 
-                if(ABS(middleEnergy) < 8*c->QP)
+                if(FFABS(middleEnergy) < 8*c->QP)
                 {
                         const int q=(dst[3] - dst[4])/2;
                         const int leftEnergy=  5*(dst[2] - dst[1]) + 2*(dst[0] - dst[3]);
                         const int rightEnergy= 5*(dst[6] - dst[5]) + 2*(dst[4] - dst[7]);
 
-                        int d= ABS(middleEnergy) - FFMIN( ABS(leftEnergy), ABS(rightEnergy) );
+                        int d= FFABS(middleEnergy) - FFMIN( FFABS(leftEnergy), FFABS(rightEnergy) );
                         d= FFMAX(d, 0);
 
                         d= (5*d + 32) >> 6;
@@ -369,8 +369,8 @@
         int y;
         for(y=0; y<BLOCK_SIZE; y++)
         {
-                const int first= ABS(dst[-1] - dst[0]) < c->QP ? dst[-1] : dst[0];
-                const int last= ABS(dst[8] - dst[7]) < c->QP ? dst[8] : dst[7];
+                const int first= FFABS(dst[-1] - dst[0]) < c->QP ? dst[-1] : dst[0];
+                const int last= FFABS(dst[8] - dst[7]) < c->QP ? dst[8] : dst[7];
 
                 int sums[10];
                 sums[0] = 4*first + dst[0] + dst[1] + dst[2] + 4;
@@ -445,7 +445,7 @@
                 int b= src[3] - src[4];
                 int c= src[5] - src[6];
 
-                int d= FFMAX(ABS(b) - (ABS(a) + ABS(c))/2, 0);
+                int d= FFMAX(FFABS(b) - (FFABS(a) + FFABS(c))/2, 0);
 
                 if(d < QP)
                 {
@@ -505,8 +505,8 @@
                                 }
                         }
                         if(max-min < 2*QP){
-                                const int first= ABS(src[-1*step] - src[0]) < QP ? src[-1*step] : src[0];
-                                const int last= ABS(src[8*step] - src[7*step]) < QP ? src[8*step] : src[7*step];
+                                const int first= FFABS(src[-1*step] - src[0]) < QP ? src[-1*step] : src[0];
+                                const int last= FFABS(src[8*step] - src[7*step]) < QP ? src[8*step] : src[7*step];
 
                                 int sums[10];
                                 sums[0] = 4*first + src[0*step] + src[1*step] + src[2*step] + 4;
@@ -532,13 +532,13 @@
                 }else{
                         const int middleEnergy= 5*(src[4*step] - src[3*step]) + 2*(src[2*step] - src[5*step]);
 
-                        if(ABS(middleEnergy) < 8*QP)
+                        if(FFABS(middleEnergy) < 8*QP)
                         {
                                 const int q=(src[3*step] - src[4*step])/2;
                                 const int leftEnergy=  5*(src[2*step] - src[1*step]) + 2*(src[0*step] - src[3*step]);
                                 const int rightEnergy= 5*(src[6*step] - src[5*step]) + 2*(src[4*step] - src[7*step]);
 
-                                int d= ABS(middleEnergy) - FFMIN( ABS(leftEnergy), ABS(rightEnergy) );
+                                int d= FFABS(middleEnergy) - FFMIN( FFABS(leftEnergy), FFABS(rightEnergy) );
                                 d= FFMAX(d, 0);
 
                                 d= (5*d + 32) >> 6;
@@ -1045,8 +1045,8 @@
         int mbHeight= (height+15)>>4;
         PPMode *mode = (PPMode*)vm;
         PPContext *c = (PPContext*)vc;
-        int minStride= FFMAX(ABS(srcStride[0]), ABS(dstStride[0]));
-        int absQPStride = ABS(QPStride);
+        int minStride= FFMAX(FFABS(srcStride[0]), FFABS(dstStride[0]));
+        int absQPStride = FFABS(QPStride);
 
         // c->stride and c->QPStride are always positive
         if(c->stride < minStride || c->qpStride < absQPStride)
--- a/postprocess_template.c	Wed Oct 11 22:59:37 2006 +0000
+++ b/postprocess_template.c	Wed Oct 11 23:17:58 2006 +0000
@@ -338,8 +338,8 @@
         src+= stride*3;
         for(x=0; x<BLOCK_SIZE; x++)
         {
-                const int first= ABS(src[0] - src[l1]) < c->QP ? src[0] : src[l1];
-                const int last= ABS(src[l8] - src[l9]) < c->QP ? src[l9] : src[l8];
+                const int first= FFABS(src[0] - src[l1]) < c->QP ? src[0] : src[l1];
+                const int last= FFABS(src[l8] - src[l9]) < c->QP ? src[l9] : src[l8];
 
                 int sums[10];
                 sums[0] = 4*first + src[l1] + src[l2] + src[l3] + 4;
@@ -460,7 +460,7 @@
         for(x=0; x<BLOCK_SIZE; x++)
         {
                 const int v = (src[x+l5] - src[x+l4]);
-                if(ABS(v) < QP15)
+                if(FFABS(v) < QP15)
                 {
                         src[x+l3] +=v>>3;
                         src[x+l4] +=v>>1;
@@ -589,7 +589,7 @@
                 int b= src[l4] - src[l5];
                 int c= src[l5] - src[l6];
 
-                int d= ABS(b) - ((ABS(a) + ABS(c))>>1);
+                int d= FFABS(b) - ((FFABS(a) + FFABS(c))>>1);
                 d= FFMAX(d, 0);
 
                 if(d < co->QP*2)
@@ -845,13 +845,13 @@
         for(x=0; x<BLOCK_SIZE; x++)
         {
                 const int middleEnergy= 5*(src[l5] - src[l4]) + 2*(src[l3] - src[l6]);
-                if(ABS(middleEnergy)< 8*QP)
+                if(FFABS(middleEnergy)< 8*QP)
                 {
                         const int q=(src[l4] - src[l5])/2;
                         const int leftEnergy=  5*(src[l3] - src[l2]) + 2*(src[l1] - src[l4]);
                         const int rightEnergy= 5*(src[l7] - src[l6]) + 2*(src[l5] - src[l8]);
 
-                        int d= ABS(middleEnergy) - FFMIN( ABS(leftEnergy), ABS(rightEnergy) );
+                        int d= FFABS(middleEnergy) - FFMIN( FFABS(leftEnergy), FFABS(rightEnergy) );
                         d= FFMAX(d, 0);
 
                         d= (5*d + 32) >> 6;
@@ -880,7 +880,7 @@
                 for(y=4; y<6; y++)
                 {
                         int d= src[x+y*stride] - tmp[x+(y-4)*8];
-                        int ad= ABS(d);
+                        int ad= FFABS(d);
                         static int max=0;
                         static int sum=0;
                         static int num=0;
@@ -1149,13 +1149,13 @@
         for(x=0; x<BLOCK_SIZE; x++)
         {
                 const int middleEnergy= 5*(src[l5] - src[l4]) + 2*(src[l3] - src[l6]);
-                if(ABS(middleEnergy) < 8*c->QP)
+                if(FFABS(middleEnergy) < 8*c->QP)
                 {
                         const int q=(src[l4] - src[l5])/2;
                         const int leftEnergy=  5*(src[l3] - src[l2]) + 2*(src[l1] - src[l4]);
                         const int rightEnergy= 5*(src[l7] - src[l6]) + 2*(src[l5] - src[l8]);
 
-                        int d= ABS(middleEnergy) - FFMIN( ABS(leftEnergy), ABS(rightEnergy) );
+                        int d= FFABS(middleEnergy) - FFMIN( FFABS(leftEnergy), FFABS(rightEnergy) );
                         d= FFMAX(d, 0);
 
                         d= (5*d + 32) >> 6;
@@ -1491,7 +1491,7 @@
                                         static int worstRange=0;
                                         static int worstDiff=0;
                                         int diff= (f - *p);
-                                        int absDiff= ABS(diff);
+                                        int absDiff= FFABS(diff);
                                         int error= diff*diff;
 
                                         if(x==1 || x==8 || y==1 || y==8) continue;
@@ -2552,7 +2552,7 @@
                         int d1=ref - cur;
 //                        if(x==0 || x==7) d1+= d1>>1;
 //                        if(y==0 || y==7) d1+= d1>>1;
-//                        d+= ABS(d1);
+//                        d+= FFABS(d1);
                         d+= d1*d1;
 //                        sysd+= d1;
                 }
@@ -3529,7 +3529,7 @@
                         dstBlock+=8;
                         srcBlock+=8;
                 }
-                if(width==ABS(dstStride))
+                if(width==FFABS(dstStride))
                         linecpy(dst, tempDst + 9*dstStride, copyAhead, dstStride);
                 else
                 {
@@ -3551,7 +3551,7 @@
                 uint8_t *tempBlock2= c.tempBlocks + 8;
 #endif
                 int8_t *QPptr= &QPs[(y>>qpVShift)*QPStride];
-                int8_t *nonBQPptr= &c.nonBQPTable[(y>>qpVShift)*ABS(QPStride)];
+                int8_t *nonBQPptr= &c.nonBQPTable[(y>>qpVShift)*FFABS(QPStride)];
                 int QP=0;
                 /* can we mess with a 8x16 block from srcBlock/dstBlock downwards and 1 line upwards
                    if not than use a temporary buffer */
@@ -3565,14 +3565,14 @@
 
                         /* duplicate last line of src to fill the void upto line (copyAhead+7) */
                         for(i=FFMAX(height-y, 8); i<copyAhead+8; i++)
-                                memcpy(tempSrc + srcStride*i, src + srcStride*(height-1), ABS(srcStride));
+                                memcpy(tempSrc + srcStride*i, src + srcStride*(height-1), FFABS(srcStride));
 
                         /* copy up to (copyAhead+1) lines of dst (line -1 to (copyAhead-1))*/
                         linecpy(tempDst, dstBlock - dstStride, FFMIN(height-y+1, copyAhead+1), dstStride);
 
                         /* duplicate last line of dst to fill the void upto line (copyAhead) */
                         for(i=height-y+1; i<=copyAhead; i++)
-                                memcpy(tempDst + dstStride*i, dst + dstStride*(height-1), ABS(dstStride));
+                                memcpy(tempDst + dstStride*i, dst + dstStride*(height-1), FFABS(dstStride));
 
                         dstBlock= tempDst + dstStride;
                         srcBlock= tempSrc;
@@ -3783,7 +3783,7 @@
                 if(y+15 >= height)
                 {
                         uint8_t *dstBlock= &(dst[y*dstStride]);
-                        if(width==ABS(dstStride))
+                        if(width==FFABS(dstStride))
                                 linecpy(dstBlock, tempDst + dstStride, height-y, dstStride);
                         else
                         {