implement optional parity contexts

This commit is contained in:
2022-09-20 23:24:19 +02:00
parent cc41feb5cd
commit f5fc9bd005
5 changed files with 84 additions and 29 deletions

View File

@@ -6,11 +6,12 @@ use crate::ProgressCallback;
pub fn pack(
data: &[u8],
use_bitstream: bool,
parity_contexts: usize,
mut progress_callback: Option<ProgressCallback>,
) -> Vec<u8> {
let mut match_finder = MatchFinder::new(data);
let mut rans_coder = RansCoder::new(use_bitstream);
let mut state = lz::CoderState::new();
let mut state = lz::CoderState::new(parity_contexts);
let mut pos = 0;
while pos < data.len() {