| Index: media/base/simd/convert_rgb_to_yuv_sse2.cc
|
| diff --git a/media/base/simd/convert_rgb_to_yuv_sse2.cc b/media/base/simd/convert_rgb_to_yuv_sse2.cc
|
| index bb803f6189cc637030baa65135fa4918acb44a35..47ec4c9b01a60f987252a872429b0a697ad83e4e 100644
|
| --- a/media/base/simd/convert_rgb_to_yuv_sse2.cc
|
| +++ b/media/base/simd/convert_rgb_to_yuv_sse2.cc
|
| @@ -18,15 +18,20 @@ namespace media {
|
| #define FIX_SHIFT 12
|
| #define FIX(x) ((x) * (1 << FIX_SHIFT))
|
|
|
| +// Define a convenient macro to do static cast.
|
| +#define INT16_FIX(x) static_cast<int16>(FIX(x))
|
| +
|
| SIMD_ALIGNED(const int16 ConvertRGBAToYUV_kTable[8 * 3]) = {
|
| - FIX(0.098), FIX(0.504), FIX(0.257), 0,
|
| - FIX(0.098), FIX(0.504), FIX(0.257), 0,
|
| - FIX(0.439), -FIX(0.291), -FIX(0.148), 0,
|
| - FIX(0.439), -FIX(0.291), -FIX(0.148), 0,
|
| - -FIX(0.071), -FIX(0.368), FIX(0.439), 0,
|
| - -FIX(0.071), -FIX(0.368), FIX(0.439), 0,
|
| + INT16_FIX(0.098), INT16_FIX(0.504), INT16_FIX(0.257), 0,
|
| + INT16_FIX(0.098), INT16_FIX(0.504), INT16_FIX(0.257), 0,
|
| + INT16_FIX(0.439), -INT16_FIX(0.291), -INT16_FIX(0.148), 0,
|
| + INT16_FIX(0.439), -INT16_FIX(0.291), -INT16_FIX(0.148), 0,
|
| + -INT16_FIX(0.071), -INT16_FIX(0.368), INT16_FIX(0.439), 0,
|
| + -INT16_FIX(0.071), -INT16_FIX(0.368), INT16_FIX(0.439), 0,
|
| };
|
|
|
| +#undef INT16_FIX
|
| +
|
| // This is the final offset for the conversion from signed yuv values to
|
| // unsigned values. It is arranged so that offset of 16 is applied to Y
|
| // components and 128 is added to UV components for 2 pixels.
|
|
|