When a standard talks about ECS, it does not refer to it as a segment type, such as SOS, with a header and a size component; this is literally the original Huffman compressed stream representing the MCU that contains the image data. It is complemented by filling in an integer number of bytes and can be interleaved with RST headers (formally, RST headers are separate for ECS).
When the standard says ECS 0 , it means the 0 (first) start of ECS, and not a specific type of ECS, for example, as SOF0 / SOF1 / SOF2 / etc - different types.
An example of a basic 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 convenient free program for explaining the structure of JFIF is JPEGsnoop ( http://www.impulseadventure.com/photo/jpeg-snoop.html ). The menu has the option "Full Decode", which shows the original Huffman data stream, how it is mapped to Huffman symbols, gets de-quantized and then mapped to DCT components.
matja
source share