Skip to content

Commit

Permalink
switch back to the C brotli default of 5 bytes of backwards info for …
Browse files Browse the repository at this point in the history
…the hashing function for prior copies
  • Loading branch information
danielrh committed Jul 31, 2021
1 parent bb17a3a commit b3fa87f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/bin/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ fn test_random_then_unicode_9() {
roundtrip_helper(RANDOM_THEN_UNICODE, 9, 22, false);
}
#[cfg(feature="std")]
const random_then_unicode_compressed_size_9_5 : usize = 136542;
const random_then_unicode_compressed_size_9_5 : usize = 136126;
#[cfg(feature="std")]
const random_then_unicode_compressed_size_9_5x : usize = 136045;

Expand All @@ -412,7 +412,7 @@ const alice_compressed_size_11 : usize = 46510;


#[cfg(not(feature="std"))] // approx log
const random_then_unicode_compressed_size_9_5 : usize = 136719;
const random_then_unicode_compressed_size_9_5 : usize = 136409;
#[cfg(not(feature="std"))] // approx log
const random_then_unicode_compressed_size_9_5x : usize = 136095;

Expand Down
8 changes: 4 additions & 4 deletions src/enc/backward_references/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,17 +679,17 @@ impl<Alloc: alloc::Allocator<u16> + alloc::Allocator<u32>> AnyHasher for H9<Allo
}
#[inline(always)]
fn HashBytes(&self, data: &[u8]) -> usize {
let h: u32 = BROTLI_UNALIGNED_LOAD32(data).wrapping_mul(kHashMul32);
let thirty_two : usize = 32;
let h: u64 = (BROTLI_UNALIGNED_LOAD32(data) as u64| ((data[4] as u64) << 32)).wrapping_mul(kHashMul64Long);
let thirty_two : usize = 64;
(h >> (thirty_two.wrapping_sub(H9_BUCKET_BITS))) as usize
}
#[inline(always)]
fn HashTypeLength(&self) -> usize {
4
5
}
#[inline(always)]
fn StoreLookahead(&self) -> usize {
4
5
}
fn PrepareDistanceCache(&self, distance_cache: &mut [i32]) {
let num_distances = H9_NUM_LAST_DISTANCES_TO_CHECK as i32;
Expand Down

0 comments on commit b3fa87f

Please sign in to comment.