@@ -98,7 +98,7 @@ int oaci_bitexact_delta(int itheta) {
9898 sign = -1 ;
9999 }
100100 /* log2(tan(pi/4*x)) ~= log2(x) -.343 - .061*x + .404*x.^2. */
101- return IMIN ( 16384 , IMAX ( -16384 , sign * (oaci_bitexact_log2 (itheta ) - 703 - FRAC_MUL16 (itheta , (500 - FRAC_MUL16 (itheta , 13238 )) ))));
101+ return sign * (oaci_bitexact_log2 (itheta ) - 703 - FRAC_MUL16 (itheta , (500 - FRAC_MUL16 (itheta , 13238 ))));
102102}
103103
104104
@@ -608,7 +608,7 @@ void oaci_haar1(celt_norm *X, int N0, int stride) {
608608 }
609609}
610610
611- static int oaci_compute_qn (int N , int b , int offset , int pulse_cap , int stereo ) {
611+ static int oaci_compute_qn (int N , oac_int32 b , int offset , int pulse_cap , int stereo ) {
612612 static const oac_int16 exp2_table8 [8 ] =
613613 {16384 , 17866 , 19483 , 21247 , 23170 , 25267 , 27554 , 30048 };
614614 int qn , qb ;
@@ -653,13 +653,13 @@ struct band_ctx {
653653
654654struct split_ctx {
655655 int inv ;
656- int delta ;
656+ oac_int32 delta ;
657657 int itheta ;
658658 int itheta_q30 ;
659659};
660660
661661static void oaci_compute_theta (struct band_ctx * ctx , struct split_ctx * sctx ,
662- celt_norm * X , celt_norm * Y , int N , int * b , int B , int B0 ,
662+ celt_norm * X , celt_norm * Y , int N , oac_int32 * b , int B , int B0 ,
663663 int LM ,
664664 int stereo , int * fill ) {
665665 int qn ;
@@ -1090,7 +1090,7 @@ unsigned oaci_cubic_quant_partition(struct band_ctx *ctx, celt_norm *X, int N, i
10901090
10911091/* This function is responsible for encoding and decoding a band for the mono case. */
10921092static unsigned oaci_quant_band (struct band_ctx * ctx , celt_norm * X ,
1093- int N , int b , int B , celt_norm * lowband ,
1093+ int N , oac_int32 b , int B , celt_norm * lowband ,
10941094 int LM , celt_norm * lowband_out ,
10951095 oac_val32 gain , celt_norm * lowband_scratch , int fill ) {
10961096 int N0 = N ;
@@ -1211,7 +1211,7 @@ static unsigned oaci_quant_band(struct band_ctx *ctx, celt_norm *X,
12111211
12121212/* This function is responsible for encoding and decoding a band for the stereo case. */
12131213static unsigned oaci_quant_band_stereo (struct band_ctx * ctx , celt_norm * X , celt_norm * Y ,
1214- int N , int b , int B , celt_norm * lowband ,
1214+ int N , oac_int32 b , int B , celt_norm * lowband ,
12151215 int LM , celt_norm * lowband_out ,
12161216 celt_norm * lowband_scratch , int fill ) {
12171217 int inv = 0 ;
@@ -1443,7 +1443,7 @@ void oaci_quant_all_bands(int encode, const CELTMode *m, int start, int end,
14431443 ctx .avoid_split_noise = B > 1 ;
14441444 for (i = start ; i < end ; i ++ ) {
14451445 oac_int32 tell ;
1446- int b ;
1446+ oac_int32 b ;
14471447 int N ;
14481448 oac_int32 curr_balance ;
14491449 int effective_lowband = -1 ;
@@ -1472,7 +1472,7 @@ void oaci_quant_all_bands(int encode, const CELTMode *m, int start, int end,
14721472 ctx .total_bits = total_bits ;
14731473 if (i <= codedBands - 1 ) {
14741474 curr_balance = oaci_celt_sudiv (balance , IMIN (3 , codedBands - i ));
1475- b = IMAX (0 , IMIN (16383 , IMIN (remaining_bits , pulses [i ] + curr_balance )));
1475+ b = IMAX (0 , IMIN (32767 , IMIN (remaining_bits , pulses [i ] + curr_balance )));
14761476 } else {
14771477 b = 0 ;
14781478 }
0 commit comments