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

idea by vitor
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-09-29 21:39:08 +02:00
parent 6e505547f1
commit 431f8af824

View File

@ -216,8 +216,8 @@ static int normalize_bits(int num, int width)
return bits;
if (num < 0)
num = ~num;
for (i = 0; num < limit; i++)
num <<= 1;
i= bits - av_log2(num) - 1;
i= FFMAX(i, 0);
}
return i;
}