pcm/Dither: move shift from DitherConvert() to Dither()

All callers need this shift, so let's move it to the basic method.
This commit is contained in:
Max Kellermann 2013-12-24 23:39:29 +01:00
parent d1b7473418
commit 9ac18c39a1

View File

@ -59,7 +59,7 @@ PcmDither::Dither(T sample)
error[0] = sample - output; error[0] = sample - output;
return output; return output >> scale_bits;
} }
template<typename ST, typename DT> template<typename ST, typename DT>
@ -72,7 +72,7 @@ PcmDither::DitherConvert(typename ST::value_type sample)
constexpr unsigned scale_bits = ST::BITS - DT::BITS; constexpr unsigned scale_bits = ST::BITS - DT::BITS;
return Dither<typename ST::sum_type, ST::MIN, ST::MAX, return Dither<typename ST::sum_type, ST::MIN, ST::MAX,
scale_bits>(sample) >> scale_bits; scale_bits>(sample);
} }
template<typename ST, typename DT> template<typename ST, typename DT>