summaryrefslogtreecommitdiffstats
path: root/media/audio/audio_util.cc
diff options
context:
space:
mode:
authordalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 09:03:22 +0000
committerdalecurtis@chromium.org <dalecurtis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-30 09:03:22 +0000
commit61e4a97449c59ce762603139ee541528b37d5c64 (patch)
tree410c6109cc1027e547f112540d20cd3cdf94a169 /media/audio/audio_util.cc
parentd91312244a7a40d2a3e2dc5c6f39e72cc0c2b8a4 (diff)
downloadchromium_src-61e4a97449c59ce762603139ee541528b37d5c64.zip
chromium_src-61e4a97449c59ce762603139ee541528b37d5c64.tar.gz
chromium_src-61e4a97449c59ce762603139ee541528b37d5c64.tar.bz2
Convert WebAudio file handlers to use AudioBus.
Lets us remove AudioUtil::DeinterleaveAudioChannel(). Modifies AudioBus to add a new FromInterleavedPartial() function which allows for streaming deinterleave. Also adds supporting method: ZeroFramesPartial(). BUG=114700, 120319 TEST=unittests + WebAudio test page. Review URL: https://chromiumcodereview.appspot.com/10871051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154099 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_util.cc')
-rw-r--r--media/audio/audio_util.cc48
1 files changed, 0 insertions, 48 deletions
diff --git a/media/audio/audio_util.cc b/media/audio/audio_util.cc
index 19aef12..9f4cdbd 100644
--- a/media/audio/audio_util.cc
+++ b/media/audio/audio_util.cc
@@ -177,54 +177,6 @@ bool FoldChannels(void* buf,
return false;
}
-// TODO(dalecurtis): Delete once everywhere is using the AudioBus version:
-// http://crbug.com/120319.
-bool DeinterleaveAudioChannel(void* source,
- float* destination,
- int channels,
- int channel_index,
- int bytes_per_sample,
- size_t number_of_frames) {
- switch (bytes_per_sample) {
- case 1:
- {
- uint8* source8 = reinterpret_cast<uint8*>(source) + channel_index;
- const float kScale = 1.0f / 128.0f;
- for (unsigned i = 0; i < number_of_frames; ++i) {
- destination[i] = kScale * (static_cast<int>(*source8) - 128);
- source8 += channels;
- }
- return true;
- }
-
- case 2:
- {
- int16* source16 = reinterpret_cast<int16*>(source) + channel_index;
- const float kScale = 1.0f / 32768.0f;
- for (unsigned i = 0; i < number_of_frames; ++i) {
- destination[i] = kScale * *source16;
- source16 += channels;
- }
- return true;
- }
-
- case 4:
- {
- int32* source32 = reinterpret_cast<int32*>(source) + channel_index;
- const float kScale = 1.0f / 2147483648.0f;
- for (unsigned i = 0; i < number_of_frames; ++i) {
- destination[i] = kScale * *source32;
- source32 += channels;
- }
- return true;
- }
-
- default:
- break;
- }
- return false;
-}
-
// TODO(enal): use template specialization and size-specific intrinsics.
// Call is on the time-critical path, and by using SSE/AVX
// instructions we can speed things up by ~4-8x, more for the case