diff --git a/src/enc/constants.rs b/src/enc/constants.rs index 4e19756b..2453386f 100644 --- a/src/enc/constants.rs +++ b/src/enc/constants.rs @@ -104,7 +104,10 @@ static kContextLookup: [u8; 2048] = [ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, ]; +#[cfg(not(feature = "disallow_large_window_size"))] pub const BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS: usize = 544; +#[cfg(feature = "disallow_large_window_size")] +pub const BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS: usize = 520; pub const BROTLI_NUM_LITERAL_SYMBOLS: usize = 256; pub const BROTLI_NUM_COMMAND_SYMBOLS: usize = 704; pub const BROTLI_WINDOW_GAP: usize = 16; diff --git a/src/enc/histogram.rs b/src/enc/histogram.rs index 3825ccbd..30cb03b2 100644 --- a/src/enc/histogram.rs +++ b/src/enc/histogram.rs @@ -5,7 +5,9 @@ use super::super::alloc; use super::super::alloc::{SliceWrapper, SliceWrapperMut}; use super::block_split::BlockSplit; use super::command::Command; -use super::constants::{kSigned3BitContextLookup, kUTF8ContextLookup}; +use super::constants::{ + kSigned3BitContextLookup, kUTF8ContextLookup, BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS, +}; use super::util::floatX; use super::vectorization::Mem256i; @@ -63,11 +65,6 @@ impl Default for HistogramCommand { } //#[derive(Clone)] // #derive is broken for arrays > 32 -#[cfg(not(feature = "disallow_large_window_size"))] -const BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS: usize = 544; -#[cfg(feature = "disallow_large_window_size")] -const BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS: usize = 520; - pub struct HistogramDistance { pub data_: [u32; BROTLI_NUM_HISTOGRAM_DISTANCE_SYMBOLS], pub total_count_: usize,