Mercurial > mplayer.hg
annotate libaf/reorder_ch.c @ 29417:eb3504191e7b
undocumented keyword
author | compn |
---|---|
date | Thu, 30 Jul 2009 12:03:42 +0000 |
parents | f9ae25067fe0 |
children | 99eda963d27a |
rev | line source |
---|---|
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1 /* |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
2 * common functions for reordering audio channels |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
3 * |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
4 * Copyright (C) 2007 Ulion <ulion A gmail P com> |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
5 * |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
6 * This file is part of MPlayer. |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
7 * |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
8 * MPlayer is free software; you can redistribute it and/or modify |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
9 * it under the terms of the GNU General Public License as published by |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
10 * the Free Software Foundation; either version 2 of the License, or |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
11 * (at your option) any later version. |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
12 * |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
13 * MPlayer is distributed in the hope that it will be useful, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
16 * GNU General Public License for more details. |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
17 * |
26740
b3a38b361fef
Use standard license headers with standard formatting.
diego
parents:
26132
diff
changeset
|
18 * You should have received a copy of the GNU General Public License along |
b3a38b361fef
Use standard license headers with standard formatting.
diego
parents:
26132
diff
changeset
|
19 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
b3a38b361fef
Use standard license headers with standard formatting.
diego
parents:
26132
diff
changeset
|
20 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
21 */ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
22 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
23 #include <stdio.h> |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
24 #include <stdlib.h> |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
25 #include <inttypes.h> |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
26 #include <string.h> |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
27 #include "libvo/fastmemcpy.h" |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
28 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
29 #include "reorder_ch.h" |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
30 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
31 #ifdef TEST |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
32 #define mp_msg(mod,lev, fmt, args... ) printf( fmt, ## args ) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
33 #else |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
34 #include "mp_msg.h" |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
35 #endif |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
36 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
37 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
38 #define REORDER_COPY_5(DEST,SRC,SAMPLES,S0,S1,S2,S3,S4) \ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
39 for (i = 0; i < SAMPLES; i += 5) {\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
40 DEST[i] = SRC[i+S0];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
41 DEST[i+1] = SRC[i+S1];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
42 DEST[i+2] = SRC[i+S2];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
43 DEST[i+3] = SRC[i+S3];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
44 DEST[i+4] = SRC[i+S4];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
45 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
46 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
47 static int reorder_copy_5ch(void *dest, const void *src, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
48 unsigned int samples, unsigned int samplesize, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
49 int s0, int s1, int s2, int s3, int s4) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
50 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
51 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
52 switch (samplesize) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
53 case 1: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
54 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
55 int8_t *dest_8 = dest; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
56 const int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
57 REORDER_COPY_5(dest_8,src_8,samples,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
58 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
59 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
60 case 2: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
61 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
62 int16_t *dest_16 = dest; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
63 const int16_t *src_16 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
64 REORDER_COPY_5(dest_16,src_16,samples,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
65 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
66 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
67 case 3: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
68 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
69 int8_t *dest_8 = dest; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
70 const int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
71 for (i = 0; i < samples; i += 15) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
72 dest_8[i] = src_8[i+s0*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
73 dest_8[i+1] = src_8[i+s0*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
74 dest_8[i+2] = src_8[i+s0*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
75 dest_8[i+3] = src_8[i+s1*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
76 dest_8[i+4] = src_8[i+s1*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
77 dest_8[i+5] = src_8[i+s1*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
78 dest_8[i+6] = src_8[i+s2*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
79 dest_8[i+7] = src_8[i+s2*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
80 dest_8[i+8] = src_8[i+s2*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
81 dest_8[i+9] = src_8[i+s3*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
82 dest_8[i+10] = src_8[i+s3*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
83 dest_8[i+11] = src_8[i+s3*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
84 dest_8[i+12] = src_8[i+s4*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
85 dest_8[i+13] = src_8[i+s4*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
86 dest_8[i+14] = src_8[i+s4*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
87 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
88 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
89 case 4: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
90 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
91 int32_t *dest_32 = dest; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
92 const int32_t *src_32 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
93 REORDER_COPY_5(dest_32,src_32,samples,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
94 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
95 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
96 case 8: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
97 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
98 int64_t *dest_64 = dest; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
99 const int64_t *src_64 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
100 REORDER_COPY_5(dest_64,src_64,samples,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
101 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
102 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
103 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
104 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
105 "[reorder_ch] Unsupported sample size: %d, please " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
106 "report this error on the MPlayer mailing list.\n",samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
107 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
108 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
109 return 1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
110 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
111 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
112 #define REORDER_COPY_6(DEST,SRC,SAMPLES,S0,S1,S2,S3,S4,S5) \ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
113 for (i = 0; i < SAMPLES; i += 6) {\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
114 DEST[i] = SRC[i+S0];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
115 DEST[i+1] = SRC[i+S1];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
116 DEST[i+2] = SRC[i+S2];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
117 DEST[i+3] = SRC[i+S3];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
118 DEST[i+4] = SRC[i+S4];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
119 DEST[i+5] = SRC[i+S5];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
120 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
121 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
122 static int reorder_copy_6ch(void *dest, const void *src, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
123 unsigned int samples, uint8_t samplesize, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
124 int s0, int s1, int s2, int s3, int s4, int s5) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
125 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
126 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
127 switch (samplesize) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
128 case 1: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
129 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
130 int8_t *dest_8 = dest; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
131 const int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
132 REORDER_COPY_6(dest_8,src_8,samples,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
133 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
134 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
135 case 2: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
136 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
137 int16_t *dest_16 = dest; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
138 const int16_t *src_16 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
139 REORDER_COPY_6(dest_16,src_16,samples,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
140 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
141 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
142 case 3: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
143 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
144 int8_t *dest_8 = dest; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
145 const int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
146 for (i = 0; i < samples; i += 18) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
147 dest_8[i] = src_8[i+s0*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
148 dest_8[i+1] = src_8[i+s0*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
149 dest_8[i+2] = src_8[i+s0*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
150 dest_8[i+3] = src_8[i+s1*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
151 dest_8[i+4] = src_8[i+s1*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
152 dest_8[i+5] = src_8[i+s1*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
153 dest_8[i+6] = src_8[i+s2*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
154 dest_8[i+7] = src_8[i+s2*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
155 dest_8[i+8] = src_8[i+s2*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
156 dest_8[i+9] = src_8[i+s3*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
157 dest_8[i+10] = src_8[i+s3*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
158 dest_8[i+11] = src_8[i+s3*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
159 dest_8[i+12] = src_8[i+s4*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
160 dest_8[i+13] = src_8[i+s4*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
161 dest_8[i+14] = src_8[i+s4*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
162 dest_8[i+15] = src_8[i+s5*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
163 dest_8[i+16] = src_8[i+s5*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
164 dest_8[i+17] = src_8[i+s5*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
165 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
166 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
167 case 4: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
168 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
169 int32_t *dest_32 = dest; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
170 const int32_t *src_32 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
171 REORDER_COPY_6(dest_32,src_32,samples,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
172 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
173 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
174 case 8: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
175 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
176 int64_t *dest_64 = dest; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
177 const int64_t *src_64 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
178 REORDER_COPY_6(dest_64,src_64,samples,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
179 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
180 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
181 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
182 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
183 "[reorder_ch] Unsupported sample size: %d, please " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
184 "report this error on the MPlayer mailing list.\n",samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
185 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
186 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
187 return 1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
188 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
189 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
190 void reorder_channel_copy(void *src, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
191 int src_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
192 void *dest, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
193 int dest_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
194 int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
195 int samplesize) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
196 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
197 if (dest_layout==src_layout) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
198 fast_memcpy(dest, src, samples*samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
199 return; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
200 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
201 if (!AF_IS_SAME_CH_NUM(dest_layout,src_layout)) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
202 mp_msg(MSGT_GLOBAL, MSGL_WARN, "[reorder_ch] different channel count " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
203 "between src and dest: %x, %x\n", |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
204 AF_GET_CH_NUM_WITH_LFE(src_layout), |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
205 AF_GET_CH_NUM_WITH_LFE(dest_layout)); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
206 return; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
207 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
208 switch ((src_layout<<16)|dest_layout) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
209 // AF_CHANNEL_LAYOUT_5_0_A L R C Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
210 // AF_CHANNEL_LAYOUT_5_0_B L R Ls Rs C |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
211 // AF_CHANNEL_LAYOUT_5_0_C L C R Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
212 // AF_CHANNEL_LAYOUT_5_0_D C L R Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
213 case AF_CHANNEL_LAYOUT_5_0_A << 16 | AF_CHANNEL_LAYOUT_5_0_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
214 reorder_copy_5ch(dest, src, samples, samplesize, 0, 1, 3, 4, 2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
215 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
216 case AF_CHANNEL_LAYOUT_5_0_A << 16 | AF_CHANNEL_LAYOUT_5_0_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
217 reorder_copy_5ch(dest, src, samples, samplesize, 0, 2, 1, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
218 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
219 case AF_CHANNEL_LAYOUT_5_0_A << 16 | AF_CHANNEL_LAYOUT_5_0_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
220 reorder_copy_5ch(dest, src, samples, samplesize, 2, 0, 1, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
221 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
222 case AF_CHANNEL_LAYOUT_5_0_B << 16 | AF_CHANNEL_LAYOUT_5_0_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
223 reorder_copy_5ch(dest, src, samples, samplesize, 0, 1, 4, 2, 3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
224 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
225 case AF_CHANNEL_LAYOUT_5_0_B << 16 | AF_CHANNEL_LAYOUT_5_0_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
226 reorder_copy_5ch(dest, src, samples, samplesize, 0, 4, 1, 2, 3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
227 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
228 case AF_CHANNEL_LAYOUT_5_0_B << 16 | AF_CHANNEL_LAYOUT_5_0_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
229 reorder_copy_5ch(dest, src, samples, samplesize, 4, 0, 1, 2, 3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
230 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
231 case AF_CHANNEL_LAYOUT_5_0_C << 16 | AF_CHANNEL_LAYOUT_5_0_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
232 reorder_copy_5ch(dest, src, samples, samplesize, 0, 2, 1, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
233 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
234 case AF_CHANNEL_LAYOUT_5_0_C << 16 | AF_CHANNEL_LAYOUT_5_0_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
235 reorder_copy_5ch(dest, src, samples, samplesize, 0, 2, 3, 4, 1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
236 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
237 case AF_CHANNEL_LAYOUT_5_0_C << 16 | AF_CHANNEL_LAYOUT_5_0_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
238 reorder_copy_5ch(dest, src, samples, samplesize, 1, 0, 2, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
239 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
240 case AF_CHANNEL_LAYOUT_5_0_D << 16 | AF_CHANNEL_LAYOUT_5_0_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
241 reorder_copy_5ch(dest, src, samples, samplesize, 1, 2, 0, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
242 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
243 case AF_CHANNEL_LAYOUT_5_0_D << 16 | AF_CHANNEL_LAYOUT_5_0_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
244 reorder_copy_5ch(dest, src, samples, samplesize, 1, 2, 3, 4, 0); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
245 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
246 case AF_CHANNEL_LAYOUT_5_0_D << 16 | AF_CHANNEL_LAYOUT_5_0_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
247 reorder_copy_5ch(dest, src, samples, samplesize, 1, 0, 2, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
248 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
249 // AF_CHANNEL_LAYOUT_5_1_A L R C LFE Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
250 // AF_CHANNEL_LAYOUT_5_1_B L R Ls Rs C LFE |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
251 // AF_CHANNEL_LAYOUT_5_1_C L C R Ls Rs LFE |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
252 // AF_CHANNEL_LAYOUT_5_1_D C L R Ls Rs LFE |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
253 // AF_CHANNEL_LAYOUT_5_1_E LFE L C R Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
254 case AF_CHANNEL_LAYOUT_5_1_A << 16 | AF_CHANNEL_LAYOUT_5_1_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
255 reorder_copy_6ch(dest, src, samples, samplesize, 0, 1, 4, 5, 2, 3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
256 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
257 case AF_CHANNEL_LAYOUT_5_1_A << 16 | AF_CHANNEL_LAYOUT_5_1_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
258 reorder_copy_6ch(dest, src, samples, samplesize, 0, 2, 1, 4, 5, 3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
259 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
260 case AF_CHANNEL_LAYOUT_5_1_A << 16 | AF_CHANNEL_LAYOUT_5_1_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
261 reorder_copy_6ch(dest, src, samples, samplesize, 2, 0, 1, 4, 5, 3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
262 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
263 case AF_CHANNEL_LAYOUT_5_1_B << 16 | AF_CHANNEL_LAYOUT_5_1_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
264 reorder_copy_6ch(dest, src, samples, samplesize, 0, 1, 4, 5, 2, 3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
265 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
266 case AF_CHANNEL_LAYOUT_5_1_B << 16 | AF_CHANNEL_LAYOUT_5_1_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
267 reorder_copy_6ch(dest, src, samples, samplesize, 0, 4, 1, 2, 3, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
268 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
269 case AF_CHANNEL_LAYOUT_5_1_B << 16 | AF_CHANNEL_LAYOUT_5_1_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
270 reorder_copy_6ch(dest, src, samples, samplesize, 4, 0, 1, 2, 3, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
271 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
272 case AF_CHANNEL_LAYOUT_5_1_B << 16 | AF_CHANNEL_LAYOUT_5_1_E: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
273 reorder_copy_6ch(dest, src, samples, samplesize, 5, 0, 4, 1, 2, 3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
274 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
275 case AF_CHANNEL_LAYOUT_5_1_C << 16 | AF_CHANNEL_LAYOUT_5_1_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
276 reorder_copy_6ch(dest, src, samples, samplesize, 0, 2, 1, 5, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
277 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
278 case AF_CHANNEL_LAYOUT_5_1_C << 16 | AF_CHANNEL_LAYOUT_5_1_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
279 reorder_copy_6ch(dest, src, samples, samplesize, 0, 2, 3, 4, 1, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
280 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
281 case AF_CHANNEL_LAYOUT_5_1_C << 16 | AF_CHANNEL_LAYOUT_5_1_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
282 reorder_copy_6ch(dest, src, samples, samplesize, 1, 0, 2, 3, 4, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
283 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
284 case AF_CHANNEL_LAYOUT_5_1_D << 16 | AF_CHANNEL_LAYOUT_5_1_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
285 reorder_copy_6ch(dest, src, samples, samplesize, 1, 2, 0, 5, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
286 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
287 case AF_CHANNEL_LAYOUT_5_1_D << 16 | AF_CHANNEL_LAYOUT_5_1_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
288 reorder_copy_6ch(dest, src, samples, samplesize, 1, 2, 3, 4, 0, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
289 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
290 case AF_CHANNEL_LAYOUT_5_1_D << 16 | AF_CHANNEL_LAYOUT_5_1_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
291 reorder_copy_6ch(dest, src, samples, samplesize, 1, 0, 2, 3, 4, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
292 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
293 case AF_CHANNEL_LAYOUT_5_1_E << 16 | AF_CHANNEL_LAYOUT_5_1_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
294 reorder_copy_6ch(dest, src, samples, samplesize, 1, 3, 4, 5, 2, 0); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
295 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
296 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
297 mp_msg(MSGT_GLOBAL, MSGL_WARN, "[reorder_channel_copy] unsupport " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
298 "from %x to %x, %d * %d\n", src_layout, dest_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
299 samples, samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
300 fast_memcpy(dest, src, samples*samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
301 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
302 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
303 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
304 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
305 #define REORDER_SELF_SWAP_2(SRC,TMP,SAMPLES,CHNUM,S0,S1) \ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
306 for (i = 0; i < SAMPLES; i += CHNUM) {\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
307 TMP = SRC[i+S0];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
308 SRC[i+S0] = SRC[i+S1];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
309 SRC[i+S1] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
310 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
311 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
312 static int reorder_self_2(void *src, unsigned int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
313 unsigned int samplesize, unsigned int chnum, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
314 int s0, int s1) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
315 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
316 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
317 switch (samplesize) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
318 case 1: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
319 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
320 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
321 int8_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
322 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
323 REORDER_SELF_SWAP_2(src_8,tmp,samples,6,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
324 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
325 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
326 REORDER_SELF_SWAP_2(src_8,tmp,samples,5,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
327 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
328 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
329 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
330 case 2: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
331 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
332 int16_t *src_16 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
333 int16_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
334 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
335 REORDER_SELF_SWAP_2(src_16,tmp,samples,6,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
336 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
337 else if (chnum==3) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
338 REORDER_SELF_SWAP_2(src_16,tmp,samples,3,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
339 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
340 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
341 REORDER_SELF_SWAP_2(src_16,tmp,samples,5,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
342 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
343 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
344 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
345 case 3: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
346 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
347 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
348 int8_t tmp0, tmp1, tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
349 for (i = 0; i < samples; i += chnum*3) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
350 tmp0 = src_8[i+s0*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
351 tmp1 = src_8[i+s0*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
352 tmp2 = src_8[i+s0*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
353 src_8[i+s0*3] = src_8[i+s1*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
354 src_8[i+s0*3+1] = src_8[i+s1*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
355 src_8[i+s0*3+2] = src_8[i+s1*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
356 src_8[i+s1*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
357 src_8[i+s1*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
358 src_8[i+s1*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
359 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
360 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
361 case 4: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
362 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
363 int32_t *src_32 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
364 int32_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
365 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
366 REORDER_SELF_SWAP_2(src_32,tmp,samples,6,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
367 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
368 else if (chnum==3) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
369 REORDER_SELF_SWAP_2(src_32,tmp,samples,3,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
370 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
371 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
372 REORDER_SELF_SWAP_2(src_32,tmp,samples,5,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
373 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
374 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
375 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
376 case 8: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
377 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
378 int64_t *src_64 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
379 int64_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
380 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
381 REORDER_SELF_SWAP_2(src_64,tmp,samples,6,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
382 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
383 else if (chnum==3) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
384 REORDER_SELF_SWAP_2(src_64,tmp,samples,3,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
385 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
386 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
387 REORDER_SELF_SWAP_2(src_64,tmp,samples,5,s0,s1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
388 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
389 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
390 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
391 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
392 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
393 "[reorder_ch] Unsupported sample size: %d, please " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
394 "report this error on the MPlayer mailing list.\n",samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
395 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
396 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
397 return 1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
398 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
399 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
400 #define REORDER_SELF_SWAP_3(SRC,TMP,SAMPLES,CHNUM,S0,S1,S2) \ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
401 for (i = 0; i < SAMPLES; i += CHNUM) {\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
402 TMP = SRC[i+S0];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
403 SRC[i+S0] = SRC[i+S1];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
404 SRC[i+S1] = SRC[i+S2];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
405 SRC[i+S2] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
406 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
407 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
408 static int reorder_self_3(void *src, unsigned int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
409 unsigned int samplesize, unsigned int chnum, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
410 int s0, int s1, int s2) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
411 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
412 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
413 switch (samplesize) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
414 case 1: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
415 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
416 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
417 int8_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
418 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
419 REORDER_SELF_SWAP_3(src_8,tmp,samples,6,s0,s1,s2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
420 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
421 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
422 REORDER_SELF_SWAP_3(src_8,tmp,samples,5,s0,s1,s2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
423 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
424 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
425 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
426 case 2: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
427 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
428 int16_t *src_16 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
429 int16_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
430 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
431 REORDER_SELF_SWAP_3(src_16,tmp,samples,6,s0,s1,s2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
432 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
433 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
434 REORDER_SELF_SWAP_3(src_16,tmp,samples,5,s0,s1,s2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
435 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
436 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
437 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
438 case 3: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
439 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
440 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
441 int8_t tmp0, tmp1, tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
442 for (i = 0; i < samples; i += chnum*3) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
443 tmp0 = src_8[i+s0*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
444 tmp1 = src_8[i+s0*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
445 tmp2 = src_8[i+s0*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
446 src_8[i+s0*3] = src_8[i+s1*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
447 src_8[i+s0*3+1] = src_8[i+s1*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
448 src_8[i+s0*3+2] = src_8[i+s1*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
449 src_8[i+s1*3] = src_8[i+s2*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
450 src_8[i+s1*3+1] = src_8[i+s2*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
451 src_8[i+s1*3+2] = src_8[i+s2*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
452 src_8[i+s2*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
453 src_8[i+s2*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
454 src_8[i+s2*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
455 } |
29385 | 456 break; |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
457 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
458 case 4: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
459 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
460 int32_t *src_32 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
461 int32_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
462 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
463 REORDER_SELF_SWAP_3(src_32,tmp,samples,6,s0,s1,s2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
464 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
465 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
466 REORDER_SELF_SWAP_3(src_32,tmp,samples,5,s0,s1,s2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
467 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
468 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
469 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
470 case 8: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
471 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
472 int64_t *src_64 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
473 int64_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
474 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
475 REORDER_SELF_SWAP_3(src_64,tmp,samples,6,s0,s1,s2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
476 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
477 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
478 REORDER_SELF_SWAP_3(src_64,tmp,samples,5,s0,s1,s2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
479 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
480 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
481 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
482 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
483 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
484 "[reorder_ch] Unsupported sample size: %d, please " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
485 "report this error on the MPlayer mailing list.\n",samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
486 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
487 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
488 return 1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
489 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
490 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
491 #define REORDER_SELF_SWAP_4_STEP_1(SRC,TMP,SAMPLES,CHNUM,S0,S1,S2,S3) \ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
492 for (i = 0; i < SAMPLES; i += CHNUM) {\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
493 TMP = SRC[i+S0];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
494 SRC[i+S0] = SRC[i+S1];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
495 SRC[i+S1] = SRC[i+S2];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
496 SRC[i+S2] = SRC[i+S3];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
497 SRC[i+S3] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
498 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
499 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
500 static int reorder_self_4_step_1(void *src, unsigned int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
501 unsigned int samplesize, unsigned int chnum, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
502 int s0, int s1, int s2, int s3) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
503 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
504 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
505 switch (samplesize) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
506 case 1: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
507 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
508 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
509 int8_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
510 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
511 REORDER_SELF_SWAP_4_STEP_1(src_8,tmp,samples,6,s0,s1,s2,s3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
512 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
513 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
514 REORDER_SELF_SWAP_4_STEP_1(src_8,tmp,samples,5,s0,s1,s2,s3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
515 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
516 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
517 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
518 case 2: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
519 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
520 int16_t *src_16 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
521 int16_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
522 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
523 REORDER_SELF_SWAP_4_STEP_1(src_16,tmp,samples,6,s0,s1,s2,s3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
524 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
525 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
526 REORDER_SELF_SWAP_4_STEP_1(src_16,tmp,samples,5,s0,s1,s2,s3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
527 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
528 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
529 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
530 case 3: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
531 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
532 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
533 int8_t tmp0, tmp1, tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
534 for (i = 0; i < samples; i += chnum*3) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
535 tmp0 = src_8[i+s0*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
536 tmp1 = src_8[i+s0*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
537 tmp2 = src_8[i+s0*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
538 src_8[i+s0*3] = src_8[i+s1*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
539 src_8[i+s0*3+1] = src_8[i+s1*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
540 src_8[i+s0*3+2] = src_8[i+s1*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
541 src_8[i+s1*3] = src_8[i+s2*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
542 src_8[i+s1*3+1] = src_8[i+s2*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
543 src_8[i+s1*3+2] = src_8[i+s2*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
544 src_8[i+s2*3] = src_8[i+s3*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
545 src_8[i+s2*3+1] = src_8[i+s3*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
546 src_8[i+s2*3+2] = src_8[i+s3*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
547 src_8[i+s3*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
548 src_8[i+s3*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
549 src_8[i+s3*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
550 } |
29385 | 551 break; |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
552 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
553 case 4: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
554 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
555 int32_t *src_32 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
556 int32_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
557 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
558 REORDER_SELF_SWAP_4_STEP_1(src_32,tmp,samples,6,s0,s1,s2,s3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
559 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
560 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
561 REORDER_SELF_SWAP_4_STEP_1(src_32,tmp,samples,5,s0,s1,s2,s3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
562 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
563 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
564 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
565 case 8: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
566 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
567 int64_t *src_64 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
568 int64_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
569 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
570 REORDER_SELF_SWAP_4_STEP_1(src_64,tmp,samples,6,s0,s1,s2,s3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
571 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
572 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
573 REORDER_SELF_SWAP_4_STEP_1(src_64,tmp,samples,5,s0,s1,s2,s3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
574 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
575 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
576 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
577 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
578 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
579 "[reorder_ch] Unsupported sample size: %d, please " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
580 "report this error on the MPlayer mailing list.\n",samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
581 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
582 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
583 return 1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
584 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
585 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
586 #define REORDER_SELF_SWAP_4_STEP_2(SRC,TMP,SAMPLES,CHNUM,S0,S1,S2,S3) \ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
587 for (i = 0; i < SAMPLES; i += CHNUM) {\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
588 TMP = SRC[i+S0];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
589 SRC[i+S0] = SRC[i+S2];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
590 SRC[i+S2] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
591 TMP = SRC[i+S1];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
592 SRC[i+S1] = SRC[i+S3];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
593 SRC[i+S3] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
594 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
595 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
596 static int reorder_self_4_step_2(void *src, unsigned int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
597 unsigned int samplesize, unsigned int chnum, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
598 int s0, int s1, int s2, int s3) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
599 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
600 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
601 switch (samplesize) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
602 case 3: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
603 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
604 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
605 int8_t tmp0, tmp1, tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
606 for (i = 0; i < samples; i += chnum*3) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
607 tmp0 = src_8[i+s0*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
608 tmp1 = src_8[i+s0*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
609 tmp2 = src_8[i+s0*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
610 src_8[i+s0*3] = src_8[i+s2*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
611 src_8[i+s0*3+1] = src_8[i+s2*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
612 src_8[i+s0*3+2] = src_8[i+s2*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
613 src_8[i+s2*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
614 src_8[i+s2*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
615 src_8[i+s2*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
616 tmp0 = src_8[i+s1*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
617 tmp1 = src_8[i+s1*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
618 tmp2 = src_8[i+s1*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
619 src_8[i+s1*3] = src_8[i+s3*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
620 src_8[i+s1*3+1] = src_8[i+s3*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
621 src_8[i+s1*3+2] = src_8[i+s3*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
622 src_8[i+s3*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
623 src_8[i+s3*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
624 src_8[i+s3*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
625 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
626 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
627 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
628 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
629 "[reorder_ch] Unsupported sample size: %d, please " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
630 "report this error on the MPlayer mailing list.\n",samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
631 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
632 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
633 return 1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
634 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
635 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
636 #define REORDER_SELF_SWAP_5_STEP_1(SRC,TMP,SAMPLES,CHNUM,S0,S1,S2,S3,S4) \ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
637 for (i = 0; i < SAMPLES; i += CHNUM) {\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
638 TMP = SRC[i+S0];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
639 SRC[i+S0] = SRC[i+S1];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
640 SRC[i+S1] = SRC[i+S2];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
641 SRC[i+S2] = SRC[i+S3];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
642 SRC[i+S3] = SRC[i+S4];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
643 SRC[i+S4] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
644 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
645 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
646 static int reorder_self_5_step_1(void *src, unsigned int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
647 unsigned int samplesize, unsigned int chnum, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
648 int s0, int s1, int s2, int s3, int s4) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
649 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
650 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
651 switch (samplesize) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
652 case 1: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
653 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
654 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
655 int8_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
656 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
657 REORDER_SELF_SWAP_5_STEP_1(src_8,tmp,samples,6,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
658 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
659 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
660 REORDER_SELF_SWAP_5_STEP_1(src_8,tmp,samples,5,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
661 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
662 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
663 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
664 case 2: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
665 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
666 int16_t *src_16 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
667 int16_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
668 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
669 REORDER_SELF_SWAP_5_STEP_1(src_16,tmp,samples,6,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
670 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
671 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
672 REORDER_SELF_SWAP_5_STEP_1(src_16,tmp,samples,5,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
673 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
674 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
675 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
676 case 3: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
677 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
678 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
679 int8_t tmp0, tmp1, tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
680 for (i = 0; i < samples; i += chnum*3) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
681 tmp0 = src_8[i+s0*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
682 tmp1 = src_8[i+s0*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
683 tmp2 = src_8[i+s0*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
684 src_8[i+s0*3] = src_8[i+s1*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
685 src_8[i+s0*3+1] = src_8[i+s1*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
686 src_8[i+s0*3+2] = src_8[i+s1*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
687 src_8[i+s1*3] = src_8[i+s2*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
688 src_8[i+s1*3+1] = src_8[i+s2*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
689 src_8[i+s1*3+2] = src_8[i+s2*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
690 src_8[i+s2*3] = src_8[i+s3*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
691 src_8[i+s2*3+1] = src_8[i+s3*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
692 src_8[i+s2*3+2] = src_8[i+s3*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
693 src_8[i+s3*3] = src_8[i+s4*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
694 src_8[i+s3*3+1] = src_8[i+s4*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
695 src_8[i+s3*3+2] = src_8[i+s4*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
696 src_8[i+s4*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
697 src_8[i+s4*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
698 src_8[i+s4*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
699 } |
29385 | 700 break; |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
701 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
702 case 4: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
703 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
704 int32_t *src_32 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
705 int32_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
706 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
707 REORDER_SELF_SWAP_5_STEP_1(src_32,tmp,samples,6,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
708 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
709 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
710 REORDER_SELF_SWAP_5_STEP_1(src_32,tmp,samples,5,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
711 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
712 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
713 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
714 case 8: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
715 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
716 int64_t *src_64 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
717 int64_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
718 if (chnum==6) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
719 REORDER_SELF_SWAP_5_STEP_1(src_64,tmp,samples,6,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
720 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
721 else { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
722 REORDER_SELF_SWAP_5_STEP_1(src_64,tmp,samples,5,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
723 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
724 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
725 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
726 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
727 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
728 "[reorder_ch] Unsupported sample size: %d, please " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
729 "report this error on the MPlayer mailing list.\n",samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
730 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
731 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
732 return 1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
733 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
734 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
735 #define REORDER_SELF_SWAP_2_3(SRC,TMP,SAMPLES,CHNUM,S0,S1,S2,S3,S4) \ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
736 for (i = 0; i < SAMPLES; i += CHNUM) {\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
737 TMP = SRC[i+S0];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
738 SRC[i+S0] = SRC[i+S1];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
739 SRC[i+S1] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
740 TMP = SRC[i+S2];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
741 SRC[i+S2] = SRC[i+S3];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
742 SRC[i+S3] = SRC[i+S4];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
743 SRC[i+S4] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
744 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
745 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
746 static int reorder_self_2_3(void *src, unsigned int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
747 unsigned int samplesize, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
748 int s0, int s1, int s2, int s3, int s4) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
749 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
750 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
751 switch (samplesize) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
752 case 1: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
753 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
754 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
755 int8_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
756 REORDER_SELF_SWAP_2_3(src_8,tmp,samples,6,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
757 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
758 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
759 case 2: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
760 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
761 int16_t *src_16 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
762 int16_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
763 REORDER_SELF_SWAP_2_3(src_16,tmp,samples,6,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
764 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
765 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
766 case 3: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
767 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
768 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
769 int8_t tmp0, tmp1, tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
770 for (i = 0; i < samples; i += 18) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
771 tmp0 = src_8[i+s0*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
772 tmp1 = src_8[i+s0*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
773 tmp2 = src_8[i+s0*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
774 src_8[i+s0*3] = src_8[i+s1*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
775 src_8[i+s0*3+1] = src_8[i+s1*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
776 src_8[i+s0*3+2] = src_8[i+s1*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
777 src_8[i+s1*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
778 src_8[i+s1*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
779 src_8[i+s1*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
780 tmp0 = src_8[i+s2*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
781 tmp1 = src_8[i+s2*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
782 tmp2 = src_8[i+s2*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
783 src_8[i+s2*3] = src_8[i+s3*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
784 src_8[i+s2*3+1] = src_8[i+s3*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
785 src_8[i+s2*3+2] = src_8[i+s3*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
786 src_8[i+s3*3] = src_8[i+s4*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
787 src_8[i+s3*3+1] = src_8[i+s4*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
788 src_8[i+s3*3+2] = src_8[i+s4*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
789 src_8[i+s4*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
790 src_8[i+s4*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
791 src_8[i+s4*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
792 } |
29385 | 793 break; |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
794 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
795 case 4: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
796 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
797 int32_t *src_32 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
798 int32_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
799 REORDER_SELF_SWAP_2_3(src_32,tmp,samples,6,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
800 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
801 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
802 case 8: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
803 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
804 int64_t *src_64 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
805 int64_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
806 REORDER_SELF_SWAP_2_3(src_64,tmp,samples,6,s0,s1,s2,s3,s4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
807 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
808 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
809 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
810 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
811 "[reorder_ch] Unsupported sample size: %d, please " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
812 "report this error on the MPlayer mailing list.\n",samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
813 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
814 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
815 return 1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
816 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
817 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
818 #define REORDER_SELF_SWAP_3_3(SRC,TMP,SAMPLES,CHNUM,S0,S1,S2,S3,S4,S5) \ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
819 for (i = 0; i < SAMPLES; i += CHNUM) {\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
820 TMP = SRC[i+S0];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
821 SRC[i+S0] = SRC[i+S1];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
822 SRC[i+S1] = SRC[i+S2];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
823 SRC[i+S2] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
824 TMP = SRC[i+S3];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
825 SRC[i+S3] = SRC[i+S4];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
826 SRC[i+S4] = SRC[i+S5];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
827 SRC[i+S5] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
828 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
829 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
830 static int reorder_self_3_3(void *src, unsigned int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
831 unsigned int samplesize, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
832 int s0, int s1, int s2, int s3, int s4, int s5) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
833 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
834 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
835 switch (samplesize) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
836 case 1: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
837 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
838 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
839 int8_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
840 REORDER_SELF_SWAP_3_3(src_8,tmp,samples,6,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
841 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
842 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
843 case 2: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
844 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
845 int16_t *src_16 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
846 int16_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
847 REORDER_SELF_SWAP_3_3(src_16,tmp,samples,6,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
848 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
849 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
850 case 3: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
851 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
852 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
853 int8_t tmp0, tmp1, tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
854 for (i = 0; i < samples; i += 18) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
855 tmp0 = src_8[i+s0*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
856 tmp1 = src_8[i+s0*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
857 tmp2 = src_8[i+s0*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
858 src_8[i+s0*3] = src_8[i+s1*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
859 src_8[i+s0*3+1] = src_8[i+s1*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
860 src_8[i+s0*3+2] = src_8[i+s1*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
861 src_8[i+s1*3] = src_8[i+s2*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
862 src_8[i+s1*3+1] = src_8[i+s2*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
863 src_8[i+s1*3+2] = src_8[i+s2*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
864 src_8[i+s2*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
865 src_8[i+s2*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
866 src_8[i+s2*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
867 tmp0 = src_8[i+s3*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
868 tmp1 = src_8[i+s3*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
869 tmp2 = src_8[i+s3*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
870 src_8[i+s3*3] = src_8[i+s4*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
871 src_8[i+s3*3+1] = src_8[i+s4*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
872 src_8[i+s3*3+2] = src_8[i+s4*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
873 src_8[i+s4*3] = src_8[i+s5*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
874 src_8[i+s4*3+1] = src_8[i+s5*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
875 src_8[i+s4*3+2] = src_8[i+s5*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
876 src_8[i+s5*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
877 src_8[i+s5*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
878 src_8[i+s5*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
879 } |
29385 | 880 break; |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
881 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
882 case 4: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
883 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
884 int32_t *src_32 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
885 int32_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
886 REORDER_SELF_SWAP_3_3(src_32,tmp,samples,6,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
887 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
888 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
889 case 8: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
890 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
891 int64_t *src_64 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
892 int64_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
893 REORDER_SELF_SWAP_3_3(src_64,tmp,samples,6,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
894 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
895 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
896 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
897 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
898 "[reorder_ch] Unsupported sample size: %d, please " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
899 "report this error on the MPlayer mailing list.\n",samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
900 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
901 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
902 return 1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
903 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
904 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
905 #define REORDER_SELF_SWAP_2_4(SRC,TMP,SAMPLES,CHNUM,S0,S1,S2,S3,S4,S5) \ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
906 for (i = 0; i < SAMPLES; i += CHNUM) {\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
907 TMP = SRC[i+S0];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
908 SRC[i+S0] = SRC[i+S1];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
909 SRC[i+S1] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
910 TMP = SRC[i+S2];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
911 SRC[i+S2] = SRC[i+S3];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
912 SRC[i+S3] = SRC[i+S4];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
913 SRC[i+S4] = SRC[i+S5];\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
914 SRC[i+S5] = TMP;\ |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
915 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
916 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
917 static int reorder_self_2_4(void *src, unsigned int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
918 unsigned int samplesize, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
919 int s0, int s1, int s2, int s3, int s4, int s5) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
920 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
921 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
922 switch (samplesize) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
923 case 1: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
924 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
925 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
926 int8_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
927 REORDER_SELF_SWAP_2_4(src_8,tmp,samples,6,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
928 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
929 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
930 case 2: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
931 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
932 int16_t *src_16 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
933 int16_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
934 REORDER_SELF_SWAP_2_4(src_16,tmp,samples,6,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
935 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
936 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
937 case 3: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
938 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
939 int8_t *src_8 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
940 int8_t tmp0, tmp1, tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
941 for (i = 0; i < samples; i += 18) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
942 tmp0 = src_8[i+s0*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
943 tmp1 = src_8[i+s0*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
944 tmp2 = src_8[i+s0*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
945 src_8[i+s0*3] = src_8[i+s1*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
946 src_8[i+s0*3+1] = src_8[i+s1*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
947 src_8[i+s0*3+2] = src_8[i+s1*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
948 src_8[i+s1*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
949 src_8[i+s1*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
950 src_8[i+s1*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
951 tmp0 = src_8[i+s2*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
952 tmp1 = src_8[i+s2*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
953 tmp2 = src_8[i+s2*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
954 src_8[i+s2*3] = src_8[i+s3*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
955 src_8[i+s2*3+1] = src_8[i+s3*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
956 src_8[i+s2*3+2] = src_8[i+s3*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
957 src_8[i+s3*3] = src_8[i+s4*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
958 src_8[i+s3*3+1] = src_8[i+s4*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
959 src_8[i+s3*3+2] = src_8[i+s4*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
960 src_8[i+s4*3] = src_8[i+s5*3]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
961 src_8[i+s4*3+1] = src_8[i+s5*3+1]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
962 src_8[i+s4*3+2] = src_8[i+s5*3+2]; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
963 src_8[i+s5*3] = tmp0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
964 src_8[i+s5*3+1] = tmp1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
965 src_8[i+s5*3+2] = tmp2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
966 } |
29385 | 967 break; |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
968 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
969 case 4: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
970 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
971 int32_t *src_32 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
972 int32_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
973 REORDER_SELF_SWAP_2_4(src_32,tmp,samples,6,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
974 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
975 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
976 case 8: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
977 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
978 int64_t *src_64 = src; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
979 int64_t tmp; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
980 REORDER_SELF_SWAP_2_4(src_64,tmp,samples,6,s0,s1,s2,s3,s4,s5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
981 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
982 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
983 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
984 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
985 "[reorder_ch] Unsupported sample size: %d, please " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
986 "report this error on the MPlayer mailing list.\n",samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
987 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
988 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
989 return 1; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
990 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
991 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
992 void reorder_channel(void *src, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
993 int src_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
994 int dest_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
995 int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
996 int samplesize) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
997 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
998 if (dest_layout==src_layout) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
999 return; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1000 if (!AF_IS_SAME_CH_NUM(dest_layout,src_layout)) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1001 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1002 "[reorder_channel] different channel count " |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1003 "between current and target: %x, %x\n", |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1004 AF_GET_CH_NUM_WITH_LFE(src_layout), |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1005 AF_GET_CH_NUM_WITH_LFE(dest_layout)); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1006 return; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1007 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1008 switch ((src_layout<<16)|dest_layout) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1009 // AF_CHANNEL_LAYOUT_5_0_A L R C Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1010 // AF_CHANNEL_LAYOUT_5_0_B L R Ls Rs C |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1011 // AF_CHANNEL_LAYOUT_5_0_C L C R Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1012 // AF_CHANNEL_LAYOUT_5_0_D C L R Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1013 case AF_CHANNEL_LAYOUT_5_0_A << 16 | AF_CHANNEL_LAYOUT_5_0_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1014 reorder_self_3(src, samples, samplesize, 5, 2, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1015 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1016 case AF_CHANNEL_LAYOUT_5_0_A << 16 | AF_CHANNEL_LAYOUT_5_0_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1017 reorder_self_2(src, samples, samplesize, 5, 1, 2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1018 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1019 case AF_CHANNEL_LAYOUT_5_0_A << 16 | AF_CHANNEL_LAYOUT_5_0_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1020 reorder_self_3(src, samples, samplesize, 5, 2, 1, 0); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1021 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1022 case AF_CHANNEL_LAYOUT_5_0_B << 16 | AF_CHANNEL_LAYOUT_5_0_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1023 reorder_self_3(src, samples, samplesize, 5, 4, 3, 2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1024 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1025 case AF_CHANNEL_LAYOUT_5_0_B << 16 | AF_CHANNEL_LAYOUT_5_0_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1026 reorder_self_4_step_1(src, samples, samplesize, 5, 4, 3, 2, 1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1027 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1028 case AF_CHANNEL_LAYOUT_5_0_B << 16 | AF_CHANNEL_LAYOUT_5_0_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1029 reorder_self_5_step_1(src, samples, samplesize, 5, 4, 3, 2, 1, 0); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1030 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1031 case AF_CHANNEL_LAYOUT_5_0_C << 16 | AF_CHANNEL_LAYOUT_5_0_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1032 reorder_self_2(src, samples, samplesize, 5, 1, 2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1033 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1034 case AF_CHANNEL_LAYOUT_5_0_C << 16 | AF_CHANNEL_LAYOUT_5_0_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1035 reorder_self_4_step_1(src, samples, samplesize, 5, 1, 2, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1036 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1037 case AF_CHANNEL_LAYOUT_5_0_C << 16 | AF_CHANNEL_LAYOUT_5_0_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1038 reorder_self_2(src, samples, samplesize, 5, 0, 1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1039 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1040 case AF_CHANNEL_LAYOUT_5_0_D << 16 | AF_CHANNEL_LAYOUT_5_0_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1041 reorder_self_3(src, samples, samplesize, 5, 0, 1, 2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1042 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1043 case AF_CHANNEL_LAYOUT_5_0_D << 16 | AF_CHANNEL_LAYOUT_5_0_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1044 reorder_self_5_step_1(src, samples, samplesize, 5, 0, 1, 2, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1045 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1046 case AF_CHANNEL_LAYOUT_5_0_D << 16 | AF_CHANNEL_LAYOUT_5_0_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1047 reorder_self_2(src, samples, samplesize, 5, 0, 1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1048 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1049 // AF_CHANNEL_LAYOUT_5_1_A L R C LFE Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1050 // AF_CHANNEL_LAYOUT_5_1_B L R Ls Rs C LFE |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1051 // AF_CHANNEL_LAYOUT_5_1_C L C R Ls Rs LFE |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1052 // AF_CHANNEL_LAYOUT_5_1_D C L R Ls Rs LFE |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1053 // AF_CHANNEL_LAYOUT_5_1_E LFE L C R Ls Rs |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1054 case AF_CHANNEL_LAYOUT_5_1_A << 16 | AF_CHANNEL_LAYOUT_5_1_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1055 if (samplesize != 3) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1056 reorder_self_2(src, samples/2, samplesize*2, 3, 1, 2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1057 else |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1058 reorder_self_4_step_2(src, samples, samplesize, 6, 2, 3, 4, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1059 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1060 case AF_CHANNEL_LAYOUT_5_1_A << 16 | AF_CHANNEL_LAYOUT_5_1_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1061 reorder_self_2_3(src, samples, samplesize, 1, 2, 3, 4, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1062 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1063 case AF_CHANNEL_LAYOUT_5_1_A << 16 | AF_CHANNEL_LAYOUT_5_1_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1064 reorder_self_3_3(src, samples, samplesize, 2, 1, 0, 3, 4, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1065 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1066 case AF_CHANNEL_LAYOUT_5_1_B << 16 | AF_CHANNEL_LAYOUT_5_1_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1067 if (samplesize != 3) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1068 reorder_self_2(src, samples/2, samplesize*2, 3, 1, 2); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1069 else |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1070 reorder_self_4_step_2(src, samples, samplesize, 6, 2, 3, 4, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1071 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1072 case AF_CHANNEL_LAYOUT_5_1_B << 16 | AF_CHANNEL_LAYOUT_5_1_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1073 reorder_self_4_step_1(src, samples, samplesize, 6, 4, 3, 2, 1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1074 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1075 case AF_CHANNEL_LAYOUT_5_1_B << 16 | AF_CHANNEL_LAYOUT_5_1_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1076 reorder_self_5_step_1(src, samples, samplesize, 6, 4, 3, 2, 1, 0); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1077 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1078 case AF_CHANNEL_LAYOUT_5_1_B << 16 | AF_CHANNEL_LAYOUT_5_1_E: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1079 reorder_self_2_4(src, samples, samplesize, 2, 4, 5, 3, 1, 0); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1080 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1081 case AF_CHANNEL_LAYOUT_5_1_C << 16 | AF_CHANNEL_LAYOUT_5_1_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1082 reorder_self_2_3(src, samples, samplesize, 1, 2, 5, 4, 3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1083 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1084 case AF_CHANNEL_LAYOUT_5_1_C << 16 | AF_CHANNEL_LAYOUT_5_1_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1085 reorder_self_4_step_1(src, samples, samplesize, 6, 1, 2, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1086 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1087 case AF_CHANNEL_LAYOUT_5_1_C << 16 | AF_CHANNEL_LAYOUT_5_1_D: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1088 reorder_self_2(src, samples, samplesize, 6, 0, 1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1089 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1090 case AF_CHANNEL_LAYOUT_5_1_D << 16 | AF_CHANNEL_LAYOUT_5_1_A: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1091 reorder_self_3_3(src, samples, samplesize, 0, 1, 2, 5, 4, 3); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1092 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1093 case AF_CHANNEL_LAYOUT_5_1_D << 16 | AF_CHANNEL_LAYOUT_5_1_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1094 reorder_self_5_step_1(src, samples, samplesize, 6, 0, 1, 2, 3, 4); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1095 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1096 case AF_CHANNEL_LAYOUT_5_1_D << 16 | AF_CHANNEL_LAYOUT_5_1_C: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1097 reorder_self_2(src, samples, samplesize, 6, 0, 1); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1098 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1099 case AF_CHANNEL_LAYOUT_5_1_E << 16 | AF_CHANNEL_LAYOUT_5_1_B: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1100 reorder_self_2_4(src, samples, samplesize, 2, 4, 0, 1, 3, 5); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1101 break; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1102 default: |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1103 mp_msg(MSGT_GLOBAL, MSGL_WARN, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1104 "[reorder_channel] unsupported from %x to %x, %d * %d\n", |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1105 src_layout, dest_layout, samples, samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1106 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1107 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1108 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1109 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1110 static int channel_layout_mapping_5ch[AF_CHANNEL_LAYOUT_SOURCE_NUM] = { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1111 AF_CHANNEL_LAYOUT_ALSA_5CH_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1112 AF_CHANNEL_LAYOUT_AAC_5CH_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1113 AF_CHANNEL_LAYOUT_WAVEEX_5CH_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1114 AF_CHANNEL_LAYOUT_LAVC_AC3_5CH_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1115 AF_CHANNEL_LAYOUT_LAVC_LIBA52_5CH_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1116 AF_CHANNEL_LAYOUT_LAVC_DCA_5CH_DEFAULT, |
26987
d3a0f537dbe8
rename AF_CHANNEL_LAYOUT_LAVC_VORBIS* => AF_CHANNEL_LAYOUT_VORBIS*.
ulion
parents:
26740
diff
changeset
|
1117 AF_CHANNEL_LAYOUT_VORBIS_5CH_DEFAULT, |
27700 | 1118 AF_CHANNEL_LAYOUT_FLAC_5CH_DEFAULT, |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1119 }; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1120 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1121 static int channel_layout_mapping_6ch[AF_CHANNEL_LAYOUT_SOURCE_NUM] = { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1122 AF_CHANNEL_LAYOUT_ALSA_6CH_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1123 AF_CHANNEL_LAYOUT_AAC_6CH_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1124 AF_CHANNEL_LAYOUT_WAVEEX_6CH_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1125 AF_CHANNEL_LAYOUT_LAVC_AC3_6CH_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1126 AF_CHANNEL_LAYOUT_LAVC_LIBA52_6CH_DEFAULT, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1127 AF_CHANNEL_LAYOUT_LAVC_DCA_6CH_DEFAULT, |
26987
d3a0f537dbe8
rename AF_CHANNEL_LAYOUT_LAVC_VORBIS* => AF_CHANNEL_LAYOUT_VORBIS*.
ulion
parents:
26740
diff
changeset
|
1128 AF_CHANNEL_LAYOUT_VORBIS_6CH_DEFAULT, |
27700 | 1129 AF_CHANNEL_LAYOUT_FLAC_6CH_DEFAULT, |
25315
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1130 }; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1131 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1132 void reorder_channel_copy_nch(void *src, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1133 int src_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1134 void *dest, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1135 int dest_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1136 int chnum, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1137 int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1138 int samplesize) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1139 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1140 if (chnum < 5 || chnum > 6 || src_layout < 0 || dest_layout < 0 || |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1141 src_layout >= AF_CHANNEL_LAYOUT_SOURCE_NUM || |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1142 dest_layout >= AF_CHANNEL_LAYOUT_SOURCE_NUM) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1143 fast_memcpy(dest, src, samples*samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1144 else if (chnum == 6) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1145 reorder_channel_copy(src, channel_layout_mapping_6ch[src_layout], |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1146 dest, channel_layout_mapping_6ch[dest_layout], |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1147 samples, samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1148 else |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1149 reorder_channel_copy(src, channel_layout_mapping_5ch[src_layout], |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1150 dest, channel_layout_mapping_5ch[dest_layout], |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1151 samples, samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1152 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1153 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1154 void reorder_channel_nch(void *buf, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1155 int src_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1156 int dest_layout, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1157 int chnum, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1158 int samples, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1159 int samplesize) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1160 { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1161 if (src_layout == dest_layout || chnum < 5 || chnum > 6 || |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1162 src_layout < 0 || dest_layout < 0 || |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1163 src_layout >= AF_CHANNEL_LAYOUT_SOURCE_NUM || |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1164 dest_layout >= AF_CHANNEL_LAYOUT_SOURCE_NUM || |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1165 src_layout == dest_layout) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1166 return; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1167 if (chnum == 6) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1168 reorder_channel(buf, channel_layout_mapping_6ch[src_layout], |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1169 channel_layout_mapping_6ch[dest_layout], |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1170 samples, samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1171 else |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1172 reorder_channel(buf, channel_layout_mapping_5ch[src_layout], |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1173 channel_layout_mapping_5ch[dest_layout], |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1174 samples, samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1175 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1176 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1177 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1178 #ifdef TEST |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1179 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1180 static void test_copy(int channels) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1181 int samples = 12*1024*1024; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1182 int samplesize = 2; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1183 int i; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1184 unsigned char *bufin = malloc((samples+100)*samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1185 unsigned char *bufout = malloc((samples+100)*samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1186 memset(bufin, 0xFF, samples*samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1187 for (i = 0;i < 100; ++i) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1188 reorder_channel_copy(bufin, AF_CHANNEL_LAYOUT_5_1_A, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1189 bufout, AF_CHANNEL_LAYOUT_5_1_B, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1190 samples, samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1191 // reorder_channel(bufin, AF_CHANNEL_LAYOUT_5_1_B, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1192 // AF_CHANNEL_LAYOUT_5_1_D, |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1193 // samples, samplesize); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1194 free(bufin); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1195 free(bufout); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1196 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1197 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1198 int main(int argc, char *argv[]) { |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1199 int channels = 6; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1200 if (argc > 1) |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1201 channels = atoi(argv[1]); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1202 test_copy(channels); |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1203 return 0; |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1204 } |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1205 |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1206 #endif |
dfa8a510c81c
Fix all current known multi-channel wrong order problems by adding
ulion
parents:
diff
changeset
|
1207 |