summaryrefslogtreecommitdiff
path: root/lib/rbcodec/codecs/libopus/celt/mathops.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rbcodec/codecs/libopus/celt/mathops.c')
-rw-r--r--lib/rbcodec/codecs/libopus/celt/mathops.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/mathops.c b/lib/rbcodec/codecs/libopus/celt/mathops.c
index 3f8c5dcc0e..6ee9b9e101 100644
--- a/lib/rbcodec/codecs/libopus/celt/mathops.c
+++ b/lib/rbcodec/codecs/libopus/celt/mathops.c
@@ -38,7 +38,8 @@
38#include "mathops.h" 38#include "mathops.h"
39 39
40/*Compute floor(sqrt(_val)) with exact arithmetic. 40/*Compute floor(sqrt(_val)) with exact arithmetic.
41 This has been tested on all possible 32-bit inputs.*/ 41 _val must be greater than 0.
42 This has been tested on all possible 32-bit inputs greater than 0.*/
42unsigned isqrt32(opus_uint32 _val){ 43unsigned isqrt32(opus_uint32 _val){
43 unsigned b; 44 unsigned b;
44 unsigned g; 45 unsigned g;
@@ -164,7 +165,7 @@ opus_val16 celt_cos_norm(opus_val32 x)
164 { 165 {
165 return _celt_cos_pi_2(EXTRACT16(x)); 166 return _celt_cos_pi_2(EXTRACT16(x));
166 } else { 167 } else {
167 return NEG32(_celt_cos_pi_2(EXTRACT16(65536-x))); 168 return NEG16(_celt_cos_pi_2(EXTRACT16(65536-x)));
168 } 169 }
169 } else { 170 } else {
170 if (x&0x0000ffff) 171 if (x&0x0000ffff)
@@ -182,7 +183,7 @@ opus_val32 celt_rcp(opus_val32 x)
182 int i; 183 int i;
183 opus_val16 n; 184 opus_val16 n;
184 opus_val16 r; 185 opus_val16 r;
185 celt_assert2(x>0, "celt_rcp() only defined for positive values"); 186 celt_sig_assert(x>0);
186 i = celt_ilog2(x); 187 i = celt_ilog2(x);
187 /* n is Q15 with range [0,1). */ 188 /* n is Q15 with range [0,1). */
188 n = VSHR32(x,i-15)-32768; 189 n = VSHR32(x,i-15)-32768;