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

Unified Diff: media/base/yuv_convert.cc

Issue 7003082: Implements RGB to YV12 conversion in YASM. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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
Index: media/base/yuv_convert.cc
===================================================================
--- media/base/yuv_convert.cc (revision 99884)
+++ media/base/yuv_convert.cc (working copy)
@@ -19,6 +19,7 @@
#include "build/build_config.h"
#include "media/base/cpu_features.h"
+#include "media/base/simd/convert_rgb_to_yuv.h"
#include "media/base/yuv_convert_internal.h"
#include "media/base/yuv_row.h"
@@ -369,8 +370,10 @@
// TODO(hclam): Implement a NEON version.
convert_proc = &ConvertRGB32ToYUV_C;
#else
- // For x86 processors, check if SSE2 is supported.
- if (hasSSE2())
+ // For x86 processors, check if SSSE3 (or SSE2) is supported.
+ if (hasSSSE3())
+ convert_proc = &ConvertRGB32ToYUV_SSSE3;
+ else if (hasSSE2())
convert_proc = &ConvertRGB32ToYUV_SSE2;
else
convert_proc = &ConvertRGB32ToYUV_C;
@@ -390,8 +393,21 @@
int rgbstride,
int ystride,
int uvstride) {
+#if defined(ARCH_CPU_ARM_FAMILY)
ConvertRGB24ToYUV_C(rgbframe, yplane, uplane, vplane, width, height,
rgbstride, ystride, uvstride);
+#else
+ static void (*convert_proc)(const uint8*, uint8*, uint8*, uint8*,
+ int, int, int, int, int) = NULL;
+ if (!convert_proc) {
+ if (hasSSSE3())
+ convert_proc = &ConvertRGB24ToYUV_SSSE3;
+ else
+ convert_proc = &ConvertRGB24ToYUV_C;
+ }
+ convert_proc(rgbframe, yplane, uplane, vplane, width, height,
+ rgbstride, ystride, uvstride);
+#endif
}
void ConvertYUY2ToYUV(const uint8* src,
« media/base/simd/x86inc.asm ('K') | « media/base/simd/x86inc.asm ('k') | media/media.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698