diff options
author | Chia-chi Yeh <chiachi@android.com> | 2010-11-01 10:56:45 +0800 |
---|---|---|
committer | Chia-chi Yeh <chiachi@android.com> | 2010-11-01 10:56:45 +0800 |
commit | 67f41771d5c34e6e8568bf906724e137da123c77 (patch) | |
tree | 7f5358285f318855375b54f6f058c6d9ba001b93 /media/libmedia/Visualizer.cpp | |
parent | 70a2c15ecfd4e8cd8581699d5df8a219c7d5cdb1 (diff) | |
download | frameworks_base-67f41771d5c34e6e8568bf906724e137da123c77.zip frameworks_base-67f41771d5c34e6e8568bf906724e137da123c77.tar.gz frameworks_base-67f41771d5c34e6e8568bf906724e137da123c77.tar.bz2 |
Visualizer: Fix the conversion from 8-bit sample to 16-bit sample.
Change-Id: Ie6d77b0f61a37333e05cdcdb6ef29d6f6c345a9d
Diffstat (limited to 'media/libmedia/Visualizer.cpp')
-rw-r--r-- | media/libmedia/Visualizer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/media/libmedia/Visualizer.cpp b/media/libmedia/Visualizer.cpp index 68f2e9b..a660429 100644 --- a/media/libmedia/Visualizer.cpp +++ b/media/libmedia/Visualizer.cpp @@ -209,8 +209,8 @@ status_t Visualizer::doFft(uint8_t *fft, uint8_t *waveform) int32_t nonzero = 0; for (uint32_t i = 0; i < mCaptureSize; i += 2) { - workspace[i >> 1] = (waveform[i] ^ 0x80) << 23; - workspace[i >> 1] |= (waveform[i + 1] ^ 0x80) << 7; + workspace[i >> 1] = + ((waveform[i] ^ 0x80) << 24) | ((waveform[i + 1] ^ 0x80) << 8); nonzero |= workspace[i >> 1]; } @@ -219,8 +219,8 @@ status_t Visualizer::doFft(uint8_t *fft, uint8_t *waveform) } for (uint32_t i = 0; i < mCaptureSize; i += 2) { - fft[i] = workspace[i >> 1] >> 23; - fft[i + 1] = workspace[i >> 1] >> 7; + fft[i] = workspace[i >> 1] >> 24; + fft[i + 1] = workspace[i >> 1] >> 8; } return NO_ERROR; |