By "undo the quantization" I mean element-wise multiply by the quantization matrix, certainly the rounding is irreversible (I know the JPEG algorithm).
Anyway I think it's irrelevant it sounds like the lowest level information I can easily get is the DCT coefficients, which is fine since I can easily convert them to a sparse format which should be mathematically equivalent to what I would have if I had the RLC directly. Thanks a lot for your help On Wednesday, February 21, 2018 at 12:44:34 PM UTC-5, DRC wrote: > > Run-length encoding is baked into the Huffman algorithm. Quantization > is irreversible. That is what makes JPEG a lossy format, in fact. Once > the DCT coefficients are quantized, they are irrevocably altered, so > there is no way to "undo" quantization. The Huffman decoder outputs the > quantized DCT coefficients. The Huffman encoder inputs the quantized > DCT coefficients. At least in our implementation, there is no > intermediate step between quantized DCT coefficients and Huffman coding. > > > On 2/21/18 10:28 AM, Max wrote: > > Interesting OK, so my understanding was that the DCT blocks are > > run-length coded first to make the huffman coding more efficient, > > especially since the end of a block is probably going to consist of a > > bunch of 0s, you would store the number of 0s instead of each 0 > > separately. This would lead to a so-called sparse matrix, where you > > store the index of non-zero blocks and their values rather than the full > > matrix (like a 2d array or something), which certain processing > > algorithms can exploit to get a massive speed boost. > > > > Does the Huffman decoder also undo the quantization then? > -- You received this message because you are subscribed to the Google Groups "libjpeg-turbo User Discussion/Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to libjpeg-turbo-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/libjpeg-turbo-users/b8a7ae77-fe36-4ee7-8a1a-d034409c346f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.