Reverse-engineering static Huffman tables in a chip.

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Reverse-engineering static Huffman tables in a chip.
by on (#21952)
I'd like to add PC-FX MJPEG decoding to Mednafen, the emulator, but I can't figure out what the values of the internal Huffman tables are(they are static, in the chip). There is one piece of software, mixplay, at http://home.highway.ne.jp/soltin/mixplay.html that has the Huffman tables in it, but I can't figure out how to convert them to the format I need to use(16 lengths + code table)... The Magic Engine-FX author reverse-engineered mixplay, but it was too overwhelming when I tried to debug it myself(darn x86 assembly!).

Does anyone know how to construct a JPEG bytestream that, when decoded by a JPEG decoder, will reveal bits of the Huffman tables used to decode, in the decoded graphics?