Better interpolation for the x4 upsampling case
authorSam Lantinga <slouken@libsdl.org>
Thu, 12 Jan 2012 22:54:09 -0500
changeset 6211 b0b81f18bf35
parent 6210 a598b3abd962
child 6212 78d854de3a66
Better interpolation for the x4 upsampling case
src/audio/SDL_audiotypecvt.c
src/audio/sdlgenaudiocvt.pl
--- a/src/audio/SDL_audiotypecvt.c	Thu Jan 12 21:42:35 2012 -0500
+++ b/src/audio/SDL_audiotypecvt.c	Thu Jan 12 22:54:09 2012 -0500
@@ -7163,10 +7163,10 @@
     while (dst >= target) {
         const Sint16 sample0 = (Sint16) src[0];
         src--;
-        dst[3] = (Uint8) sample0;
-        dst[2] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[3] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[2] = (Uint8) ((sample0 + last_sample0) >> 1);
+        dst[1] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
+        dst[0] = (Uint8) sample0;
         last_sample0 = sample0;
         dst -= 4;
     }
@@ -7282,14 +7282,14 @@
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample0 = (Sint16) src[0];
         src -= 2;
-        dst[7] = (Uint8) sample1;
-        dst[6] = (Uint8) sample0;
-        dst[5] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[7] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[6] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[5] = (Uint8) ((sample1 + last_sample1) >> 1);
+        dst[4] = (Uint8) ((sample0 + last_sample0) >> 1);
+        dst[3] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
+        dst[2] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
+        dst[1] = (Uint8) sample1;
+        dst[0] = (Uint8) sample0;
         last_sample1 = sample1;
         last_sample0 = sample0;
         dst -= 8;
@@ -7432,22 +7432,22 @@
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample0 = (Sint16) src[0];
         src -= 4;
-        dst[15] = (Uint8) sample3;
-        dst[14] = (Uint8) sample2;
-        dst[13] = (Uint8) sample1;
-        dst[12] = (Uint8) sample0;
-        dst[11] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[15] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[14] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[13] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[12] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[11] = (Uint8) ((sample3 + last_sample3) >> 1);
+        dst[10] = (Uint8) ((sample2 + last_sample2) >> 1);
+        dst[9] = (Uint8) ((sample1 + last_sample1) >> 1);
+        dst[8] = (Uint8) ((sample0 + last_sample0) >> 1);
+        dst[7] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
+        dst[6] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
+        dst[5] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
+        dst[4] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
+        dst[3] = (Uint8) sample3;
+        dst[2] = (Uint8) sample2;
+        dst[1] = (Uint8) sample1;
+        dst[0] = (Uint8) sample0;
         last_sample3 = sample3;
         last_sample2 = sample2;
         last_sample1 = sample1;
@@ -7622,30 +7622,30 @@
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample0 = (Sint16) src[0];
         src -= 6;
-        dst[23] = (Uint8) sample5;
-        dst[22] = (Uint8) sample4;
-        dst[21] = (Uint8) sample3;
-        dst[20] = (Uint8) sample2;
-        dst[19] = (Uint8) sample1;
-        dst[18] = (Uint8) sample0;
-        dst[17] = (Uint8) (((3 * sample5) + last_sample5) >> 2);
-        dst[16] = (Uint8) (((3 * sample4) + last_sample4) >> 2);
-        dst[15] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[14] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[13] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[12] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[11] = (Uint8) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Uint8) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[22] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[21] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[20] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[19] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[18] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[17] = (Uint8) ((sample5 + last_sample5) >> 1);
+        dst[16] = (Uint8) ((sample4 + last_sample4) >> 1);
+        dst[15] = (Uint8) ((sample3 + last_sample3) >> 1);
+        dst[14] = (Uint8) ((sample2 + last_sample2) >> 1);
+        dst[13] = (Uint8) ((sample1 + last_sample1) >> 1);
+        dst[12] = (Uint8) ((sample0 + last_sample0) >> 1);
+        dst[11] = (Uint8) (((3 * sample5) + last_sample5) >> 2);
+        dst[10] = (Uint8) (((3 * sample4) + last_sample4) >> 2);
+        dst[9] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
+        dst[8] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
+        dst[7] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
+        dst[6] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
+        dst[5] = (Uint8) sample5;
+        dst[4] = (Uint8) sample4;
+        dst[3] = (Uint8) sample3;
+        dst[2] = (Uint8) sample2;
+        dst[1] = (Uint8) sample1;
+        dst[0] = (Uint8) sample0;
         last_sample5 = sample5;
         last_sample4 = sample4;
         last_sample3 = sample3;
@@ -7852,38 +7852,38 @@
         const Sint16 sample1 = (Sint16) src[1];
         const Sint16 sample0 = (Sint16) src[0];
         src -= 8;
-        dst[31] = (Uint8) sample7;
-        dst[30] = (Uint8) sample6;
-        dst[29] = (Uint8) sample5;
-        dst[28] = (Uint8) sample4;
-        dst[27] = (Uint8) sample3;
-        dst[26] = (Uint8) sample2;
-        dst[25] = (Uint8) sample1;
-        dst[24] = (Uint8) sample0;
-        dst[23] = (Uint8) (((3 * sample7) + last_sample7) >> 2);
-        dst[22] = (Uint8) (((3 * sample6) + last_sample6) >> 2);
-        dst[21] = (Uint8) (((3 * sample5) + last_sample5) >> 2);
-        dst[20] = (Uint8) (((3 * sample4) + last_sample4) >> 2);
-        dst[19] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[18] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[17] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[16] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[15] = (Uint8) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Uint8) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Uint8) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Uint8) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Uint8) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Uint8) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Uint8) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Uint8) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Uint8) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[6] = (Uint8) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[5] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[31] = (Uint8) ((sample7 + (3 * last_sample7)) >> 2);
+        dst[30] = (Uint8) ((sample6 + (3 * last_sample6)) >> 2);
+        dst[29] = (Uint8) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[28] = (Uint8) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[27] = (Uint8) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[26] = (Uint8) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[25] = (Uint8) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[24] = (Uint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Uint8) ((sample7 + last_sample7) >> 1);
+        dst[22] = (Uint8) ((sample6 + last_sample6) >> 1);
+        dst[21] = (Uint8) ((sample5 + last_sample5) >> 1);
+        dst[20] = (Uint8) ((sample4 + last_sample4) >> 1);
+        dst[19] = (Uint8) ((sample3 + last_sample3) >> 1);
+        dst[18] = (Uint8) ((sample2 + last_sample2) >> 1);
+        dst[17] = (Uint8) ((sample1 + last_sample1) >> 1);
+        dst[16] = (Uint8) ((sample0 + last_sample0) >> 1);
+        dst[15] = (Uint8) (((3 * sample7) + last_sample7) >> 2);
+        dst[14] = (Uint8) (((3 * sample6) + last_sample6) >> 2);
+        dst[13] = (Uint8) (((3 * sample5) + last_sample5) >> 2);
+        dst[12] = (Uint8) (((3 * sample4) + last_sample4) >> 2);
+        dst[11] = (Uint8) (((3 * sample3) + last_sample3) >> 2);
+        dst[10] = (Uint8) (((3 * sample2) + last_sample2) >> 2);
+        dst[9] = (Uint8) (((3 * sample1) + last_sample1) >> 2);
+        dst[8] = (Uint8) (((3 * sample0) + last_sample0) >> 2);
+        dst[7] = (Uint8) sample7;
+        dst[6] = (Uint8) sample6;
+        dst[5] = (Uint8) sample5;
+        dst[4] = (Uint8) sample4;
+        dst[3] = (Uint8) sample3;
+        dst[2] = (Uint8) sample2;
+        dst[1] = (Uint8) sample1;
+        dst[0] = (Uint8) sample0;
         last_sample7 = sample7;
         last_sample6 = sample6;
         last_sample5 = sample5;
@@ -8023,10 +8023,10 @@
     while (dst >= target) {
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src--;
-        dst[3] = (Sint8) sample0;
-        dst[2] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[3] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[2] = (Sint8) ((sample0 + last_sample0) >> 1);
+        dst[1] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
+        dst[0] = (Sint8) sample0;
         last_sample0 = sample0;
         dst -= 4;
     }
@@ -8142,14 +8142,14 @@
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src -= 2;
-        dst[7] = (Sint8) sample1;
-        dst[6] = (Sint8) sample0;
-        dst[5] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[7] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[6] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[5] = (Sint8) ((sample1 + last_sample1) >> 1);
+        dst[4] = (Sint8) ((sample0 + last_sample0) >> 1);
+        dst[3] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
+        dst[2] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
+        dst[1] = (Sint8) sample1;
+        dst[0] = (Sint8) sample0;
         last_sample1 = sample1;
         last_sample0 = sample0;
         dst -= 8;
@@ -8292,22 +8292,22 @@
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src -= 4;
-        dst[15] = (Sint8) sample3;
-        dst[14] = (Sint8) sample2;
-        dst[13] = (Sint8) sample1;
-        dst[12] = (Sint8) sample0;
-        dst[11] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[15] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[14] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[13] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[12] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[11] = (Sint8) ((sample3 + last_sample3) >> 1);
+        dst[10] = (Sint8) ((sample2 + last_sample2) >> 1);
+        dst[9] = (Sint8) ((sample1 + last_sample1) >> 1);
+        dst[8] = (Sint8) ((sample0 + last_sample0) >> 1);
+        dst[7] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
+        dst[6] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
+        dst[5] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
+        dst[4] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
+        dst[3] = (Sint8) sample3;
+        dst[2] = (Sint8) sample2;
+        dst[1] = (Sint8) sample1;
+        dst[0] = (Sint8) sample0;
         last_sample3 = sample3;
         last_sample2 = sample2;
         last_sample1 = sample1;
@@ -8482,30 +8482,30 @@
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src -= 6;
-        dst[23] = (Sint8) sample5;
-        dst[22] = (Sint8) sample4;
-        dst[21] = (Sint8) sample3;
-        dst[20] = (Sint8) sample2;
-        dst[19] = (Sint8) sample1;
-        dst[18] = (Sint8) sample0;
-        dst[17] = (Sint8) (((3 * sample5) + last_sample5) >> 2);
-        dst[16] = (Sint8) (((3 * sample4) + last_sample4) >> 2);
-        dst[15] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[14] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[13] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[12] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[11] = (Sint8) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Sint8) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[22] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[21] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[20] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[19] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[18] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[17] = (Sint8) ((sample5 + last_sample5) >> 1);
+        dst[16] = (Sint8) ((sample4 + last_sample4) >> 1);
+        dst[15] = (Sint8) ((sample3 + last_sample3) >> 1);
+        dst[14] = (Sint8) ((sample2 + last_sample2) >> 1);
+        dst[13] = (Sint8) ((sample1 + last_sample1) >> 1);
+        dst[12] = (Sint8) ((sample0 + last_sample0) >> 1);
+        dst[11] = (Sint8) (((3 * sample5) + last_sample5) >> 2);
+        dst[10] = (Sint8) (((3 * sample4) + last_sample4) >> 2);
+        dst[9] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
+        dst[8] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
+        dst[7] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
+        dst[6] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
+        dst[5] = (Sint8) sample5;
+        dst[4] = (Sint8) sample4;
+        dst[3] = (Sint8) sample3;
+        dst[2] = (Sint8) sample2;
+        dst[1] = (Sint8) sample1;
+        dst[0] = (Sint8) sample0;
         last_sample5 = sample5;
         last_sample4 = sample4;
         last_sample3 = sample3;
@@ -8712,38 +8712,38 @@
         const Sint16 sample1 = (Sint16) ((Sint8) src[1]);
         const Sint16 sample0 = (Sint16) ((Sint8) src[0]);
         src -= 8;
-        dst[31] = (Sint8) sample7;
-        dst[30] = (Sint8) sample6;
-        dst[29] = (Sint8) sample5;
-        dst[28] = (Sint8) sample4;
-        dst[27] = (Sint8) sample3;
-        dst[26] = (Sint8) sample2;
-        dst[25] = (Sint8) sample1;
-        dst[24] = (Sint8) sample0;
-        dst[23] = (Sint8) (((3 * sample7) + last_sample7) >> 2);
-        dst[22] = (Sint8) (((3 * sample6) + last_sample6) >> 2);
-        dst[21] = (Sint8) (((3 * sample5) + last_sample5) >> 2);
-        dst[20] = (Sint8) (((3 * sample4) + last_sample4) >> 2);
-        dst[19] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
-        dst[18] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
-        dst[17] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
-        dst[16] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
-        dst[15] = (Sint8) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Sint8) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Sint8) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Sint8) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Sint8) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint8) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint8) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint8) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint8) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[6] = (Sint8) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[5] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[31] = (Sint8) ((sample7 + (3 * last_sample7)) >> 2);
+        dst[30] = (Sint8) ((sample6 + (3 * last_sample6)) >> 2);
+        dst[29] = (Sint8) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[28] = (Sint8) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[27] = (Sint8) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[26] = (Sint8) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[25] = (Sint8) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[24] = (Sint8) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Sint8) ((sample7 + last_sample7) >> 1);
+        dst[22] = (Sint8) ((sample6 + last_sample6) >> 1);
+        dst[21] = (Sint8) ((sample5 + last_sample5) >> 1);
+        dst[20] = (Sint8) ((sample4 + last_sample4) >> 1);
+        dst[19] = (Sint8) ((sample3 + last_sample3) >> 1);
+        dst[18] = (Sint8) ((sample2 + last_sample2) >> 1);
+        dst[17] = (Sint8) ((sample1 + last_sample1) >> 1);
+        dst[16] = (Sint8) ((sample0 + last_sample0) >> 1);
+        dst[15] = (Sint8) (((3 * sample7) + last_sample7) >> 2);
+        dst[14] = (Sint8) (((3 * sample6) + last_sample6) >> 2);
+        dst[13] = (Sint8) (((3 * sample5) + last_sample5) >> 2);
+        dst[12] = (Sint8) (((3 * sample4) + last_sample4) >> 2);
+        dst[11] = (Sint8) (((3 * sample3) + last_sample3) >> 2);
+        dst[10] = (Sint8) (((3 * sample2) + last_sample2) >> 2);
+        dst[9] = (Sint8) (((3 * sample1) + last_sample1) >> 2);
+        dst[8] = (Sint8) (((3 * sample0) + last_sample0) >> 2);
+        dst[7] = (Sint8) sample7;
+        dst[6] = (Sint8) sample6;
+        dst[5] = (Sint8) sample5;
+        dst[4] = (Sint8) sample4;
+        dst[3] = (Sint8) sample3;
+        dst[2] = (Sint8) sample2;
+        dst[1] = (Sint8) sample1;
+        dst[0] = (Sint8) sample0;
         last_sample7 = sample7;
         last_sample6 = sample6;
         last_sample5 = sample5;
@@ -8883,10 +8883,10 @@
     while (dst >= target) {
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src--;
-        dst[3] = (Uint16) sample0;
-        dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[3] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
+        dst[1] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[0] = (Uint16) sample0;
         last_sample0 = sample0;
         dst -= 4;
     }
@@ -9002,14 +9002,14 @@
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src -= 2;
-        dst[7] = (Uint16) sample1;
-        dst[6] = (Uint16) sample0;
-        dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[7] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[6] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
+        dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
+        dst[3] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[1] = (Uint16) sample1;
+        dst[0] = (Uint16) sample0;
         last_sample1 = sample1;
         last_sample0 = sample0;
         dst -= 8;
@@ -9152,22 +9152,22 @@
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src -= 4;
-        dst[15] = (Uint16) sample3;
-        dst[14] = (Uint16) sample2;
-        dst[13] = (Uint16) sample1;
-        dst[12] = (Uint16) sample0;
-        dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[15] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[14] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[13] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[12] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
+        dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
+        dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
+        dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
+        dst[7] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[6] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[3] = (Uint16) sample3;
+        dst[2] = (Uint16) sample2;
+        dst[1] = (Uint16) sample1;
+        dst[0] = (Uint16) sample0;
         last_sample3 = sample3;
         last_sample2 = sample2;
         last_sample1 = sample1;
@@ -9342,30 +9342,30 @@
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src -= 6;
-        dst[23] = (Uint16) sample5;
-        dst[22] = (Uint16) sample4;
-        dst[21] = (Uint16) sample3;
-        dst[20] = (Uint16) sample2;
-        dst[19] = (Uint16) sample1;
-        dst[18] = (Uint16) sample0;
-        dst[17] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[16] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[15] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[14] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[13] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[12] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[11] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[22] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[21] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[20] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[19] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[18] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[17] = (Uint16) ((sample5 + last_sample5) >> 1);
+        dst[16] = (Uint16) ((sample4 + last_sample4) >> 1);
+        dst[15] = (Uint16) ((sample3 + last_sample3) >> 1);
+        dst[14] = (Uint16) ((sample2 + last_sample2) >> 1);
+        dst[13] = (Uint16) ((sample1 + last_sample1) >> 1);
+        dst[12] = (Uint16) ((sample0 + last_sample0) >> 1);
+        dst[11] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
+        dst[10] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
+        dst[9] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[8] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[7] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[6] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[5] = (Uint16) sample5;
+        dst[4] = (Uint16) sample4;
+        dst[3] = (Uint16) sample3;
+        dst[2] = (Uint16) sample2;
+        dst[1] = (Uint16) sample1;
+        dst[0] = (Uint16) sample0;
         last_sample5 = sample5;
         last_sample4 = sample4;
         last_sample3 = sample3;
@@ -9572,38 +9572,38 @@
         const Sint32 sample1 = (Sint32) SDL_SwapLE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapLE16(src[0]);
         src -= 8;
-        dst[31] = (Uint16) sample7;
-        dst[30] = (Uint16) sample6;
-        dst[29] = (Uint16) sample5;
-        dst[28] = (Uint16) sample4;
-        dst[27] = (Uint16) sample3;
-        dst[26] = (Uint16) sample2;
-        dst[25] = (Uint16) sample1;
-        dst[24] = (Uint16) sample0;
-        dst[23] = (Uint16) (((3 * sample7) + last_sample7) >> 2);
-        dst[22] = (Uint16) (((3 * sample6) + last_sample6) >> 2);
-        dst[21] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[20] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[19] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[18] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[17] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[16] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[15] = (Uint16) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Uint16) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[6] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[5] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[31] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2);
+        dst[30] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2);
+        dst[29] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[28] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[27] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[26] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[25] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[24] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Uint16) ((sample7 + last_sample7) >> 1);
+        dst[22] = (Uint16) ((sample6 + last_sample6) >> 1);
+        dst[21] = (Uint16) ((sample5 + last_sample5) >> 1);
+        dst[20] = (Uint16) ((sample4 + last_sample4) >> 1);
+        dst[19] = (Uint16) ((sample3 + last_sample3) >> 1);
+        dst[18] = (Uint16) ((sample2 + last_sample2) >> 1);
+        dst[17] = (Uint16) ((sample1 + last_sample1) >> 1);
+        dst[16] = (Uint16) ((sample0 + last_sample0) >> 1);
+        dst[15] = (Uint16) (((3 * sample7) + last_sample7) >> 2);
+        dst[14] = (Uint16) (((3 * sample6) + last_sample6) >> 2);
+        dst[13] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
+        dst[12] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
+        dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[7] = (Uint16) sample7;
+        dst[6] = (Uint16) sample6;
+        dst[5] = (Uint16) sample5;
+        dst[4] = (Uint16) sample4;
+        dst[3] = (Uint16) sample3;
+        dst[2] = (Uint16) sample2;
+        dst[1] = (Uint16) sample1;
+        dst[0] = (Uint16) sample0;
         last_sample7 = sample7;
         last_sample6 = sample6;
         last_sample5 = sample5;
@@ -9743,10 +9743,10 @@
     while (dst >= target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src--;
-        dst[3] = (Sint16) sample0;
-        dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[3] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
+        dst[1] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[0] = (Sint16) sample0;
         last_sample0 = sample0;
         dst -= 4;
     }
@@ -9862,14 +9862,14 @@
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src -= 2;
-        dst[7] = (Sint16) sample1;
-        dst[6] = (Sint16) sample0;
-        dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[7] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[6] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
+        dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
+        dst[3] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[1] = (Sint16) sample1;
+        dst[0] = (Sint16) sample0;
         last_sample1 = sample1;
         last_sample0 = sample0;
         dst -= 8;
@@ -10012,22 +10012,22 @@
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src -= 4;
-        dst[15] = (Sint16) sample3;
-        dst[14] = (Sint16) sample2;
-        dst[13] = (Sint16) sample1;
-        dst[12] = (Sint16) sample0;
-        dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[15] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[14] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[13] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[12] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
+        dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
+        dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
+        dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
+        dst[7] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[6] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[3] = (Sint16) sample3;
+        dst[2] = (Sint16) sample2;
+        dst[1] = (Sint16) sample1;
+        dst[0] = (Sint16) sample0;
         last_sample3 = sample3;
         last_sample2 = sample2;
         last_sample1 = sample1;
@@ -10202,30 +10202,30 @@
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src -= 6;
-        dst[23] = (Sint16) sample5;
-        dst[22] = (Sint16) sample4;
-        dst[21] = (Sint16) sample3;
-        dst[20] = (Sint16) sample2;
-        dst[19] = (Sint16) sample1;
-        dst[18] = (Sint16) sample0;
-        dst[17] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[16] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[15] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[14] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[13] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[12] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[11] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[22] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[21] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[20] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[19] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[18] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[17] = (Sint16) ((sample5 + last_sample5) >> 1);
+        dst[16] = (Sint16) ((sample4 + last_sample4) >> 1);
+        dst[15] = (Sint16) ((sample3 + last_sample3) >> 1);
+        dst[14] = (Sint16) ((sample2 + last_sample2) >> 1);
+        dst[13] = (Sint16) ((sample1 + last_sample1) >> 1);
+        dst[12] = (Sint16) ((sample0 + last_sample0) >> 1);
+        dst[11] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
+        dst[10] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
+        dst[9] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[8] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[7] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[6] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[5] = (Sint16) sample5;
+        dst[4] = (Sint16) sample4;
+        dst[3] = (Sint16) sample3;
+        dst[2] = (Sint16) sample2;
+        dst[1] = (Sint16) sample1;
+        dst[0] = (Sint16) sample0;
         last_sample5 = sample5;
         last_sample4 = sample4;
         last_sample3 = sample3;
@@ -10432,38 +10432,38 @@
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapLE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapLE16(src[0]));
         src -= 8;
-        dst[31] = (Sint16) sample7;
-        dst[30] = (Sint16) sample6;
-        dst[29] = (Sint16) sample5;
-        dst[28] = (Sint16) sample4;
-        dst[27] = (Sint16) sample3;
-        dst[26] = (Sint16) sample2;
-        dst[25] = (Sint16) sample1;
-        dst[24] = (Sint16) sample0;
-        dst[23] = (Sint16) (((3 * sample7) + last_sample7) >> 2);
-        dst[22] = (Sint16) (((3 * sample6) + last_sample6) >> 2);
-        dst[21] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[20] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[19] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[18] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[17] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[16] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[15] = (Sint16) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Sint16) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[6] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[5] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[31] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2);
+        dst[30] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2);
+        dst[29] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[28] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[27] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[26] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[25] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[24] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Sint16) ((sample7 + last_sample7) >> 1);
+        dst[22] = (Sint16) ((sample6 + last_sample6) >> 1);
+        dst[21] = (Sint16) ((sample5 + last_sample5) >> 1);
+        dst[20] = (Sint16) ((sample4 + last_sample4) >> 1);
+        dst[19] = (Sint16) ((sample3 + last_sample3) >> 1);
+        dst[18] = (Sint16) ((sample2 + last_sample2) >> 1);
+        dst[17] = (Sint16) ((sample1 + last_sample1) >> 1);
+        dst[16] = (Sint16) ((sample0 + last_sample0) >> 1);
+        dst[15] = (Sint16) (((3 * sample7) + last_sample7) >> 2);
+        dst[14] = (Sint16) (((3 * sample6) + last_sample6) >> 2);
+        dst[13] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
+        dst[12] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
+        dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[7] = (Sint16) sample7;
+        dst[6] = (Sint16) sample6;
+        dst[5] = (Sint16) sample5;
+        dst[4] = (Sint16) sample4;
+        dst[3] = (Sint16) sample3;
+        dst[2] = (Sint16) sample2;
+        dst[1] = (Sint16) sample1;
+        dst[0] = (Sint16) sample0;
         last_sample7 = sample7;
         last_sample6 = sample6;
         last_sample5 = sample5;
@@ -10603,10 +10603,10 @@
     while (dst >= target) {
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src--;
-        dst[3] = (Uint16) sample0;
-        dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[3] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
+        dst[1] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[0] = (Uint16) sample0;
         last_sample0 = sample0;
         dst -= 4;
     }
@@ -10722,14 +10722,14 @@
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src -= 2;
-        dst[7] = (Uint16) sample1;
-        dst[6] = (Uint16) sample0;
-        dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[7] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[6] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
+        dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
+        dst[3] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[2] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[1] = (Uint16) sample1;
+        dst[0] = (Uint16) sample0;
         last_sample1 = sample1;
         last_sample0 = sample0;
         dst -= 8;
@@ -10872,22 +10872,22 @@
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src -= 4;
-        dst[15] = (Uint16) sample3;
-        dst[14] = (Uint16) sample2;
-        dst[13] = (Uint16) sample1;
-        dst[12] = (Uint16) sample0;
-        dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[15] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[14] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[13] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[12] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
+        dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
+        dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
+        dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
+        dst[7] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[6] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[5] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[4] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[3] = (Uint16) sample3;
+        dst[2] = (Uint16) sample2;
+        dst[1] = (Uint16) sample1;
+        dst[0] = (Uint16) sample0;
         last_sample3 = sample3;
         last_sample2 = sample2;
         last_sample1 = sample1;
@@ -11062,30 +11062,30 @@
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src -= 6;
-        dst[23] = (Uint16) sample5;
-        dst[22] = (Uint16) sample4;
-        dst[21] = (Uint16) sample3;
-        dst[20] = (Uint16) sample2;
-        dst[19] = (Uint16) sample1;
-        dst[18] = (Uint16) sample0;
-        dst[17] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[16] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[15] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[14] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[13] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[12] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[11] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[22] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[21] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[20] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[19] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[18] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[17] = (Uint16) ((sample5 + last_sample5) >> 1);
+        dst[16] = (Uint16) ((sample4 + last_sample4) >> 1);
+        dst[15] = (Uint16) ((sample3 + last_sample3) >> 1);
+        dst[14] = (Uint16) ((sample2 + last_sample2) >> 1);
+        dst[13] = (Uint16) ((sample1 + last_sample1) >> 1);
+        dst[12] = (Uint16) ((sample0 + last_sample0) >> 1);
+        dst[11] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
+        dst[10] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
+        dst[9] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[8] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[7] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[6] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[5] = (Uint16) sample5;
+        dst[4] = (Uint16) sample4;
+        dst[3] = (Uint16) sample3;
+        dst[2] = (Uint16) sample2;
+        dst[1] = (Uint16) sample1;
+        dst[0] = (Uint16) sample0;
         last_sample5 = sample5;
         last_sample4 = sample4;
         last_sample3 = sample3;
@@ -11292,38 +11292,38 @@
         const Sint32 sample1 = (Sint32) SDL_SwapBE16(src[1]);
         const Sint32 sample0 = (Sint32) SDL_SwapBE16(src[0]);
         src -= 8;
-        dst[31] = (Uint16) sample7;
-        dst[30] = (Uint16) sample6;
-        dst[29] = (Uint16) sample5;
-        dst[28] = (Uint16) sample4;
-        dst[27] = (Uint16) sample3;
-        dst[26] = (Uint16) sample2;
-        dst[25] = (Uint16) sample1;
-        dst[24] = (Uint16) sample0;
-        dst[23] = (Uint16) (((3 * sample7) + last_sample7) >> 2);
-        dst[22] = (Uint16) (((3 * sample6) + last_sample6) >> 2);
-        dst[21] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[20] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[19] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[18] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[17] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[16] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[15] = (Uint16) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Uint16) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Uint16) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Uint16) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Uint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Uint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Uint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Uint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[6] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[5] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[31] = (Uint16) ((sample7 + (3 * last_sample7)) >> 2);
+        dst[30] = (Uint16) ((sample6 + (3 * last_sample6)) >> 2);
+        dst[29] = (Uint16) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[28] = (Uint16) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[27] = (Uint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[26] = (Uint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[25] = (Uint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[24] = (Uint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Uint16) ((sample7 + last_sample7) >> 1);
+        dst[22] = (Uint16) ((sample6 + last_sample6) >> 1);
+        dst[21] = (Uint16) ((sample5 + last_sample5) >> 1);
+        dst[20] = (Uint16) ((sample4 + last_sample4) >> 1);
+        dst[19] = (Uint16) ((sample3 + last_sample3) >> 1);
+        dst[18] = (Uint16) ((sample2 + last_sample2) >> 1);
+        dst[17] = (Uint16) ((sample1 + last_sample1) >> 1);
+        dst[16] = (Uint16) ((sample0 + last_sample0) >> 1);
+        dst[15] = (Uint16) (((3 * sample7) + last_sample7) >> 2);
+        dst[14] = (Uint16) (((3 * sample6) + last_sample6) >> 2);
+        dst[13] = (Uint16) (((3 * sample5) + last_sample5) >> 2);
+        dst[12] = (Uint16) (((3 * sample4) + last_sample4) >> 2);
+        dst[11] = (Uint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[10] = (Uint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[9] = (Uint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[8] = (Uint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[7] = (Uint16) sample7;
+        dst[6] = (Uint16) sample6;
+        dst[5] = (Uint16) sample5;
+        dst[4] = (Uint16) sample4;
+        dst[3] = (Uint16) sample3;
+        dst[2] = (Uint16) sample2;
+        dst[1] = (Uint16) sample1;
+        dst[0] = (Uint16) sample0;
         last_sample7 = sample7;
         last_sample6 = sample6;
         last_sample5 = sample5;
@@ -11463,10 +11463,10 @@
     while (dst >= target) {
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src--;
-        dst[3] = (Sint16) sample0;
-        dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[3] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
+        dst[1] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[0] = (Sint16) sample0;
         last_sample0 = sample0;
         dst -= 4;
     }
@@ -11582,14 +11582,14 @@
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src -= 2;
-        dst[7] = (Sint16) sample1;
-        dst[6] = (Sint16) sample0;
-        dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[7] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[6] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
+        dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
+        dst[3] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[2] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[1] = (Sint16) sample1;
+        dst[0] = (Sint16) sample0;
         last_sample1 = sample1;
         last_sample0 = sample0;
         dst -= 8;
@@ -11732,22 +11732,22 @@
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src -= 4;
-        dst[15] = (Sint16) sample3;
-        dst[14] = (Sint16) sample2;
-        dst[13] = (Sint16) sample1;
-        dst[12] = (Sint16) sample0;
-        dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[15] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[14] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[13] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[12] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
+        dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
+        dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
+        dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
+        dst[7] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[6] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[5] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[4] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[3] = (Sint16) sample3;
+        dst[2] = (Sint16) sample2;
+        dst[1] = (Sint16) sample1;
+        dst[0] = (Sint16) sample0;
         last_sample3 = sample3;
         last_sample2 = sample2;
         last_sample1 = sample1;
@@ -11922,30 +11922,30 @@
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src -= 6;
-        dst[23] = (Sint16) sample5;
-        dst[22] = (Sint16) sample4;
-        dst[21] = (Sint16) sample3;
-        dst[20] = (Sint16) sample2;
-        dst[19] = (Sint16) sample1;
-        dst[18] = (Sint16) sample0;
-        dst[17] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[16] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[15] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[14] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[13] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[12] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[11] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[22] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[21] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[20] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[19] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[18] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[17] = (Sint16) ((sample5 + last_sample5) >> 1);
+        dst[16] = (Sint16) ((sample4 + last_sample4) >> 1);
+        dst[15] = (Sint16) ((sample3 + last_sample3) >> 1);
+        dst[14] = (Sint16) ((sample2 + last_sample2) >> 1);
+        dst[13] = (Sint16) ((sample1 + last_sample1) >> 1);
+        dst[12] = (Sint16) ((sample0 + last_sample0) >> 1);
+        dst[11] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
+        dst[10] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
+        dst[9] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[8] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[7] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[6] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[5] = (Sint16) sample5;
+        dst[4] = (Sint16) sample4;
+        dst[3] = (Sint16) sample3;
+        dst[2] = (Sint16) sample2;
+        dst[1] = (Sint16) sample1;
+        dst[0] = (Sint16) sample0;
         last_sample5 = sample5;
         last_sample4 = sample4;
         last_sample3 = sample3;
@@ -12152,38 +12152,38 @@
         const Sint32 sample1 = (Sint32) ((Sint16) SDL_SwapBE16(src[1]));
         const Sint32 sample0 = (Sint32) ((Sint16) SDL_SwapBE16(src[0]));
         src -= 8;
-        dst[31] = (Sint16) sample7;
-        dst[30] = (Sint16) sample6;
-        dst[29] = (Sint16) sample5;
-        dst[28] = (Sint16) sample4;
-        dst[27] = (Sint16) sample3;
-        dst[26] = (Sint16) sample2;
-        dst[25] = (Sint16) sample1;
-        dst[24] = (Sint16) sample0;
-        dst[23] = (Sint16) (((3 * sample7) + last_sample7) >> 2);
-        dst[22] = (Sint16) (((3 * sample6) + last_sample6) >> 2);
-        dst[21] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
-        dst[20] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
-        dst[19] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
-        dst[18] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
-        dst[17] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
-        dst[16] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
-        dst[15] = (Sint16) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Sint16) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Sint16) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Sint16) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Sint16) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint16) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint16) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint16) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[6] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[5] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[31] = (Sint16) ((sample7 + (3 * last_sample7)) >> 2);
+        dst[30] = (Sint16) ((sample6 + (3 * last_sample6)) >> 2);
+        dst[29] = (Sint16) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[28] = (Sint16) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[27] = (Sint16) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[26] = (Sint16) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[25] = (Sint16) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[24] = (Sint16) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Sint16) ((sample7 + last_sample7) >> 1);
+        dst[22] = (Sint16) ((sample6 + last_sample6) >> 1);
+        dst[21] = (Sint16) ((sample5 + last_sample5) >> 1);
+        dst[20] = (Sint16) ((sample4 + last_sample4) >> 1);
+        dst[19] = (Sint16) ((sample3 + last_sample3) >> 1);
+        dst[18] = (Sint16) ((sample2 + last_sample2) >> 1);
+        dst[17] = (Sint16) ((sample1 + last_sample1) >> 1);
+        dst[16] = (Sint16) ((sample0 + last_sample0) >> 1);
+        dst[15] = (Sint16) (((3 * sample7) + last_sample7) >> 2);
+        dst[14] = (Sint16) (((3 * sample6) + last_sample6) >> 2);
+        dst[13] = (Sint16) (((3 * sample5) + last_sample5) >> 2);
+        dst[12] = (Sint16) (((3 * sample4) + last_sample4) >> 2);
+        dst[11] = (Sint16) (((3 * sample3) + last_sample3) >> 2);
+        dst[10] = (Sint16) (((3 * sample2) + last_sample2) >> 2);
+        dst[9] = (Sint16) (((3 * sample1) + last_sample1) >> 2);
+        dst[8] = (Sint16) (((3 * sample0) + last_sample0) >> 2);
+        dst[7] = (Sint16) sample7;
+        dst[6] = (Sint16) sample6;
+        dst[5] = (Sint16) sample5;
+        dst[4] = (Sint16) sample4;
+        dst[3] = (Sint16) sample3;
+        dst[2] = (Sint16) sample2;
+        dst[1] = (Sint16) sample1;
+        dst[0] = (Sint16) sample0;
         last_sample7 = sample7;
         last_sample6 = sample6;
         last_sample5 = sample5;
@@ -12323,10 +12323,10 @@
     while (dst >= target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src--;
-        dst[3] = (Sint32) sample0;
-        dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[3] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
+        dst[1] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
+        dst[0] = (Sint32) sample0;
         last_sample0 = sample0;
         dst -= 4;
     }
@@ -12442,14 +12442,14 @@
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src -= 2;
-        dst[7] = (Sint32) sample1;
-        dst[6] = (Sint32) sample0;
-        dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[7] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[6] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
+        dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
+        dst[3] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
+        dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
+        dst[1] = (Sint32) sample1;
+        dst[0] = (Sint32) sample0;
         last_sample1 = sample1;
         last_sample0 = sample0;
         dst -= 8;
@@ -12592,22 +12592,22 @@
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src -= 4;
-        dst[15] = (Sint32) sample3;
-        dst[14] = (Sint32) sample2;
-        dst[13] = (Sint32) sample1;
-        dst[12] = (Sint32) sample0;
-        dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[15] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[14] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[13] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[12] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
+        dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
+        dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
+        dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
+        dst[7] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
+        dst[6] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
+        dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
+        dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
+        dst[3] = (Sint32) sample3;
+        dst[2] = (Sint32) sample2;
+        dst[1] = (Sint32) sample1;
+        dst[0] = (Sint32) sample0;
         last_sample3 = sample3;
         last_sample2 = sample2;
         last_sample1 = sample1;
@@ -12782,30 +12782,30 @@
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src -= 6;
-        dst[23] = (Sint32) sample5;
-        dst[22] = (Sint32) sample4;
-        dst[21] = (Sint32) sample3;
-        dst[20] = (Sint32) sample2;
-        dst[19] = (Sint32) sample1;
-        dst[18] = (Sint32) sample0;
-        dst[17] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
-        dst[16] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
-        dst[15] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[14] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[13] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[12] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[11] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[22] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[21] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[20] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[19] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[18] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[17] = (Sint32) ((sample5 + last_sample5) >> 1);
+        dst[16] = (Sint32) ((sample4 + last_sample4) >> 1);
+        dst[15] = (Sint32) ((sample3 + last_sample3) >> 1);
+        dst[14] = (Sint32) ((sample2 + last_sample2) >> 1);
+        dst[13] = (Sint32) ((sample1 + last_sample1) >> 1);
+        dst[12] = (Sint32) ((sample0 + last_sample0) >> 1);
+        dst[11] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
+        dst[10] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
+        dst[9] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
+        dst[8] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
+        dst[7] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
+        dst[6] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
+        dst[5] = (Sint32) sample5;
+        dst[4] = (Sint32) sample4;
+        dst[3] = (Sint32) sample3;
+        dst[2] = (Sint32) sample2;
+        dst[1] = (Sint32) sample1;
+        dst[0] = (Sint32) sample0;
         last_sample5 = sample5;
         last_sample4 = sample4;
         last_sample3 = sample3;
@@ -13012,38 +13012,38 @@
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapLE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapLE32(src[0]));
         src -= 8;
-        dst[31] = (Sint32) sample7;
-        dst[30] = (Sint32) sample6;
-        dst[29] = (Sint32) sample5;
-        dst[28] = (Sint32) sample4;
-        dst[27] = (Sint32) sample3;
-        dst[26] = (Sint32) sample2;
-        dst[25] = (Sint32) sample1;
-        dst[24] = (Sint32) sample0;
-        dst[23] = (Sint32) (((3 * sample7) + last_sample7) >> 2);
-        dst[22] = (Sint32) (((3 * sample6) + last_sample6) >> 2);
-        dst[21] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
-        dst[20] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
-        dst[19] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[18] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[17] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[16] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[15] = (Sint32) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Sint32) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[6] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[5] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[31] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2);
+        dst[30] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2);
+        dst[29] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[28] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[27] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[26] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[25] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[24] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Sint32) ((sample7 + last_sample7) >> 1);
+        dst[22] = (Sint32) ((sample6 + last_sample6) >> 1);
+        dst[21] = (Sint32) ((sample5 + last_sample5) >> 1);
+        dst[20] = (Sint32) ((sample4 + last_sample4) >> 1);
+        dst[19] = (Sint32) ((sample3 + last_sample3) >> 1);
+        dst[18] = (Sint32) ((sample2 + last_sample2) >> 1);
+        dst[17] = (Sint32) ((sample1 + last_sample1) >> 1);
+        dst[16] = (Sint32) ((sample0 + last_sample0) >> 1);
+        dst[15] = (Sint32) (((3 * sample7) + last_sample7) >> 2);
+        dst[14] = (Sint32) (((3 * sample6) + last_sample6) >> 2);
+        dst[13] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
+        dst[12] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
+        dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
+        dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
+        dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
+        dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
+        dst[7] = (Sint32) sample7;
+        dst[6] = (Sint32) sample6;
+        dst[5] = (Sint32) sample5;
+        dst[4] = (Sint32) sample4;
+        dst[3] = (Sint32) sample3;
+        dst[2] = (Sint32) sample2;
+        dst[1] = (Sint32) sample1;
+        dst[0] = (Sint32) sample0;
         last_sample7 = sample7;
         last_sample6 = sample6;
         last_sample5 = sample5;
@@ -13183,10 +13183,10 @@
     while (dst >= target) {
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src--;
-        dst[3] = (Sint32) sample0;
-        dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[1] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[3] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
+        dst[1] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
+        dst[0] = (Sint32) sample0;
         last_sample0 = sample0;
         dst -= 4;
     }
@@ -13302,14 +13302,14 @@
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src -= 2;
-        dst[7] = (Sint32) sample1;
-        dst[6] = (Sint32) sample0;
-        dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[3] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[2] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[7] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[6] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
+        dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
+        dst[3] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
+        dst[2] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
+        dst[1] = (Sint32) sample1;
+        dst[0] = (Sint32) sample0;
         last_sample1 = sample1;
         last_sample0 = sample0;
         dst -= 8;
@@ -13452,22 +13452,22 @@
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src -= 4;
-        dst[15] = (Sint32) sample3;
-        dst[14] = (Sint32) sample2;
-        dst[13] = (Sint32) sample1;
-        dst[12] = (Sint32) sample0;
-        dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[7] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[6] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[5] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[4] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[15] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[14] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[13] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[12] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
+        dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
+        dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
+        dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
+        dst[7] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
+        dst[6] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
+        dst[5] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
+        dst[4] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
+        dst[3] = (Sint32) sample3;
+        dst[2] = (Sint32) sample2;
+        dst[1] = (Sint32) sample1;
+        dst[0] = (Sint32) sample0;
         last_sample3 = sample3;
         last_sample2 = sample2;
         last_sample1 = sample1;
@@ -13642,30 +13642,30 @@
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src -= 6;
-        dst[23] = (Sint32) sample5;
-        dst[22] = (Sint32) sample4;
-        dst[21] = (Sint32) sample3;
-        dst[20] = (Sint32) sample2;
-        dst[19] = (Sint32) sample1;
-        dst[18] = (Sint32) sample0;
-        dst[17] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
-        dst[16] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
-        dst[15] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[14] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[13] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[12] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[11] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[10] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[9] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[8] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[7] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[6] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[5] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[22] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[21] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[20] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[19] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[18] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[17] = (Sint32) ((sample5 + last_sample5) >> 1);
+        dst[16] = (Sint32) ((sample4 + last_sample4) >> 1);
+        dst[15] = (Sint32) ((sample3 + last_sample3) >> 1);
+        dst[14] = (Sint32) ((sample2 + last_sample2) >> 1);
+        dst[13] = (Sint32) ((sample1 + last_sample1) >> 1);
+        dst[12] = (Sint32) ((sample0 + last_sample0) >> 1);
+        dst[11] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
+        dst[10] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
+        dst[9] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
+        dst[8] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
+        dst[7] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
+        dst[6] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
+        dst[5] = (Sint32) sample5;
+        dst[4] = (Sint32) sample4;
+        dst[3] = (Sint32) sample3;
+        dst[2] = (Sint32) sample2;
+        dst[1] = (Sint32) sample1;
+        dst[0] = (Sint32) sample0;
         last_sample5 = sample5;
         last_sample4 = sample4;
         last_sample3 = sample3;
@@ -13872,38 +13872,38 @@
         const Sint64 sample1 = (Sint64) ((Sint32) SDL_SwapBE32(src[1]));
         const Sint64 sample0 = (Sint64) ((Sint32) SDL_SwapBE32(src[0]));
         src -= 8;
-        dst[31] = (Sint32) sample7;
-        dst[30] = (Sint32) sample6;
-        dst[29] = (Sint32) sample5;
-        dst[28] = (Sint32) sample4;
-        dst[27] = (Sint32) sample3;
-        dst[26] = (Sint32) sample2;
-        dst[25] = (Sint32) sample1;
-        dst[24] = (Sint32) sample0;
-        dst[23] = (Sint32) (((3 * sample7) + last_sample7) >> 2);
-        dst[22] = (Sint32) (((3 * sample6) + last_sample6) >> 2);
-        dst[21] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
-        dst[20] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
-        dst[19] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
-        dst[18] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
-        dst[17] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
-        dst[16] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
-        dst[15] = (Sint32) ((sample7 + last_sample7) >> 1);
-        dst[14] = (Sint32) ((sample6 + last_sample6) >> 1);
-        dst[13] = (Sint32) ((sample5 + last_sample5) >> 1);
-        dst[12] = (Sint32) ((sample4 + last_sample4) >> 1);
-        dst[11] = (Sint32) ((sample3 + last_sample3) >> 1);
-        dst[10] = (Sint32) ((sample2 + last_sample2) >> 1);
-        dst[9] = (Sint32) ((sample1 + last_sample1) >> 1);
-        dst[8] = (Sint32) ((sample0 + last_sample0) >> 1);
-        dst[7] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2);
-        dst[6] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2);
-        dst[5] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
-        dst[4] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
-        dst[3] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
-        dst[2] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
-        dst[1] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
-        dst[0] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[31] = (Sint32) ((sample7 + (3 * last_sample7)) >> 2);
+        dst[30] = (Sint32) ((sample6 + (3 * last_sample6)) >> 2);
+        dst[29] = (Sint32) ((sample5 + (3 * last_sample5)) >> 2);
+        dst[28] = (Sint32) ((sample4 + (3 * last_sample4)) >> 2);
+        dst[27] = (Sint32) ((sample3 + (3 * last_sample3)) >> 2);
+        dst[26] = (Sint32) ((sample2 + (3 * last_sample2)) >> 2);
+        dst[25] = (Sint32) ((sample1 + (3 * last_sample1)) >> 2);
+        dst[24] = (Sint32) ((sample0 + (3 * last_sample0)) >> 2);
+        dst[23] = (Sint32) ((sample7 + last_sample7) >> 1);
+        dst[22] = (Sint32) ((sample6 + last_sample6) >> 1);
+        dst[21] = (Sint32) ((sample5 + last_sample5) >> 1);
+        dst[20] = (Sint32) ((sample4 + last_sample4) >> 1);
+        dst[19] = (Sint32) ((sample3 + last_sample3) >> 1);
+        dst[18] = (Sint32) ((sample2 + last_sample2) >> 1);
+        dst[17] = (Sint32) ((sample1 + last_sample1) >> 1);
+        dst[16] = (Sint32) ((sample0 + last_sample0) >> 1);
+        dst[15] = (Sint32) (((3 * sample7) + last_sample7) >> 2);
+        dst[14] = (Sint32) (((3 * sample6) + last_sample6) >> 2);
+        dst[13] = (Sint32) (((3 * sample5) + last_sample5) >> 2);
+        dst[12] = (Sint32) (((3 * sample4) + last_sample4) >> 2);
+        dst[11] = (Sint32) (((3 * sample3) + last_sample3) >> 2);
+        dst[10] = (Sint32) (((3 * sample2) + last_sample2) >> 2);
+        dst[9] = (Sint32) (((3 * sample1) + last_sample1) >> 2);
+        dst[8] = (Sint32) (((3 * sample0) + last_sample0) >> 2);
+        dst[7] = (Sint32) sample7;
+        dst[6] = (Sint32) sample6;
+        dst[5] = (Sint32) sample5;
+        dst[4] = (Sint32) sample4;
+        dst[3] = (Sint32) sample3;
+        dst[2] = (Sint32) sample2;
+        dst[1] = (Sint32) sample1;
+        dst[0] = (Sint32) sample0;
         last_sample7 = sample7;
         last_sample6 = sample6;
         last_sample5 = sample5;
@@ -14043,10 +14043,10 @@
     while (dst >= target) {
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src--;
-        dst[3] = (float) sample0;
-        dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[1] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[3] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[2] = (float) ((sample0 + last_sample0) * 0.5);
+        dst[1] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
+        dst[0] = (float) sample0;
         last_sample0 = sample0;
         dst -= 4;
     }
@@ -14162,14 +14162,14 @@
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src -= 2;
-        dst[7] = (float) sample1;
-        dst[6] = (float) sample0;
-        dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[3] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[7] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
+        dst[6] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[5] = (float) ((sample1 + last_sample1) * 0.5);
+        dst[4] = (float) ((sample0 + last_sample0) * 0.5);
+        dst[3] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
+        dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
+        dst[1] = (float) sample1;
+        dst[0] = (float) sample0;
         last_sample1 = sample1;
         last_sample0 = sample0;
         dst -= 8;
@@ -14312,22 +14312,22 @@
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src -= 4;
-        dst[15] = (float) sample3;
-        dst[14] = (float) sample2;
-        dst[13] = (float) sample1;
-        dst[12] = (float) sample0;
-        dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[7] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[6] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[5] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[4] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[15] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
+        dst[14] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
+        dst[13] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
+        dst[12] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[11] = (float) ((sample3 + last_sample3) * 0.5);
+        dst[10] = (float) ((sample2 + last_sample2) * 0.5);
+        dst[9] = (float) ((sample1 + last_sample1) * 0.5);
+        dst[8] = (float) ((sample0 + last_sample0) * 0.5);
+        dst[7] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
+        dst[6] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
+        dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
+        dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
+        dst[3] = (float) sample3;
+        dst[2] = (float) sample2;
+        dst[1] = (float) sample1;
+        dst[0] = (float) sample0;
         last_sample3 = sample3;
         last_sample2 = sample2;
         last_sample1 = sample1;
@@ -14502,30 +14502,30 @@
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src -= 6;
-        dst[23] = (float) sample5;
-        dst[22] = (float) sample4;
-        dst[21] = (float) sample3;
-        dst[20] = (float) sample2;
-        dst[19] = (float) sample1;
-        dst[18] = (float) sample0;
-        dst[17] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
-        dst[16] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
-        dst[15] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[14] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[13] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[12] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[11] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[10] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[9] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[8] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[7] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[6] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[5] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
-        dst[4] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
-        dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[23] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
+        dst[22] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
+        dst[21] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
+        dst[20] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
+        dst[19] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
+        dst[18] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[17] = (float) ((sample5 + last_sample5) * 0.5);
+        dst[16] = (float) ((sample4 + last_sample4) * 0.5);
+        dst[15] = (float) ((sample3 + last_sample3) * 0.5);
+        dst[14] = (float) ((sample2 + last_sample2) * 0.5);
+        dst[13] = (float) ((sample1 + last_sample1) * 0.5);
+        dst[12] = (float) ((sample0 + last_sample0) * 0.5);
+        dst[11] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
+        dst[10] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
+        dst[9] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
+        dst[8] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
+        dst[7] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
+        dst[6] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
+        dst[5] = (float) sample5;
+        dst[4] = (float) sample4;
+        dst[3] = (float) sample3;
+        dst[2] = (float) sample2;
+        dst[1] = (float) sample1;
+        dst[0] = (float) sample0;
         last_sample5 = sample5;
         last_sample4 = sample4;
         last_sample3 = sample3;
@@ -14732,38 +14732,38 @@
         const double sample1 = (double) SDL_SwapFloatLE(src[1]);
         const double sample0 = (double) SDL_SwapFloatLE(src[0]);
         src -= 8;
-        dst[31] = (float) sample7;
-        dst[30] = (float) sample6;
-        dst[29] = (float) sample5;
-        dst[28] = (float) sample4;
-        dst[27] = (float) sample3;
-        dst[26] = (float) sample2;
-        dst[25] = (float) sample1;
-        dst[24] = (float) sample0;
-        dst[23] = (float) (((3.0 * sample7) + last_sample7) * 0.25);
-        dst[22] = (float) (((3.0 * sample6) + last_sample6) * 0.25);
-        dst[21] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
-        dst[20] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
-        dst[19] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[18] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[17] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[16] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[15] = (float) ((sample7 + last_sample7) * 0.5);
-        dst[14] = (float) ((sample6 + last_sample6) * 0.5);
-        dst[13] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[12] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[11] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[10] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[9] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[8] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[7] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25);
-        dst[6] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25);
-        dst[5] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
-        dst[4] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
-        dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[31] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25);
+        dst[30] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25);
+        dst[29] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
+        dst[28] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
+        dst[27] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
+        dst[26] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
+        dst[25] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
+        dst[24] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[23] = (float) ((sample7 + last_sample7) * 0.5);
+        dst[22] = (float) ((sample6 + last_sample6) * 0.5);
+        dst[21] = (float) ((sample5 + last_sample5) * 0.5);
+        dst[20] = (float) ((sample4 + last_sample4) * 0.5);
+        dst[19] = (float) ((sample3 + last_sample3) * 0.5);
+        dst[18] = (float) ((sample2 + last_sample2) * 0.5);
+        dst[17] = (float) ((sample1 + last_sample1) * 0.5);
+        dst[16] = (float) ((sample0 + last_sample0) * 0.5);
+        dst[15] = (float) (((3.0 * sample7) + last_sample7) * 0.25);
+        dst[14] = (float) (((3.0 * sample6) + last_sample6) * 0.25);
+        dst[13] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
+        dst[12] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
+        dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
+        dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
+        dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
+        dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
+        dst[7] = (float) sample7;
+        dst[6] = (float) sample6;
+        dst[5] = (float) sample5;
+        dst[4] = (float) sample4;
+        dst[3] = (float) sample3;
+        dst[2] = (float) sample2;
+        dst[1] = (float) sample1;
+        dst[0] = (float) sample0;
         last_sample7 = sample7;
         last_sample6 = sample6;
         last_sample5 = sample5;
@@ -14903,10 +14903,10 @@
     while (dst >= target) {
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src--;
-        dst[3] = (float) sample0;
-        dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[1] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[3] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[2] = (float) ((sample0 + last_sample0) * 0.5);
+        dst[1] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
+        dst[0] = (float) sample0;
         last_sample0 = sample0;
         dst -= 4;
     }
@@ -15022,14 +15022,14 @@
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src -= 2;
-        dst[7] = (float) sample1;
-        dst[6] = (float) sample0;
-        dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[3] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[2] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[7] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
+        dst[6] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[5] = (float) ((sample1 + last_sample1) * 0.5);
+        dst[4] = (float) ((sample0 + last_sample0) * 0.5);
+        dst[3] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
+        dst[2] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
+        dst[1] = (float) sample1;
+        dst[0] = (float) sample0;
         last_sample1 = sample1;
         last_sample0 = sample0;
         dst -= 8;
@@ -15172,22 +15172,22 @@
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src -= 4;
-        dst[15] = (float) sample3;
-        dst[14] = (float) sample2;
-        dst[13] = (float) sample1;
-        dst[12] = (float) sample0;
-        dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[7] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[6] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[5] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[4] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[15] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
+        dst[14] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
+        dst[13] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
+        dst[12] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[11] = (float) ((sample3 + last_sample3) * 0.5);
+        dst[10] = (float) ((sample2 + last_sample2) * 0.5);
+        dst[9] = (float) ((sample1 + last_sample1) * 0.5);
+        dst[8] = (float) ((sample0 + last_sample0) * 0.5);
+        dst[7] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
+        dst[6] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
+        dst[5] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
+        dst[4] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
+        dst[3] = (float) sample3;
+        dst[2] = (float) sample2;
+        dst[1] = (float) sample1;
+        dst[0] = (float) sample0;
         last_sample3 = sample3;
         last_sample2 = sample2;
         last_sample1 = sample1;
@@ -15362,30 +15362,30 @@
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src -= 6;
-        dst[23] = (float) sample5;
-        dst[22] = (float) sample4;
-        dst[21] = (float) sample3;
-        dst[20] = (float) sample2;
-        dst[19] = (float) sample1;
-        dst[18] = (float) sample0;
-        dst[17] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
-        dst[16] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
-        dst[15] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[14] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[13] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[12] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[11] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[10] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[9] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[8] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[7] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[6] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[5] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
-        dst[4] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
-        dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[23] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
+        dst[22] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
+        dst[21] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
+        dst[20] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
+        dst[19] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
+        dst[18] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[17] = (float) ((sample5 + last_sample5) * 0.5);
+        dst[16] = (float) ((sample4 + last_sample4) * 0.5);
+        dst[15] = (float) ((sample3 + last_sample3) * 0.5);
+        dst[14] = (float) ((sample2 + last_sample2) * 0.5);
+        dst[13] = (float) ((sample1 + last_sample1) * 0.5);
+        dst[12] = (float) ((sample0 + last_sample0) * 0.5);
+        dst[11] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
+        dst[10] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
+        dst[9] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
+        dst[8] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
+        dst[7] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
+        dst[6] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
+        dst[5] = (float) sample5;
+        dst[4] = (float) sample4;
+        dst[3] = (float) sample3;
+        dst[2] = (float) sample2;
+        dst[1] = (float) sample1;
+        dst[0] = (float) sample0;
         last_sample5 = sample5;
         last_sample4 = sample4;
         last_sample3 = sample3;
@@ -15592,38 +15592,38 @@
         const double sample1 = (double) SDL_SwapFloatBE(src[1]);
         const double sample0 = (double) SDL_SwapFloatBE(src[0]);
         src -= 8;
-        dst[31] = (float) sample7;
-        dst[30] = (float) sample6;
-        dst[29] = (float) sample5;
-        dst[28] = (float) sample4;
-        dst[27] = (float) sample3;
-        dst[26] = (float) sample2;
-        dst[25] = (float) sample1;
-        dst[24] = (float) sample0;
-        dst[23] = (float) (((3.0 * sample7) + last_sample7) * 0.25);
-        dst[22] = (float) (((3.0 * sample6) + last_sample6) * 0.25);
-        dst[21] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
-        dst[20] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
-        dst[19] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
-        dst[18] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
-        dst[17] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
-        dst[16] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
-        dst[15] = (float) ((sample7 + last_sample7) * 0.5);
-        dst[14] = (float) ((sample6 + last_sample6) * 0.5);
-        dst[13] = (float) ((sample5 + last_sample5) * 0.5);
-        dst[12] = (float) ((sample4 + last_sample4) * 0.5);
-        dst[11] = (float) ((sample3 + last_sample3) * 0.5);
-        dst[10] = (float) ((sample2 + last_sample2) * 0.5);
-        dst[9] = (float) ((sample1 + last_sample1) * 0.5);
-        dst[8] = (float) ((sample0 + last_sample0) * 0.5);
-        dst[7] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25);
-        dst[6] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25);
-        dst[5] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
-        dst[4] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
-        dst[3] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
-        dst[2] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
-        dst[1] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
-        dst[0] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[31] = (float) ((sample7 + (3.0 * last_sample7)) * 0.25);
+        dst[30] = (float) ((sample6 + (3.0 * last_sample6)) * 0.25);
+        dst[29] = (float) ((sample5 + (3.0 * last_sample5)) * 0.25);
+        dst[28] = (float) ((sample4 + (3.0 * last_sample4)) * 0.25);
+        dst[27] = (float) ((sample3 + (3.0 * last_sample3)) * 0.25);
+        dst[26] = (float) ((sample2 + (3.0 * last_sample2)) * 0.25);
+        dst[25] = (float) ((sample1 + (3.0 * last_sample1)) * 0.25);
+        dst[24] = (float) ((sample0 + (3.0 * last_sample0)) * 0.25);
+        dst[23] = (float) ((sample7 + last_sample7) * 0.5);
+        dst[22] = (float) ((sample6 + last_sample6) * 0.5);
+        dst[21] = (float) ((sample5 + last_sample5) * 0.5);
+        dst[20] = (float) ((sample4 + last_sample4) * 0.5);
+        dst[19] = (float) ((sample3 + last_sample3) * 0.5);
+        dst[18] = (float) ((sample2 + last_sample2) * 0.5);
+        dst[17] = (float) ((sample1 + last_sample1) * 0.5);
+        dst[16] = (float) ((sample0 + last_sample0) * 0.5);
+        dst[15] = (float) (((3.0 * sample7) + last_sample7) * 0.25);
+        dst[14] = (float) (((3.0 * sample6) + last_sample6) * 0.25);
+        dst[13] = (float) (((3.0 * sample5) + last_sample5) * 0.25);
+        dst[12] = (float) (((3.0 * sample4) + last_sample4) * 0.25);
+        dst[11] = (float) (((3.0 * sample3) + last_sample3) * 0.25);
+        dst[10] = (float) (((3.0 * sample2) + last_sample2) * 0.25);
+        dst[9] = (float) (((3.0 * sample1) + last_sample1) * 0.25);
+        dst[8] = (float) (((3.0 * sample0) + last_sample0) * 0.25);
+        dst[7] = (float) sample7;
+        dst[6] = (float) sample6;
+        dst[5] = (float) sample5;
+        dst[4] = (float) sample4;
+        dst[3] = (float) sample3;
+        dst[2] = (float) sample2;
+        dst[1] = (float) sample1;
+        dst[0] = (float) sample0;
         last_sample7 = sample7;
         last_sample6 = sample6;
         last_sample5 = sample5;
--- a/src/audio/sdlgenaudiocvt.pl	Thu Jan 12 21:42:35 2012 -0500
+++ b/src/audio/sdlgenaudiocvt.pl	Thu Jan 12 22:54:09 2012 -0500
@@ -611,28 +611,28 @@
             for (my $i = $channels-1; $i >= 0; $i--) {
                 my $dsti = $i + ($channels * 3);
                 print <<EOF;
-        dst[$dsti] = ($fctype) sample${i};
+        dst[$dsti] = ($fctype) ((sample${i} + ($mult3 * last_sample${i})) $interp2);
 EOF
             }
 
             for (my $i = $channels-1; $i >= 0; $i--) {
                 my $dsti = $i + ($channels * 2);
                 print <<EOF;
-        dst[$dsti] = ($fctype) ((($mult3 * sample${i}) + last_sample${i}) $interp2);
+        dst[$dsti] = ($fctype) ((sample${i} + last_sample${i}) $interp);
 EOF
             }
 
             for (my $i = $channels-1; $i >= 0; $i--) {
                 my $dsti = $i + ($channels * 1);
                 print <<EOF;
-        dst[$dsti] = ($fctype) ((sample${i} + last_sample${i}) $interp);
+        dst[$dsti] = ($fctype) ((($mult3 * sample${i}) + last_sample${i}) $interp2);
 EOF
             }
 
             for (my $i = $channels-1; $i >= 0; $i--) {
                 my $dsti = $i + ($channels * 0);
                 print <<EOF;
-        dst[$dsti] = ($fctype) ((sample${i} + ($mult3 * last_sample${i})) $interp2);
+        dst[$dsti] = ($fctype) sample${i};
 EOF
             }
         } else {