anchor.diff:  (defun apply-filter (entropy order fracbits)
     (declare (type (sa-sb 32) entropy)
              (type (integer 1 15) fracbits)
  -           (type non-negative-fixnum order))
  +           (type non-negative-fixnum order)
  +           (optimize (speed 3)))
     (let ((coeffs (make-array order
                               :element-type '(sb 16)
                               :initial-element 0))
  
positive.code:     (declare (type (sa-sb 16) coeffs buffer)
               (type (sb 32) avg))
      (dotimes (i (length entropy))
        (let* ((buffer-idx (rem i +history-size+))
               (history (make-displaced-array buffer buffer-idx order))
               (adapt (make-displaced-array buffer (+ buffer-idx order) order))
               (current-data (aref entropy i)))
  
          ;; Copy data from back to start when... we need to
          (when (zerop buffer-idx)
            (map-into buffer #'identity
                      (make-displaced-array
                       buffer +history-size+
                       (ash order 1))))
  
          ;; Decoded output
          (let ((new-data
                  (+ current-data
                     (ash (+ (ash 1 (1- fracbits))
                             (dot-product coeffs adapt))
                          (- fracbits)))))
  
            ;; Update filter coeffs
            (map-into coeffs
                      (lambda (x y)
                        (declare (type (sb 16) x y))
                        (- x (* y (signum current-data))))
                      coeffs history)
  
            (setf (aref entropy i)
                  new-data
                  (aref buffer (+ buffer-idx (ash order 1)))
                  (clamp new-data -32768 32767)
                  (aref adapt 0)
                  (cond
                    ((<= (abs new-data)
                         (truncate (* avg 4) 3))
                     (* -8 (signum new-data)))
                    ((<= (abs new-data)
                         (* avg 3))
                     (* -16 (signum new-data)))
                    (t
                     (* -32 (signum new-data)))))
            (incf avg (truncate (- (abs new-data) avg) 16))
  
          (symbol-macrolet
              ((x-1 (aref history (+ order -1)))
               (x-2 (aref history (+ order -2)))
               (x-8 (aref history (+ order -8))))
            (setf x-1 (ash x-1 -1)
                  x-2 (ash x-2 -1)
                  x-8 (ash x-8 -1)))))))
    entropy)
  
  (defmethod predictor-decode (frame (version (eql 3950)))
    (declare (ignore version))
    (let ((orders   (nth (frame-fset frame) *filter-orders*))
          (fracbits (nth (frame-fset frame) *fracbits*)))
      (flet ((apply-filter-channels (order fracbits)
  
negative.code: (defun predictor-promote-version (version)
    (find version *predictor-versions* :test #'>=))
  
  (declaim (inline dot-product))
  (defun dot-product (x y &key (start1 0) (start2 0))
    (declare (type (sa-sb 16) x y)
             (type fixnum start1 start2)
             (optimize (speed 3)))
    (loop
      for i from start1 below (length x)
      for j from start2 below (length y)
      sum (* (aref x i) (aref y j)) fixnum))
  
  (declaim (inline clamp))
  (defun clamp (x min max)
    (declare (type (sb 32) x min max)
             (optimize (speed 3)))
    (min (max x min) max))
  
  (defun decode-frame (frame)
  