code: public static int maxdiffbits(int initoffset, int[] i, int pos, int length) {
          int mask = 0;
          mask |= (i[pos] - initoffset);
          for (int k = pos + 1; k < pos + length; ++k) {
              mask |= i[k] - i[k - 1];
          }
          return bits(mask);
      }
docs: Compute the maximum of the integer logarithms (ceil(log(x+1)) of a the
  successive differences (deltas) of a range of value
  
  @param initoffset
  initial vallue for the computation of the deltas
  @param i
  source array
  @param pos
  starting position
  @param length
  number of integers to consider
  @return integer logarithm