Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: media/audio/audio_util.cc

Issue 10871051: Convert WebAudio file handlers to use AudioBus. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update webkit glue gyp. Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/audio/audio_util.cc
diff --git a/media/audio/audio_util.cc b/media/audio/audio_util.cc
index 19aef1242fe532658d7b6d06514d0a77685878a2..9f4cdbd0c3739d94e49285125a384a537a12a4b7 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
« no previous file with comments | « media/audio/audio_util.h ('k') | media/base/audio_bus.h » ('j') | media/base/audio_bus.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698