OSDN Git Service
(root)
/
coroid
/
ffmpeg_saccubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cb7e2c1
)
ac3enc: simplify sym_quant()
author
Mans Rullgard
<mans@mansr.com>
Thu, 31 Mar 2011 00:28:08 +0000
(
01:28
+0100)
committer
Mans Rullgard
<mans@mansr.com>
Thu, 31 Mar 2011 11:01:27 +0000
(12:01 +0100)
These expressions are equivalent since levels is always odd, and
overflow is impossible due to the constraints set by the assert().
Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/ac3enc.c
patch
|
blob
|
history
diff --git
a/libavcodec/ac3enc.c
b/libavcodec/ac3enc.c
index
18e4dae
..
a869d7d
100644
(file)
--- a/
libavcodec/ac3enc.c
+++ b/
libavcodec/ac3enc.c
@@
-1192,7
+1192,7
@@
static int compute_bit_allocation(AC3EncodeContext *s)
*/
static inline int sym_quant(int c, int e, int levels)
{
- int v = (((
(levels * c) >> (24 - e)) + 1) >> 1) + (levels >> 1)
;
+ int v = (((
levels * c) >> (24 - e)) + levels) >> 1
;
av_assert2(v >= 0 && v < levels);
return v;
}