adikshit
adikshit

Reputation: 205

Is restart marker in a JPEG JFIF optional?

I am trying to work on a JPEG (JFIF) baseline image decoder. While reading about Restart Interval I got confused. A JPEG image has a DRI field which tells you after how many MCUs the image should restart. But in addition to it there are restart markers inserted in scans. To me it seems redundant information. Can someone please suggest why we need this information in 2 places ? Or is one of them optional ? To me it seems that either should be sufficient. Only DRI is enough if we want the multithreading advantage of Restart Intervals.

Upvotes: 0

Views: 586

Answers (1)

user3344003
user3344003

Reputation: 21647

Restart Markers are option and tend to be uncommon. If you use the DRI field, they become mandatory.

The DRI field tells where the decode should expect to find restart markers in the stream. Restart markers can be used to recover if there is corruption in the compressed data. This was of more value in the days of dialup internet.

Upvotes: 0

Related Questions