summaryrefslogtreecommitdiff
path: root/src/pcm/Volume.hxx
AgeCommit message (Collapse)Author
2021-01-01copyright year 2021Max Kellermann
2020-03-16fix double promotionsRosen Penev
Found with -Wdouble-promotion Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12replace assert.h with cassertRosen Penev
The former was deprecated with C++14. According to the C++11 and C++17 standards, both files are identical. Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-01-18copyright year 2020Max Kellermann
2019-07-30pcm/Volume: convert S16 to S24 to preserve quality and reduce noiseMax Kellermann
Applying software volume to S16 samples means several bits of precision are lost; at 25% volume, two bits are lost. Additionally, dithering adds some noise. The problem gets worse when you apply the software volume code twice: for the software mixer volume, and again for the replay gain. This loses some more precision and adds even more dithering noise, which can become audible (see https://github.com/MusicPlayerDaemon/MPD/issues/542). By converting everything to 24 bit, we need to shift only two bits to the right instead of ten, losing nearly no precision, and dithering is not needed. Even if the output device is unable to play S24 directly, we can convert back to S16 with only one stage of dithering. Closes https://github.com/MusicPlayerDaemon/MPD/issues/542
2019-07-05pcm/Volume: Open() returns output sample formatMax Kellermann
Prepare for a new mode which may convert to a different sample format when applying volume, to reduce dithering.
2019-07-05pcm/Volume: allow any exceptionMax Kellermann
2019-07-05pcm/Volume: calculate PCM_VOLUME_1Max Kellermann
2019-07-05pcm/Volume: fix API documentationMax Kellermann
2019-06-17pcm/Pcm*: drop more "Pcm" prefixes from source file namesMax Kellermann
2019-06-17Copyright year 2019Max Kellermann
2019-03-08AudioFormat, pcm/Dsd*: remove redundant `inline` keywords from `constexpr` ↵Max Kellermann
functions
2018-10-31*: copyright year 2018Max Kellermann
2018-01-01pcm/*: add "noexcept"Max Kellermann
2017-05-08*: add "noexcept" to many, many function prototypesMax Kellermann
This eliminates some overhead, because the compiler doesn't need to consider these functions throwing.
2017-01-17AudioFormat: move enum SampleFormat to pcm/SampleFormat.hxxMax Kellermann
2017-01-03update copyright yearMax Kellermann
2016-09-09pcm/Convert: migrate from class Error to C++ exceptionsMax Kellermann
2016-07-01pcm/Volume: remove assert() from destructorMax Kellermann
While this assert() was useful when we had to track the object's state manually, there was no practical purpose other than verifying old code, and it complicates our new C++ code.
2016-03-01*: include cleanup (using iwyu)Max Kellermann
2016-02-26update copyright year to 2016Max Kellermann
2015-01-01Copyright year 2015Max Kellermann
2014-01-13copyright year 2014Max Kellermann
2013-12-28pcm/Volume: remove unused function pcm_volume_dither()Max Kellermann
2013-12-28pcm/Volume: improved ditheringMax Kellermann
Instead of just adding a rectangular random value before shifting back to the normal scale, use the existing PcmDither library.
2013-12-23pcm/Volume: convert to classMax Kellermann
Prepare for adding state.
2013-12-23pcm/PcmVolume: rename to Volume.cxxMax Kellermann