/// Derive over all values in order to produce differences to the previous value.
Derive over all values in order to produce differences to the previous value.
Derive over all values in order to produce differences to the previous value .
pub fn samples_to_differences(buffer: &mut [u8]){
        for index in (1..buffer.len()).rev() {
            buffer[index] = (buffer[index] as i32 - buffer[index - 1] as i32 + 128) as u8; // index unsafe but handled with care and unit-tested
        }
    }
pub fn samples_to_differences ( buffer : & mut [ u8 ] ) { for index in ( 1 .. buffer . len ( ) ) . rev ( ) { buffer [ index ] = ( buffer [ index ] as i32 - buffer [ index - 1 ] as i32 + 128 ) as u8 ; // index unsafe but handled with care and unit-tested } }
Derive over all values in order to produce differences to the previous value.
Derive over all values in order to produce differences to the previous value .
buffer
&mut [u8]