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:
a4b8fc3
)
g723.1: simplify scale_vector()
author
Mans Rullgard
<mans@mansr.com>
Mon, 13 Aug 2012 22:50:10 +0000
(23:50 +0100)
committer
Mans Rullgard
<mans@mansr.com>
Tue, 14 Aug 2012 11:08:30 +0000
(12:08 +0100)
It is impossible for bits to be 15 here so the special case is
not needed.
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
fd03ed9
..
793b2d3
100644
(file)
--- a/
libavcodec/g723_1.c
+++ b/
libavcodec/g723_1.c
@@
-283,12
+283,8
@@
static int scale_vector(int16_t *dst, const int16_t *vector, int length)
max = FFMIN(max, 0x7FFF);
bits = normalize_bits(max, 15);
- if (bits == 15)
- for (i = 0; i < length; i++)
- dst[i] = vector[i] * 0x7fff >> 3;
- else
- for (i = 0; i < length; i++)
- dst[i] = vector[i] << bits >> 3;
+ for (i = 0; i < length; i++)
+ dst[i] = vector[i] << bits >> 3;
return bits - 3;
}