[1:03:12][Come to understand DEFLATE's use of Huffman coding[ref
site=IETF
page="DEFLATE Compressed Data Format Specification version 1.3"
url=https://www.ietf.org/rfc/rfc1951.txt] specifications with a few words on compressor creation][:compression :research]
[1:08:27][Enable ComputeHuffman() to find the numerical value of the smallest code for each code length, and assign numerical values to all the codes][:compression]
[1:15:13][Consider ourselves done with that part of it][:compression :speech]
[1:25:15][Fix AllocateHuffman() to set the MaxCodeLengthInBits][:compression]
[1:25:40][Continue to step through ComputeHuffman() and consider the use of MaxCodeLengthInBits in the ArbitraryBits computation][:compression :run]
[1:29:35][Change AllocateHuffman() to set the MaxCodeLengthInBits according to the length of that length it was passed in, i.e. 2^Length][:compression]
[1:31:30][:Run it and hit our assertion in AllocateHuffman()][:compression]
[1:31:44][Revert AllocateHuffman() and instead make ParsePNG() pass 8 to it for the DictHuffman allocation][:compression]
[1:32:16][Continue to step through ComputeHuffman() and inspect our data][:compression :run]
[1:33:38][Assert in HuffmanDecode() that BitsUsed != 0][:compression]
[1:34:20][Continue to step through ParsePNG(), hit our assertion in HuffmanDecode() and investigate why][:compression :run]
[1:35:26][Carefully read 3.1.1 Packing into bytes[ref
site=IETF
page="DEFLATE Compressed Data Format Specification version 1.3"
url=https://www.ietf.org/rfc/rfc1951.txt] to discover that Huffman codes are packed in the opposite direction to everything else][:compression :research]
[1:45:30][Make ComputeHuffman() flip the bits of Huffman codes][:compression]
[1:48:12][Step through ComputeHuffman() to watch our bits flip][:compression :run]
[1:49:07][Fix ComputeHuffman() to flip all our bits correctly][:compression]
[1:50:13][Step through ComputeHuffman() to see our correctly flipping bits][:compression :run]
[1:51:17][Consider packing the Huffman codes backwards][:compression :speech]
[1:53:12][Step through HuffmanDecode() until we assert][:compression :run]
[1:55:57][Make ParsePNG() increment LitLenCount in the LitLenDistTable construction routine][:compression]
[1:56:50][:Run until we crash in HuffmanDecode()][:compression]
[1:57:09][Temporarily prevent ComputeHuffman() from flipping the Huffman bits][:compression]
[1:57:26][:Run it and crash earlier][:compression]
[1:58:05][Q&A][:speech]
[1:58:17][Fix typo in the LitLenDistTable construction in ParsePNG()[ref
site=GitHub
page="HandmadeHero / cpp/Issues / Wrong value in LitLenDistTable for value of 17"
[2:00:15][@ratchetfreak][Q: Don't the bits when reading the table need to be reversed as well?][:compression]
[2:00:53][@spensasaurusrex][Q: How many hours long is this series now? I've dabbled in the first dozen or so episodes, but trying to catch up on so much content is discouraging]
[2:01:12][@mmozeiko][Q: You said multiple times that PNG spec does not allow fixed Huffman codes, but this is not true: PNG spec explicitly says that both fixed and dynamic Huffmans are allowed (section 10.1)][:compression]
[2:01:28][@somebody_took_my_name][Q: In AllocateHuffman() you use the sizeof the huffman table not the entries to malloc data][:memory]
[2:05:51][@ratchetfreak][Q: Yeah, you are correct][:compression]
[2:08:29][@ratchetfreak][Q: Only Huffman codes are bit-reversed when looking at the bit from first byte to last, and most significant bit to least significant][:compression]