diff options
author | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-08 21:30:37 +0000 |
---|---|---|
committer | dalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-08 21:30:37 +0000 |
commit | 7ed91e9093602872c62eba397fc1be8741089157 (patch) | |
tree | 6c4c2c6878ed51ca2e90586f11ea3887835c5e8c /media/base/vector_math.h | |
parent | 13bfbc41308953ebea4952ff504037a261cfdd3c (diff) | |
download | chromium_src-7ed91e9093602872c62eba397fc1be8741089157.zip chromium_src-7ed91e9093602872c62eba397fc1be8741089157.tar.gz chromium_src-7ed91e9093602872c62eba397fc1be8741089157.tar.bz2 |
Add vector_math::FMUL. Replace audio_util::AdjustVolume.
Removes the integer based volume adjustment code from the
melting pot that is audio_util in favor of an
AudioBus::AdjustVolume() method which works on float.
The driver behind the method is a new vector_math::FMUL
method which is SSE optimized. Benchmarks put it in line
with the vector_math::FMAC() method.
Benchmarking 200000 iterations:
FMUL_C took 1962.52ms.
FMUL_SSE (unaligned size) took 493.03ms; which is 3.98x faster than FMUL_C.
FMUL_SSE (aligned size) took 491.79ms; which is 3.99x faster than FMUL_C and 1.00x faster than FMUL_SSE (unaligned size).
BUG=120319, 171540, 226447
TEST=new media_unittests.
Review URL: https://chromiumcodereview.appspot.com/13726011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192905 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/vector_math.h')
-rw-r--r-- | media/base/vector_math.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/media/base/vector_math.h b/media/base/vector_math.h index 10c3039..2618687 100644 --- a/media/base/vector_math.h +++ b/media/base/vector_math.h @@ -17,6 +17,10 @@ enum { kRequiredAlignment = 16 }; // |src| and |dest| must be aligned by kRequiredAlignment. MEDIA_EXPORT void FMAC(const float src[], float scale, int len, float dest[]); +// Multiply each element of |src| by |scale| and store in |dest|. |src| and +// |dest| must be aligned by kRequiredAlignment. +MEDIA_EXPORT void FMUL(const float src[], float scale, int len, float dest[]); + } // namespace vector_math } // namespace media |