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 | 6b6a736ec71c692c165952fe653a7766075e94bb (patch) | |
tree | 2000c38c45f45551faa3a78de14f7f7f387b0f80 /media/libmedia | |
parent | 64c3bdea8cba454d4404baded584ea0f0611b3ee (diff) | |
download | frameworks_av-6b6a736ec71c692c165952fe653a7766075e94bb.zip frameworks_av-6b6a736ec71c692c165952fe653a7766075e94bb.tar.gz frameworks_av-6b6a736ec71c692c165952fe653a7766075e94bb.tar.bz2 |
Visualizer: Fix the conversion from 8-bit sample to 16-bit sample.
Change-Id: Ie6d77b0f61a37333e05cdcdb6ef29d6f6c345a9d
Diffstat (limited to 'media/libmedia')
-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; |