projects
/
platform
/
upstream
/
libav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fddc5b9
)
g723.1: deobfuscate "(x << 4) - x" to "15 * x"
author
Mans Rullgard
<mans@mansr.com>
Sat, 11 Aug 2012 00:54:15 +0000
(
01:54
+0100)
committer
Mans Rullgard
<mans@mansr.com>
Mon, 13 Aug 2012 00:03:25 +0000
(
01:03
+0100)
The compiler performs this optimisation.
Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/g723_1.c
patch
|
blob
|
history
diff --git
a/libavcodec/g723_1.c
b/libavcodec/g723_1.c
index
7d8a48e
..
d4158ff
100644
(file)
--- a/
libavcodec/g723_1.c
+++ b/
libavcodec/g723_1.c
@@
-914,7
+914,7
@@
static void gain_scale(G723_1_Context *p, int16_t * buf, int energy)
}
for (i = 0; i < SUBFRAME_LEN; i++) {
- p->pf_gain = (
(p->pf_gain << 4) -
p->pf_gain + gain + (1 << 3)) >> 4;
+ p->pf_gain = (
15 *
p->pf_gain + gain + (1 << 3)) >> 4;
buf[i] = av_clip_int16((buf[i] * (p->pf_gain + (p->pf_gain >> 4)) +
(1 << 10)) >> 11);
}