summaryrefslogtreecommitdiffstats
path: root/media/base/yuv_convert_internal.h
diff options
context:
space:
mode:
authordhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-14 01:08:22 +0000
committerdhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-14 01:08:22 +0000
commit3227bd548c98f90ecabfcd4e3ccc3785ee9409d8 (patch)
tree4a06e64c741c94e8665bc1c25ffd142a75fd39f4 /media/base/yuv_convert_internal.h
parent7758c234c30291995c01b79887b52a471362fcc3 (diff)
downloadchromium_src-3227bd548c98f90ecabfcd4e3ccc3785ee9409d8.zip
chromium_src-3227bd548c98f90ecabfcd4e3ccc3785ee9409d8.tar.gz
chromium_src-3227bd548c98f90ecabfcd4e3ccc3785ee9409d8.tar.bz2
Revert 100915 - Rewrite color space conversions suite using YASM
Failed on official Linux 32 builder. (x486?) http://build.chromium.org/p/chromium.chrome/builders/Google%20Chrome%20Linux/builds/11240/steps/compile/logs/stdio In file included from media/base/yuv_convert.cc:33: /usr/lib/gcc/i486-linux-gnu/4.4.3/include/emmintrin.h:32:3:error: #error "SSE2 instruction set not enabled" make: *** [out/Release/obj.target/yuv_convert/media/base/yuv_convert.o] Error 1 Besides rewrite assembly code in YASM, this change also do runtime selection of routine depending processor support. There are couple advantages in this YASM version. 1. Performance improvement Using YASM we can push less to the stack, this results in ~5% improvement on 32-bits system. 2. MMX and SSE versions are separate SSE version use movntq while MMX version use movq. 3. 64-bits version works universally This means that 64-bits YASM code compile and run on 64-bits windows, mac and linux. While previously it only runs on linux 64. 4. Handling PIC much better PIC code runs and build on 32-bits and 64-bits system. This is better than before which only works on 32-bits mac. 5. Easier maintenance This code uses x86asm.inc for a bunch of nice macros. Having just one YASM verion is better than having inline VC assembly and don't have to worry inline assemly has different register names on mac and linux. I tested on linux 32-bits, linux 32-bits PIC and linux 64-bits that this code is at least as fast as before. BUG=None TEST=media_unittests runs and all passing Review URL: http://codereview.chromium.org/7858003 TBR=hclam@chromium.org Review URL: http://codereview.chromium.org/7887025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101008 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/yuv_convert_internal.h')
-rw-r--r--media/base/yuv_convert_internal.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/media/base/yuv_convert_internal.h b/media/base/yuv_convert_internal.h
index 7be14c4..80776aa 100644
--- a/media/base/yuv_convert_internal.h
+++ b/media/base/yuv_convert_internal.h
@@ -13,15 +13,15 @@
namespace media {
// SSE2 version of converting RGBA to YV12.
-void ConvertRGB32ToYUV_SSE2(const uint8* rgbframe,
- uint8* yplane,
- uint8* uplane,
- uint8* vplane,
- int width,
- int height,
- int rgbstride,
- int ystride,
- int uvstride);
+extern void ConvertRGB32ToYUV_SSE2(const uint8* rgbframe,
+ uint8* yplane,
+ uint8* uplane,
+ uint8* vplane,
+ int width,
+ int height,
+ int rgbstride,
+ int ystride,
+ int uvstride);
// This is a C reference implementation of the above routine.
// This method should only be used in unit test.