Class: Omnizip::Algorithms::LZMA::ProbabilityModels

Inherits:
Object
  • Object
show all
Defined in:
lib/omnizip/algorithms/lzma/probability_models.rb

Overview

Container for all LZMA probability models Ported from lzma_encoder_private.h

Constant Summary collapse

STATES =

Constants

12
POS_STATES_MAX =
16
LEN_LOW_SYMBOLS =
8
LEN_MID_SYMBOLS =
8
LEN_HIGH_SYMBOLS =
16
LEN_SYMBOLS =
272
MATCH_LEN_MIN =
2
MATCH_LEN_MAX =
273
DIST_STATES =
4
DIST_SLOTS =
64
DIST_MODEL_START =
4
DIST_MODEL_END =
14
FULL_DISTANCES =
128
ALIGN_SIZE =
16

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lc: 3, lp: 0, pb: 2) ⇒ ProbabilityModels

Returns a new instance of ProbabilityModels.



30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 30

def initialize(lc: 3, lp: 0, pb: 2)
  @lc = lc
  @lp = lp
  @pb = pb

  @literal = init_literal_models
  @is_match = init_is_match_models
  @is_rep = init_array(STATES, BitModel)
  @is_rep0 = init_array(STATES, BitModel)
  @is_rep1 = init_array(STATES, BitModel)
  @is_rep2 = init_array(STATES, BitModel)
  @is_rep0_long = init_is_rep0_long_models
  @dist_slot = init_dist_slot_models
  @dist_special = init_array(FULL_DISTANCES - DIST_MODEL_END, BitModel)
  @dist_align = init_array(ALIGN_SIZE, BitModel)
end

Instance Attribute Details

#dist_alignObject

Returns the value of attribute dist_align.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def dist_align
  @dist_align
end

#dist_slotObject

Returns the value of attribute dist_slot.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def dist_slot
  @dist_slot
end

#dist_specialObject

Returns the value of attribute dist_special.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def dist_special
  @dist_special
end

#is_matchObject

Returns the value of attribute is_match.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def is_match
  @is_match
end

#is_repObject

Returns the value of attribute is_rep.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def is_rep
  @is_rep
end

#is_rep0Object

Returns the value of attribute is_rep0.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def is_rep0
  @is_rep0
end

#is_rep0_longObject

Returns the value of attribute is_rep0_long.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def is_rep0_long
  @is_rep0_long
end

#is_rep1Object

Returns the value of attribute is_rep1.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def is_rep1
  @is_rep1
end

#is_rep2Object

Returns the value of attribute is_rep2.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def is_rep2
  @is_rep2
end

#literalObject

Returns the value of attribute literal.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def literal
  @literal
end

#match_len_encoderObject

Returns the value of attribute match_len_encoder.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def match_len_encoder
  @match_len_encoder
end

#rep_len_encoderObject

Returns the value of attribute rep_len_encoder.



25
26
27
# File 'lib/omnizip/algorithms/lzma/probability_models.rb', line 25

def rep_len_encoder
  @rep_len_encoder
end