Commit c62d3011 authored by fbarchard@google.com's avatar fbarchard@google.com

adjust bias on Y channel so error histogram is better centered on green channel

BUG=324
TESTED=FullYUVTest
R=tpsiaki@google.com

Review URL: https://webrtc-codereview.appspot.com/38689004

git-svn-id: http://libyuv.googlecode.com/svn/trunk@1245 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 48da8c29
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 1244
Version: 1245
License: BSD
License File: LICENSE
......
......@@ -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
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment