Parsing JPEG SOS Marker

后端 未结 2 742
渐次进展
渐次进展 2021-02-13 22:46

There is a question with the same title but unfortunatly it doesn\'t help me.

I am trying to parse the data of a SOS marker. All documentations I can find say that afte

2条回答
  •  不知归路
    2021-02-13 22:57

    Summary of how to find next marker after SOS marker (0xFFDA):

    1. Skip first 3 bytes after SOS marker (2 bytes header size + 1 byte number of image components in scan).
    2. Search for next FFxx marker (skip every FF00 and range from FFD0 to FFD7 because they are part of scan).

    *This is summary of comments below post of user3344003 + my knowledge + Table B.1 from https://www.w3.org/Graphics/JPEG/itu-t81.pdf.

    *Basing on Table B.1 I can also suspect that values FF01 and FF02 through FFBF should also be skipped in point 2 but I am not sure if they cannot appear as part of encoded SOS data.


    Additional question above:

    Why does a Baseline DCT Image have multiple scans? I would understand why it has two; the main image and a thumbnail, but what is the third scan?

    If image stream contains APP2 marker (0xFFE2), that tells us it can be (but not have to be) Multi Picture JPEG (tag named MPF), we can have more than 3 images. In general APP markers can store anything, there are a lot of standards related to APP segments in JPEG files.

    First table tells us about "things" that can be stored in each APP segment: https://sno.phy.queensu.ca/~phil/exiftool/TagNames/JPEG.html

提交回复
热议问题