Commit 431f8af8 authored by Michael Niedermayer's avatar Michael Niedermayer

g723.1: replace loop of normalize_bits( by av_log2()

idea by vitor
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 6e505547
...@@ -216,8 +216,8 @@ static int normalize_bits(int num, int width) ...@@ -216,8 +216,8 @@ static int normalize_bits(int num, int width)
return bits; return bits;
if (num < 0) if (num < 0)
num = ~num; num = ~num;
for (i = 0; num < limit; i++) i= bits - av_log2(num) - 1;
num <<= 1; i= FFMAX(i, 0);
} }
return i; return i;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment