rasterwave 0.5.0

High-performance streaming SSTV and radiofax encoder/decoder
Documentation
1
2
3
4
5
6
7
8
9
10
11
pub(crate) const VIS_BIT_SECONDS: f64 = 0.030;

pub(crate) fn with_even_parity(vis: u8) -> u8 {
    let seven_bits = vis & 0x7f;
    let parity = (seven_bits.count_ones() & 1) as u8;
    seven_bits | (parity << 7)
}

pub(crate) fn has_even_parity(value: u8) -> bool {
    value.count_ones() % 2 == 0
}