You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
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>
This commit is contained in:
@@ -1192,7 +1192,7 @@ static int compute_bit_allocation(AC3EncodeContext *s)
|
|||||||
*/
|
*/
|
||||||
static inline int sym_quant(int c, int e, int levels)
|
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);
|
av_assert2(v >= 0 && v < levels);
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user