aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm/PcmDither.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/pcm/PcmDither.hxx')
-rw-r--r--src/pcm/PcmDither.hxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/pcm/PcmDither.hxx b/src/pcm/PcmDither.hxx
index 106382307..2b75cdaeb 100644
--- a/src/pcm/PcmDither.hxx
+++ b/src/pcm/PcmDither.hxx
@@ -22,6 +22,8 @@
#include <stdint.h>
+enum class SampleFormat : uint8_t;
+
class PcmDither {
int32_t error[3];
int32_t random;
@@ -37,8 +39,16 @@ public:
const int32_t *src_end);
private:
- int16_t Dither24To16(int_fast32_t sample);
- int16_t Dither32To16(int_fast32_t sample);
+ template<typename T, T MIN, T MAX, unsigned scale_bits>
+ T Dither(T sample);
+
+ template<typename ST, typename DT>
+ typename DT::value_type DitherShift(typename ST::value_type sample);
+
+ template<typename ST, typename DT>
+ void DitherShift(typename DT::pointer_type dest,
+ typename ST::const_pointer_type src,
+ typename ST::const_pointer_type src_end);
};
#endif