SOURCE Coding algorithm
- Fenaux Encoding Fano Coding
- Huffman Code Huffman Coding
Fenaux Encoding Step
- The source symbols are arranged from large to small according to their probability size;
- Divide this set of source symbols into probabilities and as close as possible or equal to one group (i.e. two sets of probabilities and the difference between the differences as small as possible!) );
- The above set of symbols encoded into 0, the following group encoded into 1, vice versa;
- Repeat steps 2 and 3 for the group that you have already divided until you can no longer group;
- Write the code word one at a time from left to right.
Fenaux Coding Demo
Known:
The encoding process is:
Huffman Code Huffman Coding encoding Step
- The source symbols are arranged from large to small according to the probability size;
- The probability of the smallest two source symbols into a group, wherein the above an encoding of 0, the following an encoding of 1, and the probability of the two symbols added together, and the result is again with the symbol has not been processed by the size of the order;
- Repeat step 2 until all the source symbols have been processed;
- Each code word can be obtained by returning from right to left according to the encoded path.
Huffman Coding Demo
Known:
The encoding process is:
Source Encoding algorithm (Fenaux encoding && Huffman coding)