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

Unified Diff: media/audio/audio_util.h

Issue 155894: Surround Sound handling by folding 5 channels down to stereo. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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
« no previous file with comments | « no previous file | media/audio/audio_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_util.h
===================================================================
--- media/audio/audio_util.h (revision 21354)
+++ media/audio/audio_util.h (working copy)
@@ -9,6 +9,11 @@
namespace media {
+// For all audio functions 3 audio formats are supported:
+// 8 bits unsigned 0 to 255.
+// 16 bit signed (little endian).
+// 32 bit signed (little endian)
+
// AdjustVolume() does a software volume adjustment of a sample buffer.
// The samples are multiplied by the volume, which should range from
// 0.0 (mute) to 1.0 (full volume).
@@ -25,6 +30,25 @@
int bytes_per_sample,
float volume);
+// FoldChannels() does a software multichannel folding down to stereo.
+// Channel order is assumed to be 5.1 Dolby standard which is
+// front left, front right, center, surround left, surround right.
+// The subwoofer is ignored.
+// 6.1 adds a rear center speaker, and 7.1 has 2 rear speakers. These
+// channels are rare and ignored.
+// After summing the channels, volume is adjusted and the samples are
+// clipped to the maximum value.
+// Volume should normally range from 0.0 (mute) to 1.0 (full volume), but
+// since clamping is performed a value of more than 1 is allowed to increase
+// volume.
+// The buffer is modified in-place to avoid memory management, as this
+// function may be called in performance critical code.
+bool FoldChannels(void* buf,
+ size_t buflen,
+ int channels,
+ int bytes_per_sample,
+ float volume);
+
} // namespace media
#endif // MEDIA_AUDIO_AUDIO_UTIL_H_
« no previous file with comments | « no previous file | media/audio/audio_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698