/// A very quick check if the provided buffer is likely be a FLAC frame header.
A very quick check if the provided buffer is likely be a FLAC frame header.
A very quick check if the provided buffer is likely be a FLAC frame header .
pub fn is_likely_frame_header(buf: &[u8]) -> bool {
    // let is_variable = (buf[1] & 0x1) == 1;
    if (buf[0] & 0xf0) == 0x00 {
        return false;
    }
    if (buf[0] & 0x0f) == 0x0f {
        return false;
    }
    if ((buf[1] & 0xf0) >> 4) >= 0xb {
        return false;
    }
    if (buf[1] & 0x0e == 0x6) || (buf[1] & 0x0e == 0x0e) {
        return false;
    }
    if buf[1] & 0x1 == 1 {
        return false;
    }
    true
}
pub fn is_likely_frame_header ( buf : & [ u8 ] ) -> bool { // let is_variable = (buf[1] & 0x1) == 1; if ( buf [ 0 ] & 0xf0 ) == 0x00 { return false ; } if ( buf [ 0 ] & 0x0f ) == 0x0f { return false ; } if ( ( buf [ 1 ] & 0xf0 ) >> 4 ) >= 0xb { return false ; } if ( buf [ 1 ] & 0x0e == 0x6 ) || ( buf [ 1 ] & 0x0e == 0x0e ) { return false ; } if buf [ 1 ] & 0x1 == 1 { return false ; } true }
A very quick check if the provided buffer is likely be a FLAC frame header.
A very quick check if the provided buffer is likely be a FLAC frame header .
buf
&[u8]