diff --git a/README.chromium b/README.chromium index 6171411dc..0050db4a8 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1244 +Version: 1245 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 341c431e9..34ddb4a27 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 1244 +#define LIBYUV_VERSION 1245 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/row_common.cc b/source/row_common.cc index 9d86f12d0..d68ce1894 100644 --- a/source/row_common.cc +++ b/source/row_common.cc @@ -962,8 +962,9 @@ void I400ToARGBRow_C(const uint8* src_y, uint8* dst_argb, int width) { // C reference code that mimics the YUV assembly. #define YG 19071 /* round(1.164 * 64 * 256) */ -#define YGB 1192 /* round(1.164 * 64 * 16) */ +#define YGB 1197 /* 1.164 * 64 * 16 - adjusted for even error distribution */ +// TODO(fbarchard): Adjusted U and V bias for even error distribution. #define UB -128 /* -min(128, round(2.018 * 64)) */ #define UG 25 /* -round(-0.391 * 64) */ #define UR 0 @@ -980,9 +981,9 @@ 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 * 0x0101 * YG) >> 16; - *b = Clamp((int32)(y1 - (v * VB + u * UB) + BB) >> 6); - *g = Clamp((int32)(y1 - (v * VG + u * UG) + BG) >> 6); - *r = Clamp((int32)(y1 - (v * VR + u * UR) + BR) >> 6); + *b = Clamp((int32)(BB - (v * VB + u * UB) + y1) >> 6); + *g = Clamp((int32)(BG - (v * VG + u * UG) + y1) >> 6); + *r = Clamp((int32)(BR - (v * VR + u * UR) + y1) >> 6); } #undef YG diff --git a/source/row_win.cc b/source/row_win.cc index 091bd0dad..0e49f1901 100644 --- a/source/row_win.cc +++ b/source/row_win.cc @@ -24,10 +24,11 @@ extern "C" { #if !defined(LIBYUV_DISABLE_X86) && defined(_MSC_VER) && \ (defined(_M_IX86) || defined(_M_X64)) -// C reference code that mimics the YUV assembly. +// YUV conversion constants. #define YG 19071 /* round(1.164 * 64 * 256) */ -#define YGB 1192 /* round(1.164 * 64 * 16) */ +#define YGB 1197 /* 1.164 * 64 * 16 - adjusted for even error distribution */ +// TODO(fbarchard): Adjusted U and V bias for even error distribution. #define UB -128 /* -min(128, round(2.018 * 64)) */ #define UG 25 /* -round(-0.391 * 64) */ #define UR 0