[MPlayer-cvslog] r19186 - in trunk/libswscale: swscale.c swscale_altivec_template.c swscale_template.c
lucabe
subversion at mplayerhq.hu
Wed Jul 26 15:19:02 CEST 2006
Author: lucabe
Date: Wed Jul 26 15:19:02 2006
New Revision: 19186
Modified:
trunk/libswscale/swscale.c
trunk/libswscale/swscale_altivec_template.c
trunk/libswscale/swscale_template.c
Log:
Replace MIN() and MAX() with FFMIN() and FFMAX()
Modified: trunk/libswscale/swscale.c
==============================================================================
--- trunk/libswscale/swscale.c (original)
+++ trunk/libswscale/swscale.c Wed Jul 26 15:19:02 2006
@@ -151,9 +151,6 @@
write special BGR->BGR scaler
*/
-#define MIN(a,b) ((a) > (b) ? (b) : (a))
-#define MAX(a,b) ((a) < (b) ? (b) : (a))
-
#if defined(ARCH_X86) || defined(ARCH_X86_64)
static uint64_t attribute_used __attribute__((aligned(8))) bF8= 0xF8F8F8F8F8F8F8F8LL;
static uint64_t attribute_used __attribute__((aligned(8))) bFC= 0xFCFCFCFCFCFCFCFCLL;
@@ -252,7 +249,7 @@
for(j=0; j<lumFilterSize; j++)
val += lumSrc[j][i] * lumFilter[j];
- dest[i]= MIN(MAX(val>>19, 0), 255);
+ dest[i]= FFMIN(FFMAX(val>>19, 0), 255);
}
if(uDest != NULL)
@@ -267,8 +264,8 @@
v += chrSrc[j][i + 2048] * chrFilter[j];
}
- uDest[i]= MIN(MAX(u>>19, 0), 255);
- vDest[i]= MIN(MAX(v>>19, 0), 255);
+ uDest[i]= FFMIN(FFMAX(u>>19, 0), 255);
+ vDest[i]= FFMIN(FFMAX(v>>19, 0), 255);
}
}
@@ -285,7 +282,7 @@
for(j=0; j<lumFilterSize; j++)
val += lumSrc[j][i] * lumFilter[j];
- dest[i]= MIN(MAX(val>>19, 0), 255);
+ dest[i]= FFMIN(FFMAX(val>>19, 0), 255);
}
if(uDest == NULL)
@@ -303,8 +300,8 @@
v += chrSrc[j][i + 2048] * chrFilter[j];
}
- uDest[2*i]= MIN(MAX(u>>19, 0), 255);
- uDest[2*i+1]= MIN(MAX(v>>19, 0), 255);
+ uDest[2*i]= FFMIN(FFMAX(u>>19, 0), 255);
+ uDest[2*i+1]= FFMIN(FFMAX(v>>19, 0), 255);
}
else
for(i=0; i<chrDstW; i++)
@@ -318,8 +315,8 @@
v += chrSrc[j][i + 2048] * chrFilter[j];
}
- uDest[2*i]= MIN(MAX(v>>19, 0), 255);
- uDest[2*i+1]= MIN(MAX(u>>19, 0), 255);
+ uDest[2*i]= FFMIN(FFMAX(v>>19, 0), 255);
+ uDest[2*i+1]= FFMIN(FFMAX(u>>19, 0), 255);
}
}
@@ -1168,7 +1165,7 @@
// Move filter coeffs left to compensate for filterPos
for(j=1; j<filterSize; j++)
{
- int left= MAX(j + (*filterPos)[i], 0);
+ int left= FFMAX(j + (*filterPos)[i], 0);
filter[i*filterSize + left] += filter[i*filterSize + j];
filter[i*filterSize + j]=0;
}
@@ -1181,7 +1178,7 @@
// Move filter coeffs right to compensate for filterPos
for(j=filterSize-2; j>=0; j--)
{
- int right= MIN(j + shift, filterSize-1);
+ int right= FFMIN(j + shift, filterSize-1);
filter[i*filterSize +right] += filter[i*filterSize +j];
filter[i*filterSize +j]=0;
}
@@ -1404,7 +1401,7 @@
// generating tables:
int i;
for(i=0; i<768; i++){
- int c= MIN(MAX(i-256, 0), 255);
+ int c= FFMIN(FFMAX(i-256, 0), 255);
clip_table[i]=c;
}
}
@@ -2163,7 +2160,7 @@
for(i=0; i<dstH; i++)
{
int chrI= i*c->chrDstH / dstH;
- int nextSlice= MAX(c->vLumFilterPos[i ] + c->vLumFilterSize - 1,
+ int nextSlice= FFMAX(c->vLumFilterPos[i ] + c->vLumFilterSize - 1,
((c->vChrFilterPos[chrI] + c->vChrFilterSize - 1)<<c->chrSrcVSubSample));
nextSlice>>= c->chrSrcVSubSample;
@@ -2515,7 +2512,7 @@
}
static SwsVector *sws_sumVec(SwsVector *a, SwsVector *b){
- int length= MAX(a->length, b->length);
+ int length= FFMAX(a->length, b->length);
double *coeff= av_malloc(length*sizeof(double));
int i;
SwsVector *vec= av_malloc(sizeof(SwsVector));
@@ -2532,7 +2529,7 @@
}
static SwsVector *sws_diffVec(SwsVector *a, SwsVector *b){
- int length= MAX(a->length, b->length);
+ int length= FFMAX(a->length, b->length);
double *coeff= av_malloc(length*sizeof(double));
int i;
SwsVector *vec= av_malloc(sizeof(SwsVector));
Modified: trunk/libswscale/swscale_altivec_template.c
==============================================================================
--- trunk/libswscale/swscale_altivec_template.c (original)
+++ trunk/libswscale/swscale_altivec_template.c Wed Jul 26 15:19:02 2006
@@ -1,4 +1,4 @@
-/*
+FF/*
AltiVec-enhanced yuv2yuvX
Copyright (C) 2004 Romain Dolbeau <romain at dolbeau.org>
@@ -223,7 +223,7 @@
for(j=0; j<filterSize; j++) {
val += ((int)src[srcPos + j])*filter[filterSize*i + j];
}
- dst[i] = MIN(MAX(0, val>>7), (1<<15)-1);
+ dst[i] = FFMIN(FFMAX(0, val>>7), (1<<15)-1);
}
}
else
@@ -261,7 +261,7 @@
vector signed int val_vEven = vec_mule(src_v, filter_v);
vector signed int val_s = vec_sums(val_vEven, vzero);
vec_st(val_s, 0, tempo);
- dst[i] = MIN(MAX(0, tempo[3]>>7), (1<<15)-1);
+ dst[i] = FFMIN(FFMAX(0, tempo[3]>>7), (1<<15)-1);
}
}
break;
@@ -286,7 +286,7 @@
vector signed int val_v = vec_msums(src_v, filter_v, (vector signed int)vzero);
vector signed int val_s = vec_sums(val_v, vzero);
vec_st(val_s, 0, tempo);
- dst[i] = MIN(MAX(0, tempo[3]>>7), (1<<15)-1);
+ dst[i] = FFMIN(FFMAX(0, tempo[3]>>7), (1<<15)-1);
}
}
break;
@@ -315,7 +315,7 @@
vector signed int val_s = vec_sums(val_v, vzero);
vec_st(val_s, 0, tempo);
- dst[i] = MIN(MAX(0, tempo[3]>>7), (1<<15)-1);
+ dst[i] = FFMIN(FFMAX(0, tempo[3]>>7), (1<<15)-1);
}
}
break;
@@ -376,7 +376,7 @@
vector signed int val_s = vec_sums(val_v, vzero);
vec_st(val_s, 0, tempo);
- dst[i] = MIN(MAX(0, tempo[3]>>7), (1<<15)-1);
+ dst[i] = FFMIN(FFMAX(0, tempo[3]>>7), (1<<15)-1);
}
}
Modified: trunk/libswscale/swscale_template.c
==============================================================================
--- trunk/libswscale/swscale_template.c (original)
+++ trunk/libswscale/swscale_template.c Wed Jul 26 15:19:02 2006
@@ -2405,7 +2405,7 @@
val += ((int)src[srcPos + j])*filter[filterSize*i + j];
}
// filter += hFilterSize;
- dst[i] = MIN(MAX(0, val>>7), (1<<15)-1); // the cubic equation does overflow ...
+ dst[i] = FFMIN(FFMAX(0, val>>7), (1<<15)-1); // the cubic equation does overflow ...
// dst[i] = val>>7;
}
#endif
More information about the MPlayer-cvslog
mailing list