]> git.nihav.org Git - nihav.git/commitdiff
ape: trim filter coefficients to 16-bit
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 7 Oct 2020 12:01:38 +0000 (14:01 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 7 Oct 2020 12:01:38 +0000 (14:01 +0200)
nihav-llaudio/src/codecs/apepred.rs

index 547164c084f00c274e732c4e4a76daa3c54d63e8..9f7e8b6b2a09a1d6d9a5de7bafb2c2028fd8e850 100644 (file)
@@ -97,6 +97,7 @@ fn adapt_loop(filt: &mut [i32], coeffs: &[i32], adapt: &[i32], val: i32) -> i32
         } else if val > 0 {
             *coef -= *adapt;
         }
+        *coef = *coef << 16 >> 16;
     }
     sum
 }