Skip to content

Commit

Permalink
fixed auto compressor selection bug in CompressorFrame::compress_best #…
Browse files Browse the repository at this point in the history
  • Loading branch information
worryg0d committed Sep 9, 2024
1 parent 09acfa4 commit aa65a51
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions brro-compressor/src/frame/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,7 @@ impl CompressorFrame {
// We need enough samples to do decent compression, minimum is 128 (2^7)
let data_sample = COMPRESSION_SPEED[compression_speed] as usize;
// Eligible compressors for use
let compressor_list = [
Compressor::Constant,
Compressor::FFT,
Compressor::Polynomial,
];
let compressor_list = [Compressor::FFT, Compressor::Polynomial];
// Do a statistical analysis of the data, let's see if we can pick a compressor out of this.
let stats = DataStats::new(data);
// Checking the statistical analysis and chose, if possible, a compressor
Expand All @@ -90,6 +86,7 @@ impl CompressorFrame {
compressor,
)
})
.filter(|(result, _)| result.error <= max_error as f64)
.min_by_key(|x| x.0.compressed_data.len())
.unwrap();
self.compressor = *chosen_compressor;
Expand All @@ -108,6 +105,7 @@ impl CompressorFrame {
compressor,
)
})
.filter(|(result, _)| result.error <= max_error as f64)
.min_by_key(|x| x.0.compressed_data.len())
.unwrap();

Expand Down

0 comments on commit aa65a51

Please sign in to comment.