From 704818980f5f3383c31e4090f5e55136dcb6fb60 Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 19 Oct 2012 19:23:39 -0700 Subject: [PATCH] AccumulateLSIM: fix double -> float warnings Change-Id: I234a5cd09b9351dbbbbc5076be35bb794d1bf890 --- src/enc/picture.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/enc/picture.c b/src/enc/picture.c index 4d46f560..544bdcfc 100644 --- a/src/enc/picture.c +++ b/src/enc/picture.c @@ -915,9 +915,9 @@ void WebPCleanupTransparentArea(WebPPicture* pic) { // search radius. Shouldn't be too large. #define RADIUS 2 -static double AccumulateLSIM(const uint8_t* src, int src_stride, - const uint8_t* ref, int ref_stride, - int w, int h) { +static float AccumulateLSIM(const uint8_t* src, int src_stride, + const uint8_t* ref, int ref_stride, + int w, int h) { int x, y; double total_sse = 0.; for (y = 0; y < h; ++y) { @@ -939,7 +939,7 @@ static double AccumulateLSIM(const uint8_t* src, int src_stride, total_sse += best_sse; } } - return total_sse; + return (float)total_sse; } #undef RADIUS @@ -993,7 +993,7 @@ int WebPPictureDistortion(const WebPPicture* src, const WebPPicture* ref, sse[3] = has_alpha ? AccumulateLSIM(src->a, src->a_stride, ref->a, ref->a_stride, src->width, src->height) - : 0; + : 0.f; result[0] = GetPSNR(sse[0] / (src->width * src->height)); result[1] = GetPSNR(sse[1] / (uv_w * uv_h)); result[2] = GetPSNR(sse[2] / (uv_w * uv_h));