From 87c44b3b802b7b6fc8d21f598cb6d9034504e0a3 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Wed, 7 Oct 2020 14:01:38 +0200 Subject: [PATCH] ape: trim filter coefficients to 16-bit --- nihav-llaudio/src/codecs/apepred.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/nihav-llaudio/src/codecs/apepred.rs b/nihav-llaudio/src/codecs/apepred.rs index 547164c..9f7e8b6 100644 --- a/nihav-llaudio/src/codecs/apepred.rs +++ b/nihav-llaudio/src/codecs/apepred.rs @@ -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 } -- 2.39.5