diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 21:18:09 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 21:18:09 +0000 |
commit | 59ac148b23ebd8aa24eb4319c8a15133b90719ed (patch) | |
tree | b2e5b26fdc800a4eca5dc9823c75cfb7d8cc5fe3 /media | |
parent | f639faaed508d238110187c1717abe66a035959f (diff) | |
download | chromium_src-59ac148b23ebd8aa24eb4319c8a15133b90719ed.zip chromium_src-59ac148b23ebd8aa24eb4319c8a15133b90719ed.tar.gz chromium_src-59ac148b23ebd8aa24eb4319c8a15133b90719ed.tar.bz2 |
Fix gcc 4.7 building problems.
This is being submitted on behalf of shanhan@google.com, original CL at https://chromiumcodereview.appspot.com/10537037/ .
BUG=None
TEST=Built successfully using GCC-4.7 under linux
Review URL: https://chromiumcodereview.appspot.com/10543080
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141286 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/base/simd/convert_rgb_to_yuv_sse2.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/media/base/simd/convert_rgb_to_yuv_sse2.cc b/media/base/simd/convert_rgb_to_yuv_sse2.cc index bb803f6..f99a2fe 100644 --- a/media/base/simd/convert_rgb_to_yuv_sse2.cc +++ b/media/base/simd/convert_rgb_to_yuv_sse2.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -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. |