Skip to main content

hash_beside

Function hash_beside 

Source
fn hash_beside<R>(
    bands: &mut Vec<StripeState>,
    pixels: &[u8],
    stride: usize,
    height: usize,
    threshold: u32,
    duration: i32,
    encode: impl FnOnce() -> R,
) -> (R, Vec<bool>)
Expand description

Run encode on this thread while a thread of its own hashes the frame’s bands (hash_bands), and return what encode returned with the bands that changed: a Turbo frame’s hash kept off its encode’s path. A scoped thread per frame rather than the rayon pool, whose idle workers spin after every wake; where no thread starts, the hash runs here after the encode. The thread keeps to the CPUs sharing this one’s last-level cache (share_cache_with).