summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_ssim.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@google.com>2012-12-18 15:31:19 -0800
committerRonald S. Bultje <rbultje@google.com>2012-12-18 15:31:19 -0800
commit4cca47b5385adb8ace28b10db7a20f337b15bbeb (patch)
tree74b0e4692a4d26995dc98f9ca160a2b27a8c40dc /vp9/encoder/vp9_ssim.c
parentd47828ed59999ca9379860c13a753e092062748c (diff)
downloadlibvpx-4cca47b5385adb8ace28b10db7a20f337b15bbeb.tar
libvpx-4cca47b5385adb8ace28b10db7a20f337b15bbeb.tar.gz
libvpx-4cca47b5385adb8ace28b10db7a20f337b15bbeb.tar.bz2
libvpx-4cca47b5385adb8ace28b10db7a20f337b15bbeb.zip
Use standard integer types for pixel values and coefficients.
For coefficients, use int16_t (instead of short); for pixel values in 16-bit intermediates, use uint16_t (instead of unsigned short); for all others, use uint8_t (instead of unsigned char). Change-Id: I3619cd9abf106c3742eccc2e2f5e89a62774f7da
Diffstat (limited to 'vp9/encoder/vp9_ssim.c')
-rw-r--r--vp9/encoder/vp9_ssim.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/vp9/encoder/vp9_ssim.c b/vp9/encoder/vp9_ssim.c
index 4cbb9149b..363ed8492 100644
--- a/vp9/encoder/vp9_ssim.c
+++ b/vp9/encoder/vp9_ssim.c
@@ -11,7 +11,7 @@
#include "vp9/encoder/vp9_onyx_int.h"
-void vp9_ssim_parms_16x16_c(unsigned char *s, int sp, unsigned char *r,
+void vp9_ssim_parms_16x16_c(uint8_t *s, int sp, uint8_t *r,
int rp, unsigned long *sum_s, unsigned long *sum_r,
unsigned long *sum_sq_s, unsigned long *sum_sq_r,
unsigned long *sum_sxr) {
@@ -26,7 +26,7 @@ void vp9_ssim_parms_16x16_c(unsigned char *s, int sp, unsigned char *r,
}
}
}
-void vp9_ssim_parms_8x8_c(unsigned char *s, int sp, unsigned char *r, int rp,
+void vp9_ssim_parms_8x8_c(uint8_t *s, int sp, uint8_t *r, int rp,
unsigned long *sum_s, unsigned long *sum_r,
unsigned long *sum_sq_s, unsigned long *sum_sq_r,
unsigned long *sum_sxr) {
@@ -65,13 +65,13 @@ static double similarity(unsigned long sum_s, unsigned long sum_r,
return ssim_n * 1.0 / ssim_d;
}
-static double ssim_16x16(unsigned char *s, int sp, unsigned char *r, int rp) {
+static double ssim_16x16(uint8_t *s, int sp, uint8_t *r, int rp) {
unsigned long sum_s = 0, sum_r = 0, sum_sq_s = 0, sum_sq_r = 0, sum_sxr = 0;
vp9_ssim_parms_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) {
+static double ssim_8x8(uint8_t *s, int sp, uint8_t *r, int rp) {
unsigned long sum_s = 0, sum_r = 0, sum_sq_s = 0, sum_sq_r = 0, sum_sxr = 0;
vp9_ssim_parms_8x8(s, sp, r, rp, &sum_s, &sum_r, &sum_sq_s, &sum_sq_r,
&sum_sxr);
@@ -81,7 +81,7 @@ static double ssim_8x8(unsigned char *s, int sp, unsigned char *r, int rp) {
// We are using a 8x8 moving window with starting location of each 8x8 window
// on the 4x4 pixel grid. Such arrangement allows the windows to overlap
// block boundaries to penalize blocking artifacts.
-double vp9_ssim2(unsigned char *img1, unsigned char *img2, int stride_img1,
+double vp9_ssim2(uint8_t *img1, uint8_t *img2, int stride_img1,
int stride_img2, int width, int height) {
int i, j;
int samples = 0;