diff options
author | Chia-chi Yeh <chiachi@android.com> | 2010-11-29 22:56:56 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-11-29 22:56:56 -0800 |
commit | 879e9cb6b4e8b09a5c7d4942ce36125193deadde (patch) | |
tree | 5d62a0440aee987552a01ced8d3ad7d549749c0f /media/libmedia | |
parent | c2c8868e59bde7f48998e1d89a0d77217bc64767 (diff) | |
parent | 6b6a736ec71c692c165952fe653a7766075e94bb (diff) | |
download | frameworks_av-879e9cb6b4e8b09a5c7d4942ce36125193deadde.zip frameworks_av-879e9cb6b4e8b09a5c7d4942ce36125193deadde.tar.gz frameworks_av-879e9cb6b4e8b09a5c7d4942ce36125193deadde.tar.bz2 |
Merge "Visualizer: Fix the conversion from 8-bit sample to 16-bit sample." into gingerbread
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; |