Skip to content

tonybird/ac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

COMP590Spring2019-ArithmeticCoder

Arithmetic coder example from class

The text file encoder produces a file with the following format:

  • The first 256 * 32 bits are the frequency counts associated with the integer symbol values 0 to 255.
    • Each count is a 32 bit value.
  • The next 32 bits are the number of symbols that were encoded
  • The next 8 bits is the value of range_bit_width (i.e., the size of the range registers used by the encoder)
  • Following this are the encoded symbols.

One thing to note that was just touched on at the very end of class is that when the encoding app gets to the end (i.e., it's encoded the last symbol), it needs to have the encoder emit a bit pattern that is known to be between high and low so that the decoder doesn't run out of bits as it fills its input buffer when it gets to the end. The method emitMiddle() in the encoder does this by writing out a 1 followed by range_bit_width-1 0's since that represents the middle of value of the whole range which is guaranteed to be between high and low.

About

COMP 590 Assignment 2 - Arithmetic Coding

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages