def METHOD_NAME(values):
    """Generic encoder for data stored using two bits.
    This returns an unsigned integer array containing encoded sample
    values that range from 0 to 3.  The conversion from floating point
    sample value to unsigned int is given below, with
    ``lv = TWO_BIT_1_SIGMA = 2.1745``:
      ================= ======
      Input range       Output
      ================= ======
            value < -lv   0
      -lv < value <  0.   2
       0. < value <  lv   1
       lv < value         3
      ================= ======
    This does not pack the samples into bytes.
    """
    # Optimized for speed by doing calculations in-place, and ensuring that
    # the dtypes match.
    values = np.clip(values, clip_low, clip_high)
    values += two_bit_2_sigma
    bitvalues = np.empty(values.shape, np.uint8)
    return np.floor_divide(values, TWO_BIT_1_SIGMA, out=bitvalues,
                           casting='unsafe')