From 6895deeecc8797e6f5b28e7d07ec6bc499355c0c Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Tue, 15 May 2012 15:51:16 -0700 Subject: 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 --- media/libeffects/downmix/EffectDownmix.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'media/libeffects/downmix/EffectDownmix.h') 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_*/ -- cgit v1.1