I need access to the DCT coefficient tables after the quantization (jpeg_write_scanlines?), but before the Huffman entropy coding, and before writing the file to disk. Is that possible with libjpeg? I know that as a workaround I could write a compressed file to disk and read it right back using buffered-image mode (jpeg_read_coefficients), but I'd like to avoid that detour.
Asked
Active
Viewed 701 times
2
-
I'd like to see the answer to this question myself, but in the meantime, let me point out that you can write the compressed file to a memory buffer, and read it back in from that very memory buffer. While this still wastes your time doing the entropy coding, at least you don't have to take the hit from disc IO. More info [here](http://stackoverflow.com/questions/4559648/write-to-memory-buffer-instead-of-file-with-libjpeg) – escozzia Aug 30 '13 at 21:43
-
I did that a long time ago by modifying the libjpeg code. I don't know how much it has changed in the past decade. But it was possible. – user3344003 Mar 26 '14 at 04:41