summaryrefslogtreecommitdiff
path: root/libpostproc/postprocess.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2006-10-10 08:09:12 +0000
committerDiego Biurrun <diego@biurrun.de>2006-10-10 08:09:12 +0000
commit8925915fccefe7389f374e87af8e132c4ecf6d16 (patch)
tree128b330a63e1e93377e35450c22ab8b393ee72bb /libpostproc/postprocess.c
parentab5a1435ecad12b7c372f067322bc1b2d01dba2d (diff)
downloadffmpeg-8925915fccefe7389f374e87af8e132c4ecf6d16.tar.gz
Change libpostproc to use the FFMIN/FFMAX macros from libavutil.
Originally committed as revision 6622 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libpostproc/postprocess.c')
-rw-r--r--libpostproc/postprocess.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
index 358656b76b..52548c36e9 100644
--- a/libpostproc/postprocess.c
+++ b/libpostproc/postprocess.c
@@ -99,9 +99,6 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
#include <altivec.h>
#endif
-#define MIN(a,b) ((a) > (b) ? (b) : (a))
-#define MAX(a,b) ((a) < (b) ? (b) : (a))
-
#define GET_MODE_BUFFER_SIZE 500
#define OPTIONS_ARRAY_SIZE 10
#define BLOCK_SIZE 8
@@ -341,8 +338,8 @@ static inline void doHorizDefFilter_C(uint8_t dst[], int stride, PPContext *c)
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) - MIN( ABS(leftEnergy), ABS(rightEnergy) );
- d= MAX(d, 0);
+ int d= ABS(middleEnergy) - FFMIN( ABS(leftEnergy), ABS(rightEnergy) );
+ d= FFMAX(d, 0);
d= (5*d + 32) >> 6;
d*= SIGN(-middleEnergy);
@@ -450,7 +447,7 @@ static inline void horizX1Filter(uint8_t *src, int stride, int QP)
int b= src[3] - src[4];
int c= src[5] - src[6];
- int d= MAX(ABS(b) - (ABS(a) + ABS(c))/2, 0);
+ int d= FFMAX(ABS(b) - (ABS(a) + ABS(c))/2, 0);
if(d < QP)
{
@@ -543,8 +540,8 @@ static always_inline void do_a_deblock_C(uint8_t *src, int step, int stride, PPC
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) - MIN( ABS(leftEnergy), ABS(rightEnergy) );
- d= MAX(d, 0);
+ int d= ABS(middleEnergy) - FFMIN( ABS(leftEnergy), ABS(rightEnergy) );
+ d= FFMAX(d, 0);
d= (5*d + 32) >> 6;
d*= SIGN(-middleEnergy);
@@ -1044,14 +1041,14 @@ void pp_postprocess(uint8_t * src[3], int srcStride[3],
int mbHeight= (height+15)>>4;
PPMode *mode = (PPMode*)vm;
PPContext *c = (PPContext*)vc;
- int minStride= MAX(ABS(srcStride[0]), ABS(dstStride[0]));
+ int minStride= FFMAX(ABS(srcStride[0]), ABS(dstStride[0]));
int absQPStride = ABS(QPStride);
// c->stride and c->QPStride are always positive
if(c->stride < minStride || c->qpStride < absQPStride)
reallocBuffers(c, width, height,
- MAX(minStride, c->stride),
- MAX(c->qpStride, absQPStride));
+ FFMAX(minStride, c->stride),
+ FFMAX(c->qpStride, absQPStride));
if(QP_store==NULL || (mode->lumMode & FORCE_QUANT))
{