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

Unified Diff: media/base/simd/yuv_to_rgb_table.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 | « media/base/simd/convert_yuv_to_rgb_c.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/simd/yuv_to_rgb_table.cc
diff --git a/media/base/simd/yuv_to_rgb_table.cc b/media/base/simd/yuv_to_rgb_table.cc
index 00735655f5f9e143328ca1c68a0d3d6d33b0833b..253280da951bdb4a2fa26ee87d79ae359575f1d6 100644
--- a/media/base/simd/yuv_to_rgb_table.cc
+++ b/media/base/simd/yuv_to_rgb_table.cc
@@ -17,20 +17,42 @@ extern "C" {
// Defines the R,G,B,A contributions from U.
// The contribution to A is the same for any value of U
// causing the final A value to be 255 in every conversion.
+// Android's pixel layout is RGBA, while other platforms
+// are BGRA.
+#if defined(OS_ANDROID)
+#define RGBU(i) { \
+ 0, \
+ static_cast<int16>(-0.391 * 64 * (i - 128) + 0.5), \
+ static_cast<int16>(2.018 * 64 * (i - 128) + 0.5), \
+ static_cast<int16>(256 * 64 - 1) \
+}
+#else
#define RGBU(i) { \
static_cast<int16>(2.018 * 64 * (i - 128) + 0.5), \
static_cast<int16>(-0.391 * 64 * (i - 128) + 0.5), \
0, \
static_cast<int16>(256 * 64 - 1) \
}
+#endif
// Defines the R,G,B,A contributions from V.
+// Android's pixel layout is RGBA, while other platforms
+// are BGRA.
+#if defined(OS_ANDROID)
+#define RGBV(i) { \
+ static_cast<int16>(1.596 * 64 * (i - 128) + 0.5), \
+ static_cast<int16>(-0.813 * 64 * (i - 128) + 0.5), \
+ 0, \
+ 0 \
+}
+#else
#define RGBV(i) { \
0, \
static_cast<int16>(-0.813 * 64 * (i - 128) + 0.5), \
static_cast<int16>(1.596 * 64 * (i - 128) + 0.5), \
0 \
}
+#endif
// Used to define a set of multiplier words for each alpha level.
#define ALPHA(i) { \
« no previous file with comments | « media/base/simd/convert_yuv_to_rgb_c.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698