rle_decode_fast

Function rle_decode

Source
pub fn rle_decode<T>(
    buffer: &mut Vec<T>,
    lookbehind_length: usize,
    fill_length: usize,
)
where T: Copy,
Expand description

Fast decoding of run length encoded data

Takes the last lookbehind_length items of the buffer and repeatedly appends them until fill_length items have been copied.

ยงPanics

  • lookbehind_length is 0
  • lookbehind_length >= buffer.len()
  • fill_length + buffer.len() would overflow