aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_pcm_volume.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-12-22 17:39:26 +0100
committerMax Kellermann <max@duempel.org>2013-12-28 18:30:24 +0100
commitafcf0795c44260f54e74ec854297de439e7562c3 (patch)
treef4ec95c5d889d81ec840f83f105a03625f663cb6 /test/test_pcm_volume.cxx
parent394e2815dbaf0edb8d0f34b6ceab96b58f071ea8 (diff)
downloadmpd-afcf0795c44260f54e74ec854297de439e7562c3.tar.gz
mpd-afcf0795c44260f54e74ec854297de439e7562c3.tar.xz
mpd-afcf0795c44260f54e74ec854297de439e7562c3.zip
pcm/Volume: improved dithering
Instead of just adding a rectangular random value before shifting back to the normal scale, use the existing PcmDither library.
Diffstat (limited to 'test/test_pcm_volume.cxx')
-rw-r--r--test/test_pcm_volume.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/test_pcm_volume.cxx b/test/test_pcm_volume.cxx
index bba5d3bbf..c3a261f7a 100644
--- a/test/test_pcm_volume.cxx
+++ b/test/test_pcm_volume.cxx
@@ -60,8 +60,9 @@ TestVolume(G g=G())
const auto _dest = ConstBuffer<value_type>::FromVoid(dest);
for (unsigned i = 0; i < N; ++i) {
- CPPUNIT_ASSERT(_dest.data[i] >= (_src[i] - 1) / 2);
- CPPUNIT_ASSERT(_dest.data[i] <= _src[i] / 2 + 1);
+ const auto expected = (_src[i] + 1) / 2;
+ CPPUNIT_ASSERT(_dest.data[i] >= expected - 4);
+ CPPUNIT_ASSERT(_dest.data[i] <= expected + 4);
}
pv.Close();