Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: media/base/simd/convert_rgb_to_yuv_sse2.cc

Issue 23809010: Fix YUVConvert unittest failure on Android_X86. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/base/simd/convert_yuv_to_rgb_c.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 f99a2fef8401128376c6ae8de7dfc9d595d22797..124671c0c0317e26fec30794756d3f46425e6d43 100644
--- a/media/base/simd/convert_rgb_to_yuv_sse2.cc
+++ b/media/base/simd/convert_rgb_to_yuv_sse2.cc
@@ -21,6 +21,18 @@ namespace media {
// Define a convenient macro to do static cast.
#define INT16_FIX(x) static_cast<int16>(FIX(x))
+// Android's pixel layout is RGBA, while other platforms
+// are BGRA.
+#if defined(OS_ANDROID)
+SIMD_ALIGNED(const int16 ConvertRGBAToYUV_kTable[8 * 3]) = {
+ INT16_FIX(0.257), INT16_FIX(0.504), INT16_FIX(0.098), 0,
+ INT16_FIX(0.257), INT16_FIX(0.504), INT16_FIX(0.098), 0,
+ -INT16_FIX(0.148), -INT16_FIX(0.291), INT16_FIX(0.439), 0,
+ -INT16_FIX(0.148), -INT16_FIX(0.291), INT16_FIX(0.439), 0,
+ INT16_FIX(0.439), -INT16_FIX(0.368), -INT16_FIX(0.071), 0,
+ INT16_FIX(0.439), -INT16_FIX(0.368), -INT16_FIX(0.071), 0,
+};
+#else
SIMD_ALIGNED(const int16 ConvertRGBAToYUV_kTable[8 * 3]) = {
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,
@@ -29,6 +41,7 @@ SIMD_ALIGNED(const int16 ConvertRGBAToYUV_kTable[8 * 3]) = {
-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,
};
+#endif
#undef INT16_FIX
« no previous file with comments | « no previous file | media/base/simd/convert_yuv_to_rgb_c.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698