From fb01743a53eba9e8550e82336be8e06051c29090 Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Fri, 30 Sep 2016 16:04:17 +0200 Subject: [PATCH] get_disto: fix the r/g/b order for luma calculation Change-Id: I62be556f6254031e8c1f1a572cfdc4ea2641483b --- extras/get_disto.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/get_disto.c b/extras/get_disto.c index 085ca4e0..75ecd62c 100644 --- a/extras/get_disto.c +++ b/extras/get_disto.c @@ -186,9 +186,9 @@ static void ConvertToGray(WebPPicture* const pic) { uint32_t* const row = &pic->argb[y * pic->argb_stride]; for (x = 0; x < pic->width; ++x) { const uint32_t argb = row[x]; - const uint32_t r = (argb >> 0) & 0xff; + const uint32_t r = (argb >> 16) & 0xff; const uint32_t g = (argb >> 8) & 0xff; - const uint32_t b = (argb >> 16) & 0xff; + const uint32_t b = (argb >> 0) & 0xff; // We use BT.709 for converting to luminance. const uint32_t Y = (uint32_t)(0.2126 * r + 0.7152 * g + 0.0722 * b + .5); row[x] = (argb & 0xff000000u) | (Y * 0x010101u);