问题描述
我很难理解JPEG文件格式的ITU-T T.81规范。希望这里的其他人试图解析JPEG文件和/或知道这个文件格式的细节。
$ b 规范指出,ECS0段在SOS段后开始,但我无法在规范中找到ECS0细分市场的格式,或者如何检测其开始。在线简单的JPEG实现有限的帮助,因为他们承担了许多关于他们解析JPEG的东西。
任何人都可以指出我正确的方向吗? b
仅供参考:JPEG文件格式规格为)。在菜单中有一个完全解码选项,它显示原始霍夫曼比特流,它如何映射到霍夫曼符号,得到去量化,然后映射到DCT分量。
I'm having difficulty understanding the ITU-T T.81 spec for the JPEG file format. Hopefully someone else here has tried to parse JPEG files and/or knows about the details of this file format.
The spec indiates that the ECS0 segment starts after the SOS segment but I can't find where in the spec it actually talks about the format of the ECS0 segment or how do detect its start. Simple JPEG implementations online are of limited help because they assume many things about the JPEGs they parse.
Can anyone point me in the right direction?
FYI: The JPEG file format spec is here.
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 ECS, 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.
这篇关于解析JPEG文件格式:熵编码段(ECS)的格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!