anchor.diff:                  let mutable sum = V3d.Zero
                   for m in 0 .. 7 do
                       for n in 0 .. 7 do
  -                        sum <- sum + block.[m + 8*n] * cos ((2.0 * float m + 1.0) * float x * Constant.Pi / 16.0) *  cos ((2.0 * float n + 1.0) * float y * Constant.Pi / 16.0)
  +                        let a = cos ((2.0 * float m + 1.0) * float x * Constant.Pi / 16.0)
  +                        let b = cos ((2.0 * float n + 1.0) * float y * Constant.Pi / 16.0)
  +                        sum <- sum + block.[m + 8*n] * a * b
                   
                   0.25 * cx * cy * sum
               )
  
positive.code: 
          let writeImage (size : V2i) (blocks : list<V3i[]>) =
              let ms = new System.IO.MemoryStream()
              
  
              let header = [| 0xFFuy; 0xD8uy;  |]
              ms.Write(header, 0, header.Length)
  
negative.code:                     Codeword(x.Length + 1uy, (x.Code <<< 1) ||| (if b then 1us else 0us))
  
                  member x.AppendBits(count : byte, value : uint16) =
                      Codeword(x.Length + count, (x.Code <<< int count) ||| (value &&& ((1us <<< int count) - 1us)))
  
                  new(l,c) = { Length = l; Code = c }
              end
  
          let QLum =
              [|
                  2;  2;  2;  2;  3;  4;  5;  6;
                  2;  2;  2;  2;  3;  4;  5;  6;
                  2;  2;  2;  2;  4;  5;  7;  9;
                  2;  2;  2;  4;  5;  7;  9; 12;
                  3;  3;  4;  5;  8; 10; 12; 12;
                  4;  4;  5;  7; 10; 12; 12; 12;
                  5;  5;  7;  9; 12; 12; 12; 12;
                  6;  6;  9; 12; 12; 12; 12; 12;
              |]
  
          let QChrom =
              [|
                   3;  3;  5;  9; 13; 15; 15; 15;
                   3;  4;  6; 11; 14; 12; 12; 12;
                   5;  6;  9; 14; 12; 12; 12; 12;
                   9; 11; 14; 12; 12; 12; 12; 12;
                  13; 14; 12; 12; 12; 12; 12; 12;
                  15; 12; 12; 12; 12; 12; 12; 12;
                  15; 12; 12; 12; 12; 12; 12; 12;
                  15; 12; 12; 12; 12; 12; 12; 12;
              |]
              
  
  