anchor.diff:    "The DECODE procedure, as described in CCITT rec."
     (let ((i 1)
           (code (funcall nextbit s)))
  +    (declare #.*optimize*
  +             (type (simple-array uint8 (*)) huffval)
  +             (type (simple-array fixnum (*)) maxcode mincode valptr)
  +             (type fixnum i code))
       (loop while (> code (aref maxcode i)) do
             (incf i)
             (setf code (plus (ash code 1) (funcall nextbit s))))
  
positive.code:                                   for pos fixnum = (position cid (descriptor-cid image))
                                    collecting (list (aref (descriptor-iH image) pos)
                                                     (aref (descriptor-iV image) pos)))))
           (preds (make-array ncomp :initial-element 0 :element-type 'sint16)))
      (declare #.*optimize*
               (type fixnum ncomp Hmax Vmax x-growth y-growth nwidth)
               (type (simple-array t (*)) freqs fr)
               (dynamic-extent fr freqs))
      (catch 'marker
        (loop
          with tables =
             (make-array ncomp
                         :initial-contents
                         (loop for i fixnum from 0 below ncomp
                               for ta fixnum = (logand (second (aref (scan-cdesc scan) i)) 15)
                               for td fixnum = (ash (the fixnum (second (aref (scan-cdesc scan) i))) -4)
                               collecting (vector (aref (descriptor-huff-ac image) ta)
                                                  (aref (descriptor-huff-dc image) td))))
          do (loop for comp fixnum from 0 below ncomp
                   for pos fixnum =
                      (position (the fixnum (first (aref (scan-cdesc scan) comp)))
  
negative.code: (defun izigzag (inbuf zzbuf)
    (declare #.*optimize*
             (type sint16-array inbuf)
  	   (type sint16-2d-array zzbuf)
  	   (type uint8-2d-array +zigzag-index+))
    "Performs inverse zigzag block arrangement"
    (loop for zrow of-type uint8-array across +zigzag-index+
          for row of-type sint16-array across zzbuf do
          (loop for pos fixnum across zrow
                for x fixnum from 0 do
                (setf (aref row x) (aref inbuf pos))))
  