anchor.diff:      #(21 34 37 47 50 56 59 61)
       #(35 36 48 49 57 58 62 63)))
   
  -;;; Temporary buffer for zigzag encoding and decoding
  -(defvar *zz-result* (make-array 64 :element-type 'unsigned-byte))
  -
  -(define-constant +zzbuf+
  -  #(#(0  0  0  0  0  0  0  0)
  -    #(0  0  0  0  0  0  0  0)
  -    #(0  0  0  0  0  0  0  0)
  -    #(0  0  0  0  0  0  0  0)
  -    #(0  0  0  0  0  0  0  0)
  -    #(0  0  0  0  0  0  0  0)
  -    #(0  0  0  0  0  0  0  0)
  -    #(0  0  0  0  0  0  0  0)))
  -
   ;;;JPEG file markers
   (defconstant +M_COM+ #xfe)
   (defconstant +M_SOF0+ #xc0)
  
positive.code:       (setf (svref *idct-limit-array* i) n))
  (loop for i from 384 to 511 do
        (setf (svref *idct-limit-array* i) 255))
  
  ;;; State variables for write-bits
  (defvar *prev-byte* 0)
  (defvar *prev-length* 0)
  
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;;; Encoder part
  
negative.code:          (Vmax (loop for entry across fr maximize (second entry)))
           (x-growth (ash Hmax 3))
           (y-growth (ash Vmax 3))
  	 (*ws* (make-array 8 :initial-contents (loop for i from 0 to 7 collecting (make-array 8)))) ; Temporary workspace for IDCT
           (freqs (make-array ncomp :initial-contents
                              (loop for i fixnum from 0 below ncomp ; collecting sampling frequencies
                                    for cid fixnum = (first (svref (scan-cdesc scan) i))
  