Skip to content

Commit

Permalink
final touch ups?
Browse files Browse the repository at this point in the history
  • Loading branch information
mwlon committed Nov 9, 2024
1 parent d17c227 commit 33427ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion pco/src/metadata/delta_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ impl DeltaEncoding {
#[cfg(test)]
mod tests {
use crate::bit_writer::BitWriter;
use crate::constants::Bitlen;
use crate::metadata::delta_encoding::{DeltaConsecutiveConfig, DeltaLz77Config};
use crate::metadata::DeltaEncoding;

Expand Down
7 changes: 4 additions & 3 deletions pco/src/wrapped/chunk_compressor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ const LZ77_REQUIRED_BYTE_SAVINGS_PER_N: f64 = 0.25;
fn new_lz_delta_encoding(n: usize) -> DeltaEncoding {
DeltaEncoding::Lz77(DeltaLz77Config {
window_n_log: bits::bits_to_encode_offset(n as u32 - 1)
.min(LZ77_MAX_WINDOW_N_LOG)
.max(LZ77_MIN_WINDOW_N_LOG),
.clamp(LZ77_MIN_WINDOW_N_LOG, LZ77_MAX_WINDOW_N_LOG),
state_n_log: 0,
secondary_uses_delta: false,
})
Expand Down Expand Up @@ -756,7 +755,9 @@ mod tests {
);

let latents = DynLatents::new((0..300).collect::<Vec<u32>>()).unwrap();
let sample = choose_delta_sample(&latents, 100, 1);
let sample = choose_delta_sample(&latents, 100, 1)
.downcast::<u32>()
.unwrap();
assert_eq!(sample.len(), 200);
assert_eq!(&sample[..3], &[0, 1, 2]);
assert_eq!(&sample[197..], &[297, 298, 299]);
Expand Down

0 comments on commit 33427ce

Please sign in to comment.