From: Ronald S. Bultje Date: Mon, 10 Jun 2013 18:36:04 +0000 (-0700) Subject: Don't skip right/bottom border pixels in SSIM calculations. X-Git-Tag: v1.3.0~1023^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44f349df62e105860e8faeb29c5e3a6b9e61615e;p=platform%2Fupstream%2Flibvpx.git Don't skip right/bottom border pixels in SSIM calculations. Change-Id: I75acb55ade54bef6ad7703ed5e691581fa2f8fe1 --- diff --git a/vp9/encoder/vp9_ssim.c b/vp9/encoder/vp9_ssim.c index 363ed84..d417f6f 100644 --- a/vp9/encoder/vp9_ssim.c +++ b/vp9/encoder/vp9_ssim.c @@ -88,8 +88,9 @@ double vp9_ssim2(uint8_t *img1, uint8_t *img2, int stride_img1, double ssim_total = 0; // sample point start with each 4x4 location - for (i = 0; i < height - 8; i += 4, img1 += stride_img1 * 4, img2 += stride_img2 * 4) { - for (j = 0; j < width - 8; j += 4) { + for (i = 0; i <= height - 8; + i += 4, img1 += stride_img1 * 4, img2 += stride_img2 * 4) { + for (j = 0; j <= width - 8; j += 4) { double v = ssim_8x8(img1 + j, stride_img1, img2 + j, stride_img2); ssim_total += v; samples++;