Parsing jpeg file, SOS marker

允我心安 提交于 2019-12-07 02:35:37

问题


I'm having problem with parsing jpeg file. When I hit SOS (start of scan) marker, there are few bytes which meaning I don't understand. In picture bellow, after SOS marker, there are 2 bytes for header length (Ls part on the picture). But what the rest of data on picture mean (for example Ns, Cs1 etc....), and where the pure data starts?


回答1:


Cs1 is a components selection index, This refers back to the SOF section (where horizontal and vertical sampling factors are specified)

Td1 is the DC table selector for the current component (Cs1)

Ta1 is the AC table selector for the current component (Cs1)

Ss, Se and Ah,Al define the spectral selection for the current scan data (this is used in progressive bitmaps. In the first round of rendering, only lower frequencies are shown, in the final round, more detailed frequencies are shown)

The scan data starts after Al

In summary,

SOS (2 bytes)
Ls (2 Bytes)
Ns (1 byte)
Component Specific Parameters (Ns * 2 bytes)
Ss (1 byte)
Se (1 byte)
Ah,AL (1 byte)
... scan data ...


来源:https://stackoverflow.com/questions/8511326/parsing-jpeg-file-sos-marker

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