src/audio/SDL_audiotypecvt.c
author Ryan C. Gordon <icculus@icculus.org>
Fri, 02 Jan 2009 07:34:01 +0000
changeset 2955 2692999d5271
parent 2859 99210400e8b9
child 2956 1210d5a28e16
permissions -rw-r--r--
Avoid unnecessary assignment in generated audio type converters.
     1 /* DO NOT EDIT!  This file is generated by sdlgenaudiocvt.pl */
     2 /*
     3     SDL - Simple DirectMedia Layer
     4     Copyright (C) 1997-2009 Sam Lantinga
     5 
     6     This library is free software; you can redistribute it and/or
     7     modify it under the terms of the GNU Lesser General Public
     8     License as published by the Free Software Foundation; either
     9     version 2.1 of the License, or (at your option) any later version.
    10 
    11     This library is distributed in the hope that it will be useful,
    12     but WITHOUT ANY WARRANTY; without even the implied warranty of
    13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    14     Lesser General Public License for more details.
    15 
    16     You should have received a copy of the GNU Lesser General Public
    17     License along with this library; if not, write to the Free Software
    18     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    19 
    20     Sam Lantinga
    21     slouken@libsdl.org
    22 */
    23 
    24 #include "SDL_config.h"
    25 #include "SDL_audio.h"
    26 #include "SDL_audio_c.h"
    27 
    28 /* *INDENT-OFF* */
    29 
    30 #define DIVBY127 0.0078740157480315f
    31 #define DIVBY32767 3.05185094759972e-05f
    32 #define DIVBY2147483647 4.6566128752458e-10f
    33 
    34 static void SDLCALL
    35 SDL_Convert_U8_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
    36 {
    37     int i;
    38     const Uint8 *src;
    39     Sint8 *dst;
    40 
    41 #ifdef DEBUG_CONVERT
    42     fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S8.\n");
    43 #endif
    44 
    45     src = (const Uint8 *) cvt->buf;
    46     dst = (Sint8 *) cvt->buf;
    47     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) {
    48         const Sint8 val = ((*src) ^ 0x80);
    49         *dst = ((Sint8) val);
    50     }
    51 
    52     if (cvt->filters[++cvt->filter_index]) {
    53         cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
    54     }
    55 }
    56 
    57 static void SDLCALL
    58 SDL_Convert_U8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
    59 {
    60     int i;
    61     const Uint8 *src;
    62     Uint16 *dst;
    63 
    64 #ifdef DEBUG_CONVERT
    65     fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16LSB.\n");
    66 #endif
    67 
    68     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
    69     dst = (Uint16 *) (cvt->buf + cvt->len_cvt * 2);
    70     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
    71         const Uint16 val = (((Uint16) *src) << 8);
    72         *dst = SDL_SwapLE16(val);
    73     }
    74 
    75     cvt->len_cvt *= 2;
    76     if (cvt->filters[++cvt->filter_index]) {
    77         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
    78     }
    79 }
    80 
    81 static void SDLCALL
    82 SDL_Convert_U8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
    83 {
    84     int i;
    85     const Uint8 *src;
    86     Sint16 *dst;
    87 
    88 #ifdef DEBUG_CONVERT
    89     fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16LSB.\n");
    90 #endif
    91 
    92     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
    93     dst = (Sint16 *) (cvt->buf + cvt->len_cvt * 2);
    94     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
    95         const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8);
    96         *dst = ((Sint16) SDL_SwapLE16(val));
    97     }
    98 
    99     cvt->len_cvt *= 2;
   100     if (cvt->filters[++cvt->filter_index]) {
   101         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
   102     }
   103 }
   104 
   105 static void SDLCALL
   106 SDL_Convert_U8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   107 {
   108     int i;
   109     const Uint8 *src;
   110     Uint16 *dst;
   111 
   112 #ifdef DEBUG_CONVERT
   113     fprintf(stderr, "Converting AUDIO_U8 to AUDIO_U16MSB.\n");
   114 #endif
   115 
   116     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   117     dst = (Uint16 *) (cvt->buf + cvt->len_cvt * 2);
   118     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   119         const Uint16 val = (((Uint16) *src) << 8);
   120         *dst = SDL_SwapBE16(val);
   121     }
   122 
   123     cvt->len_cvt *= 2;
   124     if (cvt->filters[++cvt->filter_index]) {
   125         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
   126     }
   127 }
   128 
   129 static void SDLCALL
   130 SDL_Convert_U8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   131 {
   132     int i;
   133     const Uint8 *src;
   134     Sint16 *dst;
   135 
   136 #ifdef DEBUG_CONVERT
   137     fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S16MSB.\n");
   138 #endif
   139 
   140     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   141     dst = (Sint16 *) (cvt->buf + cvt->len_cvt * 2);
   142     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   143         const Sint16 val = (((Sint16) ((*src) ^ 0x80)) << 8);
   144         *dst = ((Sint16) SDL_SwapBE16(val));
   145     }
   146 
   147     cvt->len_cvt *= 2;
   148     if (cvt->filters[++cvt->filter_index]) {
   149         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
   150     }
   151 }
   152 
   153 static void SDLCALL
   154 SDL_Convert_U8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   155 {
   156     int i;
   157     const Uint8 *src;
   158     Sint32 *dst;
   159 
   160 #ifdef DEBUG_CONVERT
   161     fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32LSB.\n");
   162 #endif
   163 
   164     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   165     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 4);
   166     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   167         const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24);
   168         *dst = ((Sint32) SDL_SwapLE32(val));
   169     }
   170 
   171     cvt->len_cvt *= 4;
   172     if (cvt->filters[++cvt->filter_index]) {
   173         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
   174     }
   175 }
   176 
   177 static void SDLCALL
   178 SDL_Convert_U8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   179 {
   180     int i;
   181     const Uint8 *src;
   182     Sint32 *dst;
   183 
   184 #ifdef DEBUG_CONVERT
   185     fprintf(stderr, "Converting AUDIO_U8 to AUDIO_S32MSB.\n");
   186 #endif
   187 
   188     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   189     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 4);
   190     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   191         const Sint32 val = (((Sint32) ((*src) ^ 0x80)) << 24);
   192         *dst = ((Sint32) SDL_SwapBE32(val));
   193     }
   194 
   195     cvt->len_cvt *= 4;
   196     if (cvt->filters[++cvt->filter_index]) {
   197         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
   198     }
   199 }
   200 
   201 static void SDLCALL
   202 SDL_Convert_U8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   203 {
   204     int i;
   205     const Uint8 *src;
   206     float *dst;
   207 
   208 #ifdef DEBUG_CONVERT
   209     fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32LSB.\n");
   210 #endif
   211 
   212     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   213     dst = (float *) (cvt->buf + cvt->len_cvt * 4);
   214     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   215         const float val = ((((float) *src) * DIVBY127) - 1.0f);
   216         *dst = SDL_SwapFloatLE(val);
   217     }
   218 
   219     cvt->len_cvt *= 4;
   220     if (cvt->filters[++cvt->filter_index]) {
   221         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
   222     }
   223 }
   224 
   225 static void SDLCALL
   226 SDL_Convert_U8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   227 {
   228     int i;
   229     const Uint8 *src;
   230     float *dst;
   231 
   232 #ifdef DEBUG_CONVERT
   233     fprintf(stderr, "Converting AUDIO_U8 to AUDIO_F32MSB.\n");
   234 #endif
   235 
   236     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   237     dst = (float *) (cvt->buf + cvt->len_cvt * 4);
   238     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   239         const float val = ((((float) *src) * DIVBY127) - 1.0f);
   240         *dst = SDL_SwapFloatBE(val);
   241     }
   242 
   243     cvt->len_cvt *= 4;
   244     if (cvt->filters[++cvt->filter_index]) {
   245         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
   246     }
   247 }
   248 
   249 static void SDLCALL
   250 SDL_Convert_S8_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   251 {
   252     int i;
   253     const Uint8 *src;
   254     Uint8 *dst;
   255 
   256 #ifdef DEBUG_CONVERT
   257     fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U8.\n");
   258 #endif
   259 
   260     src = (const Uint8 *) cvt->buf;
   261     dst = (Uint8 *) cvt->buf;
   262     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, ++src, ++dst) {
   263         const Uint8 val = ((((Sint8) *src)) ^ 0x80);
   264         *dst = val;
   265     }
   266 
   267     if (cvt->filters[++cvt->filter_index]) {
   268         cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
   269     }
   270 }
   271 
   272 static void SDLCALL
   273 SDL_Convert_S8_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   274 {
   275     int i;
   276     const Uint8 *src;
   277     Uint16 *dst;
   278 
   279 #ifdef DEBUG_CONVERT
   280     fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16LSB.\n");
   281 #endif
   282 
   283     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   284     dst = (Uint16 *) (cvt->buf + cvt->len_cvt * 2);
   285     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   286         const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8);
   287         *dst = SDL_SwapLE16(val);
   288     }
   289 
   290     cvt->len_cvt *= 2;
   291     if (cvt->filters[++cvt->filter_index]) {
   292         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
   293     }
   294 }
   295 
   296 static void SDLCALL
   297 SDL_Convert_S8_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   298 {
   299     int i;
   300     const Uint8 *src;
   301     Sint16 *dst;
   302 
   303 #ifdef DEBUG_CONVERT
   304     fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16LSB.\n");
   305 #endif
   306 
   307     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   308     dst = (Sint16 *) (cvt->buf + cvt->len_cvt * 2);
   309     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   310         const Sint16 val = (((Sint16) ((Sint8) *src)) << 8);
   311         *dst = ((Sint16) SDL_SwapLE16(val));
   312     }
   313 
   314     cvt->len_cvt *= 2;
   315     if (cvt->filters[++cvt->filter_index]) {
   316         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
   317     }
   318 }
   319 
   320 static void SDLCALL
   321 SDL_Convert_S8_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   322 {
   323     int i;
   324     const Uint8 *src;
   325     Uint16 *dst;
   326 
   327 #ifdef DEBUG_CONVERT
   328     fprintf(stderr, "Converting AUDIO_S8 to AUDIO_U16MSB.\n");
   329 #endif
   330 
   331     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   332     dst = (Uint16 *) (cvt->buf + cvt->len_cvt * 2);
   333     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   334         const Uint16 val = (((Uint16) ((((Sint8) *src)) ^ 0x80)) << 8);
   335         *dst = SDL_SwapBE16(val);
   336     }
   337 
   338     cvt->len_cvt *= 2;
   339     if (cvt->filters[++cvt->filter_index]) {
   340         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
   341     }
   342 }
   343 
   344 static void SDLCALL
   345 SDL_Convert_S8_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   346 {
   347     int i;
   348     const Uint8 *src;
   349     Sint16 *dst;
   350 
   351 #ifdef DEBUG_CONVERT
   352     fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S16MSB.\n");
   353 #endif
   354 
   355     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   356     dst = (Sint16 *) (cvt->buf + cvt->len_cvt * 2);
   357     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   358         const Sint16 val = (((Sint16) ((Sint8) *src)) << 8);
   359         *dst = ((Sint16) SDL_SwapBE16(val));
   360     }
   361 
   362     cvt->len_cvt *= 2;
   363     if (cvt->filters[++cvt->filter_index]) {
   364         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
   365     }
   366 }
   367 
   368 static void SDLCALL
   369 SDL_Convert_S8_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   370 {
   371     int i;
   372     const Uint8 *src;
   373     Sint32 *dst;
   374 
   375 #ifdef DEBUG_CONVERT
   376     fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32LSB.\n");
   377 #endif
   378 
   379     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   380     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 4);
   381     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   382         const Sint32 val = (((Sint32) ((Sint8) *src)) << 24);
   383         *dst = ((Sint32) SDL_SwapLE32(val));
   384     }
   385 
   386     cvt->len_cvt *= 4;
   387     if (cvt->filters[++cvt->filter_index]) {
   388         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
   389     }
   390 }
   391 
   392 static void SDLCALL
   393 SDL_Convert_S8_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   394 {
   395     int i;
   396     const Uint8 *src;
   397     Sint32 *dst;
   398 
   399 #ifdef DEBUG_CONVERT
   400     fprintf(stderr, "Converting AUDIO_S8 to AUDIO_S32MSB.\n");
   401 #endif
   402 
   403     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   404     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 4);
   405     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   406         const Sint32 val = (((Sint32) ((Sint8) *src)) << 24);
   407         *dst = ((Sint32) SDL_SwapBE32(val));
   408     }
   409 
   410     cvt->len_cvt *= 4;
   411     if (cvt->filters[++cvt->filter_index]) {
   412         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
   413     }
   414 }
   415 
   416 static void SDLCALL
   417 SDL_Convert_S8_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   418 {
   419     int i;
   420     const Uint8 *src;
   421     float *dst;
   422 
   423 #ifdef DEBUG_CONVERT
   424     fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32LSB.\n");
   425 #endif
   426 
   427     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   428     dst = (float *) (cvt->buf + cvt->len_cvt * 4);
   429     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   430         const float val = (((float) ((Sint8) *src)) * DIVBY127);
   431         *dst = SDL_SwapFloatLE(val);
   432     }
   433 
   434     cvt->len_cvt *= 4;
   435     if (cvt->filters[++cvt->filter_index]) {
   436         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
   437     }
   438 }
   439 
   440 static void SDLCALL
   441 SDL_Convert_S8_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   442 {
   443     int i;
   444     const Uint8 *src;
   445     float *dst;
   446 
   447 #ifdef DEBUG_CONVERT
   448     fprintf(stderr, "Converting AUDIO_S8 to AUDIO_F32MSB.\n");
   449 #endif
   450 
   451     src = (const Uint8 *) (cvt->buf + cvt->len_cvt);
   452     dst = (float *) (cvt->buf + cvt->len_cvt * 4);
   453     for (i = cvt->len_cvt / sizeof (Uint8); i; --i, --src, --dst) {
   454         const float val = (((float) ((Sint8) *src)) * DIVBY127);
   455         *dst = SDL_SwapFloatBE(val);
   456     }
   457 
   458     cvt->len_cvt *= 4;
   459     if (cvt->filters[++cvt->filter_index]) {
   460         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
   461     }
   462 }
   463 
   464 static void SDLCALL
   465 SDL_Convert_U16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   466 {
   467     int i;
   468     const Uint16 *src;
   469     Uint8 *dst;
   470 
   471 #ifdef DEBUG_CONVERT
   472     fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U8.\n");
   473 #endif
   474 
   475     src = (const Uint16 *) cvt->buf;
   476     dst = (Uint8 *) cvt->buf;
   477     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   478         const Uint8 val = ((Uint8) (SDL_SwapLE16(*src) >> 8));
   479         *dst = val;
   480     }
   481 
   482     cvt->len_cvt /= 2;
   483     if (cvt->filters[++cvt->filter_index]) {
   484         cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
   485     }
   486 }
   487 
   488 static void SDLCALL
   489 SDL_Convert_U16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   490 {
   491     int i;
   492     const Uint16 *src;
   493     Sint8 *dst;
   494 
   495 #ifdef DEBUG_CONVERT
   496     fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S8.\n");
   497 #endif
   498 
   499     src = (const Uint16 *) cvt->buf;
   500     dst = (Sint8 *) cvt->buf;
   501     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   502         const Sint8 val = ((Sint8) (((SDL_SwapLE16(*src)) ^ 0x8000) >> 8));
   503         *dst = ((Sint8) val);
   504     }
   505 
   506     cvt->len_cvt /= 2;
   507     if (cvt->filters[++cvt->filter_index]) {
   508         cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
   509     }
   510 }
   511 
   512 static void SDLCALL
   513 SDL_Convert_U16LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   514 {
   515     int i;
   516     const Uint16 *src;
   517     Sint16 *dst;
   518 
   519 #ifdef DEBUG_CONVERT
   520     fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16LSB.\n");
   521 #endif
   522 
   523     src = (const Uint16 *) cvt->buf;
   524     dst = (Sint16 *) cvt->buf;
   525     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   526         const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000);
   527         *dst = ((Sint16) SDL_SwapLE16(val));
   528     }
   529 
   530     if (cvt->filters[++cvt->filter_index]) {
   531         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
   532     }
   533 }
   534 
   535 static void SDLCALL
   536 SDL_Convert_U16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   537 {
   538     int i;
   539     const Uint16 *src;
   540     Uint16 *dst;
   541 
   542 #ifdef DEBUG_CONVERT
   543     fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_U16MSB.\n");
   544 #endif
   545 
   546     src = (const Uint16 *) cvt->buf;
   547     dst = (Uint16 *) cvt->buf;
   548     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   549         const Uint16 val = SDL_SwapLE16(*src);
   550         *dst = SDL_SwapBE16(val);
   551     }
   552 
   553     if (cvt->filters[++cvt->filter_index]) {
   554         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
   555     }
   556 }
   557 
   558 static void SDLCALL
   559 SDL_Convert_U16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   560 {
   561     int i;
   562     const Uint16 *src;
   563     Sint16 *dst;
   564 
   565 #ifdef DEBUG_CONVERT
   566     fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S16MSB.\n");
   567 #endif
   568 
   569     src = (const Uint16 *) cvt->buf;
   570     dst = (Sint16 *) cvt->buf;
   571     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   572         const Sint16 val = ((SDL_SwapLE16(*src)) ^ 0x8000);
   573         *dst = ((Sint16) SDL_SwapBE16(val));
   574     }
   575 
   576     if (cvt->filters[++cvt->filter_index]) {
   577         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
   578     }
   579 }
   580 
   581 static void SDLCALL
   582 SDL_Convert_U16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   583 {
   584     int i;
   585     const Uint16 *src;
   586     Sint32 *dst;
   587 
   588 #ifdef DEBUG_CONVERT
   589     fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32LSB.\n");
   590 #endif
   591 
   592     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
   593     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
   594     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
   595         const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16);
   596         *dst = ((Sint32) SDL_SwapLE32(val));
   597     }
   598 
   599     cvt->len_cvt *= 2;
   600     if (cvt->filters[++cvt->filter_index]) {
   601         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
   602     }
   603 }
   604 
   605 static void SDLCALL
   606 SDL_Convert_U16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   607 {
   608     int i;
   609     const Uint16 *src;
   610     Sint32 *dst;
   611 
   612 #ifdef DEBUG_CONVERT
   613     fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_S32MSB.\n");
   614 #endif
   615 
   616     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
   617     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
   618     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
   619         const Sint32 val = (((Sint32) ((SDL_SwapLE16(*src)) ^ 0x8000)) << 16);
   620         *dst = ((Sint32) SDL_SwapBE32(val));
   621     }
   622 
   623     cvt->len_cvt *= 2;
   624     if (cvt->filters[++cvt->filter_index]) {
   625         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
   626     }
   627 }
   628 
   629 static void SDLCALL
   630 SDL_Convert_U16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   631 {
   632     int i;
   633     const Uint16 *src;
   634     float *dst;
   635 
   636 #ifdef DEBUG_CONVERT
   637     fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32LSB.\n");
   638 #endif
   639 
   640     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
   641     dst = (float *) (cvt->buf + cvt->len_cvt * 2);
   642     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
   643         const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f);
   644         *dst = SDL_SwapFloatLE(val);
   645     }
   646 
   647     cvt->len_cvt *= 2;
   648     if (cvt->filters[++cvt->filter_index]) {
   649         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
   650     }
   651 }
   652 
   653 static void SDLCALL
   654 SDL_Convert_U16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   655 {
   656     int i;
   657     const Uint16 *src;
   658     float *dst;
   659 
   660 #ifdef DEBUG_CONVERT
   661     fprintf(stderr, "Converting AUDIO_U16LSB to AUDIO_F32MSB.\n");
   662 #endif
   663 
   664     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
   665     dst = (float *) (cvt->buf + cvt->len_cvt * 2);
   666     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
   667         const float val = ((((float) SDL_SwapLE16(*src)) * DIVBY32767) - 1.0f);
   668         *dst = SDL_SwapFloatBE(val);
   669     }
   670 
   671     cvt->len_cvt *= 2;
   672     if (cvt->filters[++cvt->filter_index]) {
   673         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
   674     }
   675 }
   676 
   677 static void SDLCALL
   678 SDL_Convert_S16LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   679 {
   680     int i;
   681     const Uint16 *src;
   682     Uint8 *dst;
   683 
   684 #ifdef DEBUG_CONVERT
   685     fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U8.\n");
   686 #endif
   687 
   688     src = (const Uint16 *) cvt->buf;
   689     dst = (Uint8 *) cvt->buf;
   690     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   691         const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000) >> 8));
   692         *dst = val;
   693     }
   694 
   695     cvt->len_cvt /= 2;
   696     if (cvt->filters[++cvt->filter_index]) {
   697         cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
   698     }
   699 }
   700 
   701 static void SDLCALL
   702 SDL_Convert_S16LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   703 {
   704     int i;
   705     const Uint16 *src;
   706     Sint8 *dst;
   707 
   708 #ifdef DEBUG_CONVERT
   709     fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S8.\n");
   710 #endif
   711 
   712     src = (const Uint16 *) cvt->buf;
   713     dst = (Sint8 *) cvt->buf;
   714     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   715         const Sint8 val = ((Sint8) (((Sint16) SDL_SwapLE16(*src)) >> 8));
   716         *dst = ((Sint8) val);
   717     }
   718 
   719     cvt->len_cvt /= 2;
   720     if (cvt->filters[++cvt->filter_index]) {
   721         cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
   722     }
   723 }
   724 
   725 static void SDLCALL
   726 SDL_Convert_S16LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   727 {
   728     int i;
   729     const Uint16 *src;
   730     Uint16 *dst;
   731 
   732 #ifdef DEBUG_CONVERT
   733     fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16LSB.\n");
   734 #endif
   735 
   736     src = (const Uint16 *) cvt->buf;
   737     dst = (Uint16 *) cvt->buf;
   738     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   739         const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000);
   740         *dst = SDL_SwapLE16(val);
   741     }
   742 
   743     if (cvt->filters[++cvt->filter_index]) {
   744         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
   745     }
   746 }
   747 
   748 static void SDLCALL
   749 SDL_Convert_S16LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   750 {
   751     int i;
   752     const Uint16 *src;
   753     Uint16 *dst;
   754 
   755 #ifdef DEBUG_CONVERT
   756     fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_U16MSB.\n");
   757 #endif
   758 
   759     src = (const Uint16 *) cvt->buf;
   760     dst = (Uint16 *) cvt->buf;
   761     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   762         const Uint16 val = ((((Sint16) SDL_SwapLE16(*src))) ^ 0x8000);
   763         *dst = SDL_SwapBE16(val);
   764     }
   765 
   766     if (cvt->filters[++cvt->filter_index]) {
   767         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
   768     }
   769 }
   770 
   771 static void SDLCALL
   772 SDL_Convert_S16LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   773 {
   774     int i;
   775     const Uint16 *src;
   776     Sint16 *dst;
   777 
   778 #ifdef DEBUG_CONVERT
   779     fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S16MSB.\n");
   780 #endif
   781 
   782     src = (const Uint16 *) cvt->buf;
   783     dst = (Sint16 *) cvt->buf;
   784     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   785         const Sint16 val = ((Sint16) SDL_SwapLE16(*src));
   786         *dst = ((Sint16) SDL_SwapBE16(val));
   787     }
   788 
   789     if (cvt->filters[++cvt->filter_index]) {
   790         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
   791     }
   792 }
   793 
   794 static void SDLCALL
   795 SDL_Convert_S16LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   796 {
   797     int i;
   798     const Uint16 *src;
   799     Sint32 *dst;
   800 
   801 #ifdef DEBUG_CONVERT
   802     fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32LSB.\n");
   803 #endif
   804 
   805     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
   806     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
   807     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
   808         const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16);
   809         *dst = ((Sint32) SDL_SwapLE32(val));
   810     }
   811 
   812     cvt->len_cvt *= 2;
   813     if (cvt->filters[++cvt->filter_index]) {
   814         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
   815     }
   816 }
   817 
   818 static void SDLCALL
   819 SDL_Convert_S16LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   820 {
   821     int i;
   822     const Uint16 *src;
   823     Sint32 *dst;
   824 
   825 #ifdef DEBUG_CONVERT
   826     fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_S32MSB.\n");
   827 #endif
   828 
   829     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
   830     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
   831     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
   832         const Sint32 val = (((Sint32) ((Sint16) SDL_SwapLE16(*src))) << 16);
   833         *dst = ((Sint32) SDL_SwapBE32(val));
   834     }
   835 
   836     cvt->len_cvt *= 2;
   837     if (cvt->filters[++cvt->filter_index]) {
   838         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
   839     }
   840 }
   841 
   842 static void SDLCALL
   843 SDL_Convert_S16LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   844 {
   845     int i;
   846     const Uint16 *src;
   847     float *dst;
   848 
   849 #ifdef DEBUG_CONVERT
   850     fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32LSB.\n");
   851 #endif
   852 
   853     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
   854     dst = (float *) (cvt->buf + cvt->len_cvt * 2);
   855     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
   856         const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767);
   857         *dst = SDL_SwapFloatLE(val);
   858     }
   859 
   860     cvt->len_cvt *= 2;
   861     if (cvt->filters[++cvt->filter_index]) {
   862         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
   863     }
   864 }
   865 
   866 static void SDLCALL
   867 SDL_Convert_S16LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   868 {
   869     int i;
   870     const Uint16 *src;
   871     float *dst;
   872 
   873 #ifdef DEBUG_CONVERT
   874     fprintf(stderr, "Converting AUDIO_S16LSB to AUDIO_F32MSB.\n");
   875 #endif
   876 
   877     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
   878     dst = (float *) (cvt->buf + cvt->len_cvt * 2);
   879     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
   880         const float val = (((float) ((Sint16) SDL_SwapLE16(*src))) * DIVBY32767);
   881         *dst = SDL_SwapFloatBE(val);
   882     }
   883 
   884     cvt->len_cvt *= 2;
   885     if (cvt->filters[++cvt->filter_index]) {
   886         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
   887     }
   888 }
   889 
   890 static void SDLCALL
   891 SDL_Convert_U16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   892 {
   893     int i;
   894     const Uint16 *src;
   895     Uint8 *dst;
   896 
   897 #ifdef DEBUG_CONVERT
   898     fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U8.\n");
   899 #endif
   900 
   901     src = (const Uint16 *) cvt->buf;
   902     dst = (Uint8 *) cvt->buf;
   903     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   904         const Uint8 val = ((Uint8) (SDL_SwapBE16(*src) >> 8));
   905         *dst = val;
   906     }
   907 
   908     cvt->len_cvt /= 2;
   909     if (cvt->filters[++cvt->filter_index]) {
   910         cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
   911     }
   912 }
   913 
   914 static void SDLCALL
   915 SDL_Convert_U16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   916 {
   917     int i;
   918     const Uint16 *src;
   919     Sint8 *dst;
   920 
   921 #ifdef DEBUG_CONVERT
   922     fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S8.\n");
   923 #endif
   924 
   925     src = (const Uint16 *) cvt->buf;
   926     dst = (Sint8 *) cvt->buf;
   927     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   928         const Sint8 val = ((Sint8) (((SDL_SwapBE16(*src)) ^ 0x8000) >> 8));
   929         *dst = ((Sint8) val);
   930     }
   931 
   932     cvt->len_cvt /= 2;
   933     if (cvt->filters[++cvt->filter_index]) {
   934         cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
   935     }
   936 }
   937 
   938 static void SDLCALL
   939 SDL_Convert_U16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   940 {
   941     int i;
   942     const Uint16 *src;
   943     Uint16 *dst;
   944 
   945 #ifdef DEBUG_CONVERT
   946     fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_U16LSB.\n");
   947 #endif
   948 
   949     src = (const Uint16 *) cvt->buf;
   950     dst = (Uint16 *) cvt->buf;
   951     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   952         const Uint16 val = SDL_SwapBE16(*src);
   953         *dst = SDL_SwapLE16(val);
   954     }
   955 
   956     if (cvt->filters[++cvt->filter_index]) {
   957         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
   958     }
   959 }
   960 
   961 static void SDLCALL
   962 SDL_Convert_U16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   963 {
   964     int i;
   965     const Uint16 *src;
   966     Sint16 *dst;
   967 
   968 #ifdef DEBUG_CONVERT
   969     fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16LSB.\n");
   970 #endif
   971 
   972     src = (const Uint16 *) cvt->buf;
   973     dst = (Sint16 *) cvt->buf;
   974     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   975         const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000);
   976         *dst = ((Sint16) SDL_SwapLE16(val));
   977     }
   978 
   979     if (cvt->filters[++cvt->filter_index]) {
   980         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
   981     }
   982 }
   983 
   984 static void SDLCALL
   985 SDL_Convert_U16MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
   986 {
   987     int i;
   988     const Uint16 *src;
   989     Sint16 *dst;
   990 
   991 #ifdef DEBUG_CONVERT
   992     fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S16MSB.\n");
   993 #endif
   994 
   995     src = (const Uint16 *) cvt->buf;
   996     dst = (Sint16 *) cvt->buf;
   997     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
   998         const Sint16 val = ((SDL_SwapBE16(*src)) ^ 0x8000);
   999         *dst = ((Sint16) SDL_SwapBE16(val));
  1000     }
  1001 
  1002     if (cvt->filters[++cvt->filter_index]) {
  1003         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
  1004     }
  1005 }
  1006 
  1007 static void SDLCALL
  1008 SDL_Convert_U16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1009 {
  1010     int i;
  1011     const Uint16 *src;
  1012     Sint32 *dst;
  1013 
  1014 #ifdef DEBUG_CONVERT
  1015     fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32LSB.\n");
  1016 #endif
  1017 
  1018     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
  1019     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
  1020     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
  1021         const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16);
  1022         *dst = ((Sint32) SDL_SwapLE32(val));
  1023     }
  1024 
  1025     cvt->len_cvt *= 2;
  1026     if (cvt->filters[++cvt->filter_index]) {
  1027         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
  1028     }
  1029 }
  1030 
  1031 static void SDLCALL
  1032 SDL_Convert_U16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1033 {
  1034     int i;
  1035     const Uint16 *src;
  1036     Sint32 *dst;
  1037 
  1038 #ifdef DEBUG_CONVERT
  1039     fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_S32MSB.\n");
  1040 #endif
  1041 
  1042     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
  1043     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
  1044     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
  1045         const Sint32 val = (((Sint32) ((SDL_SwapBE16(*src)) ^ 0x8000)) << 16);
  1046         *dst = ((Sint32) SDL_SwapBE32(val));
  1047     }
  1048 
  1049     cvt->len_cvt *= 2;
  1050     if (cvt->filters[++cvt->filter_index]) {
  1051         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
  1052     }
  1053 }
  1054 
  1055 static void SDLCALL
  1056 SDL_Convert_U16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1057 {
  1058     int i;
  1059     const Uint16 *src;
  1060     float *dst;
  1061 
  1062 #ifdef DEBUG_CONVERT
  1063     fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32LSB.\n");
  1064 #endif
  1065 
  1066     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
  1067     dst = (float *) (cvt->buf + cvt->len_cvt * 2);
  1068     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
  1069         const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f);
  1070         *dst = SDL_SwapFloatLE(val);
  1071     }
  1072 
  1073     cvt->len_cvt *= 2;
  1074     if (cvt->filters[++cvt->filter_index]) {
  1075         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
  1076     }
  1077 }
  1078 
  1079 static void SDLCALL
  1080 SDL_Convert_U16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1081 {
  1082     int i;
  1083     const Uint16 *src;
  1084     float *dst;
  1085 
  1086 #ifdef DEBUG_CONVERT
  1087     fprintf(stderr, "Converting AUDIO_U16MSB to AUDIO_F32MSB.\n");
  1088 #endif
  1089 
  1090     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
  1091     dst = (float *) (cvt->buf + cvt->len_cvt * 2);
  1092     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
  1093         const float val = ((((float) SDL_SwapBE16(*src)) * DIVBY32767) - 1.0f);
  1094         *dst = SDL_SwapFloatBE(val);
  1095     }
  1096 
  1097     cvt->len_cvt *= 2;
  1098     if (cvt->filters[++cvt->filter_index]) {
  1099         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
  1100     }
  1101 }
  1102 
  1103 static void SDLCALL
  1104 SDL_Convert_S16MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1105 {
  1106     int i;
  1107     const Uint16 *src;
  1108     Uint8 *dst;
  1109 
  1110 #ifdef DEBUG_CONVERT
  1111     fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U8.\n");
  1112 #endif
  1113 
  1114     src = (const Uint16 *) cvt->buf;
  1115     dst = (Uint8 *) cvt->buf;
  1116     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
  1117         const Uint8 val = ((Uint8) (((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000) >> 8));
  1118         *dst = val;
  1119     }
  1120 
  1121     cvt->len_cvt /= 2;
  1122     if (cvt->filters[++cvt->filter_index]) {
  1123         cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
  1124     }
  1125 }
  1126 
  1127 static void SDLCALL
  1128 SDL_Convert_S16MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1129 {
  1130     int i;
  1131     const Uint16 *src;
  1132     Sint8 *dst;
  1133 
  1134 #ifdef DEBUG_CONVERT
  1135     fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S8.\n");
  1136 #endif
  1137 
  1138     src = (const Uint16 *) cvt->buf;
  1139     dst = (Sint8 *) cvt->buf;
  1140     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
  1141         const Sint8 val = ((Sint8) (((Sint16) SDL_SwapBE16(*src)) >> 8));
  1142         *dst = ((Sint8) val);
  1143     }
  1144 
  1145     cvt->len_cvt /= 2;
  1146     if (cvt->filters[++cvt->filter_index]) {
  1147         cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
  1148     }
  1149 }
  1150 
  1151 static void SDLCALL
  1152 SDL_Convert_S16MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1153 {
  1154     int i;
  1155     const Uint16 *src;
  1156     Uint16 *dst;
  1157 
  1158 #ifdef DEBUG_CONVERT
  1159     fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16LSB.\n");
  1160 #endif
  1161 
  1162     src = (const Uint16 *) cvt->buf;
  1163     dst = (Uint16 *) cvt->buf;
  1164     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
  1165         const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000);
  1166         *dst = SDL_SwapLE16(val);
  1167     }
  1168 
  1169     if (cvt->filters[++cvt->filter_index]) {
  1170         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
  1171     }
  1172 }
  1173 
  1174 static void SDLCALL
  1175 SDL_Convert_S16MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1176 {
  1177     int i;
  1178     const Uint16 *src;
  1179     Sint16 *dst;
  1180 
  1181 #ifdef DEBUG_CONVERT
  1182     fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S16LSB.\n");
  1183 #endif
  1184 
  1185     src = (const Uint16 *) cvt->buf;
  1186     dst = (Sint16 *) cvt->buf;
  1187     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
  1188         const Sint16 val = ((Sint16) SDL_SwapBE16(*src));
  1189         *dst = ((Sint16) SDL_SwapLE16(val));
  1190     }
  1191 
  1192     if (cvt->filters[++cvt->filter_index]) {
  1193         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
  1194     }
  1195 }
  1196 
  1197 static void SDLCALL
  1198 SDL_Convert_S16MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1199 {
  1200     int i;
  1201     const Uint16 *src;
  1202     Uint16 *dst;
  1203 
  1204 #ifdef DEBUG_CONVERT
  1205     fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_U16MSB.\n");
  1206 #endif
  1207 
  1208     src = (const Uint16 *) cvt->buf;
  1209     dst = (Uint16 *) cvt->buf;
  1210     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, ++src, ++dst) {
  1211         const Uint16 val = ((((Sint16) SDL_SwapBE16(*src))) ^ 0x8000);
  1212         *dst = SDL_SwapBE16(val);
  1213     }
  1214 
  1215     if (cvt->filters[++cvt->filter_index]) {
  1216         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
  1217     }
  1218 }
  1219 
  1220 static void SDLCALL
  1221 SDL_Convert_S16MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1222 {
  1223     int i;
  1224     const Uint16 *src;
  1225     Sint32 *dst;
  1226 
  1227 #ifdef DEBUG_CONVERT
  1228     fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32LSB.\n");
  1229 #endif
  1230 
  1231     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
  1232     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
  1233     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
  1234         const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16);
  1235         *dst = ((Sint32) SDL_SwapLE32(val));
  1236     }
  1237 
  1238     cvt->len_cvt *= 2;
  1239     if (cvt->filters[++cvt->filter_index]) {
  1240         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
  1241     }
  1242 }
  1243 
  1244 static void SDLCALL
  1245 SDL_Convert_S16MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1246 {
  1247     int i;
  1248     const Uint16 *src;
  1249     Sint32 *dst;
  1250 
  1251 #ifdef DEBUG_CONVERT
  1252     fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_S32MSB.\n");
  1253 #endif
  1254 
  1255     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
  1256     dst = (Sint32 *) (cvt->buf + cvt->len_cvt * 2);
  1257     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
  1258         const Sint32 val = (((Sint32) ((Sint16) SDL_SwapBE16(*src))) << 16);
  1259         *dst = ((Sint32) SDL_SwapBE32(val));
  1260     }
  1261 
  1262     cvt->len_cvt *= 2;
  1263     if (cvt->filters[++cvt->filter_index]) {
  1264         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
  1265     }
  1266 }
  1267 
  1268 static void SDLCALL
  1269 SDL_Convert_S16MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1270 {
  1271     int i;
  1272     const Uint16 *src;
  1273     float *dst;
  1274 
  1275 #ifdef DEBUG_CONVERT
  1276     fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32LSB.\n");
  1277 #endif
  1278 
  1279     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
  1280     dst = (float *) (cvt->buf + cvt->len_cvt * 2);
  1281     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
  1282         const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767);
  1283         *dst = SDL_SwapFloatLE(val);
  1284     }
  1285 
  1286     cvt->len_cvt *= 2;
  1287     if (cvt->filters[++cvt->filter_index]) {
  1288         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
  1289     }
  1290 }
  1291 
  1292 static void SDLCALL
  1293 SDL_Convert_S16MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1294 {
  1295     int i;
  1296     const Uint16 *src;
  1297     float *dst;
  1298 
  1299 #ifdef DEBUG_CONVERT
  1300     fprintf(stderr, "Converting AUDIO_S16MSB to AUDIO_F32MSB.\n");
  1301 #endif
  1302 
  1303     src = (const Uint16 *) (cvt->buf + cvt->len_cvt);
  1304     dst = (float *) (cvt->buf + cvt->len_cvt * 2);
  1305     for (i = cvt->len_cvt / sizeof (Uint16); i; --i, --src, --dst) {
  1306         const float val = (((float) ((Sint16) SDL_SwapBE16(*src))) * DIVBY32767);
  1307         *dst = SDL_SwapFloatBE(val);
  1308     }
  1309 
  1310     cvt->len_cvt *= 2;
  1311     if (cvt->filters[++cvt->filter_index]) {
  1312         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
  1313     }
  1314 }
  1315 
  1316 static void SDLCALL
  1317 SDL_Convert_S32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1318 {
  1319     int i;
  1320     const Uint32 *src;
  1321     Uint8 *dst;
  1322 
  1323 #ifdef DEBUG_CONVERT
  1324     fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U8.\n");
  1325 #endif
  1326 
  1327     src = (const Uint32 *) cvt->buf;
  1328     dst = (Uint8 *) cvt->buf;
  1329     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1330         const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 24));
  1331         *dst = val;
  1332     }
  1333 
  1334     cvt->len_cvt /= 4;
  1335     if (cvt->filters[++cvt->filter_index]) {
  1336         cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
  1337     }
  1338 }
  1339 
  1340 static void SDLCALL
  1341 SDL_Convert_S32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1342 {
  1343     int i;
  1344     const Uint32 *src;
  1345     Sint8 *dst;
  1346 
  1347 #ifdef DEBUG_CONVERT
  1348     fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S8.\n");
  1349 #endif
  1350 
  1351     src = (const Uint32 *) cvt->buf;
  1352     dst = (Sint8 *) cvt->buf;
  1353     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1354         const Sint8 val = ((Sint8) (((Sint32) SDL_SwapLE32(*src)) >> 24));
  1355         *dst = ((Sint8) val);
  1356     }
  1357 
  1358     cvt->len_cvt /= 4;
  1359     if (cvt->filters[++cvt->filter_index]) {
  1360         cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
  1361     }
  1362 }
  1363 
  1364 static void SDLCALL
  1365 SDL_Convert_S32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1366 {
  1367     int i;
  1368     const Uint32 *src;
  1369     Uint16 *dst;
  1370 
  1371 #ifdef DEBUG_CONVERT
  1372     fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16LSB.\n");
  1373 #endif
  1374 
  1375     src = (const Uint32 *) cvt->buf;
  1376     dst = (Uint16 *) cvt->buf;
  1377     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1378         const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16));
  1379         *dst = SDL_SwapLE16(val);
  1380     }
  1381 
  1382     cvt->len_cvt /= 2;
  1383     if (cvt->filters[++cvt->filter_index]) {
  1384         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
  1385     }
  1386 }
  1387 
  1388 static void SDLCALL
  1389 SDL_Convert_S32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1390 {
  1391     int i;
  1392     const Uint32 *src;
  1393     Sint16 *dst;
  1394 
  1395 #ifdef DEBUG_CONVERT
  1396     fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16LSB.\n");
  1397 #endif
  1398 
  1399     src = (const Uint32 *) cvt->buf;
  1400     dst = (Sint16 *) cvt->buf;
  1401     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1402         const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16));
  1403         *dst = ((Sint16) SDL_SwapLE16(val));
  1404     }
  1405 
  1406     cvt->len_cvt /= 2;
  1407     if (cvt->filters[++cvt->filter_index]) {
  1408         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
  1409     }
  1410 }
  1411 
  1412 static void SDLCALL
  1413 SDL_Convert_S32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1414 {
  1415     int i;
  1416     const Uint32 *src;
  1417     Uint16 *dst;
  1418 
  1419 #ifdef DEBUG_CONVERT
  1420     fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_U16MSB.\n");
  1421 #endif
  1422 
  1423     src = (const Uint32 *) cvt->buf;
  1424     dst = (Uint16 *) cvt->buf;
  1425     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1426         const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapLE32(*src))) ^ 0x80000000) >> 16));
  1427         *dst = SDL_SwapBE16(val);
  1428     }
  1429 
  1430     cvt->len_cvt /= 2;
  1431     if (cvt->filters[++cvt->filter_index]) {
  1432         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
  1433     }
  1434 }
  1435 
  1436 static void SDLCALL
  1437 SDL_Convert_S32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1438 {
  1439     int i;
  1440     const Uint32 *src;
  1441     Sint16 *dst;
  1442 
  1443 #ifdef DEBUG_CONVERT
  1444     fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S16MSB.\n");
  1445 #endif
  1446 
  1447     src = (const Uint32 *) cvt->buf;
  1448     dst = (Sint16 *) cvt->buf;
  1449     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1450         const Sint16 val = ((Sint16) (((Sint32) SDL_SwapLE32(*src)) >> 16));
  1451         *dst = ((Sint16) SDL_SwapBE16(val));
  1452     }
  1453 
  1454     cvt->len_cvt /= 2;
  1455     if (cvt->filters[++cvt->filter_index]) {
  1456         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
  1457     }
  1458 }
  1459 
  1460 static void SDLCALL
  1461 SDL_Convert_S32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1462 {
  1463     int i;
  1464     const Uint32 *src;
  1465     Sint32 *dst;
  1466 
  1467 #ifdef DEBUG_CONVERT
  1468     fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_S32MSB.\n");
  1469 #endif
  1470 
  1471     src = (const Uint32 *) cvt->buf;
  1472     dst = (Sint32 *) cvt->buf;
  1473     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1474         const Sint32 val = ((Sint32) SDL_SwapLE32(*src));
  1475         *dst = ((Sint32) SDL_SwapBE32(val));
  1476     }
  1477 
  1478     if (cvt->filters[++cvt->filter_index]) {
  1479         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
  1480     }
  1481 }
  1482 
  1483 static void SDLCALL
  1484 SDL_Convert_S32LSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1485 {
  1486     int i;
  1487     const Uint32 *src;
  1488     float *dst;
  1489 
  1490 #ifdef DEBUG_CONVERT
  1491     fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32LSB.\n");
  1492 #endif
  1493 
  1494     src = (const Uint32 *) cvt->buf;
  1495     dst = (float *) cvt->buf;
  1496     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1497         const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647);
  1498         *dst = SDL_SwapFloatLE(val);
  1499     }
  1500 
  1501     if (cvt->filters[++cvt->filter_index]) {
  1502         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
  1503     }
  1504 }
  1505 
  1506 static void SDLCALL
  1507 SDL_Convert_S32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1508 {
  1509     int i;
  1510     const Uint32 *src;
  1511     float *dst;
  1512 
  1513 #ifdef DEBUG_CONVERT
  1514     fprintf(stderr, "Converting AUDIO_S32LSB to AUDIO_F32MSB.\n");
  1515 #endif
  1516 
  1517     src = (const Uint32 *) cvt->buf;
  1518     dst = (float *) cvt->buf;
  1519     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1520         const float val = (((float) ((Sint32) SDL_SwapLE32(*src))) * DIVBY2147483647);
  1521         *dst = SDL_SwapFloatBE(val);
  1522     }
  1523 
  1524     if (cvt->filters[++cvt->filter_index]) {
  1525         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
  1526     }
  1527 }
  1528 
  1529 static void SDLCALL
  1530 SDL_Convert_S32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1531 {
  1532     int i;
  1533     const Uint32 *src;
  1534     Uint8 *dst;
  1535 
  1536 #ifdef DEBUG_CONVERT
  1537     fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U8.\n");
  1538 #endif
  1539 
  1540     src = (const Uint32 *) cvt->buf;
  1541     dst = (Uint8 *) cvt->buf;
  1542     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1543         const Uint8 val = ((Uint8) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 24));
  1544         *dst = val;
  1545     }
  1546 
  1547     cvt->len_cvt /= 4;
  1548     if (cvt->filters[++cvt->filter_index]) {
  1549         cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
  1550     }
  1551 }
  1552 
  1553 static void SDLCALL
  1554 SDL_Convert_S32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1555 {
  1556     int i;
  1557     const Uint32 *src;
  1558     Sint8 *dst;
  1559 
  1560 #ifdef DEBUG_CONVERT
  1561     fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S8.\n");
  1562 #endif
  1563 
  1564     src = (const Uint32 *) cvt->buf;
  1565     dst = (Sint8 *) cvt->buf;
  1566     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1567         const Sint8 val = ((Sint8) (((Sint32) SDL_SwapBE32(*src)) >> 24));
  1568         *dst = ((Sint8) val);
  1569     }
  1570 
  1571     cvt->len_cvt /= 4;
  1572     if (cvt->filters[++cvt->filter_index]) {
  1573         cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
  1574     }
  1575 }
  1576 
  1577 static void SDLCALL
  1578 SDL_Convert_S32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1579 {
  1580     int i;
  1581     const Uint32 *src;
  1582     Uint16 *dst;
  1583 
  1584 #ifdef DEBUG_CONVERT
  1585     fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16LSB.\n");
  1586 #endif
  1587 
  1588     src = (const Uint32 *) cvt->buf;
  1589     dst = (Uint16 *) cvt->buf;
  1590     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1591         const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16));
  1592         *dst = SDL_SwapLE16(val);
  1593     }
  1594 
  1595     cvt->len_cvt /= 2;
  1596     if (cvt->filters[++cvt->filter_index]) {
  1597         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
  1598     }
  1599 }
  1600 
  1601 static void SDLCALL
  1602 SDL_Convert_S32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1603 {
  1604     int i;
  1605     const Uint32 *src;
  1606     Sint16 *dst;
  1607 
  1608 #ifdef DEBUG_CONVERT
  1609     fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16LSB.\n");
  1610 #endif
  1611 
  1612     src = (const Uint32 *) cvt->buf;
  1613     dst = (Sint16 *) cvt->buf;
  1614     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1615         const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16));
  1616         *dst = ((Sint16) SDL_SwapLE16(val));
  1617     }
  1618 
  1619     cvt->len_cvt /= 2;
  1620     if (cvt->filters[++cvt->filter_index]) {
  1621         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
  1622     }
  1623 }
  1624 
  1625 static void SDLCALL
  1626 SDL_Convert_S32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1627 {
  1628     int i;
  1629     const Uint32 *src;
  1630     Uint16 *dst;
  1631 
  1632 #ifdef DEBUG_CONVERT
  1633     fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_U16MSB.\n");
  1634 #endif
  1635 
  1636     src = (const Uint32 *) cvt->buf;
  1637     dst = (Uint16 *) cvt->buf;
  1638     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1639         const Uint16 val = ((Uint16) (((((Sint32) SDL_SwapBE32(*src))) ^ 0x80000000) >> 16));
  1640         *dst = SDL_SwapBE16(val);
  1641     }
  1642 
  1643     cvt->len_cvt /= 2;
  1644     if (cvt->filters[++cvt->filter_index]) {
  1645         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
  1646     }
  1647 }
  1648 
  1649 static void SDLCALL
  1650 SDL_Convert_S32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1651 {
  1652     int i;
  1653     const Uint32 *src;
  1654     Sint16 *dst;
  1655 
  1656 #ifdef DEBUG_CONVERT
  1657     fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S16MSB.\n");
  1658 #endif
  1659 
  1660     src = (const Uint32 *) cvt->buf;
  1661     dst = (Sint16 *) cvt->buf;
  1662     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1663         const Sint16 val = ((Sint16) (((Sint32) SDL_SwapBE32(*src)) >> 16));
  1664         *dst = ((Sint16) SDL_SwapBE16(val));
  1665     }
  1666 
  1667     cvt->len_cvt /= 2;
  1668     if (cvt->filters[++cvt->filter_index]) {
  1669         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
  1670     }
  1671 }
  1672 
  1673 static void SDLCALL
  1674 SDL_Convert_S32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1675 {
  1676     int i;
  1677     const Uint32 *src;
  1678     Sint32 *dst;
  1679 
  1680 #ifdef DEBUG_CONVERT
  1681     fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_S32LSB.\n");
  1682 #endif
  1683 
  1684     src = (const Uint32 *) cvt->buf;
  1685     dst = (Sint32 *) cvt->buf;
  1686     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1687         const Sint32 val = ((Sint32) SDL_SwapBE32(*src));
  1688         *dst = ((Sint32) SDL_SwapLE32(val));
  1689     }
  1690 
  1691     if (cvt->filters[++cvt->filter_index]) {
  1692         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
  1693     }
  1694 }
  1695 
  1696 static void SDLCALL
  1697 SDL_Convert_S32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1698 {
  1699     int i;
  1700     const Uint32 *src;
  1701     float *dst;
  1702 
  1703 #ifdef DEBUG_CONVERT
  1704     fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32LSB.\n");
  1705 #endif
  1706 
  1707     src = (const Uint32 *) cvt->buf;
  1708     dst = (float *) cvt->buf;
  1709     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1710         const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647);
  1711         *dst = SDL_SwapFloatLE(val);
  1712     }
  1713 
  1714     if (cvt->filters[++cvt->filter_index]) {
  1715         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
  1716     }
  1717 }
  1718 
  1719 static void SDLCALL
  1720 SDL_Convert_S32MSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1721 {
  1722     int i;
  1723     const Uint32 *src;
  1724     float *dst;
  1725 
  1726 #ifdef DEBUG_CONVERT
  1727     fprintf(stderr, "Converting AUDIO_S32MSB to AUDIO_F32MSB.\n");
  1728 #endif
  1729 
  1730     src = (const Uint32 *) cvt->buf;
  1731     dst = (float *) cvt->buf;
  1732     for (i = cvt->len_cvt / sizeof (Uint32); i; --i, ++src, ++dst) {
  1733         const float val = (((float) ((Sint32) SDL_SwapBE32(*src))) * DIVBY2147483647);
  1734         *dst = SDL_SwapFloatBE(val);
  1735     }
  1736 
  1737     if (cvt->filters[++cvt->filter_index]) {
  1738         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
  1739     }
  1740 }
  1741 
  1742 static void SDLCALL
  1743 SDL_Convert_F32LSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1744 {
  1745     int i;
  1746     const float *src;
  1747     Uint8 *dst;
  1748 
  1749 #ifdef DEBUG_CONVERT
  1750     fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U8.\n");
  1751 #endif
  1752 
  1753     src = (const float *) cvt->buf;
  1754     dst = (Uint8 *) cvt->buf;
  1755     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1756         const Uint8 val = ((Uint8) ((SDL_SwapFloatLE(*src) + 1.0f) * 127.0f));
  1757         *dst = val;
  1758     }
  1759 
  1760     cvt->len_cvt /= 4;
  1761     if (cvt->filters[++cvt->filter_index]) {
  1762         cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
  1763     }
  1764 }
  1765 
  1766 static void SDLCALL
  1767 SDL_Convert_F32LSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1768 {
  1769     int i;
  1770     const float *src;
  1771     Sint8 *dst;
  1772 
  1773 #ifdef DEBUG_CONVERT
  1774     fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S8.\n");
  1775 #endif
  1776 
  1777     src = (const float *) cvt->buf;
  1778     dst = (Sint8 *) cvt->buf;
  1779     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1780         const Sint8 val = ((Sint8) (SDL_SwapFloatLE(*src) * 127.0f));
  1781         *dst = ((Sint8) val);
  1782     }
  1783 
  1784     cvt->len_cvt /= 4;
  1785     if (cvt->filters[++cvt->filter_index]) {
  1786         cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
  1787     }
  1788 }
  1789 
  1790 static void SDLCALL
  1791 SDL_Convert_F32LSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1792 {
  1793     int i;
  1794     const float *src;
  1795     Uint16 *dst;
  1796 
  1797 #ifdef DEBUG_CONVERT
  1798     fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16LSB.\n");
  1799 #endif
  1800 
  1801     src = (const float *) cvt->buf;
  1802     dst = (Uint16 *) cvt->buf;
  1803     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1804         const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f));
  1805         *dst = SDL_SwapLE16(val);
  1806     }
  1807 
  1808     cvt->len_cvt /= 2;
  1809     if (cvt->filters[++cvt->filter_index]) {
  1810         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
  1811     }
  1812 }
  1813 
  1814 static void SDLCALL
  1815 SDL_Convert_F32LSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1816 {
  1817     int i;
  1818     const float *src;
  1819     Sint16 *dst;
  1820 
  1821 #ifdef DEBUG_CONVERT
  1822     fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16LSB.\n");
  1823 #endif
  1824 
  1825     src = (const float *) cvt->buf;
  1826     dst = (Sint16 *) cvt->buf;
  1827     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1828         const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f));
  1829         *dst = ((Sint16) SDL_SwapLE16(val));
  1830     }
  1831 
  1832     cvt->len_cvt /= 2;
  1833     if (cvt->filters[++cvt->filter_index]) {
  1834         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
  1835     }
  1836 }
  1837 
  1838 static void SDLCALL
  1839 SDL_Convert_F32LSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1840 {
  1841     int i;
  1842     const float *src;
  1843     Uint16 *dst;
  1844 
  1845 #ifdef DEBUG_CONVERT
  1846     fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_U16MSB.\n");
  1847 #endif
  1848 
  1849     src = (const float *) cvt->buf;
  1850     dst = (Uint16 *) cvt->buf;
  1851     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1852         const Uint16 val = ((Uint16) ((SDL_SwapFloatLE(*src) + 1.0f) * 32767.0f));
  1853         *dst = SDL_SwapBE16(val);
  1854     }
  1855 
  1856     cvt->len_cvt /= 2;
  1857     if (cvt->filters[++cvt->filter_index]) {
  1858         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
  1859     }
  1860 }
  1861 
  1862 static void SDLCALL
  1863 SDL_Convert_F32LSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1864 {
  1865     int i;
  1866     const float *src;
  1867     Sint16 *dst;
  1868 
  1869 #ifdef DEBUG_CONVERT
  1870     fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S16MSB.\n");
  1871 #endif
  1872 
  1873     src = (const float *) cvt->buf;
  1874     dst = (Sint16 *) cvt->buf;
  1875     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1876         const Sint16 val = ((Sint16) (SDL_SwapFloatLE(*src) * 32767.0f));
  1877         *dst = ((Sint16) SDL_SwapBE16(val));
  1878     }
  1879 
  1880     cvt->len_cvt /= 2;
  1881     if (cvt->filters[++cvt->filter_index]) {
  1882         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
  1883     }
  1884 }
  1885 
  1886 static void SDLCALL
  1887 SDL_Convert_F32LSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1888 {
  1889     int i;
  1890     const float *src;
  1891     Sint32 *dst;
  1892 
  1893 #ifdef DEBUG_CONVERT
  1894     fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32LSB.\n");
  1895 #endif
  1896 
  1897     src = (const float *) cvt->buf;
  1898     dst = (Sint32 *) cvt->buf;
  1899     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1900         const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0));
  1901         *dst = ((Sint32) SDL_SwapLE32(val));
  1902     }
  1903 
  1904     if (cvt->filters[++cvt->filter_index]) {
  1905         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
  1906     }
  1907 }
  1908 
  1909 static void SDLCALL
  1910 SDL_Convert_F32LSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1911 {
  1912     int i;
  1913     const float *src;
  1914     Sint32 *dst;
  1915 
  1916 #ifdef DEBUG_CONVERT
  1917     fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_S32MSB.\n");
  1918 #endif
  1919 
  1920     src = (const float *) cvt->buf;
  1921     dst = (Sint32 *) cvt->buf;
  1922     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1923         const Sint32 val = ((Sint32) (SDL_SwapFloatLE(*src) * 2147483647.0));
  1924         *dst = ((Sint32) SDL_SwapBE32(val));
  1925     }
  1926 
  1927     if (cvt->filters[++cvt->filter_index]) {
  1928         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
  1929     }
  1930 }
  1931 
  1932 static void SDLCALL
  1933 SDL_Convert_F32LSB_to_F32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1934 {
  1935     int i;
  1936     const float *src;
  1937     float *dst;
  1938 
  1939 #ifdef DEBUG_CONVERT
  1940     fprintf(stderr, "Converting AUDIO_F32LSB to AUDIO_F32MSB.\n");
  1941 #endif
  1942 
  1943     src = (const float *) cvt->buf;
  1944     dst = (float *) cvt->buf;
  1945     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1946         const float val = SDL_SwapFloatLE(*src);
  1947         *dst = SDL_SwapFloatBE(val);
  1948     }
  1949 
  1950     if (cvt->filters[++cvt->filter_index]) {
  1951         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32MSB);
  1952     }
  1953 }
  1954 
  1955 static void SDLCALL
  1956 SDL_Convert_F32MSB_to_U8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1957 {
  1958     int i;
  1959     const float *src;
  1960     Uint8 *dst;
  1961 
  1962 #ifdef DEBUG_CONVERT
  1963     fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U8.\n");
  1964 #endif
  1965 
  1966     src = (const float *) cvt->buf;
  1967     dst = (Uint8 *) cvt->buf;
  1968     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1969         const Uint8 val = ((Uint8) ((SDL_SwapFloatBE(*src) + 1.0f) * 127.0f));
  1970         *dst = val;
  1971     }
  1972 
  1973     cvt->len_cvt /= 4;
  1974     if (cvt->filters[++cvt->filter_index]) {
  1975         cvt->filters[cvt->filter_index] (cvt, AUDIO_U8);
  1976     }
  1977 }
  1978 
  1979 static void SDLCALL
  1980 SDL_Convert_F32MSB_to_S8(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  1981 {
  1982     int i;
  1983     const float *src;
  1984     Sint8 *dst;
  1985 
  1986 #ifdef DEBUG_CONVERT
  1987     fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S8.\n");
  1988 #endif
  1989 
  1990     src = (const float *) cvt->buf;
  1991     dst = (Sint8 *) cvt->buf;
  1992     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  1993         const Sint8 val = ((Sint8) (SDL_SwapFloatBE(*src) * 127.0f));
  1994         *dst = ((Sint8) val);
  1995     }
  1996 
  1997     cvt->len_cvt /= 4;
  1998     if (cvt->filters[++cvt->filter_index]) {
  1999         cvt->filters[cvt->filter_index] (cvt, AUDIO_S8);
  2000     }
  2001 }
  2002 
  2003 static void SDLCALL
  2004 SDL_Convert_F32MSB_to_U16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  2005 {
  2006     int i;
  2007     const float *src;
  2008     Uint16 *dst;
  2009 
  2010 #ifdef DEBUG_CONVERT
  2011     fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16LSB.\n");
  2012 #endif
  2013 
  2014     src = (const float *) cvt->buf;
  2015     dst = (Uint16 *) cvt->buf;
  2016     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  2017         const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f));
  2018         *dst = SDL_SwapLE16(val);
  2019     }
  2020 
  2021     cvt->len_cvt /= 2;
  2022     if (cvt->filters[++cvt->filter_index]) {
  2023         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16LSB);
  2024     }
  2025 }
  2026 
  2027 static void SDLCALL
  2028 SDL_Convert_F32MSB_to_S16LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  2029 {
  2030     int i;
  2031     const float *src;
  2032     Sint16 *dst;
  2033 
  2034 #ifdef DEBUG_CONVERT
  2035     fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16LSB.\n");
  2036 #endif
  2037 
  2038     src = (const float *) cvt->buf;
  2039     dst = (Sint16 *) cvt->buf;
  2040     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  2041         const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f));
  2042         *dst = ((Sint16) SDL_SwapLE16(val));
  2043     }
  2044 
  2045     cvt->len_cvt /= 2;
  2046     if (cvt->filters[++cvt->filter_index]) {
  2047         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16LSB);
  2048     }
  2049 }
  2050 
  2051 static void SDLCALL
  2052 SDL_Convert_F32MSB_to_U16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  2053 {
  2054     int i;
  2055     const float *src;
  2056     Uint16 *dst;
  2057 
  2058 #ifdef DEBUG_CONVERT
  2059     fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_U16MSB.\n");
  2060 #endif
  2061 
  2062     src = (const float *) cvt->buf;
  2063     dst = (Uint16 *) cvt->buf;
  2064     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  2065         const Uint16 val = ((Uint16) ((SDL_SwapFloatBE(*src) + 1.0f) * 32767.0f));
  2066         *dst = SDL_SwapBE16(val);
  2067     }
  2068 
  2069     cvt->len_cvt /= 2;
  2070     if (cvt->filters[++cvt->filter_index]) {
  2071         cvt->filters[cvt->filter_index] (cvt, AUDIO_U16MSB);
  2072     }
  2073 }
  2074 
  2075 static void SDLCALL
  2076 SDL_Convert_F32MSB_to_S16MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  2077 {
  2078     int i;
  2079     const float *src;
  2080     Sint16 *dst;
  2081 
  2082 #ifdef DEBUG_CONVERT
  2083     fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S16MSB.\n");
  2084 #endif
  2085 
  2086     src = (const float *) cvt->buf;
  2087     dst = (Sint16 *) cvt->buf;
  2088     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  2089         const Sint16 val = ((Sint16) (SDL_SwapFloatBE(*src) * 32767.0f));
  2090         *dst = ((Sint16) SDL_SwapBE16(val));
  2091     }
  2092 
  2093     cvt->len_cvt /= 2;
  2094     if (cvt->filters[++cvt->filter_index]) {
  2095         cvt->filters[cvt->filter_index] (cvt, AUDIO_S16MSB);
  2096     }
  2097 }
  2098 
  2099 static void SDLCALL
  2100 SDL_Convert_F32MSB_to_S32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  2101 {
  2102     int i;
  2103     const float *src;
  2104     Sint32 *dst;
  2105 
  2106 #ifdef DEBUG_CONVERT
  2107     fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32LSB.\n");
  2108 #endif
  2109 
  2110     src = (const float *) cvt->buf;
  2111     dst = (Sint32 *) cvt->buf;
  2112     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  2113         const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0));
  2114         *dst = ((Sint32) SDL_SwapLE32(val));
  2115     }
  2116 
  2117     if (cvt->filters[++cvt->filter_index]) {
  2118         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32LSB);
  2119     }
  2120 }
  2121 
  2122 static void SDLCALL
  2123 SDL_Convert_F32MSB_to_S32MSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  2124 {
  2125     int i;
  2126     const float *src;
  2127     Sint32 *dst;
  2128 
  2129 #ifdef DEBUG_CONVERT
  2130     fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_S32MSB.\n");
  2131 #endif
  2132 
  2133     src = (const float *) cvt->buf;
  2134     dst = (Sint32 *) cvt->buf;
  2135     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  2136         const Sint32 val = ((Sint32) (SDL_SwapFloatBE(*src) * 2147483647.0));
  2137         *dst = ((Sint32) SDL_SwapBE32(val));
  2138     }
  2139 
  2140     if (cvt->filters[++cvt->filter_index]) {
  2141         cvt->filters[cvt->filter_index] (cvt, AUDIO_S32MSB);
  2142     }
  2143 }
  2144 
  2145 static void SDLCALL
  2146 SDL_Convert_F32MSB_to_F32LSB(SDL_AudioCVT * cvt, SDL_AudioFormat format)
  2147 {
  2148     int i;
  2149     const float *src;
  2150     float *dst;
  2151 
  2152 #ifdef DEBUG_CONVERT
  2153     fprintf(stderr, "Converting AUDIO_F32MSB to AUDIO_F32LSB.\n");
  2154 #endif
  2155 
  2156     src = (const float *) cvt->buf;
  2157     dst = (float *) cvt->buf;
  2158     for (i = cvt->len_cvt / sizeof (float); i; --i, ++src, ++dst) {
  2159         const float val = SDL_SwapFloatBE(*src);
  2160         *dst = SDL_SwapFloatLE(val);
  2161     }
  2162 
  2163     if (cvt->filters[++cvt->filter_index]) {
  2164         cvt->filters[cvt->filter_index] (cvt, AUDIO_F32LSB);
  2165     }
  2166 }
  2167 
  2168 const SDL_AudioTypeFilters sdl_audio_type_filters[] =
  2169 {
  2170     { AUDIO_U8, AUDIO_S8, SDL_Convert_U8_to_S8 },
  2171     { AUDIO_U8, AUDIO_U16LSB, SDL_Convert_U8_to_U16LSB },
  2172     { AUDIO_U8, AUDIO_S16LSB, SDL_Convert_U8_to_S16LSB },
  2173     { AUDIO_U8, AUDIO_U16MSB, SDL_Convert_U8_to_U16MSB },
  2174     { AUDIO_U8, AUDIO_S16MSB, SDL_Convert_U8_to_S16MSB },
  2175     { AUDIO_U8, AUDIO_S32LSB, SDL_Convert_U8_to_S32LSB },
  2176     { AUDIO_U8, AUDIO_S32MSB, SDL_Convert_U8_to_S32MSB },
  2177     { AUDIO_U8, AUDIO_F32LSB, SDL_Convert_U8_to_F32LSB },
  2178     { AUDIO_U8, AUDIO_F32MSB, SDL_Convert_U8_to_F32MSB },
  2179     { AUDIO_S8, AUDIO_U8, SDL_Convert_S8_to_U8 },
  2180     { AUDIO_S8, AUDIO_U16LSB, SDL_Convert_S8_to_U16LSB },
  2181     { AUDIO_S8, AUDIO_S16LSB, SDL_Convert_S8_to_S16LSB },
  2182     { AUDIO_S8, AUDIO_U16MSB, SDL_Convert_S8_to_U16MSB },
  2183     { AUDIO_S8, AUDIO_S16MSB, SDL_Convert_S8_to_S16MSB },
  2184     { AUDIO_S8, AUDIO_S32LSB, SDL_Convert_S8_to_S32LSB },
  2185     { AUDIO_S8, AUDIO_S32MSB, SDL_Convert_S8_to_S32MSB },
  2186     { AUDIO_S8, AUDIO_F32LSB, SDL_Convert_S8_to_F32LSB },
  2187     { AUDIO_S8, AUDIO_F32MSB, SDL_Convert_S8_to_F32MSB },
  2188     { AUDIO_U16LSB, AUDIO_U8, SDL_Convert_U16LSB_to_U8 },
  2189     { AUDIO_U16LSB, AUDIO_S8, SDL_Convert_U16LSB_to_S8 },
  2190     { AUDIO_U16LSB, AUDIO_S16LSB, SDL_Convert_U16LSB_to_S16LSB },
  2191     { AUDIO_U16LSB, AUDIO_U16MSB, SDL_Convert_U16LSB_to_U16MSB },
  2192     { AUDIO_U16LSB, AUDIO_S16MSB, SDL_Convert_U16LSB_to_S16MSB },
  2193     { AUDIO_U16LSB, AUDIO_S32LSB, SDL_Convert_U16LSB_to_S32LSB },
  2194     { AUDIO_U16LSB, AUDIO_S32MSB, SDL_Convert_U16LSB_to_S32MSB },
  2195     { AUDIO_U16LSB, AUDIO_F32LSB, SDL_Convert_U16LSB_to_F32LSB },
  2196     { AUDIO_U16LSB, AUDIO_F32MSB, SDL_Convert_U16LSB_to_F32MSB },
  2197     { AUDIO_S16LSB, AUDIO_U8, SDL_Convert_S16LSB_to_U8 },
  2198     { AUDIO_S16LSB, AUDIO_S8, SDL_Convert_S16LSB_to_S8 },
  2199     { AUDIO_S16LSB, AUDIO_U16LSB, SDL_Convert_S16LSB_to_U16LSB },
  2200     { AUDIO_S16LSB, AUDIO_U16MSB, SDL_Convert_S16LSB_to_U16MSB },
  2201     { AUDIO_S16LSB, AUDIO_S16MSB, SDL_Convert_S16LSB_to_S16MSB },
  2202     { AUDIO_S16LSB, AUDIO_S32LSB, SDL_Convert_S16LSB_to_S32LSB },
  2203     { AUDIO_S16LSB, AUDIO_S32MSB, SDL_Convert_S16LSB_to_S32MSB },
  2204     { AUDIO_S16LSB, AUDIO_F32LSB, SDL_Convert_S16LSB_to_F32LSB },
  2205     { AUDIO_S16LSB, AUDIO_F32MSB, SDL_Convert_S16LSB_to_F32MSB },
  2206     { AUDIO_U16MSB, AUDIO_U8, SDL_Convert_U16MSB_to_U8 },
  2207     { AUDIO_U16MSB, AUDIO_S8, SDL_Convert_U16MSB_to_S8 },
  2208     { AUDIO_U16MSB, AUDIO_U16LSB, SDL_Convert_U16MSB_to_U16LSB },
  2209     { AUDIO_U16MSB, AUDIO_S16LSB, SDL_Convert_U16MSB_to_S16LSB },
  2210     { AUDIO_U16MSB, AUDIO_S16MSB, SDL_Convert_U16MSB_to_S16MSB },
  2211     { AUDIO_U16MSB, AUDIO_S32LSB, SDL_Convert_U16MSB_to_S32LSB },
  2212     { AUDIO_U16MSB, AUDIO_S32MSB, SDL_Convert_U16MSB_to_S32MSB },
  2213     { AUDIO_U16MSB, AUDIO_F32LSB, SDL_Convert_U16MSB_to_F32LSB },
  2214     { AUDIO_U16MSB, AUDIO_F32MSB, SDL_Convert_U16MSB_to_F32MSB },
  2215     { AUDIO_S16MSB, AUDIO_U8, SDL_Convert_S16MSB_to_U8 },
  2216     { AUDIO_S16MSB, AUDIO_S8, SDL_Convert_S16MSB_to_S8 },
  2217     { AUDIO_S16MSB, AUDIO_U16LSB, SDL_Convert_S16MSB_to_U16LSB },
  2218     { AUDIO_S16MSB, AUDIO_S16LSB, SDL_Convert_S16MSB_to_S16LSB },
  2219     { AUDIO_S16MSB, AUDIO_U16MSB, SDL_Convert_S16MSB_to_U16MSB },
  2220     { AUDIO_S16MSB, AUDIO_S32LSB, SDL_Convert_S16MSB_to_S32LSB },
  2221     { AUDIO_S16MSB, AUDIO_S32MSB, SDL_Convert_S16MSB_to_S32MSB },
  2222     { AUDIO_S16MSB, AUDIO_F32LSB, SDL_Convert_S16MSB_to_F32LSB },
  2223     { AUDIO_S16MSB, AUDIO_F32MSB, SDL_Convert_S16MSB_to_F32MSB },
  2224     { AUDIO_S32LSB, AUDIO_U8, SDL_Convert_S32LSB_to_U8 },
  2225     { AUDIO_S32LSB, AUDIO_S8, SDL_Convert_S32LSB_to_S8 },
  2226     { AUDIO_S32LSB, AUDIO_U16LSB, SDL_Convert_S32LSB_to_U16LSB },
  2227     { AUDIO_S32LSB, AUDIO_S16LSB, SDL_Convert_S32LSB_to_S16LSB },
  2228     { AUDIO_S32LSB, AUDIO_U16MSB, SDL_Convert_S32LSB_to_U16MSB },
  2229     { AUDIO_S32LSB, AUDIO_S16MSB, SDL_Convert_S32LSB_to_S16MSB },
  2230     { AUDIO_S32LSB, AUDIO_S32MSB, SDL_Convert_S32LSB_to_S32MSB },
  2231     { AUDIO_S32LSB, AUDIO_F32LSB, SDL_Convert_S32LSB_to_F32LSB },
  2232     { AUDIO_S32LSB, AUDIO_F32MSB, SDL_Convert_S32LSB_to_F32MSB },
  2233     { AUDIO_S32MSB, AUDIO_U8, SDL_Convert_S32MSB_to_U8 },
  2234     { AUDIO_S32MSB, AUDIO_S8, SDL_Convert_S32MSB_to_S8 },
  2235     { AUDIO_S32MSB, AUDIO_U16LSB, SDL_Convert_S32MSB_to_U16LSB },
  2236     { AUDIO_S32MSB, AUDIO_S16LSB, SDL_Convert_S32MSB_to_S16LSB },
  2237     { AUDIO_S32MSB, AUDIO_U16MSB, SDL_Convert_S32MSB_to_U16MSB },
  2238     { AUDIO_S32MSB, AUDIO_S16MSB, SDL_Convert_S32MSB_to_S16MSB },
  2239     { AUDIO_S32MSB, AUDIO_S32LSB, SDL_Convert_S32MSB_to_S32LSB },
  2240     { AUDIO_S32MSB, AUDIO_F32LSB, SDL_Convert_S32MSB_to_F32LSB },
  2241     { AUDIO_S32MSB, AUDIO_F32MSB, SDL_Convert_S32MSB_to_F32MSB },
  2242     { AUDIO_F32LSB, AUDIO_U8, SDL_Convert_F32LSB_to_U8 },
  2243     { AUDIO_F32LSB, AUDIO_S8, SDL_Convert_F32LSB_to_S8 },
  2244     { AUDIO_F32LSB, AUDIO_U16LSB, SDL_Convert_F32LSB_to_U16LSB },
  2245     { AUDIO_F32LSB, AUDIO_S16LSB, SDL_Convert_F32LSB_to_S16LSB },
  2246     { AUDIO_F32LSB, AUDIO_U16MSB, SDL_Convert_F32LSB_to_U16MSB },
  2247     { AUDIO_F32LSB, AUDIO_S16MSB, SDL_Convert_F32LSB_to_S16MSB },
  2248     { AUDIO_F32LSB, AUDIO_S32LSB, SDL_Convert_F32LSB_to_S32LSB },
  2249     { AUDIO_F32LSB, AUDIO_S32MSB, SDL_Convert_F32LSB_to_S32MSB },
  2250     { AUDIO_F32LSB, AUDIO_F32MSB, SDL_Convert_F32LSB_to_F32MSB },
  2251     { AUDIO_F32MSB, AUDIO_U8, SDL_Convert_F32MSB_to_U8 },
  2252     { AUDIO_F32MSB, AUDIO_S8, SDL_Convert_F32MSB_to_S8 },
  2253     { AUDIO_F32MSB, AUDIO_U16LSB, SDL_Convert_F32MSB_to_U16LSB },
  2254     { AUDIO_F32MSB, AUDIO_S16LSB, SDL_Convert_F32MSB_to_S16LSB },
  2255     { AUDIO_F32MSB, AUDIO_U16MSB, SDL_Convert_F32MSB_to_U16MSB },
  2256     { AUDIO_F32MSB, AUDIO_S16MSB, SDL_Convert_F32MSB_to_S16MSB },
  2257     { AUDIO_F32MSB, AUDIO_S32LSB, SDL_Convert_F32MSB_to_S32LSB },
  2258     { AUDIO_F32MSB, AUDIO_S32MSB, SDL_Convert_F32MSB_to_S32MSB },
  2259     { AUDIO_F32MSB, AUDIO_F32LSB, SDL_Convert_F32MSB_to_F32LSB },
  2260 };
  2261 
  2262 
  2263 /* *INDENT-ON* */
  2264 
  2265 /* vi: set ts=4 sw=4 expandtab: */