pcm_dither: pass an "end" pointer instead of a sample count

This is easier and more efficient to loop on, because only two
variables get modified (src and dest).
This commit is contained in:
Max Kellermann
2011-10-09 12:37:32 +02:00
parent a47e9d1a4b
commit 20c6159c04
4 changed files with 16 additions and 21 deletions

View File

@@ -48,7 +48,7 @@ test_pcm_dither_24(void)
int16_t dest[N];
pcm_dither_24_to_16(&dither, dest, src, N);
pcm_dither_24_to_16(&dither, dest, src, src + N);
for (unsigned i = 0; i < N; ++i) {
g_assert_cmpint(dest[i], >=, (src[i] >> 8) - 8);
@@ -70,7 +70,7 @@ test_pcm_dither_32(void)
int16_t dest[N];
pcm_dither_32_to_16(&dither, dest, src, N);
pcm_dither_32_to_16(&dither, dest, src, src + N);
for (unsigned i = 0; i < N; ++i) {
g_assert_cmpint(dest[i], >=, (src[i] >> 16) - 8);