summaryrefslogtreecommitdiffstats
path: root/media/media.gyp
diff options
context:
space:
mode:
authorhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 15:07:17 +0000
committerhclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-13 15:07:17 +0000
commitc856b5eb097095c4ee2148659bfbd9b0a4671134 (patch)
tree3d668e24020280acefbd11e21882bc8f3d6b91b4 /media/media.gyp
parent8d2de578eec94c5a66841b9e65d11567d9514a16 (diff)
downloadchromium_src-c856b5eb097095c4ee2148659bfbd9b0a4671134.zip
chromium_src-c856b5eb097095c4ee2148659bfbd9b0a4671134.tar.gz
chromium_src-c856b5eb097095c4ee2148659bfbd9b0a4671134.tar.bz2
Rewrite color space conversions suite using YASM
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 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/media.gyp')
-rw-r--r--media/media.gyp55
1 files changed, 49 insertions, 6 deletions
diff --git a/media/media.gyp b/media/media.gyp
index 5282afb..6ecd6af 100644
--- a/media/media.gyp
+++ b/media/media.gyp
@@ -341,7 +341,12 @@
'conditions': [
[ 'target_arch == "ia32" or target_arch == "x64"', {
'dependencies': [
- 'yuv_convert_sse2',
+ 'yuv_convert_simd_x86',
+ ],
+ }],
+ [ 'target_arch == "arm"', {
+ 'dependencies': [
+ 'yuv_convert_simd_arm',
],
}],
],
@@ -357,15 +362,45 @@
],
},
{
- 'target_name': 'yuv_convert_sse2',
+ 'target_name': 'yuv_convert_simd_x86',
'type': 'static_library',
'include_dirs': [
'..',
],
+ 'sources': [
+ 'base/yuv_convert_sse2.cc',
+ 'base/simd/convert_rgb_to_yuv_x86.cc',
+ 'base/simd/convert_rgb_to_yuv_ssse3.asm',
+ 'base/simd/convert_rgb_to_yuv_ssse3.inc',
+ 'base/simd/convert_yuv_to_rgb_c.cc',
+ 'base/simd/convert_yuv_to_rgb_x86.cc',
+ 'base/simd/convert_yuv_to_rgb_mmx.asm',
+ 'base/simd/convert_yuv_to_rgb_mmx.inc',
+ 'base/simd/convert_yuv_to_rgb_sse.asm',
+ 'base/simd/filter_yuv.h',
+ 'base/simd/filter_yuv_c.cc',
+ 'base/simd/filter_yuv_mmx.cc',
+ 'base/simd/filter_yuv_sse2.cc',
+ 'base/simd/linear_scale_yuv_to_rgb_mmx.asm',
+ 'base/simd/linear_scale_yuv_to_rgb_mmx.inc',
+ 'base/simd/linear_scale_yuv_to_rgb_sse.asm',
+ 'base/simd/scale_yuv_to_rgb_mmx.asm',
+ 'base/simd/scale_yuv_to_rgb_mmx.inc',
+ 'base/simd/scale_yuv_to_rgb_sse.asm',
+ ],
'conditions': [
+ [ 'target_arch == "x64"', {
+ # Source files optimized for X64 systems.
+ 'sources': [
+ 'base/simd/linear_scale_yuv_to_rgb_mmx_x64.asm',
+ 'base/simd/scale_yuv_to_rgb_sse2_x64.asm',
+ ],
+ }],
[ 'os_posix == 1 and OS != "mac"', {
'cflags': [
'-msse2',
+ '-msse3',
+ '-mssse3',
],
}],
[ 'OS == "mac"', {
@@ -428,10 +463,6 @@
},
}],
],
- 'sources': [
- 'base/yuv_convert_sse2.cc',
- 'base/simd/convert_rgb_to_yuv.cc',
- ],
'variables': {
'yasm_output_path': '<(SHARED_INTERMEDIATE_DIR)/media',
},
@@ -440,6 +471,18 @@
],
},
{
+ 'target_name': 'yuv_convert_simd_arm',
+ 'type': 'static_library',
+ 'include_dirs': [
+ '..',
+ ],
+ 'sources': [
+ 'base/simd/convert_yuv_to_rgb_c.cc',
+ 'base/simd/filter_yuv.h',
+ 'base/simd/filter_yuv_c.cc',
+ ],
+ },
+ {
'target_name': 'ffmpeg_unittests',
'type': 'executable',
'dependencies': [