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.hxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/pcm/PcmDither.hxx b/src/pcm/PcmDither.hxx
index fdcdb1f6a..473a45ac3 100644
--- a/src/pcm/PcmDither.hxx
+++ b/src/pcm/PcmDither.hxx
@@ -32,6 +32,18 @@ public:
constexpr PcmDither()
:error{0, 0, 0}, random(0) {}
+ /**
+ * Shift the given sample by #SBITS-#DBITS to the right, and
+ * apply dithering.
+ *
+ * @param ST the input sample type
+ * @param SBITS the input bit width
+ * @param DBITS the output bit width
+ * @param sample the input sample value
+ */
+ template<typename ST, unsigned SBITS, unsigned DBITS>
+ ST DitherShift(ST sample);
+
void Dither24To16(int16_t *dest, const int32_t *src,
const int32_t *src_end);