Jpeg 檔案結構

來源:互聯網
上載者:User

JPEG檔案由八個部分組成,每個部分的標記位元組為兩個,首位元組固定為:0xFF,當然,准許在其前面再填充多個0xFF,以最後一個為準。下面為各部分的名稱和第二個標記位元組的數值,用ultraedit的16進位搜尋功能可找到各部分的起始位置,在嵌入式系統中可用類似的數值匹配法定位。
一、映像開始SOI(Start of Image)標記,數值0xD8
二、APP0標記(Marker),數值0xE0
1、APP0長度(length)
2、標識符(identifier)
3、版本號碼(version)
4、X和Y的密度單位(units=0:無單位;units=1:點數/英寸;units=2:點數/厘米)
5、X方向像素密度(X density)
6、Y方向像素密度(Y density)
7、縮圖水平像素數目(thumbnail horizontal pixels)
8、縮圖垂直像素數目(thumbnail vertical pixels)
9、縮圖RGB位元影像(thumbnail RGB bitmap),由前面的數值決定,取值3n,n為縮圖總像素
三、APPn標記(Markers),其中n=1~15,數值對應0xE1~0xEF   
1、APPn長度(length)
2、應用細節資訊(application specific information)
四、一個或者多個量化表DQT(difine quantization table),數值0xDB
1、量化表長度(quantization table length)
2、量化表數目(quantization table number)
3、量化表(quantization table)
五、幀映像開始SOF0(Start of Frame),數值0xC0
1、幀開始長度(start of frame length)
2、精度(precision),每個顏色分量每個像素的位元(bits per pixel per color component)
3、映像高度(image height)
4、映像寬度(image width)
5、顏色分量數(number of color components)
6、對每個顏色分量(for each component)
包括:ID、垂直方向的樣本因子(vertical sample factor)、水平方向的樣本因子(horizontal sample factor) 、量化表號(quantization table#)
六、一個或者多個霍夫曼表DHT(Difine Huffman Table),數值0xC4
1、霍夫曼表的長度(Huffman table length)
2、類型、AC或者DC(Type, AC or DC)
3、索引(Index)
4、位表(bits table)
5、值表(value table)
七、掃描開始SOS(Start of Scan),數值0xDA
1、掃描開始長度(start of scan length)
2、顏色分量數(number of color components)
3、每個顏色分量
包括:ID、交流係數表號(AC table #)、直流係數表號(DC table #)
4、壓縮映像資料(compressed image data)
八、映像結束EOI(End of Image),數值0xD9

JPEG檔案由八個部分組成,每個部分的標記位元組為兩個,首位元組固定為:0xFF,當然,准許在其前面再填充多個0xFF,以最後一個為準。下面為各部分的名稱和第二個標記位元組的數值,用ultraedit的16進位搜尋功能可找到各部分的起始位置,在嵌入式系統中可用類似的數值匹配法定位。
一、映像開始SOI(Start of Image)標記,數值0xD8
二、APP0標記(Marker),數值0xE0
1、APP0長度(length)
2、標識符(identifier)
3、版本號碼(version)
4、X和Y的密度單位(units=0:無單位;units=1:點數/英寸;units=2:點數/厘米)
5、X方向像素密度(X density)
6、Y方向像素密度(Y density)
7、縮圖水平像素數目(thumbnail horizontal pixels)
8、縮圖垂直像素數目(thumbnail vertical pixels)
9、縮圖RGB位元影像(thumbnail RGB bitmap),由前面的數值決定,取值3n,n為縮圖總像素
三、APPn標記(Markers),其中n=1~15,數值對應0xE1~0xEF   
1、APPn長度(length)
2、應用細節資訊(application specific information)
四、一個或者多個量化表DQT(difine quantization table),數值0xDB
1、量化表長度(quantization table length)
2、量化表數目(quantization table number)
3、量化表(quantization table)
五、幀映像開始SOF0(Start of Frame),數值0xC0
1、幀開始長度(start of frame length)
2、精度(precision),每個顏色分量每個像素的位元(bits per pixel per color component)
3、映像高度(image height)
4、映像寬度(image width)
5、顏色分量數(number of color components)
6、對每個顏色分量(for each component)
包括:ID、垂直方向的樣本因子(vertical sample factor)、水平方向的樣本因子(horizontal sample factor) 、量化表號(quantization table#)
六、一個或者多個霍夫曼表DHT(Difine Huffman Table),數值0xC4
1、霍夫曼表的長度(Huffman table length)
2、類型、AC或者DC(Type, AC or DC)
3、索引(Index)
4、位表(bits table)
5、值表(value table)
七、掃描開始SOS(Start of Scan),數值0xDA
1、掃描開始長度(start of scan length)
2、顏色分量數(number of color components)
3、每個顏色分量
包括:ID、交流係數表號(AC table #)、直流係數表號(DC table #)
4、壓縮映像資料(compressed image data)
八、映像結束EOI(End of Image),數值0xD9

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.