script2.ijg 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. # Here is an example of a successive-approximation script.
  2. # This is equivalent to the default script used by
  3. # "cjpeg -progressive" for YCbCr images:
  4. # Initial DC scan for Y,Cb,Cr (lowest bit not sent)
  5. 0,1,2: 0-0, 0, 1 ;
  6. # First AC scan: send first 5 Y AC coefficients, minus 2 lowest bits:
  7. 0: 1-5, 0, 2 ;
  8. # Send all Cr,Cb AC coefficients, minus lowest bit:
  9. # (chroma data is usually too small to be worth subdividing further;
  10. # but note we send Cr first since eye is least sensitive to Cb)
  11. 2: 1-63, 0, 1 ;
  12. 1: 1-63, 0, 1 ;
  13. # Send remaining Y AC coefficients, minus 2 lowest bits:
  14. 0: 6-63, 0, 2 ;
  15. # Send next-to-lowest bit of all Y AC coefficients:
  16. 0: 1-63, 2, 1 ;
  17. # At this point we've sent all but the lowest bit of all coefficients.
  18. # Send lowest bit of DC coefficients
  19. 0,1,2: 0-0, 1, 0 ;
  20. # Send lowest bit of AC coefficients
  21. 2: 1-63, 1, 0 ;
  22. 1: 1-63, 1, 0 ;
  23. # Y AC lowest bit scan is last; it's usually the largest scan
  24. 0: 1-63, 1, 0 ;
  25. # It may be worth pointing out that this script is tuned for quality
  26. # settings of around 50 to 75. For lower quality settings, you'd
  27. # probably want to use a script with fewer stages of successive
  28. # approximation (otherwise the initial scans will be really bad).
  29. # For higher quality settings, you might want to use more stages of
  30. # successive approximation (so that the initial scans are not too large).