summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioMixer.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-01-27 15:26:23 -0800
committerGlenn Kasten <gkasten@google.com>2012-02-17 09:41:56 -0800
commit3b81acab52b7140c1b8b20be2d67be3e221637e7 (patch)
tree0b225360603f19ba2f60fb1cf7a616dfe51d99b1 /services/audioflinger/AudioMixer.h
parent1b094ee8f7fe7eca65bf3d2f983ba95eef6db93d (diff)
downloadframeworks_av-3b81acab52b7140c1b8b20be2d67be3e221637e7.zip
frameworks_av-3b81acab52b7140c1b8b20be2d67be3e221637e7.tar.gz
frameworks_av-3b81acab52b7140c1b8b20be2d67be3e221637e7.tar.bz2
Remove bit fields to improve performance
uint16_t enabled is (mostly) changed to bool in a separate CL Change-Id: Ied9f8c034b2479cee9a8778cee7b8ff92ae75b7b
Diffstat (limited to 'services/audioflinger/AudioMixer.h')
-rw-r--r--services/audioflinger/AudioMixer.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index c3174ae..b210212 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -127,32 +127,46 @@ private:
int32_t prevVolume[MAX_NUM_CHANNELS];
+ // 16-byte boundary
+
int32_t volumeInc[MAX_NUM_CHANNELS];
- int32_t auxLevel;
int32_t auxInc;
int32_t prevAuxLevel;
+ // 16-byte boundary
+
+ int16_t auxLevel; // 0 <= auxLevel <= MAX_GAIN_INT, but signed for mul performance
uint16_t frameCount;
- uint8_t channelCount : 4;
- uint8_t enabled : 1;
- uint8_t reserved0 : 3;
- uint8_t format;
- uint32_t channelMask;
+ uint8_t channelCount; // 1 or 2, redundant with (needs & NEEDS_CHANNEL_COUNT__MASK)
+ uint8_t format; // always 16
+ uint16_t enabled; // actually bool
+ uint32_t channelMask; // currently under-used
AudioBufferProvider* bufferProvider;
- mutable AudioBufferProvider::Buffer buffer;
+
+ // 16-byte boundary
+
+ mutable AudioBufferProvider::Buffer buffer; // 8 bytes
hook_t hook;
const void* in; // current location in buffer
+ // 16-byte boundary
+
AudioResampler* resampler;
uint32_t sampleRate;
int32_t* mainBuffer;
int32_t* auxBuffer;
+ // 16-byte boundary
+
uint64_t localTimeFreq;
+ int64_t padding;
+
+ // 16-byte boundary
+
bool setResampler(uint32_t sampleRate, uint32_t devSampleRate);
bool doesResample() const { return resampler != NULL; }
void resetResampler() { if (resampler != NULL) resampler->reset(); }