First shot at new audio data types (int32 and float32).
Notable changes:
- Converters between types are autogenerated. Instead of making multiple
passes over the data with seperate filters for endianess, size, signedness,
etc, converting between data types is always one specialized filter. This
simplifies SDL_BuildAudioCVT(), which otherwise had a million edge cases
with the new types, and makes the actually conversions more CPU cache
friendly. Left a stub for adding specific optimized versions of these
routines (SSE/MMX/Altivec, assembler, etc)
- Autogenerated converters are built by SDL/src/audio/sdlgenaudiocvt.pl. This
does not need to be run unless tweaking the code, and thus doesn't need
integration into the build system.
- Went through all the drivers and tried to weed out all the "Uint16"
references that are better specified with the new SDL_AudioFormat typedef.
- Cleaned out a bunch of hardcoded bitwise magic numbers and replaced them
with new SDL_AUDIO_* macros.
- Added initial float32 and int32 support code. Theoretically, existing
drivers will push these through converters to get the data they want to
feed to the hardware.
Still TODO:
- Optimize and debug new converters.
- Update the CoreAudio backend to accept float32 data directly.
- Other backends, too?
- SDL_LoadWAV() needs to be updated to support int32 and float32 .wav files
(both of which exist and can be generated by 'sox' for testing purposes).
- Update the mixer to handle new datatypes.
- Optionally update SDL_sound and SDL_mixer, etc.
1 /* DO NOT EDIT THIS FILE! It is generated code. */
2 /* Please modify SDL/src/audio/sdlgenaudiocvt.pl instead. */
5 SDL - Simple DirectMedia Layer
6 Copyright (C) 1997-2006 Sam Lantinga
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include "SDL_config.h"
27 #include "SDL_audio.h"
28 #include "SDL_audio_c.h"
30 /* Now the generated code... */
32 #define DIVBY127 0.0078740157480315f
33 #define DIVBY255 0.00392156862745098f
34 #define DIVBY32767 3.05185094759972e-05f
35 #define DIVBY65535 1.52590218966964e-05f
36 #define DIVBY2147483647 4.6566128752458e-10f
39 SDL_Convert_U8_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
46 fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S8.\n");
49 src = (const Uint8 *) cvt->buf;
50 dst = (Sint8 *) cvt->buf;
51 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) {
52 const Sint8 val = ((*src) ^ 0x80);
57 if (cvt->filters[++cvt->filter_index]) {
58 cvt->filters[cvt->filter_index] (cvt, format);
63 SDL_Convert_U8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
70 fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16LSB.\n");
73 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
74 dst = (Uint16 *) (cvt->buf + cvt->len_cvt * 2);
75 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
76 const Uint16 val = (((Uint16) *src) << 8);
77 *dst = SDL_SwapLE16(val);
81 format = AUDIO_U16LSB;
82 if (cvt->filters[++cvt->filter_index]) {
83 cvt->filters[cvt->filter_index] (cvt, format);
88 SDL_Convert_U8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
95 fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16LSB.\n");
98 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
99 dst = (Sint16 *) (cvt->buf + cvt->len_cvt * 2);
100 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
101 const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8);
102 *dst = ((Sint16) SDL_SwapLE16(val));
106 format = AUDIO_S16LSB;
107 if (cvt->filters[++cvt->filter_index]) {
108 cvt->filters[cvt->filter_index] (cvt, format);
113 SDL_Convert_U8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
120 fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16MSB.\n");
123 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
124 dst = (Uint16 *) (cvt->buf + cvt->len_cvt * 2);
125 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
126 const Uint16 val = (((Uint16) *src) << 8);
127 *dst = SDL_SwapBE16(val);
131 format = AUDIO_U16MSB;
132 if (cvt->filters[++cvt->filter_index]) {
133 cvt->filters[cvt->filter_index] (cvt, format);
138 SDL_Convert_U8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
145 fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16MSB.\n");
148 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
149 dst = (Sint16 *) (cvt->buf + cvt->len_cvt * 2);
150 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
151 const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8);
152 *dst = ((Sint16) SDL_SwapBE16(val));
156 format = AUDIO_S16MSB;
157 if (cvt->filters[++cvt->filter_index]) {
158 cvt->filters[cvt->filter_index] (cvt, format);
163 SDL_Convert_U8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
170 fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32LSB.\n");
173 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
174 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 4);
175 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
176 const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24);
177 *dst = ((Sint32) SDL_SwapLE32(val));
181 format = AUDIO_S32LSB;
182 if (cvt->filters[++cvt->filter_index]) {
183 cvt->filters[cvt->filter_index] (cvt, format);
188 SDL_Convert_U8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
195 fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32MSB.\n");
198 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
199 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 4);
200 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
201 const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24);
202 *dst = ((Sint32) SDL_SwapBE32(val));
206 format = AUDIO_S32MSB;
207 if (cvt->filters[++cvt->filter_index]) {
208 cvt->filters[cvt->filter_index] (cvt, format);
213 SDL_Convert_U8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
220 fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32LSB.\n");
223 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
224 dst = (float *) (cvt->buf + cvt->len_cvt * 4);
225 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
226 const float val = (((float) *src) * DIVBY255);
227 *dst = SDL_SwapFloatLE(val);
231 format = AUDIO_F32LSB;
232 if (cvt->filters[++cvt->filter_index]) {
233 cvt->filters[cvt->filter_index] (cvt, format);
238 SDL_Convert_U8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
245 fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32MSB.\n");
248 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
249 dst = (float *) (cvt->buf + cvt->len_cvt * 4);
250 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
251 const float val = (((float) *src) * DIVBY255);
252 *dst = SDL_SwapFloatBE(val);
256 format = AUDIO_F32MSB;
257 if (cvt->filters[++cvt->filter_index]) {
258 cvt->filters[cvt->filter_index] (cvt, format);
263 SDL_Convert_S8_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
270 fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U8.\n");
273 src = (const Uint8 *) cvt->buf;
274 dst = (Uint8 *) cvt->buf;
275 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) {
276 const Uint8 val = ((((Sint8) *src)) ^ 0x80);
281 if (cvt->filters[++cvt->filter_index]) {
282 cvt->filters[cvt->filter_index] (cvt, format);
287 SDL_Convert_S8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
294 fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16LSB.\n");
297 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
298 dst = (Uint16 *) (cvt->buf + cvt->len_cvt * 2);
299 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
300 const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8);
301 *dst = SDL_SwapLE16(val);
305 format = AUDIO_U16LSB;
306 if (cvt->filters[++cvt->filter_index]) {
307 cvt->filters[cvt->filter_index] (cvt, format);
312 SDL_Convert_S8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
319 fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16LSB.\n");
322 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
323 dst = (Sint16 *) (cvt->buf + cvt->len_cvt * 2);
324 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
325 const Sint16 val = (((Sint16) ((Sint8) *src)) << 8);
326 *dst = ((Sint16) SDL_SwapLE16(val));
330 format = AUDIO_S16LSB;
331 if (cvt->filters[++cvt->filter_index]) {
332 cvt->filters[cvt->filter_index] (cvt, format);
337 SDL_Convert_S8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
344 fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16MSB.\n");
347 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
348 dst = (Uint16 *) (cvt->buf + cvt->len_cvt * 2);
349 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
350 const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8);
351 *dst = SDL_SwapBE16(val);
355 format = AUDIO_U16MSB;
356 if (cvt->filters[++cvt->filter_index]) {
357 cvt->filters[cvt->filter_index] (cvt, format);
362 SDL_Convert_S8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
369 fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16MSB.\n");
372 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
373 dst = (Sint16 *) (cvt->buf + cvt->len_cvt * 2);
374 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
375 const Sint16 val = (((Sint16) ((Sint8) *src)) << 8);
376 *dst = ((Sint16) SDL_SwapBE16(val));
380 format = AUDIO_S16MSB;
381 if (cvt->filters[++cvt->filter_index]) {
382 cvt->filters[cvt->filter_index] (cvt, format);
387 SDL_Convert_S8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
394 fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32LSB.\n");
397 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
398 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 4);
399 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
400 const Sint32 val = (((Sint32) ((Sint8) *src)) << 24);
401 *dst = ((Sint32) SDL_SwapLE32(val));
405 format = AUDIO_S32LSB;
406 if (cvt->filters[++cvt->filter_index]) {
407 cvt->filters[cvt->filter_index] (cvt, format);
412 SDL_Convert_S8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
419 fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32MSB.\n");
422 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
423 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 4);
424 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
425 const Sint32 val = (((Sint32) ((Sint8) *src)) << 24);
426 *dst = ((Sint32) SDL_SwapBE32(val));
430 format = AUDIO_S32MSB;
431 if (cvt->filters[++cvt->filter_index]) {
432 cvt->filters[cvt->filter_index] (cvt, format);
437 SDL_Convert_S8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
444 fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32LSB.\n");
447 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
448 dst = (float *) (cvt->buf + cvt->len_cvt * 4);
449 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
450 const float val = (((float) ((Sint8) *src)) * DIVBY127);
451 *dst = SDL_SwapFloatLE(val);
455 format = AUDIO_F32LSB;
456 if (cvt->filters[++cvt->filter_index]) {
457 cvt->filters[cvt->filter_index] (cvt, format);
462 SDL_Convert_S8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
469 fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32MSB.\n");
472 src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
473 dst = (float *) (cvt->buf + cvt->len_cvt * 4);
474 for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
475 const float val = (((float) ((Sint8) *src)) * DIVBY127);
476 *dst = SDL_SwapFloatBE(val);
480 format = AUDIO_F32MSB;
481 if (cvt->filters[++cvt->filter_index]) {
482 cvt->filters[cvt->filter_index] (cvt, format);
487 SDL_Convert_U16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
494 fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U8.\n");
497 src = (const Uint16 *) cvt->buf;
498 dst = (Uint8 *) cvt->buf;
499 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
500 const Uint8 val = ((Uint8) (SDL_SwapLE16(*src) >> 8));
506 if (cvt->filters[++cvt->filter_index]) {
507 cvt->filters[cvt->filter_index] (cvt, format);
512 SDL_Convert_U16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
519 fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S8.\n");
522 src = (const Uint16 *) cvt->buf;
523 dst = (Sint8 *) cvt->buf;
524 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
525 const Sint8 val = ((Sint8) (((SDL_SwapLE16(*src)) ^ 0x8000) >> 8));
526 *dst = ((Sint8) val);
531 if (cvt->filters[++cvt->filter_index]) {
532 cvt->filters[cvt->filter_index] (cvt, format);
537 SDL_Convert_U16LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
544 fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16LSB.\n");
547 src = (const Uint16 *) cvt->buf;
548 dst = (Sint16 *) cvt->buf;
549 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
550 const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000);
551 *dst = ((Sint16) SDL_SwapLE16(val));
554 format = AUDIO_S16LSB;
555 if (cvt->filters[++cvt->filter_index]) {
556 cvt->filters[cvt->filter_index] (cvt, format);
561 SDL_Convert_U16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
568 fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U16MSB.\n");
571 src = (const Uint16 *) cvt->buf;
572 dst = (Uint16 *) cvt->buf;
573 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
574 const Uint16 val = SDL_SwapLE16(*src);
575 *dst = SDL_SwapBE16(val);
578 format = AUDIO_U16MSB;
579 if (cvt->filters[++cvt->filter_index]) {
580 cvt->filters[cvt->filter_index] (cvt, format);
585 SDL_Convert_U16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
592 fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16MSB.\n");
595 src = (const Uint16 *) cvt->buf;
596 dst = (Sint16 *) cvt->buf;
597 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
598 const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000);
599 *dst = ((Sint16) SDL_SwapBE16(val));
602 format = AUDIO_S16MSB;
603 if (cvt->filters[++cvt->filter_index]) {
604 cvt->filters[cvt->filter_index] (cvt, format);
609 SDL_Convert_U16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
616 fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32LSB.\n");
619 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
620 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
621 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
622 const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16);
623 *dst = ((Sint32) SDL_SwapLE32(val));
627 format = AUDIO_S32LSB;
628 if (cvt->filters[++cvt->filter_index]) {
629 cvt->filters[cvt->filter_index] (cvt, format);
634 SDL_Convert_U16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
641 fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32MSB.\n");
644 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
645 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
646 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
647 const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16);
648 *dst = ((Sint32) SDL_SwapBE32(val));
652 format = AUDIO_S32MSB;
653 if (cvt->filters[++cvt->filter_index]) {
654 cvt->filters[cvt->filter_index] (cvt, format);
659 SDL_Convert_U16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
666 fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32LSB.\n");
669 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
670 dst = (float *) (cvt->buf + cvt->len_cvt * 2);
671 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
672 const float val = (((float) SDL_SwapLE16(*src)) * DIVBY65535);
673 *dst = SDL_SwapFloatLE(val);
677 format = AUDIO_F32LSB;
678 if (cvt->filters[++cvt->filter_index]) {
679 cvt->filters[cvt->filter_index] (cvt, format);
684 SDL_Convert_U16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
691 fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32MSB.\n");
694 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
695 dst = (float *) (cvt->buf + cvt->len_cvt * 2);
696 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
697 const float val = (((float) SDL_SwapLE16(*src)) * DIVBY65535);
698 *dst = SDL_SwapFloatBE(val);
702 format = AUDIO_F32MSB;
703 if (cvt->filters[++cvt->filter_index]) {
704 cvt->filters[cvt->filter_index] (cvt, format);
709 SDL_Convert_S16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
716 fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U8.\n");
719 src = (const Uint16 *) cvt->buf;
720 dst = (Uint8 *) cvt->buf;
721 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
722 const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000) >> 8));
728 if (cvt->filters[++cvt->filter_index]) {
729 cvt->filters[cvt->filter_index] (cvt, format);
734 SDL_Convert_S16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
741 fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S8.\n");
744 src = (const Uint16 *) cvt->buf;
745 dst = (Sint8 *) cvt->buf;
746 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
747 const Sint8 val = ((Sint8) (((Sint16) SDL_SwapLE16(*src)) >> 8));
748 *dst = ((Sint8) val);
753 if (cvt->filters[++cvt->filter_index]) {
754 cvt->filters[cvt->filter_index] (cvt, format);
759 SDL_Convert_S16LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
766 fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16LSB.\n");
769 src = (const Uint16 *) cvt->buf;
770 dst = (Uint16 *) cvt->buf;
771 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
772 const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000);
773 *dst = SDL_SwapLE16(val);
776 format = AUDIO_U16LSB;
777 if (cvt->filters[++cvt->filter_index]) {
778 cvt->filters[cvt->filter_index] (cvt, format);
783 SDL_Convert_S16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
790 fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16MSB.\n");
793 src = (const Uint16 *) cvt->buf;
794 dst = (Uint16 *) cvt->buf;
795 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
796 const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000);
797 *dst = SDL_SwapBE16(val);
800 format = AUDIO_U16MSB;
801 if (cvt->filters[++cvt->filter_index]) {
802 cvt->filters[cvt->filter_index] (cvt, format);
807 SDL_Convert_S16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
814 fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S16MSB.\n");
817 src = (const Uint16 *) cvt->buf;
818 dst = (Sint16 *) cvt->buf;
819 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
820 const Sint16 val = ((Sint16) SDL_SwapLE16(*src));
821 *dst = ((Sint16) SDL_SwapBE16(val));
824 format = AUDIO_S16MSB;
825 if (cvt->filters[++cvt->filter_index]) {
826 cvt->filters[cvt->filter_index] (cvt, format);
831 SDL_Convert_S16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
838 fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32LSB.\n");
841 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
842 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
843 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
844 const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16);
845 *dst = ((Sint32) SDL_SwapLE32(val));
849 format = AUDIO_S32LSB;
850 if (cvt->filters[++cvt->filter_index]) {
851 cvt->filters[cvt->filter_index] (cvt, format);
856 SDL_Convert_S16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
863 fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32MSB.\n");
866 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
867 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
868 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
869 const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16);
870 *dst = ((Sint32) SDL_SwapBE32(val));
874 format = AUDIO_S32MSB;
875 if (cvt->filters[++cvt->filter_index]) {
876 cvt->filters[cvt->filter_index] (cvt, format);
881 SDL_Convert_S16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
888 fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32LSB.\n");
891 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
892 dst = (float *) (cvt->buf + cvt->len_cvt * 2);
893 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
894 const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767);
895 *dst = SDL_SwapFloatLE(val);
899 format = AUDIO_F32LSB;
900 if (cvt->filters[++cvt->filter_index]) {
901 cvt->filters[cvt->filter_index] (cvt, format);
906 SDL_Convert_S16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
913 fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32MSB.\n");
916 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
917 dst = (float *) (cvt->buf + cvt->len_cvt * 2);
918 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
919 const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767);
920 *dst = SDL_SwapFloatBE(val);
924 format = AUDIO_F32MSB;
925 if (cvt->filters[++cvt->filter_index]) {
926 cvt->filters[cvt->filter_index] (cvt, format);
931 SDL_Convert_U16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
938 fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U8.\n");
941 src = (const Uint16 *) cvt->buf;
942 dst = (Uint8 *) cvt->buf;
943 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
944 const Uint8 val = ((Uint8) (SDL_SwapBE16(*src) >> 8));
950 if (cvt->filters[++cvt->filter_index]) {
951 cvt->filters[cvt->filter_index] (cvt, format);
956 SDL_Convert_U16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
963 fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S8.\n");
966 src = (const Uint16 *) cvt->buf;
967 dst = (Sint8 *) cvt->buf;
968 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
969 const Sint8 val = ((Sint8) (((SDL_SwapBE16(*src)) ^ 0x8000) >> 8));
970 *dst = ((Sint8) val);
975 if (cvt->filters[++cvt->filter_index]) {
976 cvt->filters[cvt->filter_index] (cvt, format);
981 SDL_Convert_U16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
988 fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U16LSB.\n");
991 src = (const Uint16 *) cvt->buf;
992 dst = (Uint16 *) cvt->buf;
993 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
994 const Uint16 val = SDL_SwapBE16(*src);
995 *dst = SDL_SwapLE16(val);
998 format = AUDIO_U16LSB;
999 if (cvt->filters[++cvt->filter_index]) {
1000 cvt->filters[cvt->filter_index] (cvt, format);
1005 SDL_Convert_U16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1011 #ifdef DEBUG_CONVERT
1012 fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16LSB.\n");
1015 src = (const Uint16 *) cvt->buf;
1016 dst = (Sint16 *) cvt->buf;
1017 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
1018 const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000);
1019 *dst = ((Sint16) SDL_SwapLE16(val));
1022 format = AUDIO_S16LSB;
1023 if (cvt->filters[++cvt->filter_index]) {
1024 cvt->filters[cvt->filter_index] (cvt, format);
1029 SDL_Convert_U16MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1035 #ifdef DEBUG_CONVERT
1036 fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16MSB.\n");
1039 src = (const Uint16 *) cvt->buf;
1040 dst = (Sint16 *) cvt->buf;
1041 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
1042 const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000);
1043 *dst = ((Sint16) SDL_SwapBE16(val));
1046 format = AUDIO_S16MSB;
1047 if (cvt->filters[++cvt->filter_index]) {
1048 cvt->filters[cvt->filter_index] (cvt, format);
1053 SDL_Convert_U16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1059 #ifdef DEBUG_CONVERT
1060 fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32LSB.\n");
1063 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
1064 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
1065 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
1066 const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16);
1067 *dst = ((Sint32) SDL_SwapLE32(val));
1071 format = AUDIO_S32LSB;
1072 if (cvt->filters[++cvt->filter_index]) {
1073 cvt->filters[cvt->filter_index] (cvt, format);
1078 SDL_Convert_U16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1084 #ifdef DEBUG_CONVERT
1085 fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32MSB.\n");
1088 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
1089 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
1090 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
1091 const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16);
1092 *dst = ((Sint32) SDL_SwapBE32(val));
1096 format = AUDIO_S32MSB;
1097 if (cvt->filters[++cvt->filter_index]) {
1098 cvt->filters[cvt->filter_index] (cvt, format);
1103 SDL_Convert_U16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1109 #ifdef DEBUG_CONVERT
1110 fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32LSB.\n");
1113 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
1114 dst = (float *) (cvt->buf + cvt->len_cvt * 2);
1115 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
1116 const float val = (((float) SDL_SwapBE16(*src)) * DIVBY65535);
1117 *dst = SDL_SwapFloatLE(val);
1121 format = AUDIO_F32LSB;
1122 if (cvt->filters[++cvt->filter_index]) {
1123 cvt->filters[cvt->filter_index] (cvt, format);
1128 SDL_Convert_U16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1134 #ifdef DEBUG_CONVERT
1135 fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32MSB.\n");
1138 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
1139 dst = (float *) (cvt->buf + cvt->len_cvt * 2);
1140 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
1141 const float val = (((float) SDL_SwapBE16(*src)) * DIVBY65535);
1142 *dst = SDL_SwapFloatBE(val);
1146 format = AUDIO_F32MSB;
1147 if (cvt->filters[++cvt->filter_index]) {
1148 cvt->filters[cvt->filter_index] (cvt, format);
1153 SDL_Convert_S16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1159 #ifdef DEBUG_CONVERT
1160 fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U8.\n");
1163 src = (const Uint16 *) cvt->buf;
1164 dst = (Uint8 *) cvt->buf;
1165 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
1166 const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000) >> 8));
1172 if (cvt->filters[++cvt->filter_index]) {
1173 cvt->filters[cvt->filter_index] (cvt, format);
1178 SDL_Convert_S16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1184 #ifdef DEBUG_CONVERT
1185 fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S8.\n");
1188 src = (const Uint16 *) cvt->buf;
1189 dst = (Sint8 *) cvt->buf;
1190 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
1191 const Sint8 val = ((Sint8) (((Sint16) SDL_SwapBE16(*src)) >> 8));
1192 *dst = ((Sint8) val);
1197 if (cvt->filters[++cvt->filter_index]) {
1198 cvt->filters[cvt->filter_index] (cvt, format);
1203 SDL_Convert_S16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1209 #ifdef DEBUG_CONVERT
1210 fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16LSB.\n");
1213 src = (const Uint16 *) cvt->buf;
1214 dst = (Uint16 *) cvt->buf;
1215 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
1216 const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000);
1217 *dst = SDL_SwapLE16(val);
1220 format = AUDIO_U16LSB;
1221 if (cvt->filters[++cvt->filter_index]) {
1222 cvt->filters[cvt->filter_index] (cvt, format);
1227 SDL_Convert_S16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1233 #ifdef DEBUG_CONVERT
1234 fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S16LSB.\n");
1237 src = (const Uint16 *) cvt->buf;
1238 dst = (Sint16 *) cvt->buf;
1239 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
1240 const Sint16 val = ((Sint16) SDL_SwapBE16(*src));
1241 *dst = ((Sint16) SDL_SwapLE16(val));
1244 format = AUDIO_S16LSB;
1245 if (cvt->filters[++cvt->filter_index]) {
1246 cvt->filters[cvt->filter_index] (cvt, format);
1251 SDL_Convert_S16MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1257 #ifdef DEBUG_CONVERT
1258 fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16MSB.\n");
1261 src = (const Uint16 *) cvt->buf;
1262 dst = (Uint16 *) cvt->buf;
1263 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
1264 const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000);
1265 *dst = SDL_SwapBE16(val);
1268 format = AUDIO_U16MSB;
1269 if (cvt->filters[++cvt->filter_index]) {
1270 cvt->filters[cvt->filter_index] (cvt, format);
1275 SDL_Convert_S16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1281 #ifdef DEBUG_CONVERT
1282 fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32LSB.\n");
1285 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
1286 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
1287 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
1288 const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16);
1289 *dst = ((Sint32) SDL_SwapLE32(val));
1293 format = AUDIO_S32LSB;
1294 if (cvt->filters[++cvt->filter_index]) {
1295 cvt->filters[cvt->filter_index] (cvt, format);
1300 SDL_Convert_S16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1306 #ifdef DEBUG_CONVERT
1307 fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32MSB.\n");
1310 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
1311 dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
1312 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
1313 const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16);
1314 *dst = ((Sint32) SDL_SwapBE32(val));
1318 format = AUDIO_S32MSB;
1319 if (cvt->filters[++cvt->filter_index]) {
1320 cvt->filters[cvt->filter_index] (cvt, format);
1325 SDL_Convert_S16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1331 #ifdef DEBUG_CONVERT
1332 fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32LSB.\n");
1335 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
1336 dst = (float *) (cvt->buf + cvt->len_cvt * 2);
1337 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
1338 const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767);
1339 *dst = SDL_SwapFloatLE(val);
1343 format = AUDIO_F32LSB;
1344 if (cvt->filters[++cvt->filter_index]) {
1345 cvt->filters[cvt->filter_index] (cvt, format);
1350 SDL_Convert_S16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1356 #ifdef DEBUG_CONVERT
1357 fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32MSB.\n");
1360 src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
1361 dst = (float *) (cvt->buf + cvt->len_cvt * 2);
1362 for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
1363 const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767);
1364 *dst = SDL_SwapFloatBE(val);
1368 format = AUDIO_F32MSB;
1369 if (cvt->filters[++cvt->filter_index]) {
1370 cvt->filters[cvt->filter_index] (cvt, format);
1375 SDL_Convert_S32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1381 #ifdef DEBUG_CONVERT
1382 fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U8.\n");
1385 src = (const Uint32 *) cvt->buf;
1386 dst = (Uint8 *) cvt->buf;
1387 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1388 const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 24));
1394 if (cvt->filters[++cvt->filter_index]) {
1395 cvt->filters[cvt->filter_index] (cvt, format);
1400 SDL_Convert_S32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1406 #ifdef DEBUG_CONVERT
1407 fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S8.\n");
1410 src = (const Uint32 *) cvt->buf;
1411 dst = (Sint8 *) cvt->buf;
1412 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1413 const Sint8 val = ((Sint8) (((Sint32) SDL_SwapLE32(*src)) >> 24));
1414 *dst = ((Sint8) val);
1419 if (cvt->filters[++cvt->filter_index]) {
1420 cvt->filters[cvt->filter_index] (cvt, format);
1425 SDL_Convert_S32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1431 #ifdef DEBUG_CONVERT
1432 fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16LSB.\n");
1435 src = (const Uint32 *) cvt->buf;
1436 dst = (Uint16 *) cvt->buf;
1437 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1438 const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16));
1439 *dst = SDL_SwapLE16(val);
1443 format = AUDIO_U16LSB;
1444 if (cvt->filters[++cvt->filter_index]) {
1445 cvt->filters[cvt->filter_index] (cvt, format);
1450 SDL_Convert_S32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1456 #ifdef DEBUG_CONVERT
1457 fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16LSB.\n");
1460 src = (const Uint32 *) cvt->buf;
1461 dst = (Sint16 *) cvt->buf;
1462 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1463 const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16));
1464 *dst = ((Sint16) SDL_SwapLE16(val));
1468 format = AUDIO_S16LSB;
1469 if (cvt->filters[++cvt->filter_index]) {
1470 cvt->filters[cvt->filter_index] (cvt, format);
1475 SDL_Convert_S32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1481 #ifdef DEBUG_CONVERT
1482 fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16MSB.\n");
1485 src = (const Uint32 *) cvt->buf;
1486 dst = (Uint16 *) cvt->buf;
1487 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1488 const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16));
1489 *dst = SDL_SwapBE16(val);
1493 format = AUDIO_U16MSB;
1494 if (cvt->filters[++cvt->filter_index]) {
1495 cvt->filters[cvt->filter_index] (cvt, format);
1500 SDL_Convert_S32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1506 #ifdef DEBUG_CONVERT
1507 fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16MSB.\n");
1510 src = (const Uint32 *) cvt->buf;
1511 dst = (Sint16 *) cvt->buf;
1512 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1513 const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16));
1514 *dst = ((Sint16) SDL_SwapBE16(val));
1518 format = AUDIO_S16MSB;
1519 if (cvt->filters[++cvt->filter_index]) {
1520 cvt->filters[cvt->filter_index] (cvt, format);
1525 SDL_Convert_S32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1531 #ifdef DEBUG_CONVERT
1532 fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S32MSB.\n");
1535 src = (const Uint32 *) cvt->buf;
1536 dst = (Sint32 *) cvt->buf;
1537 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1538 const Sint32 val = ((Sint32) SDL_SwapLE32(*src));
1539 *dst = ((Sint32) SDL_SwapBE32(val));
1542 format = AUDIO_S32MSB;
1543 if (cvt->filters[++cvt->filter_index]) {
1544 cvt->filters[cvt->filter_index] (cvt, format);
1549 SDL_Convert_S32LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1555 #ifdef DEBUG_CONVERT
1556 fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32LSB.\n");
1559 src = (const Uint32 *) cvt->buf;
1560 dst = (float *) cvt->buf;
1561 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1562 const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647);
1563 *dst = SDL_SwapFloatLE(val);
1566 format = AUDIO_F32LSB;
1567 if (cvt->filters[++cvt->filter_index]) {
1568 cvt->filters[cvt->filter_index] (cvt, format);
1573 SDL_Convert_S32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1579 #ifdef DEBUG_CONVERT
1580 fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32MSB.\n");
1583 src = (const Uint32 *) cvt->buf;
1584 dst = (float *) cvt->buf;
1585 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1586 const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647);
1587 *dst = SDL_SwapFloatBE(val);
1590 format = AUDIO_F32MSB;
1591 if (cvt->filters[++cvt->filter_index]) {
1592 cvt->filters[cvt->filter_index] (cvt, format);
1597 SDL_Convert_S32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1603 #ifdef DEBUG_CONVERT
1604 fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U8.\n");
1607 src = (const Uint32 *) cvt->buf;
1608 dst = (Uint8 *) cvt->buf;
1609 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1610 const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 24));
1616 if (cvt->filters[++cvt->filter_index]) {
1617 cvt->filters[cvt->filter_index] (cvt, format);
1622 SDL_Convert_S32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1628 #ifdef DEBUG_CONVERT
1629 fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S8.\n");
1632 src = (const Uint32 *) cvt->buf;
1633 dst = (Sint8 *) cvt->buf;
1634 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1635 const Sint8 val = ((Sint8) (((Sint32) SDL_SwapBE32(*src)) >> 24));
1636 *dst = ((Sint8) val);
1641 if (cvt->filters[++cvt->filter_index]) {
1642 cvt->filters[cvt->filter_index] (cvt, format);
1647 SDL_Convert_S32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1653 #ifdef DEBUG_CONVERT
1654 fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16LSB.\n");
1657 src = (const Uint32 *) cvt->buf;
1658 dst = (Uint16 *) cvt->buf;
1659 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1660 const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16));
1661 *dst = SDL_SwapLE16(val);
1665 format = AUDIO_U16LSB;
1666 if (cvt->filters[++cvt->filter_index]) {
1667 cvt->filters[cvt->filter_index] (cvt, format);
1672 SDL_Convert_S32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1678 #ifdef DEBUG_CONVERT
1679 fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16LSB.\n");
1682 src = (const Uint32 *) cvt->buf;
1683 dst = (Sint16 *) cvt->buf;
1684 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1685 const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16));
1686 *dst = ((Sint16) SDL_SwapLE16(val));
1690 format = AUDIO_S16LSB;
1691 if (cvt->filters[++cvt->filter_index]) {
1692 cvt->filters[cvt->filter_index] (cvt, format);
1697 SDL_Convert_S32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1703 #ifdef DEBUG_CONVERT
1704 fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16MSB.\n");
1707 src = (const Uint32 *) cvt->buf;
1708 dst = (Uint16 *) cvt->buf;
1709 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1710 const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16));
1711 *dst = SDL_SwapBE16(val);
1715 format = AUDIO_U16MSB;
1716 if (cvt->filters[++cvt->filter_index]) {
1717 cvt->filters[cvt->filter_index] (cvt, format);
1722 SDL_Convert_S32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1728 #ifdef DEBUG_CONVERT
1729 fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16MSB.\n");
1732 src = (const Uint32 *) cvt->buf;
1733 dst = (Sint16 *) cvt->buf;
1734 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1735 const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16));
1736 *dst = ((Sint16) SDL_SwapBE16(val));
1740 format = AUDIO_S16MSB;
1741 if (cvt->filters[++cvt->filter_index]) {
1742 cvt->filters[cvt->filter_index] (cvt, format);
1747 SDL_Convert_S32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1753 #ifdef DEBUG_CONVERT
1754 fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S32LSB.\n");
1757 src = (const Uint32 *) cvt->buf;
1758 dst = (Sint32 *) cvt->buf;
1759 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1760 const Sint32 val = ((Sint32) SDL_SwapBE32(*src));
1761 *dst = ((Sint32) SDL_SwapLE32(val));
1764 format = AUDIO_S32LSB;
1765 if (cvt->filters[++cvt->filter_index]) {
1766 cvt->filters[cvt->filter_index] (cvt, format);
1771 SDL_Convert_S32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1777 #ifdef DEBUG_CONVERT
1778 fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32LSB.\n");
1781 src = (const Uint32 *) cvt->buf;
1782 dst = (float *) cvt->buf;
1783 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1784 const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647);
1785 *dst = SDL_SwapFloatLE(val);
1788 format = AUDIO_F32LSB;
1789 if (cvt->filters[++cvt->filter_index]) {
1790 cvt->filters[cvt->filter_index] (cvt, format);
1795 SDL_Convert_S32MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1801 #ifdef DEBUG_CONVERT
1802 fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32MSB.\n");
1805 src = (const Uint32 *) cvt->buf;
1806 dst = (float *) cvt->buf;
1807 for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
1808 const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647);
1809 *dst = SDL_SwapFloatBE(val);
1812 format = AUDIO_F32MSB;
1813 if (cvt->filters[++cvt->filter_index]) {
1814 cvt->filters[cvt->filter_index] (cvt, format);
1819 SDL_Convert_F32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1825 #ifdef DEBUG_CONVERT
1826 fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U8.\n");
1829 src = (const float *) cvt->buf;
1830 dst = (Uint8 *) cvt->buf;
1831 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
1832 const Uint8 val = ((Uint8) (SDL_SwapFloatLE(*src) * 255.0f));
1838 if (cvt->filters[++cvt->filter_index]) {
1839 cvt->filters[cvt->filter_index] (cvt, format);
1844 SDL_Convert_F32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1850 #ifdef DEBUG_CONVERT
1851 fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S8.\n");
1854 src = (const float *) cvt->buf;
1855 dst = (Sint8 *) cvt->buf;
1856 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
1857 const Sint8 val = ((Sint8) (SDL_SwapFloatLE(*src) * 127.0f));
1858 *dst = ((Sint8) val);
1863 if (cvt->filters[++cvt->filter_index]) {
1864 cvt->filters[cvt->filter_index] (cvt, format);
1869 SDL_Convert_F32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1875 #ifdef DEBUG_CONVERT
1876 fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16LSB.\n");
1879 src = (const float *) cvt->buf;
1880 dst = (Uint16 *) cvt->buf;
1881 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
1882 const Uint16 val = ((Uint16) (SDL_SwapFloatLE(*src) * 65535.0f));
1883 *dst = SDL_SwapLE16(val);
1887 format = AUDIO_U16LSB;
1888 if (cvt->filters[++cvt->filter_index]) {
1889 cvt->filters[cvt->filter_index] (cvt, format);
1894 SDL_Convert_F32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1900 #ifdef DEBUG_CONVERT
1901 fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16LSB.\n");
1904 src = (const float *) cvt->buf;
1905 dst = (Sint16 *) cvt->buf;
1906 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
1907 const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f));
1908 *dst = ((Sint16) SDL_SwapLE16(val));
1912 format = AUDIO_S16LSB;
1913 if (cvt->filters[++cvt->filter_index]) {
1914 cvt->filters[cvt->filter_index] (cvt, format);
1919 SDL_Convert_F32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1925 #ifdef DEBUG_CONVERT
1926 fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16MSB.\n");
1929 src = (const float *) cvt->buf;
1930 dst = (Uint16 *) cvt->buf;
1931 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
1932 const Uint16 val = ((Uint16) (SDL_SwapFloatLE(*src) * 65535.0f));
1933 *dst = SDL_SwapBE16(val);
1937 format = AUDIO_U16MSB;
1938 if (cvt->filters[++cvt->filter_index]) {
1939 cvt->filters[cvt->filter_index] (cvt, format);
1944 SDL_Convert_F32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1950 #ifdef DEBUG_CONVERT
1951 fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16MSB.\n");
1954 src = (const float *) cvt->buf;
1955 dst = (Sint16 *) cvt->buf;
1956 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
1957 const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f));
1958 *dst = ((Sint16) SDL_SwapBE16(val));
1962 format = AUDIO_S16MSB;
1963 if (cvt->filters[++cvt->filter_index]) {
1964 cvt->filters[cvt->filter_index] (cvt, format);
1969 SDL_Convert_F32LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1975 #ifdef DEBUG_CONVERT
1976 fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32LSB.\n");
1979 src = (const float *) cvt->buf;
1980 dst = (Sint32 *) cvt->buf;
1981 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
1982 const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0));
1983 *dst = ((Sint32) SDL_SwapLE32(val));
1986 format = AUDIO_S32LSB;
1987 if (cvt->filters[++cvt->filter_index]) {
1988 cvt->filters[cvt->filter_index] (cvt, format);
1993 SDL_Convert_F32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
1999 #ifdef DEBUG_CONVERT
2000 fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32MSB.\n");
2003 src = (const float *) cvt->buf;
2004 dst = (Sint32 *) cvt->buf;
2005 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2006 const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0));
2007 *dst = ((Sint32) SDL_SwapBE32(val));
2010 format = AUDIO_S32MSB;
2011 if (cvt->filters[++cvt->filter_index]) {
2012 cvt->filters[cvt->filter_index] (cvt, format);
2017 SDL_Convert_F32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
2023 #ifdef DEBUG_CONVERT
2024 fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_F32MSB.\n");
2027 src = (const float *) cvt->buf;
2028 dst = (float *) cvt->buf;
2029 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2030 const float val = SDL_SwapFloatLE(*src);
2031 *dst = SDL_SwapFloatBE(val);
2034 format = AUDIO_F32MSB;
2035 if (cvt->filters[++cvt->filter_index]) {
2036 cvt->filters[cvt->filter_index] (cvt, format);
2041 SDL_Convert_F32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
2047 #ifdef DEBUG_CONVERT
2048 fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U8.\n");
2051 src = (const float *) cvt->buf;
2052 dst = (Uint8 *) cvt->buf;
2053 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2054 const Uint8 val = ((Uint8) (SDL_SwapFloatBE(*src) * 255.0f));
2060 if (cvt->filters[++cvt->filter_index]) {
2061 cvt->filters[cvt->filter_index] (cvt, format);
2066 SDL_Convert_F32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
2072 #ifdef DEBUG_CONVERT
2073 fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S8.\n");
2076 src = (const float *) cvt->buf;
2077 dst = (Sint8 *) cvt->buf;
2078 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2079 const Sint8 val = ((Sint8) (SDL_SwapFloatBE(*src) * 127.0f));
2080 *dst = ((Sint8) val);
2085 if (cvt->filters[++cvt->filter_index]) {
2086 cvt->filters[cvt->filter_index] (cvt, format);
2091 SDL_Convert_F32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
2097 #ifdef DEBUG_CONVERT
2098 fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16LSB.\n");
2101 src = (const float *) cvt->buf;
2102 dst = (Uint16 *) cvt->buf;
2103 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2104 const Uint16 val = ((Uint16) (SDL_SwapFloatBE(*src) * 65535.0f));
2105 *dst = SDL_SwapLE16(val);
2109 format = AUDIO_U16LSB;
2110 if (cvt->filters[++cvt->filter_index]) {
2111 cvt->filters[cvt->filter_index] (cvt, format);
2116 SDL_Convert_F32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
2122 #ifdef DEBUG_CONVERT
2123 fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16LSB.\n");
2126 src = (const float *) cvt->buf;
2127 dst = (Sint16 *) cvt->buf;
2128 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2129 const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f));
2130 *dst = ((Sint16) SDL_SwapLE16(val));
2134 format = AUDIO_S16LSB;
2135 if (cvt->filters[++cvt->filter_index]) {
2136 cvt->filters[cvt->filter_index] (cvt, format);
2141 SDL_Convert_F32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
2147 #ifdef DEBUG_CONVERT
2148 fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16MSB.\n");
2151 src = (const float *) cvt->buf;
2152 dst = (Uint16 *) cvt->buf;
2153 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2154 const Uint16 val = ((Uint16) (SDL_SwapFloatBE(*src) * 65535.0f));
2155 *dst = SDL_SwapBE16(val);
2159 format = AUDIO_U16MSB;
2160 if (cvt->filters[++cvt->filter_index]) {
2161 cvt->filters[cvt->filter_index] (cvt, format);
2166 SDL_Convert_F32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
2172 #ifdef DEBUG_CONVERT
2173 fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16MSB.\n");
2176 src = (const float *) cvt->buf;
2177 dst = (Sint16 *) cvt->buf;
2178 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2179 const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f));
2180 *dst = ((Sint16) SDL_SwapBE16(val));
2184 format = AUDIO_S16MSB;
2185 if (cvt->filters[++cvt->filter_index]) {
2186 cvt->filters[cvt->filter_index] (cvt, format);
2191 SDL_Convert_F32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
2197 #ifdef DEBUG_CONVERT
2198 fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32LSB.\n");
2201 src = (const float *) cvt->buf;
2202 dst = (Sint32 *) cvt->buf;
2203 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2204 const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0));
2205 *dst = ((Sint32) SDL_SwapLE32(val));
2208 format = AUDIO_S32LSB;
2209 if (cvt->filters[++cvt->filter_index]) {
2210 cvt->filters[cvt->filter_index] (cvt, format);
2215 SDL_Convert_F32MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
2221 #ifdef DEBUG_CONVERT
2222 fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32MSB.\n");
2225 src = (const float *) cvt->buf;
2226 dst = (Sint32 *) cvt->buf;
2227 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2228 const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0));
2229 *dst = ((Sint32) SDL_SwapBE32(val));
2232 format = AUDIO_S32MSB;
2233 if (cvt->filters[++cvt->filter_index]) {
2234 cvt->filters[cvt->filter_index] (cvt, format);
2239 SDL_Convert_F32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
2245 #ifdef DEBUG_CONVERT
2246 fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_F32LSB.\n");
2249 src = (const float *) cvt->buf;
2250 dst = (float *) cvt->buf;
2251 for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
2252 const float val = SDL_SwapFloatBE(*src);
2253 *dst = SDL_SwapFloatLE(val);
2256 format = AUDIO_F32LSB;
2257 if (cvt->filters[++cvt->filter_index]) {
2258 cvt->filters[cvt->filter_index] (cvt, format);
2262 const SDL_AudioTypeFilters sdl_audio_type_filters[] =
2264 { AUDIO_U8, AUDIO_S8, SDL_Convert_U8_to_S8 },
2265 { AUDIO_U8, AUDIO_U16LSB, SDL_Convert_U8_to_U16LSB },
2266 { AUDIO_U8, AUDIO_S16LSB, SDL_Convert_U8_to_S16LSB },
2267 { AUDIO_U8, AUDIO_U16MSB, SDL_Convert_U8_to_U16MSB },
2268 { AUDIO_U8, AUDIO_S16MSB, SDL_Convert_U8_to_S16MSB },
2269 { AUDIO_U8, AUDIO_S32LSB, SDL_Convert_U8_to_S32LSB },
2270 { AUDIO_U8, AUDIO_S32MSB, SDL_Convert_U8_to_S32MSB },
2271 { AUDIO_U8, AUDIO_F32LSB, SDL_Convert_U8_to_F32LSB },
2272 { AUDIO_U8, AUDIO_F32MSB, SDL_Convert_U8_to_F32MSB },
2273 { AUDIO_S8, AUDIO_U8, SDL_Convert_S8_to_U8 },
2274 { AUDIO_S8, AUDIO_U16LSB, SDL_Convert_S8_to_U16LSB },
2275 { AUDIO_S8, AUDIO_S16LSB, SDL_Convert_S8_to_S16LSB },
2276 { AUDIO_S8, AUDIO_U16MSB, SDL_Convert_S8_to_U16MSB },
2277 { AUDIO_S8, AUDIO_S16MSB, SDL_Convert_S8_to_S16MSB },
2278 { AUDIO_S8, AUDIO_S32LSB, SDL_Convert_S8_to_S32LSB },
2279 { AUDIO_S8, AUDIO_S32MSB, SDL_Convert_S8_to_S32MSB },
2280 { AUDIO_S8, AUDIO_F32LSB, SDL_Convert_S8_to_F32LSB },
2281 { AUDIO_S8, AUDIO_F32MSB, SDL_Convert_S8_to_F32MSB },
2282 { AUDIO_U16LSB, AUDIO_U8, SDL_Convert_U16LSB_to_U8 },
2283 { AUDIO_U16LSB, AUDIO_S8, SDL_Convert_U16LSB_to_S8 },
2284 { AUDIO_U16LSB, AUDIO_S16LSB, SDL_Convert_U16LSB_to_S16LSB },
2285 { AUDIO_U16LSB, AUDIO_U16MSB, SDL_Convert_U16LSB_to_U16MSB },
2286 { AUDIO_U16LSB, AUDIO_S16MSB, SDL_Convert_U16LSB_to_S16MSB },
2287 { AUDIO_U16LSB, AUDIO_S32LSB, SDL_Convert_U16LSB_to_S32LSB },
2288 { AUDIO_U16LSB, AUDIO_S32MSB, SDL_Convert_U16LSB_to_S32MSB },
2289 { AUDIO_U16LSB, AUDIO_F32LSB, SDL_Convert_U16LSB_to_F32LSB },
2290 { AUDIO_U16LSB, AUDIO_F32MSB, SDL_Convert_U16LSB_to_F32MSB },
2291 { AUDIO_S16LSB, AUDIO_U8, SDL_Convert_S16LSB_to_U8 },
2292 { AUDIO_S16LSB, AUDIO_S8, SDL_Convert_S16LSB_to_S8 },
2293 { AUDIO_S16LSB, AUDIO_U16LSB, SDL_Convert_S16LSB_to_U16LSB },
2294 { AUDIO_S16LSB, AUDIO_U16MSB, SDL_Convert_S16LSB_to_U16MSB },
2295 { AUDIO_S16LSB, AUDIO_S16MSB, SDL_Convert_S16LSB_to_S16MSB },
2296 { AUDIO_S16LSB, AUDIO_S32LSB, SDL_Convert_S16LSB_to_S32LSB },
2297 { AUDIO_S16LSB, AUDIO_S32MSB, SDL_Convert_S16LSB_to_S32MSB },
2298 { AUDIO_S16LSB, AUDIO_F32LSB, SDL_Convert_S16LSB_to_F32LSB },
2299 { AUDIO_S16LSB, AUDIO_F32MSB, SDL_Convert_S16LSB_to_F32MSB },
2300 { AUDIO_U16MSB, AUDIO_U8, SDL_Convert_U16MSB_to_U8 },
2301 { AUDIO_U16MSB, AUDIO_S8, SDL_Convert_U16MSB_to_S8 },
2302 { AUDIO_U16MSB, AUDIO_U16LSB, SDL_Convert_U16MSB_to_U16LSB },
2303 { AUDIO_U16MSB, AUDIO_S16LSB, SDL_Convert_U16MSB_to_S16LSB },
2304 { AUDIO_U16MSB, AUDIO_S16MSB, SDL_Convert_U16MSB_to_S16MSB },
2305 { AUDIO_U16MSB, AUDIO_S32LSB, SDL_Convert_U16MSB_to_S32LSB },
2306 { AUDIO_U16MSB, AUDIO_S32MSB, SDL_Convert_U16MSB_to_S32MSB },
2307 { AUDIO_U16MSB, AUDIO_F32LSB, SDL_Convert_U16MSB_to_F32LSB },
2308 { AUDIO_U16MSB, AUDIO_F32MSB, SDL_Convert_U16MSB_to_F32MSB },
2309 { AUDIO_S16MSB, AUDIO_U8, SDL_Convert_S16MSB_to_U8 },
2310 { AUDIO_S16MSB, AUDIO_S8, SDL_Convert_S16MSB_to_S8 },
2311 { AUDIO_S16MSB, AUDIO_U16LSB, SDL_Convert_S16MSB_to_U16LSB },
2312 { AUDIO_S16MSB, AUDIO_S16LSB, SDL_Convert_S16MSB_to_S16LSB },
2313 { AUDIO_S16MSB, AUDIO_U16MSB, SDL_Convert_S16MSB_to_U16MSB },
2314 { AUDIO_S16MSB, AUDIO_S32LSB, SDL_Convert_S16MSB_to_S32LSB },
2315 { AUDIO_S16MSB, AUDIO_S32MSB, SDL_Convert_S16MSB_to_S32MSB },
2316 { AUDIO_S16MSB, AUDIO_F32LSB, SDL_Convert_S16MSB_to_F32LSB },
2317 { AUDIO_S16MSB, AUDIO_F32MSB, SDL_Convert_S16MSB_to_F32MSB },
2318 { AUDIO_S32LSB, AUDIO_U8, SDL_Convert_S32LSB_to_U8 },
2319 { AUDIO_S32LSB, AUDIO_S8, SDL_Convert_S32LSB_to_S8 },
2320 { AUDIO_S32LSB, AUDIO_U16LSB, SDL_Convert_S32LSB_to_U16LSB },
2321 { AUDIO_S32LSB, AUDIO_S16LSB, SDL_Convert_S32LSB_to_S16LSB },
2322 { AUDIO_S32LSB, AUDIO_U16MSB, SDL_Convert_S32LSB_to_U16MSB },
2323 { AUDIO_S32LSB, AUDIO_S16MSB, SDL_Convert_S32LSB_to_S16MSB },
2324 { AUDIO_S32LSB, AUDIO_S32MSB, SDL_Convert_S32LSB_to_S32MSB },
2325 { AUDIO_S32LSB, AUDIO_F32LSB, SDL_Convert_S32LSB_to_F32LSB },
2326 { AUDIO_S32LSB, AUDIO_F32MSB, SDL_Convert_S32LSB_to_F32MSB },
2327 { AUDIO_S32MSB, AUDIO_U8, SDL_Convert_S32MSB_to_U8 },
2328 { AUDIO_S32MSB, AUDIO_S8, SDL_Convert_S32MSB_to_S8 },
2329 { AUDIO_S32MSB, AUDIO_U16LSB, SDL_Convert_S32MSB_to_U16LSB },
2330 { AUDIO_S32MSB, AUDIO_S16LSB, SDL_Convert_S32MSB_to_S16LSB },
2331 { AUDIO_S32MSB, AUDIO_U16MSB, SDL_Convert_S32MSB_to_U16MSB },
2332 { AUDIO_S32MSB, AUDIO_S16MSB, SDL_Convert_S32MSB_to_S16MSB },
2333 { AUDIO_S32MSB, AUDIO_S32LSB, SDL_Convert_S32MSB_to_S32LSB },
2334 { AUDIO_S32MSB, AUDIO_F32LSB, SDL_Convert_S32MSB_to_F32LSB },
2335 { AUDIO_S32MSB, AUDIO_F32MSB, SDL_Convert_S32MSB_to_F32MSB },
2336 { AUDIO_F32LSB, AUDIO_U8, SDL_Convert_F32LSB_to_U8 },
2337 { AUDIO_F32LSB, AUDIO_S8, SDL_Convert_F32LSB_to_S8 },
2338 { AUDIO_F32LSB, AUDIO_U16LSB, SDL_Convert_F32LSB_to_U16LSB },
2339 { AUDIO_F32LSB, AUDIO_S16LSB, SDL_Convert_F32LSB_to_S16LSB },
2340 { AUDIO_F32LSB, AUDIO_U16MSB, SDL_Convert_F32LSB_to_U16MSB },
2341 { AUDIO_F32LSB, AUDIO_S16MSB, SDL_Convert_F32LSB_to_S16MSB },
2342 { AUDIO_F32LSB, AUDIO_S32LSB, SDL_Convert_F32LSB_to_S32LSB },
2343 { AUDIO_F32LSB, AUDIO_S32MSB, SDL_Convert_F32LSB_to_S32MSB },
2344 { AUDIO_F32LSB, AUDIO_F32MSB, SDL_Convert_F32LSB_to_F32MSB },
2345 { AUDIO_F32MSB, AUDIO_U8, SDL_Convert_F32MSB_to_U8 },
2346 { AUDIO_F32MSB, AUDIO_S8, SDL_Convert_F32MSB_to_S8 },
2347 { AUDIO_F32MSB, AUDIO_U16LSB, SDL_Convert_F32MSB_to_U16LSB },
2348 { AUDIO_F32MSB, AUDIO_S16LSB, SDL_Convert_F32MSB_to_S16LSB },
2349 { AUDIO_F32MSB, AUDIO_U16MSB, SDL_Convert_F32MSB_to_U16MSB },
2350 { AUDIO_F32MSB, AUDIO_S16MSB, SDL_Convert_F32MSB_to_S16MSB },
2351 { AUDIO_F32MSB, AUDIO_S32LSB, SDL_Convert_F32MSB_to_S32LSB },
2352 { AUDIO_F32MSB, AUDIO_S32MSB, SDL_Convert_F32MSB_to_S32MSB },
2353 { AUDIO_F32MSB, AUDIO_F32LSB, SDL_Convert_F32MSB_to_F32LSB },