From 3842299be83217198bbcad888065bed7d42df419 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Wed, 21 Jan 2015 00:11:44 +0000 Subject: [PATCH] YUV use same constant as asm then multiply by 0x0101 to replicate the value. BUG=324 TESTED=try bots R=harryjin@google.com Review URL: https://webrtc-codereview.appspot.com/41559004 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1235 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- source/row_common.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/row_common.cc b/source/row_common.cc index 6c7ce5e66..ba9c33803 100644 --- a/source/row_common.cc +++ b/source/row_common.cc @@ -962,7 +962,7 @@ void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int width) { // C reference code that mimics the YUV assembly. -#define YG 4901247 /* round(1.164 * 64 * 256) = 19071 * 0x0101 */ +#define YG 19071 /* round(1.164 * 64 * 256) */ #define YGB 1192 /* round(1.164 * 64 * 16) */ #define UB 127 /* min(127, round(2.018 * 64)) */ @@ -980,7 +980,7 @@ void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int width) { static __inline void YuvPixel(uint8 y, uint8 u, uint8 v, uint8* b, uint8* g, uint8* r) { - uint32 y1 = (uint32)(y * YG) >> 16; + uint32 y1 = (uint32)(y * 0x0101 * YG) >> 16; *b = Clamp((int32)(u * UB + v * VB + y1 - BB) >> 6); *g = Clamp((int32)(u * UG + v * VG + y1 - BG) >> 6); *r = Clamp((int32)(u * UR + v * VR + y1 - BR) >> 6);