aboutsummaryrefslogtreecommitdiffstats
path: root/src/pcm/PcmDither.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-24 23:45:38 +0100
committerMax Kellermann <max@duempel.org>2013-12-24 23:45:38 +0100
commit431c80f4f042bcc2d549d82b28f86c06e9b1cde6 (patch)
tree9495b456380dc2dba18f03f0468abd3e0e34f056 /src/pcm/PcmDither.hxx
parent9ac18c39a1efd2b2c8bef4c5449ef9f241cc25ed (diff)
downloadmpd-431c80f4f042bcc2d549d82b28f86c06e9b1cde6.tar.gz
mpd-431c80f4f042bcc2d549d82b28f86c06e9b1cde6.tar.xz
mpd-431c80f4f042bcc2d549d82b28f86c06e9b1cde6.zip
pcm/Dither: add API documentation
Diffstat (limited to 'src/pcm/PcmDither.hxx')
-rw-r--r--src/pcm/PcmDither.hxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/pcm/PcmDither.hxx b/src/pcm/PcmDither.hxx
index 0d81b8794..fdcdb1f6a 100644
--- a/src/pcm/PcmDither.hxx
+++ b/src/pcm/PcmDither.hxx
@@ -39,9 +39,27 @@ public:
const int32_t *src_end);
private:
+ /**
+ * Shift the given sample by #scale_bits to the right, and
+ * apply dithering.
+ *
+ * @param T the input sample type
+ * @param MIN the minimum input sample value
+ * @param MAX the maximum input sample value
+ * @param scale_bits the number of bits to be discarded
+ * @param sample the input sample value
+ */
template<typename T, T MIN, T MAX, unsigned scale_bits>
T Dither(T sample);
+ /**
+ * Convert the given sample from one sample format to another,
+ * discarding bits.
+ *
+ * @param ST the input #SampleTraits class
+ * @param ST the output #SampleTraits class
+ * @param sample the input sample value
+ */
template<typename ST, typename DT>
typename DT::value_type DitherConvert(typename ST::value_type sample);