From 4cca47b5385adb8ace28b10db7a20f337b15bbeb Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Tue, 18 Dec 2012 15:31:19 -0800 Subject: 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 --- vp9/encoder/vp9_ssim.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vp9/encoder/vp9_ssim.c') 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; -- cgit v1.2.3