diff options
author | Marco Nelissen <marcone@google.com> | 2011-01-18 16:44:28 -0800 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2011-01-24 08:47:55 -0800 |
commit | 209821c7b7ead3ac58743d0a6d21dd05a2e77708 (patch) | |
tree | e9cc0ea746bad9d05425f459ad245f882ceab36c /media/libmedia | |
parent | b517e006b51c95db9c44bf5f104f562d431ae597 (diff) | |
download | frameworks_av-209821c7b7ead3ac58743d0a6d21dd05a2e77708.tar.gz frameworks_av-209821c7b7ead3ac58743d0a6d21dd05a2e77708.tar.bz2 frameworks_av-209821c7b7ead3ac58743d0a6d21dd05a2e77708.zip |
Increase the number of useful bits in the spectrum.
Change-Id: I3efc2ac8db689285566df35cb6f594aab41141db
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/Visualizer.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/media/libmedia/Visualizer.cpp b/media/libmedia/Visualizer.cpp index a660429444..43571cfbbf 100644 --- a/media/libmedia/Visualizer.cpp +++ b/media/libmedia/Visualizer.cpp @@ -219,8 +219,13 @@ status_t Visualizer::doFft(uint8_t *fft, uint8_t *waveform) } for (uint32_t i = 0; i < mCaptureSize; i += 2) { - fft[i] = workspace[i >> 1] >> 24; - fft[i + 1] = workspace[i >> 1] >> 8; + short tmp = workspace[i >> 1] >> 21; + while (tmp > 127 || tmp < -128) tmp >>= 1; + fft[i] = tmp; + tmp = workspace[i >> 1]; + tmp >>= 5; + while (tmp > 127 || tmp < -128) tmp >>= 1; + fft[i + 1] = tmp; } return NO_ERROR; |