allow more than 32767 samples to be processed by using a different min/max function