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

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

Issue 17043007: Fix the WebRTC color bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test error on Android. Created 7 years, 6 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') | media/base/yuv_convert_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/simd/convert_rgb_to_yuv_c.cc
diff --git a/media/base/simd/convert_rgb_to_yuv_c.cc b/media/base/simd/convert_rgb_to_yuv_c.cc
index ae4c7313cd701cafcdf97286c2242e52e40d070d..71c8375005e431e993799d93890cee65a7c0a71f 100644
--- a/media/base/simd/convert_rgb_to_yuv_c.cc
+++ b/media/base/simd/convert_rgb_to_yuv_c.cc
@@ -28,6 +28,16 @@ void ConvertRGB32ToYUV_C(const uint8* rgbframe,
for (int j = 0; j < width; ++j) {
// Since the input pixel format is RGB32, there are 4 bytes per pixel.
const uint8* pixel = rgbframe + 4 * j;
+#if defined(OS_ANDROID)
+ yplane[j] = clip_byte(((pixel[0] * 66 + pixel[1] * 129 +
scherkus (not reviewing) 2013/06/19 19:49:50 this is mostly duplicated -- can you instead do so
hkuang1 2013/06/19 23:21:11 Done.
+ pixel[2] * 25 + 128) >> 8) + 16);
+ if (i % 2 == 0 && j % 2 == 0) {
+ uplane[j / 2] = clip_byte(((pixel[0] * -38 + pixel[1] * -74 +
+ pixel[2] * 112 + 128) >> 8) + 128);
+ vplane[j / 2] = clip_byte(((pixel[0] * 112 + pixel[1] * -94 +
+ pixel[2] * -18 + 128) >> 8) + 128);
+ }
+#else
yplane[j] = clip_byte(((pixel[2] * 66 + pixel[1] * 129 +
pixel[0] * 25 + 128) >> 8) + 16);
if (i % 2 == 0 && j % 2 == 0) {
@@ -36,8 +46,8 @@ void ConvertRGB32ToYUV_C(const uint8* rgbframe,
vplane[j / 2] = clip_byte(((pixel[2] * 112 + pixel[1] * -94 +
pixel[0] * -18 + 128) >> 8) + 128);
}
+#endif
}
-
rgbframe += rgbstride;
yplane += ystride;
if (i % 2 == 0) {
« no previous file with comments | « no previous file | media/base/simd/convert_yuv_to_rgb_c.cc » ('j') | media/base/yuv_convert_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698