~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to audio/mixeng.c

Tags: upstream-0.9.0+20070816
ImportĀ upstreamĀ versionĀ 0.9.0+20070816

Show diffs side-by-side

added added

removed removed

Lines of Context:
82
82
#undef IN_T
83
83
#undef SHIFT
84
84
 
 
85
/* Unsigned 16 bit */
85
86
#define IN_T uint16_t
86
87
#define IN_MIN 0
87
88
#define IN_MAX USHRT_MAX
101
102
#undef IN_T
102
103
#undef SHIFT
103
104
 
104
 
t_sample *mixeng_conv[2][2][2][2] = {
 
105
/* Signed 32 bit */
 
106
#define IN_T int32_t
 
107
#define IN_MIN INT32_MIN
 
108
#define IN_MAX INT32_MAX
 
109
#define SIGNED
 
110
#define SHIFT 32
 
111
#define ENDIAN_CONVERSION natural
 
112
#define ENDIAN_CONVERT(v) (v)
 
113
#include "mixeng_template.h"
 
114
#undef ENDIAN_CONVERT
 
115
#undef ENDIAN_CONVERSION
 
116
#define ENDIAN_CONVERSION swap
 
117
#define ENDIAN_CONVERT(v) bswap32 (v)
 
118
#include "mixeng_template.h"
 
119
#undef ENDIAN_CONVERT
 
120
#undef ENDIAN_CONVERSION
 
121
#undef SIGNED
 
122
#undef IN_MAX
 
123
#undef IN_MIN
 
124
#undef IN_T
 
125
#undef SHIFT
 
126
 
 
127
/* Unsigned 16 bit */
 
128
#define IN_T uint32_t
 
129
#define IN_MIN 0
 
130
#define IN_MAX UINT32_MAX
 
131
#define SHIFT 32
 
132
#define ENDIAN_CONVERSION natural
 
133
#define ENDIAN_CONVERT(v) (v)
 
134
#include "mixeng_template.h"
 
135
#undef ENDIAN_CONVERT
 
136
#undef ENDIAN_CONVERSION
 
137
#define ENDIAN_CONVERSION swap
 
138
#define ENDIAN_CONVERT(v) bswap32 (v)
 
139
#include "mixeng_template.h"
 
140
#undef ENDIAN_CONVERT
 
141
#undef ENDIAN_CONVERSION
 
142
#undef IN_MAX
 
143
#undef IN_MIN
 
144
#undef IN_T
 
145
#undef SHIFT
 
146
 
 
147
t_sample *mixeng_conv[2][2][2][3] = {
105
148
    {
106
149
        {
107
150
            {
108
151
                conv_natural_uint8_t_to_mono,
109
 
                conv_natural_uint16_t_to_mono
 
152
                conv_natural_uint16_t_to_mono,
 
153
                conv_natural_uint32_t_to_mono
110
154
            },
111
155
            {
112
156
                conv_natural_uint8_t_to_mono,
113
 
                conv_swap_uint16_t_to_mono
 
157
                conv_swap_uint16_t_to_mono,
 
158
                conv_swap_uint32_t_to_mono,
114
159
            }
115
160
        },
116
161
        {
117
162
            {
118
163
                conv_natural_int8_t_to_mono,
119
 
                conv_natural_int16_t_to_mono
 
164
                conv_natural_int16_t_to_mono,
 
165
                conv_natural_int32_t_to_mono
120
166
            },
121
167
            {
122
168
                conv_natural_int8_t_to_mono,
123
 
                conv_swap_int16_t_to_mono
 
169
                conv_swap_int16_t_to_mono,
 
170
                conv_swap_int32_t_to_mono
124
171
            }
125
172
        }
126
173
    },
128
175
        {
129
176
            {
130
177
                conv_natural_uint8_t_to_stereo,
131
 
                conv_natural_uint16_t_to_stereo
 
178
                conv_natural_uint16_t_to_stereo,
 
179
                conv_natural_uint32_t_to_stereo
132
180
            },
133
181
            {
134
182
                conv_natural_uint8_t_to_stereo,
135
 
                conv_swap_uint16_t_to_stereo
 
183
                conv_swap_uint16_t_to_stereo,
 
184
                conv_swap_uint32_t_to_stereo
136
185
            }
137
186
        },
138
187
        {
139
188
            {
140
189
                conv_natural_int8_t_to_stereo,
141
 
                conv_natural_int16_t_to_stereo
 
190
                conv_natural_int16_t_to_stereo,
 
191
                conv_natural_int32_t_to_stereo
142
192
            },
143
193
            {
144
194
                conv_natural_int8_t_to_stereo,
145
 
                conv_swap_int16_t_to_stereo
 
195
                conv_swap_int16_t_to_stereo,
 
196
                conv_swap_int32_t_to_stereo,
146
197
            }
147
198
        }
148
199
    }
149
200
};
150
201
 
151
 
f_sample *mixeng_clip[2][2][2][2] = {
 
202
f_sample *mixeng_clip[2][2][2][3] = {
152
203
    {
153
204
        {
154
205
            {
155
206
                clip_natural_uint8_t_from_mono,
156
 
                clip_natural_uint16_t_from_mono
 
207
                clip_natural_uint16_t_from_mono,
 
208
                clip_natural_uint32_t_from_mono
157
209
            },
158
210
            {
159
211
                clip_natural_uint8_t_from_mono,
160
 
                clip_swap_uint16_t_from_mono
 
212
                clip_swap_uint16_t_from_mono,
 
213
                clip_swap_uint32_t_from_mono
161
214
            }
162
215
        },
163
216
        {
164
217
            {
165
218
                clip_natural_int8_t_from_mono,
166
 
                clip_natural_int16_t_from_mono
 
219
                clip_natural_int16_t_from_mono,
 
220
                clip_natural_int32_t_from_mono
167
221
            },
168
222
            {
169
223
                clip_natural_int8_t_from_mono,
170
 
                clip_swap_int16_t_from_mono
 
224
                clip_swap_int16_t_from_mono,
 
225
                clip_swap_int32_t_from_mono
171
226
            }
172
227
        }
173
228
    },
175
230
        {
176
231
            {
177
232
                clip_natural_uint8_t_from_stereo,
178
 
                clip_natural_uint16_t_from_stereo
 
233
                clip_natural_uint16_t_from_stereo,
 
234
                clip_natural_uint32_t_from_stereo
179
235
            },
180
236
            {
181
237
                clip_natural_uint8_t_from_stereo,
182
 
                clip_swap_uint16_t_from_stereo
 
238
                clip_swap_uint16_t_from_stereo,
 
239
                clip_swap_uint32_t_from_stereo
183
240
            }
184
241
        },
185
242
        {
186
243
            {
187
244
                clip_natural_int8_t_from_stereo,
188
 
                clip_natural_int16_t_from_stereo
 
245
                clip_natural_int16_t_from_stereo,
 
246
                clip_natural_int32_t_from_stereo
189
247
            },
190
248
            {
191
249
                clip_natural_int8_t_from_stereo,
192
 
                clip_swap_int16_t_from_stereo
 
250
                clip_swap_int16_t_from_stereo,
 
251
                clip_swap_int32_t_from_stereo
193
252
            }
194
253
        }
195
254
    }