summaryrefslogtreecommitdiffstats
path: root/media/libeffects/downmix/EffectDownmix.h
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2012-05-15 15:51:16 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2012-05-16 12:28:45 -0700
commit6895deeecc8797e6f5b28e7d07ec6bc499355c0c (patch)
tree9dc5dcdccac3993d0604b69ec08ad2ce75015664 /media/libeffects/downmix/EffectDownmix.h
parent5d3d12bf58da5b48b1edb7c20b5d1edec0773f75 (diff)
downloadframeworks_av-6895deeecc8797e6f5b28e7d07ec6bc499355c0c.zip
frameworks_av-6895deeecc8797e6f5b28e7d07ec6bc499355c0c.tar.gz
frameworks_av-6895deeecc8797e6f5b28e7d07ec6bc499355c0c.tar.bz2
Stereo downmixer supports generic configurations. Fix 7.1 downmix
Added a generic downmixer to stereo function to handle the multichannel configurations not supported by the dedicated downmix functions. It first verifies the mask is supported, and then derives channel indices for the downmix. Added support for forcing the generic downmixer to be always used instead of the format-specific functions (define DOWNMIX_ALWAYS_USE_GENERIC_DOWNMIXER to force it). Fixed 7.1 downmix function where handling of accumulate vs overwrite was inversed. Bug 4280902 Change-Id: I8259b32c4e90f76ef4dcd803592fc71df4ae90c5
Diffstat (limited to 'media/libeffects/downmix/EffectDownmix.h')
-rw-r--r--media/libeffects/downmix/EffectDownmix.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/media/libeffects/downmix/EffectDownmix.h b/media/libeffects/downmix/EffectDownmix.h
index 4176b5a..be3ca3f 100644
--- a/media/libeffects/downmix/EffectDownmix.h
+++ b/media/libeffects/downmix/EffectDownmix.h
@@ -49,6 +49,17 @@ typedef struct downmix_module_s {
downmix_object_t context;
} downmix_module_t;
+const uint32_t kSides = AUDIO_CHANNEL_OUT_SIDE_LEFT | AUDIO_CHANNEL_OUT_SIDE_RIGHT;
+const uint32_t kBacks = AUDIO_CHANNEL_OUT_BACK_LEFT | AUDIO_CHANNEL_OUT_BACK_RIGHT;
+const uint32_t kUnsupported =
+ AUDIO_CHANNEL_OUT_FRONT_LEFT_OF_CENTER | AUDIO_CHANNEL_OUT_FRONT_RIGHT_OF_CENTER |
+ AUDIO_CHANNEL_OUT_TOP_CENTER |
+ AUDIO_CHANNEL_OUT_TOP_FRONT_LEFT |
+ AUDIO_CHANNEL_OUT_TOP_FRONT_CENTER |
+ AUDIO_CHANNEL_OUT_TOP_FRONT_RIGHT |
+ AUDIO_CHANNEL_OUT_TOP_BACK_LEFT |
+ AUDIO_CHANNEL_OUT_TOP_BACK_CENTER |
+ AUDIO_CHANNEL_OUT_TOP_BACK_RIGHT;
/*------------------------------------
* Effect API
@@ -92,5 +103,7 @@ void Downmix_foldFromQuad(int16_t *pSrc, int16_t*pDst, size_t numFrames, bool ac
void Downmix_foldFromSurround(int16_t *pSrc, int16_t*pDst, size_t numFrames, bool accumulate);
void Downmix_foldFrom5Point1(int16_t *pSrc, int16_t*pDst, size_t numFrames, bool accumulate);
void Downmix_foldFrom7Point1(int16_t *pSrc, int16_t*pDst, size_t numFrames, bool accumulate);
+bool Downmix_foldGeneric(
+ uint32_t mask, int16_t *pSrc, int16_t*pDst, size_t numFrames, bool accumulate);
#endif /*ANDROID_EFFECTDOWNMIX_H_*/