Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2011-03-31 04:28:08 +0400
committerMans Rullgard <mans@mansr.com>2011-03-31 15:01:27 +0400
commit7f6e05cdfd1242a6774e89283b6e2cefde191590 (patch)
treeee3edfc058e31b191186c22f786155b01aa17519
parentcb7e2c1ca864a2ff44c851689ba8a2d4a81dfd27 (diff)
ac3enc: simplify sym_quant()
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>
-rw-r--r--libavcodec/ac3enc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 18e4dae26a..a869d7de9d 100644
--- 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;
}