Progressive JPEG in libjpeg

789 views Asked by At

I would like to know how to use libjpeg for progressive compression. Especially, how to use spectral selection or successive approximation only, or both (full progression). As far as I know, there are parameters Ss and Se (start/end of spectral selection band) and Ah and Al (high/low bit position for successive approximation) - does setting value for these parameters decide which method is used?

1

There are 1 answers

0
user3344003 On

I can speak to JPEG in general as I do not use LIBJPEG.

The method used is determined by the type of FRAME used. The SS, SE, AH, and AL parameters are for the SCAN. A frame is made up of multiple scans.

The SS and SE parameters to the SCAN indicate the range of DCT coefficients that are encoded. The AH and AL parameters can range from 0-13. Thus, in theory you can have 14 * 64 = 896 scans for a single component.

Looking in the LIBJPEG manual, it looks like this is done through setting up sequences of scans in a "j_compress_ptr" structure. They also mention a function "jpeg_simple_progression()" for setting this up.