Skip to content

Commit 996a4ae

Browse files
authored
Update README.md
1 parent ab765af commit 996a4ae

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,17 @@
11
# COMP590Spring2019-ArithmeticCoder
2+
23
Arithmetic coder example from class
4+
5+
The text file encoder produces a file with the following format:
6+
7+
* The first 256 * 32 bits are the frequency counts associated with the integer symbol values 0 to 255.
8+
* Each count is a 32 bit value.
9+
* The next 32 bits are the number of symbols that were encoded
10+
* The next 8 bits is the value of range_bit_width (i.e., the size of the range registers used by the encoder)
11+
* Following this are the encoded symbols.
12+
13+
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.,
14+
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
15+
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
16+
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.
17+

0 commit comments

Comments
 (0)