OSDN Git Service
(root)
/
android-x86
/
frameworks-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c896d85
)
Increase the number of useful bits in the spectrum.
author
Marco Nelissen
<marcone@google.com>
Wed, 19 Jan 2011 00:44:28 +0000
(16:44 -0800)
committer
Marco Nelissen
<marcone@google.com>
Mon, 24 Jan 2011 16:47:55 +0000
(08:47 -0800)
Change-Id: I3efc2ac8db689285566df35cb6f594aab41141db
media/libmedia/Visualizer.cpp
patch
|
blob
|
history
diff --git
a/media/libmedia/Visualizer.cpp
b/media/libmedia/Visualizer.cpp
index
a660429
..
43571cf
100644
(file)
--- 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;