| Index: media/base/simd/convert_rgb_to_yuv_sse2.cc
|
| ===================================================================
|
| --- media/base/simd/convert_rgb_to_yuv_sse2.cc (revision 141258)
|
| +++ media/base/simd/convert_rgb_to_yuv_sse2.cc (working copy)
|
| @@ -18,15 +18,20 @@
|
| #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.
|
|
|