summaryrefslogtreecommitdiff
path: root/vp8/encoder/ssim.c
diff options
context:
space:
mode:
authorFritz Koenig <frkoenig@google.com>2011-08-19 08:51:27 -0700
committerFritz Koenig <frkoenig@google.com>2011-08-19 08:51:27 -0700
commit01376858cd184d820ff4c2d8390361a8679c0e87 (patch)
tree8cbfe5149b080df8a18863136e76b603734e0e57 /vp8/encoder/ssim.c
parent744f4823503a7220999103111c569c00ffe0d09c (diff)
downloadlibvpx-01376858cd184d820ff4c2d8390361a8679c0e87.tar
libvpx-01376858cd184d820ff4c2d8390361a8679c0e87.tar.gz
libvpx-01376858cd184d820ff4c2d8390361a8679c0e87.tar.bz2
libvpx-01376858cd184d820ff4c2d8390361a8679c0e87.zip
Reclasify optimized ssim calculations as SSE2.
Calculations were incorrectly classified as either SSE3 or SSSE3. Only using SSE2 instructions. Cleanup function names and make non-RTCD code work as well. Change-Id: I29f5c2ead342b2086a468029c15e2c1d948b5d97
Diffstat (limited to 'vp8/encoder/ssim.c')
-rw-r--r--vp8/encoder/ssim.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/vp8/encoder/ssim.c b/vp8/encoder/ssim.c
index fea756f7b..d0f8e490a 100644
--- a/vp8/encoder/ssim.c
+++ b/vp8/encoder/ssim.c
@@ -9,18 +9,9 @@
*/
-#include "vpx_scale/yv12config.h"
-#include "math.h"
#include "onyx_int.h"
-#if CONFIG_RUNTIME_CPU_DETECT
-#define IF_RTCD(x) (x)
-#else
-#define IF_RTCD(x) NULL
-#endif
-
-
-void ssim_parms_c
+void vp8_ssim_parms_16x16_c
(
unsigned char *s,
int sp,
@@ -46,7 +37,7 @@ void ssim_parms_c
}
}
}
-void ssim_parms_8x8_c
+void vp8_ssim_parms_8x8_c
(
unsigned char *s,
int sp,
@@ -107,14 +98,14 @@ static double ssim_16x16(unsigned char *s,int sp, unsigned char *r,int rp,
const vp8_variance_rtcd_vtable_t *rtcd)
{
unsigned long sum_s=0,sum_r=0,sum_sq_s=0,sum_sq_r=0,sum_sxr=0;
- rtcd->ssimpf(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr);
+ SSIMPF_INVOKE(rtcd,16x16)(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr);
return similarity(sum_s, sum_r, sum_sq_s, sum_sq_r, sum_sxr, 256);
}
static double ssim_8x8(unsigned char *s,int sp, unsigned char *r,int rp,
const vp8_variance_rtcd_vtable_t *rtcd)
{
unsigned long sum_s=0,sum_r=0,sum_sq_s=0,sum_sq_r=0,sum_sxr=0;
- rtcd->ssimpf_8x8(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr);
+ SSIMPF_INVOKE(rtcd,8x8)(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr);
return similarity(sum_s, sum_r, sum_sq_s, sum_sq_r, sum_sxr, 64);
}
@@ -134,7 +125,7 @@ long dssim(unsigned char *s,int sp, unsigned char *r,int rp,
c1 = cc1*16;
c2 = cc2*16;
- rtcd->ssimpf(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr);
+ SSIMPF_INVOKE(rtcd,16x16)(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r, &sum_sxr);
ssim_n1 = (2*sum_s*sum_r+ c1);
ssim_n2 =((int64_t) 2*256*sum_sxr-(int64_t) 2*sum_s*sum_r+c2);