comparison ra144.c @ 7104:8a4a7069737d libavcodec

Simplify t_sqrt()
author vitor
date Mon, 23 Jun 2008 20:13:07 +0000
parents 3e9c18e58216
children b55bedad89ad
comparison
equal deleted inserted replaced
7103:3e9c18e58216 7104:8a4a7069737d
59 * Evaluate sqrt(x << 24). x must fit in 20 bits. This value is evaluated in an 59 * Evaluate sqrt(x << 24). x must fit in 20 bits. This value is evaluated in an
60 * odd way to make the output identical to the binary decoder. 60 * odd way to make the output identical to the binary decoder.
61 */ 61 */
62 static int t_sqrt(unsigned int x) 62 static int t_sqrt(unsigned int x)
63 { 63 {
64 int s = 0; 64 int s = 2;
65 while (x > 0xfff) { 65 while (x > 0xfff) {
66 s++; 66 s++;
67 x = x >> 2; 67 x = x >> 2;
68 } 68 }
69 69
70 return (ff_sqrt(x << 20) << s) << 2; 70 return ff_sqrt(x << 20) << s;
71 } 71 }
72 72
73 /** 73 /**
74 * Evaluate the LPC filter coefficients from the reflection coefficients. 74 * Evaluate the LPC filter coefficients from the reflection coefficients.
75 * Does the inverse of the eval_refl() function. 75 * Does the inverse of the eval_refl() function.