Class: Omnizip::Algorithms::PPMd8::Decoder
- Inherits:
-
Object
- Object
- Omnizip::Algorithms::PPMd8::Decoder
- Defined in:
- lib/omnizip/algorithms/ppmd8/decoder.rb
Overview
PPMd8 Decoder
Decodes streams compressed with PPMd8, maintaining synchronized model state with the encoder.
Constant Summary
Constants included from Constants
Constants::BIN_SCALE, Constants::DEFAULT_RESTORE_METHOD, Constants::GLUE_COUNT_THRESHOLD, Constants::INIT_ESCAPE_FREQ, Constants::INTERVAL, Constants::INT_BITS, Constants::MAX_FREQ, Constants::MAX_STATES, Constants::PERIOD_BITS, Constants::PROB_TOTAL, Constants::RESTORE_METHOD_CUT_OFF, Constants::RESTORE_METHOD_RESTART, Constants::SEE_CONTEXTS, Constants::SUFFIX_CONTEXTS, Constants::UNIT_ALLOC_SIZE, Constants::UNIT_SIZE
Constants included from Omnizip::Algorithms::PPMdBase::BaseConstants
Omnizip::Algorithms::PPMdBase::BaseConstants::ALPHABET_SIZE, Omnizip::Algorithms::PPMdBase::BaseConstants::BOT_VALUE, Omnizip::Algorithms::PPMdBase::BaseConstants::DEFAULT_MEM_SIZE, Omnizip::Algorithms::PPMdBase::BaseConstants::DEFAULT_ORDER, Omnizip::Algorithms::PPMdBase::BaseConstants::MAX_MEM_SIZE, Omnizip::Algorithms::PPMdBase::BaseConstants::MAX_ORDER, Omnizip::Algorithms::PPMdBase::BaseConstants::MIN_MEM_SIZE, Omnizip::Algorithms::PPMdBase::BaseConstants::MIN_ORDER, Omnizip::Algorithms::PPMdBase::BaseConstants::TOP_VALUE
Instance Attribute Summary collapse
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#decode_stream ⇒ String
Decode a stream back to original bytes.
-
#initialize(input, options = {}) ⇒ Decoder
constructor
Initialize the decoder.
Constructor Details
#initialize(input, options = {}) ⇒ Decoder
Initialize the decoder
43 44 45 46 47 48 49 50 51 |
# File 'lib/omnizip/algorithms/ppmd8/decoder.rb', line 43 def initialize(input, = {}) @input = input @model = Model.new( [:model_order] || DEFAULT_ORDER, [:mem_size] || DEFAULT_MEM_SIZE, [:restore_method] || DEFAULT_RESTORE_METHOD, ) @range_decoder = LZMA::RangeDecoder.new(input) end |
Instance Attribute Details
#model ⇒ Object (readonly)
Returns the value of attribute model.
34 35 36 |
# File 'lib/omnizip/algorithms/ppmd8/decoder.rb', line 34 def model @model end |
Instance Method Details
#decode_stream ⇒ String
Decode a stream back to original bytes
57 58 59 60 61 62 |
# File 'lib/omnizip/algorithms/ppmd8/decoder.rb', line 57 def decode_stream raise NotImplementedError, "PPMd8 decompression is not yet fully implemented. " \ "The arithmetic coding integration requires completion. " \ "Please use PPMd7 or other compression algorithms instead." end |