mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-11-17 18:02:23 +03:00
g723.1: cleanup square_root()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
1 parent
c02c52f7b2
commit
6e505547f1
1 file changed
+1
-11
+1
-11
@@ -196,17 +196,7 @@ static int unpack_bitstream(G723_1_Context *p, const uint8_t *buf,
|
||||
*/
|
||||
static int16_t square_root(int val)
|
||||
{
|
||||
int16_t res = 0;
|
||||
int16_t exp = 0x4000;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 14; i ++) {
|
||||
int res_exp = res + exp;
|
||||
if (val >= res_exp * res_exp << 1)
|
||||
res += exp;
|
||||
exp >>= 1;
|
||||
}
|
||||
return res;
|
||||
return (ff_sqrt(val << 1) >> 1) & (~1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user