diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 05:06:25 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-29 05:06:25 +0000 |
commit | 35aa77a9f31f12e9eae539aa902704622f58dd70 (patch) | |
tree | e6f6b37899d2c4f53ba75e4fafbe5b7186a4f3a4 /media | |
parent | 4d0f93ca8cec419891f009d476f1525ccab56e54 (diff) | |
download | chromium_src-35aa77a9f31f12e9eae539aa902704622f58dd70.zip chromium_src-35aa77a9f31f12e9eae539aa902704622f58dd70.tar.gz chromium_src-35aa77a9f31f12e9eae539aa902704622f58dd70.tar.bz2 |
Re-enable SSSE3-optimized functions.
This change fixes a stupid problem in getcpuid() (I forgot declaring cpuid breaks rbx) and re-enables my SSSE3-optimized RGB->YUV conversion.
BUG=none
TEST=YUVConvertTest.*
Review URL: http://codereview.chromium.org/7979016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103237 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/base/cpu_features_x86.cc | 3 | ||||
-rw-r--r-- | media/base/yuv_convert.cc | 17 |
2 files changed, 18 insertions, 2 deletions
diff --git a/media/base/cpu_features_x86.cc b/media/base/cpu_features_x86.cc index 4fb9304..2839ff8 100644 --- a/media/base/cpu_features_x86.cc +++ b/media/base/cpu_features_x86.cc @@ -37,12 +37,13 @@ static inline void getcpuid(int info_type, int info[4]) { : "a"(info_type) ); #else - // We can use cpuid instruction without saving ebx on gcc x86-64 because it + // We can use cpuid instruction without pushing ebx on gcc x86-64 because it // does not use ebx (or rbx) as a GOT register. asm volatile ( "cpuid \n\t" : "=a"(info[0]), "=r"(info[1]), "=c"(info[2]), "=d"(info[3]) : "a"(info_type) + : "%rbx" ); #endif } diff --git a/media/base/yuv_convert.cc b/media/base/yuv_convert.cc index 2fdb798..3655fdd 100644 --- a/media/base/yuv_convert.cc +++ b/media/base/yuv_convert.cc @@ -294,7 +294,9 @@ void ConvertRGB32ToYUV(const uint8* rgbframe, // TODO(hclam): Implement a NEON version. convert_proc = &ConvertRGB32ToYUV_C; #else - if (hasSSE2()) + if (hasSSSE3()) + convert_proc = &ConvertRGB32ToYUV_SSSE3; + else if (hasSSE2()) convert_proc = &ConvertRGB32ToYUV_SSE2; else convert_proc = &ConvertRGB32ToYUV_C; @@ -314,8 +316,21 @@ void ConvertRGB24ToYUV(const uint8* rgbframe, 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, |