Parsing JPEG file format: Format of entropy-coded segments (ECS)?

你离开我真会死。 提交于 2019-12-05 05:43:42

When the standard talks about ECS, it doesn't refer to it as a segment type like SOS is, with a header and a size component; it is literally the raw Huffman-compressed bitstream representing the MCU's that comprise the image data. It is padded to fill an integral number of bytes, and can optionally be interleaved with RST headers (formally, RST headers are seperate to the ECS).

When the standard says ECS0, it means the 0th (first) ECS run, rather than a specific ECS type like how SOF0/SOF1/SOF2/etc are different types.

Example for baseline DCT :

FF DA // SOS header
00 08 // 8 bytes
01 // 1 channel
01 00 // channel 1 QT 0 HT 0
00 3F 00 // start/end spectral selector, successive approximation bit high/low
12 34 56 78 ... // Huffman-compressed MCU raw data
 (sequence of Fuffman codes looked-up in AC/DC Huffman tables)

FF D9 // EOI

A handy free program for helping to explain the stucture of JFIF is JPEGsnoop ( http://www.impulseadventure.com/photo/jpeg-snoop.html ). There is a 'Full Decode' option in the menu which shows the raw Huffman bitstream, how it maps to Huffman symbols, gets de-quantized and then mapped into DCT components.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!