def METHOD_NAME(values):
    """Generic encoder for data stored using four bits.
    This returns an unsigned integer array containing encoded sample
    values that range from 0 to 15.  Floating point sample values are
    converted to unsigned int by first scaling them by
    ``FOUR_BIT_1_SIGMA = 2.95``, then adding 8.5 (the 0.5 to ensure proper
    rounding when typecasting to uint8). Some sample output levels are:
      ========================= ======
      Input range               Output
      ========================= ======
             value*scale < -7.5    0
      -7.5 < value*scale < -6.5    1
      -0.5 < value*scale < +0.5    8
       6.5 < value*scale          15
      ========================= ======
    This does not pack the samples into bytes.
    """
    # Optimized for speed by doing calculations in-place.
    values = values * FOUR_BIT_1_SIGMA
    values += 8.5
    return np.clip(values, 0., 15., out=values).astype(np.uint8)