From: Richard Kettlewell Date: Thu, 19 Nov 2009 20:13:32 +0000 (+0000) Subject: More resampler tests X-Git-Tag: 5.0~56^2~7 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/7b2c00b2255d19cd92f2f90a97a28e642d833390 More resampler tests --- diff --git a/libtests/t-resample.c b/libtests/t-resample.c index 1dbdf8b..14e2319 100644 --- a/libtests/t-resample.c +++ b/libtests/t-resample.c @@ -52,10 +52,22 @@ static const uint8_t simple_bytes_u[] = { 0, 127, 128, 255, }; +static const uint8_t simple_bytes_u2[] = { + 0, 0, 127, 127, 128, 128, 255, 255, +}; + static const uint8_t simple_bytes_s[] = { -128, -1, 0, 127, }; +static const uint8_t simple_words_u_le[] = { + 0, 1, 0, 255, 1, 0, 1, 255 +}; + +static const uint8_t simple_words_u_be[] = { + 1, 0, 255, 0, 0, 1, 255, 1 +}; + static const struct { const char *description; int input_bits; @@ -84,6 +96,16 @@ static const struct { 8, 1, 8000, 0, ENDIAN_LITTLE, simple_bytes_u, 4, 8, 1, 8000, 1, ENDIAN_LITTLE, simple_bytes_s, 4 }, + { + "mono to stereo", + 8, 1, 8000, 0, ENDIAN_LITTLE, simple_bytes_u, 4, + 8, 2, 8000, 0, ENDIAN_LITTLE, simple_bytes_u2, 8 + }, + { + "endian flip", + 16, 1, 8000, 0, ENDIAN_LITTLE, simple_words_u_le, 8, + 16, 1, 8000, 0, ENDIAN_BIG, simple_words_u_be, 8, + }, #if HAVE_SAMPLERATE_H /* Conversions that do change the sample rate */