pub mod annexa;
pub mod bitstream;
pub mod gain;
pub mod lsp;
pub mod misc;
pub mod pitch;
pub mod postfilter;
pub mod window;
#[cfg(feature = "g729")]
pub mod sid;
#[cfg(feature = "g729")]
pub mod vad;
pub const fn checksum_u16(data: &[u16]) -> u32 {
let mut acc = 0u32;
let mut i = 0;
while i < data.len() {
acc = acc.wrapping_mul(16777619) ^ (data[i] as u32);
i += 1;
}
acc
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn tables_window_shape_is_expected() {
assert_eq!(annexa::B100, [7699, -15398, 7699]);
assert_eq!(annexa::A100, [8192, 15836, -7667]);
}
#[test]
fn tables_checksums_are_stable() {
let c1 = checksum_u16(&annexa::TABPOW.map(|v| v as u16));
let c2 = checksum_u16(&annexa::TABLOG.map(|v| v as u16));
assert_ne!(c1, 0);
assert_ne!(c2, 0);
}
}