OSDN Git Service
(root)
/
android-x86
/
external-ffmpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
20035fa
)
g723_1dec: inline normalize_bits() in scale vector and optimize it.
author
Michael Niedermayer
<michaelni@gmx.at>
Mon, 13 Aug 2012 13:18:47 +0000
(15:18 +0200)
committer
Michael Niedermayer
<michaelni@gmx.at>
Mon, 13 Aug 2012 13:18:47 +0000
(15:18 +0200)
many branches and cases of scale_vector are irrelevant for the case here
and by inlining they can be reliably removed.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/g723_1.c
patch
|
blob
|
history
diff --git
a/libavcodec/g723_1.c
b/libavcodec/g723_1.c
index
ae73799
..
72151b4
100644
(file)
--- a/
libavcodec/g723_1.c
+++ b/
libavcodec/g723_1.c
@@
-257,7
+257,8
@@
static int scale_vector(int16_t *dst, const int16_t *vector, int length)
for (i = 0; i < length; i++)
max |= FFABS(vector[i]);
- bits = normalize_bits(max, 15);
+ bits= 14 - av_log2_16bit(max);
+ bits= FFMAX(bits, 0);
for (i = 0; i < length; i++)
dst[i] = vector[i] << bits >> 3;