shithub: aacenc

Download patch

ref: 08ff1d310799a9725ce709a8227ba5f6ff7045c0
parent: cc91e09b9d1f0f8106f4acfa56fa198496d599d0
author: knik <knik@users.sourceforge.net>
date: Fri Jul 28 08:28:11 EDT 2017

QuantizeReflectionCoeffs() fix (Arcen@github)

--- a/libfaac/tns.c
+++ b/libfaac/tns.c
@@ -488,7 +488,7 @@
 
     /* Quantize and inverse quantize */
     for (i=1;i<=fOrder;i++) {
-        indexArray[i] = (int)(0.5+(asin(kArray[i])*((kArray[i]>=0)?iqfac:iqfac_m)));
+        indexArray[i] = (kArray[i]>=0)?(int)(0.5+(asin(kArray[i])*iqfac)):(int)(-0.5+(asin(kArray[i])*iqfac_m));
         kArray[i] = sin((double)indexArray[i]/((indexArray[i]>=0)?iqfac:iqfac_m));
     }
 }