#define do_a_deblock_altivec(a...) do_a_deblock_C(a)
static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
- uint8_t *tempBlured, uint32_t *tempBluredPast, int *maxNoise)
+ uint8_t *tempBlurred, uint32_t *tempBlurredPast, int *maxNoise)
{
const vector signed int zero = vec_splat_s32(0);
const vector signed short vsint16_1 = vec_splat_s16(1);
vector signed int v_sysdp = zero;
int d, sysd, i;
- tempBluredPast[127]= maxNoise[0];
- tempBluredPast[128]= maxNoise[1];
- tempBluredPast[129]= maxNoise[2];
+ tempBlurredPast[127]= maxNoise[0];
+ tempBlurredPast[128]= maxNoise[1];
+ tempBlurredPast[129]= maxNoise[2];
#define LOAD_LINE(src, i) \
register int j##src##i = i * stride; \
LOAD_LINE(src, 6);
LOAD_LINE(src, 7);
- LOAD_LINE(tempBlured, 0);
- LOAD_LINE(tempBlured, 1);
- LOAD_LINE(tempBlured, 2);
- LOAD_LINE(tempBlured, 3);
- LOAD_LINE(tempBlured, 4);
- LOAD_LINE(tempBlured, 5);
- LOAD_LINE(tempBlured, 6);
- LOAD_LINE(tempBlured, 7);
+ LOAD_LINE(tempBlurred, 0);
+ LOAD_LINE(tempBlurred, 1);
+ LOAD_LINE(tempBlurred, 2);
+ LOAD_LINE(tempBlurred, 3);
+ LOAD_LINE(tempBlurred, 4);
+ LOAD_LINE(tempBlurred, 5);
+ LOAD_LINE(tempBlurred, 6);
+ LOAD_LINE(tempBlurred, 7);
#undef LOAD_LINE
#define ACCUMULATE_DIFFS(i) \
- vector signed short v_d##i = vec_sub(v_tempBluredAss##i, \
+ vector signed short v_d##i = vec_sub(v_tempBlurredAss##i, \
v_srcAss##i); \
v_dp = vec_msums(v_d##i, v_d##i, v_dp); \
v_sysdp = vec_msums(v_d##i, vsint16_1, v_sysdp)
i = d;
d = (4*d
- +(*(tempBluredPast-256))
- +(*(tempBluredPast-1))+ (*(tempBluredPast+1))
- +(*(tempBluredPast+256))
+ +(*(tempBlurredPast-256))
+ +(*(tempBlurredPast-1))+ (*(tempBlurredPast+1))
+ +(*(tempBlurredPast+256))
+4)>>3;
- *tempBluredPast=i;
+ *tempBlurredPast=i;
if (d > maxNoise[1]) {
if (d < maxNoise[2]) {
-#define OP(i) v_tempBluredAss##i = vec_avg(v_tempBluredAss##i, v_srcAss##i);
+#define OP(i) v_tempBlurredAss##i = vec_avg(v_tempBlurredAss##i, v_srcAss##i);
OP(0);
OP(1);
OP(7);
#undef OP
} else {
-#define OP(i) v_tempBluredAss##i = v_srcAss##i;
+#define OP(i) v_tempBlurredAss##i = v_srcAss##i;
OP(0);
OP(1);
#define OP(i) \
const vector signed short v_temp##i = \
- vec_mladd(v_tempBluredAss##i, \
+ vec_mladd(v_tempBlurredAss##i, \
vsint16_7, v_srcAss##i); \
const vector signed short v_temp2##i = \
vec_add(v_temp##i, vsint16_4); \
- v_tempBluredAss##i = vec_sr(v_temp2##i, vuint16_3)
+ v_tempBlurredAss##i = vec_sr(v_temp2##i, vuint16_3)
OP(0);
OP(1);
#define OP(i) \
const vector signed short v_temp##i = \
- vec_mladd(v_tempBluredAss##i, \
+ vec_mladd(v_tempBlurredAss##i, \
vsint16_3, v_srcAss##i); \
const vector signed short v_temp2##i = \
vec_add(v_temp##i, vsint16_2); \
- v_tempBluredAss##i = vec_sr(v_temp2##i, (vector unsigned short)vsint16_2)
+ v_tempBlurredAss##i = vec_sr(v_temp2##i, (vector unsigned short)vsint16_2)
OP(0);
OP(1);
const vector unsigned char perms##src##i = \
vec_lvsr(i * stride, src); \
const vector unsigned char vf##src##i = \
- vec_packsu(v_tempBluredAss##i, (vector signed short)zero); \
+ vec_packsu(v_tempBlurredAss##i, (vector signed short)zero); \
const vector unsigned char vg##src##i = \
vec_perm(vf##src##i, v_##src##A##i, permHH); \
const vector unsigned char mask##src##i = \
PACK_AND_STORE(src, 5);
PACK_AND_STORE(src, 6);
PACK_AND_STORE(src, 7);
- PACK_AND_STORE(tempBlured, 0);
- PACK_AND_STORE(tempBlured, 1);
- PACK_AND_STORE(tempBlured, 2);
- PACK_AND_STORE(tempBlured, 3);
- PACK_AND_STORE(tempBlured, 4);
- PACK_AND_STORE(tempBlured, 5);
- PACK_AND_STORE(tempBlured, 6);
- PACK_AND_STORE(tempBlured, 7);
+ PACK_AND_STORE(tempBlurred, 0);
+ PACK_AND_STORE(tempBlurred, 1);
+ PACK_AND_STORE(tempBlurred, 2);
+ PACK_AND_STORE(tempBlurred, 3);
+ PACK_AND_STORE(tempBlurred, 4);
+ PACK_AND_STORE(tempBlurred, 5);
+ PACK_AND_STORE(tempBlurred, 6);
+ PACK_AND_STORE(tempBlurred, 7);
#undef PACK_AND_STORE
}
#ifndef HAVE_ALTIVEC
static inline void RENAME(tempNoiseReducer)(uint8_t *src, int stride,
- uint8_t *tempBlured, uint32_t *tempBluredPast, int *maxNoise)
+ uint8_t *tempBlurred, uint32_t *tempBlurredPast, int *maxNoise)
{
// to save a register (FIXME do this outside of the loops)
- tempBluredPast[127]= maxNoise[0];
- tempBluredPast[128]= maxNoise[1];
- tempBluredPast[129]= maxNoise[2];
+ tempBlurredPast[127]= maxNoise[0];
+ tempBlurredPast[128]= maxNoise[1];
+ tempBlurredPast[129]= maxNoise[2];
#define FAST_L2_DIFF
//#define L1_DIFF //u should change the thresholds too if u try that one
"4: \n\t"
- :: "r" (src), "r" (tempBlured), "r"((long)stride), "m" (tempBluredPast)
+ :: "r" (src), "r" (tempBlurred), "r"((long)stride), "m" (tempBlurredPast)
: "%"REG_a, "%"REG_d, "%"REG_c, "memory"
);
#else //defined (HAVE_MMX2) || defined (HAVE_3DNOW)
for(y=0; y<8; y++){
int x;
for(x=0; x<8; x++){
- int ref= tempBlured[ x + y*stride ];
+ int ref= tempBlurred[ x + y*stride ];
int cur= src[ x + y*stride ];
int d1=ref - cur;
// if(x==0 || x==7) d1+= d1>>1;
i=d;
d= (
4*d
- +(*(tempBluredPast-256))
- +(*(tempBluredPast-1))+ (*(tempBluredPast+1))
- +(*(tempBluredPast+256))
+ +(*(tempBlurredPast-256))
+ +(*(tempBlurredPast-1))+ (*(tempBlurredPast+1))
+ +(*(tempBlurredPast+256))
+4)>>3;
- *tempBluredPast=i;
-// ((*tempBluredPast)*3 + d + 2)>>2;
+ *tempBlurredPast=i;
+// ((*tempBlurredPast)*3 + d + 2)>>2;
/*
Switch between
for(y=0; y<8; y++){
int x;
for(x=0; x<8; x++){
- int ref= tempBlured[ x + y*stride ];
+ int ref= tempBlurred[ x + y*stride ];
int cur= src[ x + y*stride ];
- tempBlured[ x + y*stride ]=
+ tempBlurred[ x + y*stride ]=
src[ x + y*stride ]=
(ref + cur + 1)>>1;
}
for(y=0; y<8; y++){
int x;
for(x=0; x<8; x++){
- tempBlured[ x + y*stride ]= src[ x + y*stride ];
+ tempBlurred[ x + y*stride ]= src[ x + y*stride ];
}
}
}
for(y=0; y<8; y++){
int x;
for(x=0; x<8; x++){
- int ref= tempBlured[ x + y*stride ];
+ int ref= tempBlurred[ x + y*stride ];
int cur= src[ x + y*stride ];
- tempBlured[ x + y*stride ]=
+ tempBlurred[ x + y*stride ]=
src[ x + y*stride ]=
(ref*7 + cur + 4)>>3;
}
for(y=0; y<8; y++){
int x;
for(x=0; x<8; x++){
- int ref= tempBlured[ x + y*stride ];
+ int ref= tempBlurred[ x + y*stride ];
int cur= src[ x + y*stride ];
- tempBlured[ x + y*stride ]=
+ tempBlurred[ x + y*stride ]=
src[ x + y*stride ]=
(ref*3 + cur + 2)>>2;
}
if(mode & TEMP_NOISE_FILTER)
{
RENAME(tempNoiseReducer)(dstBlock-8, stride,
- c.tempBlured[isColor] + y*dstStride + x,
- c.tempBluredPast[isColor] + (y>>3)*256 + (x>>3),
+ c.tempBlurred[isColor] + y*dstStride + x,
+ c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3),
c.ppMode.maxTmpNoise);
}
}
if((mode & TEMP_NOISE_FILTER)){
RENAME(tempNoiseReducer)(dstBlock-8, dstStride,
- c.tempBlured[isColor] + y*dstStride + x,
- c.tempBluredPast[isColor] + (y>>3)*256 + (x>>3),
+ c.tempBlurred[isColor] + y*dstStride + x,
+ c.tempBlurredPast[isColor] + (y>>3)*256 + (x>>3),
c.ppMode.maxTmpNoise);
}