Last active
September 11, 2016 16:42
-
-
Save jordanorelli/f782ea6fe89f5f53c425e0ce5d33abb7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0 {36271 0 PlusOne} | |
10 {25474 39 FieldPathEncodeFinish} | |
1110 {10334 1 PlusTwo} | |
1111 {10530 11 PushOneLeftDeltaNRightNonZeroPack6Bits} | |
11000 {2942 8 PushOneLeftDeltaOneRightNonZero} | |
11010 {4128 4 PlusN} | |
110010 {1375 2 PlusThree} | |
110011 {1837 29 PopAllButOnePlusOne} | |
11011001 {471 10 PushOneLeftDeltaNRightNonZero} | |
11011010 {521 7 PushOneLeftDeltaOneRightZero} | |
11011100 {560 9 PushOneLeftDeltaNRightZero} | |
11011110 {634 32 PopAllButOnePlusNPack6Bits} | |
11011111 {646 3 PlusFour} | |
110110000 {149 30 PopAllButOnePlusN} | |
110110110 {251 12 PushOneLeftDeltaNRightNonZeroPack8Bits} | |
110110111 {271 37 NonTopoPenultimatePlusOne} | |
110111010 {300 31 PopAllButOnePlusNPack3Bits} | |
110111011 {310 26 PushNAndNonTopological} | |
1101100010 {99 38 NonTopoComplexPack4Bits} | |
11011000111 {76 36 NonTopoComplex} | |
110110001101 {35 5 PushOneLeftDeltaZeroRightZero} | |
110110001100001 {2 27 PopOnePlusOne} | |
110110001100100 {3 6 PushOneLeftDeltaZeroRightNonZero} | |
1101100011000000 {1 23 PushThreeLeftDeltaN} | |
1101100011000001 {1 24 PushThreePack5LeftDeltaN} | |
1101100011000100 {1 25 PushN} | |
1101100011000101 {1 28 PopOnePlusN} | |
1101100011000110 {1 33 PopNPlusOne} | |
1101100011000111 {1 34 PopNPlusN} | |
1101100011001010 {1 35 PopNAndNonTopographical} | |
11011000110010110 {1 13 PushTwoLeftDeltaZero} | |
11011000110010111 {1 14 PushTwoPack5LeftDeltaZero} | |
11011000110011000 {1 15 PushThreeLeftDeltaZero} | |
11011000110011001 {1 16 PushThreePack5LeftDeltaZero} | |
11011000110011010 {1 17 PushTwoLeftDeltaOne} | |
11011000110011011 {1 18 PushTwoPack5LeftDeltaOne} | |
11011000110011100 {1 19 PushThreeLeftDeltaOne} | |
11011000110011101 {1 20 PushThreePack5LeftDeltaOne} | |
11011000110011110 {1 21 PushTwoLeftDeltaN} | |
11011000110011111 {1 22 PushTwoPack5LeftDeltaN} |
if you run this file it'll open a graph of the reconstructed huffman tree, containing all codes. (on linux!)
Update: here it is!
@spheenik thanks! turns out my tree was slightly wrong, but I was able to correct it based on your graph. I wasn't counting the nodes as they were added to increment what you call "num"; for intermediate nodes I was just taking the largest of the leaf node's nums instead of assigning a new num to each intermediate nodes, which put a few things out of order at the bottom of the tree where all the leaf nodes have weights of zero.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The weights seem to be correct, I checked 3-4 of them randomly. Feel free to use this static lookup function: