Surround format-specific functions with matching preprocessor conditionals.
[libav.git] / libavcodec / pcm.c
CommitLineData
a96b68b7
FB
1/*
2 * PCM codecs
ff4ec49e 3 * Copyright (c) 2001 Fabrice Bellard.
a96b68b7 4 *
b78e7197
DB
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
ff4ec49e
FB
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
b78e7197 10 * version 2.1 of the License, or (at your option) any later version.
a96b68b7 11 *
b78e7197 12 * FFmpeg is distributed in the hope that it will be useful,
a96b68b7 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ff4ec49e
FB
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
a96b68b7 16 *
ff4ec49e 17 * You should have received a copy of the GNU Lesser General Public
b78e7197 18 * License along with FFmpeg; if not, write to the Free Software
5509bffa 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
a96b68b7 20 */
115329f1 21
1ab3d669
MN
22/**
23 * @file pcm.c
24 * PCM codecs
25 */
115329f1 26
a96b68b7 27#include "avcodec.h"
b461b3bc 28#include "bitstream.h" // for ff_reverse
5a2f421a 29#include "bytestream.h"
a96b68b7 30
725d86bf
AJ
31#define MAX_CHANNELS 64
32
a96b68b7
FB
33/* from g711.c by SUN microsystems (unrestricted use) */
34
bb270c08
DB
35#define SIGN_BIT (0x80) /* Sign bit for a A-law byte. */
36#define QUANT_MASK (0xf) /* Quantization field mask. */
37#define NSEGS (8) /* Number of A-law segments. */
38#define SEG_SHIFT (4) /* Left shift for segment number. */
39#define SEG_MASK (0x70) /* Segment field mask. */
a96b68b7 40
bb270c08 41#define BIAS (0x84) /* Bias for linear code. */
a96b68b7
FB
42
43/*
44 * alaw2linear() - Convert an A-law value to 16-bit linear PCM
45 *
46 */
98a6fff9 47static av_cold int alaw2linear(unsigned char a_val)
a96b68b7 48{
bb270c08
DB
49 int t;
50 int seg;
a96b68b7 51
bb270c08 52 a_val ^= 0x55;
a96b68b7 53
bb270c08
DB
54 t = a_val & QUANT_MASK;
55 seg = ((unsigned)a_val & SEG_MASK) >> SEG_SHIFT;
56 if(seg) t= (t + t + 1 + 32) << (seg + 2);
57 else t= (t + t + 1 ) << 3;
cd1f22f9 58
ccd425e7 59 return (a_val & SIGN_BIT) ? t : -t;
a96b68b7
FB
60}
61
98a6fff9 62static av_cold int ulaw2linear(unsigned char u_val)
a96b68b7 63{
bb270c08 64 int t;
a96b68b7 65
bb270c08
DB
66 /* Complement to obtain normal u-law value. */
67 u_val = ~u_val;
a96b68b7 68
bb270c08
DB
69 /*
70 * Extract and bias the quantization bits. Then
71 * shift up by the segment number and subtract out the bias.
72 */
73 t = ((u_val & QUANT_MASK) << 3) + BIAS;
74 t <<= ((unsigned)u_val & SEG_MASK) >> SEG_SHIFT;
a96b68b7 75
ccd425e7 76 return (u_val & SIGN_BIT) ? (BIAS - t) : (t - BIAS);
a96b68b7
FB
77}
78
79/* 16384 entries per table */
e2e712e7
MN
80static uint8_t linear_to_alaw[16384];
81static uint8_t linear_to_ulaw[16384];
a96b68b7 82
98a6fff9 83static av_cold void build_xlaw_table(uint8_t *linear_to_xlaw,
a96b68b7 84 int (*xlaw2linear)(unsigned char),
115329f1 85 int mask)
a96b68b7
FB
86{
87 int i, j, v, v1, v2;
88
89 j = 0;
90 for(i=0;i<128;i++) {
91 if (i != 127) {
92 v1 = xlaw2linear(i ^ mask);
93 v2 = xlaw2linear((i + 1) ^ mask);
94 v = (v1 + v2 + 4) >> 3;
95 } else {
96 v = 8192;
97 }
98 for(;j<v;j++) {
99 linear_to_xlaw[8192 + j] = (i ^ mask);
100 if (j > 0)
101 linear_to_xlaw[8192 - j] = (i ^ (mask ^ 0x80));
102 }
103 }
104 linear_to_xlaw[0] = linear_to_xlaw[1];
105}
106
98a6fff9 107static av_cold int pcm_encode_init(AVCodecContext *avctx)
a96b68b7
FB
108{
109 avctx->frame_size = 1;
110 switch(avctx->codec->id) {
111 case CODEC_ID_PCM_ALAW:
e2e712e7 112 build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);
a96b68b7
FB
113 break;
114 case CODEC_ID_PCM_MULAW:
e2e712e7 115 build_xlaw_table(linear_to_ulaw, ulaw2linear, 0xff);
a96b68b7
FB
116 break;
117 default:
118 break;
119 }
115329f1 120
cc0b6129 121 avctx->block_align = avctx->channels * av_get_bits_per_sample(avctx->codec->id)/8;
492cd3a9
MN
122 avctx->coded_frame= avcodec_alloc_frame();
123 avctx->coded_frame->key_frame= 1;
115329f1 124
a96b68b7
FB
125 return 0;
126}
127
98a6fff9 128static av_cold int pcm_encode_close(AVCodecContext *avctx)
a96b68b7 129{
492cd3a9
MN
130 av_freep(&avctx->coded_frame);
131
a96b68b7
FB
132 return 0;
133}
134
b461b3bc 135/**
3ee573a3
PR
136 * Write PCM samples macro
137 * @param type Datatype of native machine format
138 * @param endian bytestream_put_xxx() suffix
139 * @param src Source pointer (variable name)
140 * @param dst Destination pointer (variable name)
141 * @param n Total number of samples (variable name)
5e8ecfde 142 * @param shift Bitshift (bits)
3ee573a3
PR
143 * @param offset Sample value offset
144 */
5e8ecfde
PR
145#define ENCODE(type, endian, src, dst, n, shift, offset) \
146 samples_##type = (type*)src; \
3ee573a3 147 for(;n>0;n--) { \
5e8ecfde 148 register type v = (*samples_##type++ >> shift) + offset; \
3ee573a3 149 bytestream_put_##endian(&dst, v); \
5e8ecfde 150 }
3ee573a3 151
cd4af68a 152static int pcm_encode_frame(AVCodecContext *avctx,
bb270c08 153 unsigned char *frame, int buf_size, void *data)
a96b68b7
FB
154{
155 int n, sample_size, v;
156 short *samples;
157 unsigned char *dst;
5e8ecfde
PR
158 uint8_t *srcu8;
159 int16_t *samples_int16_t;
160 int32_t *samples_int32_t;
161 uint16_t *samples_uint16_t;
162 uint32_t *samples_uint32_t;
a96b68b7 163
cc0b6129 164 sample_size = av_get_bits_per_sample(avctx->codec->id)/8;
a96b68b7
FB
165 n = buf_size / sample_size;
166 samples = data;
167 dst = frame;
168
5e8ecfde
PR
169 if (avctx->sample_fmt!=avctx->codec->sample_fmts[0]) {
170 av_log(avctx, AV_LOG_ERROR, "invalid sample_fmt\n");
171 return -1;
172 }
173
a96b68b7 174 switch(avctx->codec->id) {
aa29709e 175 case CODEC_ID_PCM_F32BE:
5e8ecfde
PR
176 case CODEC_ID_PCM_S32BE:
177 ENCODE(int32_t, be32, samples, dst, n, 0, 0)
aa29709e 178 break;
b461b3bc 179 case CODEC_ID_PCM_S32LE:
5e8ecfde 180 ENCODE(int32_t, le32, samples, dst, n, 0, 0)
b461b3bc
RD
181 break;
182 case CODEC_ID_PCM_U32LE:
5e8ecfde 183 ENCODE(uint32_t, le32, samples, dst, n, 0, 0x80000000)
b461b3bc
RD
184 break;
185 case CODEC_ID_PCM_U32BE:
5e8ecfde 186 ENCODE(uint32_t, be32, samples, dst, n, 0, 0x80000000)
b461b3bc
RD
187 break;
188 case CODEC_ID_PCM_S24LE:
5e8ecfde 189 ENCODE(int32_t, le24, samples, dst, n, 8, 0)
b461b3bc
RD
190 break;
191 case CODEC_ID_PCM_S24BE:
5e8ecfde 192 ENCODE(int32_t, be24, samples, dst, n, 8, 0)
b461b3bc
RD
193 break;
194 case CODEC_ID_PCM_U24LE:
5e8ecfde 195 ENCODE(uint32_t, le24, samples, dst, n, 8, 0x800000)
b461b3bc
RD
196 break;
197 case CODEC_ID_PCM_U24BE:
5e8ecfde 198 ENCODE(uint32_t, be24, samples, dst, n, 8, 0x800000)
b461b3bc
RD
199 break;
200 case CODEC_ID_PCM_S24DAUD:
201 for(;n>0;n--) {
13dbd9b7 202 uint32_t tmp = ff_reverse[(*samples >> 8) & 0xff] +
b461b3bc
RD
203 (ff_reverse[*samples & 0xff] << 8);
204 tmp <<= 4; // sync flags would go here
5a2f421a 205 bytestream_put_be24(&dst, tmp);
b461b3bc 206 samples++;
b461b3bc
RD
207 }
208 break;
a96b68b7 209 case CODEC_ID_PCM_S16LE:
5e8ecfde 210 ENCODE(int16_t, le16, samples, dst, n, 0, 0)
a96b68b7
FB
211 break;
212 case CODEC_ID_PCM_S16BE:
5e8ecfde 213 ENCODE(int16_t, be16, samples, dst, n, 0, 0)
a96b68b7
FB
214 break;
215 case CODEC_ID_PCM_U16LE:
5e8ecfde 216 ENCODE(uint16_t, le16, samples, dst, n, 0, 0x8000)
a96b68b7
FB
217 break;
218 case CODEC_ID_PCM_U16BE:
5e8ecfde 219 ENCODE(uint16_t, be16, samples, dst, n, 0, 0x8000)
a96b68b7
FB
220 break;
221 case CODEC_ID_PCM_S8:
5e8ecfde 222 srcu8= data;
a96b68b7 223 for(;n>0;n--) {
5e8ecfde
PR
224 v = *srcu8++;
225 *dst++ = v - 128;
a96b68b7
FB
226 }
227 break;
228 case CODEC_ID_PCM_U8:
5e8ecfde
PR
229 memcpy(dst, samples, n);
230 dst += n;
a96b68b7 231 break;
a11c2a2c
MN
232 case CODEC_ID_PCM_ZORK:
233 for(;n>0;n--) {
234 v= *samples++ >> 8;
235 if(v<0) v = -v;
236 else v+= 128;
237 *dst++ = v;
238 }
239 break;
a96b68b7
FB
240 case CODEC_ID_PCM_ALAW:
241 for(;n>0;n--) {
242 v = *samples++;
a4461664 243 *dst++ = linear_to_alaw[(v + 32768) >> 2];
a96b68b7
FB
244 }
245 break;
246 case CODEC_ID_PCM_MULAW:
247 for(;n>0;n--) {
248 v = *samples++;
a4461664 249 *dst++ = linear_to_ulaw[(v + 32768) >> 2];
a96b68b7
FB
250 }
251 break;
252 default:
253 return -1;
254 }
13a0314f 255 //avctx->frame_size = (dst - frame) / (sample_size * avctx->channels);
4c3d2e5f 256
a96b68b7
FB
257 return dst - frame;
258}
259
260typedef struct PCMDecode {
261 short table[256];
262} PCMDecode;
263
98a6fff9 264static av_cold int pcm_decode_init(AVCodecContext * avctx)
a96b68b7
FB
265{
266 PCMDecode *s = avctx->priv_data;
267 int i;
268
269 switch(avctx->codec->id) {
270 case CODEC_ID_PCM_ALAW:
271 for(i=0;i<256;i++)
272 s->table[i] = alaw2linear(i);
273 break;
274 case CODEC_ID_PCM_MULAW:
275 for(i=0;i<256;i++)
276 s->table[i] = ulaw2linear(i);
277 break;
278 default:
279 break;
280 }
aa29709e 281
0fd7e57e 282 avctx->sample_fmt = avctx->codec->sample_fmts[0];
a96b68b7
FB
283 return 0;
284}
285
b461b3bc 286/**
3ee573a3
PR
287 * Read PCM samples macro
288 * @param type Datatype of native machine format
289 * @param endian bytestream_get_xxx() endian suffix
290 * @param src Source pointer (variable name)
291 * @param dst Destination pointer (variable name)
292 * @param n Total number of samples (variable name)
5e8ecfde 293 * @param shift Bitshift (bits)
3ee573a3
PR
294 * @param offset Sample value offset
295 */
5e8ecfde
PR
296#define DECODE(type, endian, src, dst, n, shift, offset) \
297 dst_##type = (type*)dst; \
3ee573a3
PR
298 for(;n>0;n--) { \
299 register type v = bytestream_get_##endian(&src); \
5e8ecfde 300 *dst_##type++ = (v - offset) << shift; \
3ee573a3 301 } \
5e8ecfde 302 dst = (short*)dst_##type;
3ee573a3 303
cd4af68a 304static int pcm_decode_frame(AVCodecContext *avctx,
bb270c08 305 void *data, int *data_size,
7993df65 306 const uint8_t *buf, int buf_size)
a96b68b7
FB
307{
308 PCMDecode *s = avctx->priv_data;
ff66caab 309 int sample_size, c, n;
a96b68b7 310 short *samples;
7993df65 311 const uint8_t *src, *src2[MAX_CHANNELS];
5e8ecfde
PR
312 uint8_t *dstu8;
313 int16_t *dst_int16_t;
314 int32_t *dst_int32_t;
315 uint16_t *dst_uint16_t;
316 uint32_t *dst_uint32_t;
a96b68b7
FB
317
318 samples = data;
319 src = buf;
320
5e8ecfde
PR
321 if (avctx->sample_fmt!=avctx->codec->sample_fmts[0]) {
322 av_log(avctx, AV_LOG_ERROR, "invalid sample_fmt\n");
323 return -1;
324 }
325
3426d575 326 if(avctx->channels <= 0 || avctx->channels > MAX_CHANNELS){
327 av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
328 return -1;
329 }
b2a581dc 330
ff66caab
PR
331 sample_size = av_get_bits_per_sample(avctx->codec_id)/8;
332
333 n = avctx->channels * sample_size;
1472b7dd
LT
334 /* av_get_bits_per_sample returns 0 for CODEC_ID_PCM_DVD */
335 if (CODEC_ID_PCM_DVD == avctx->codec_id)
336 /* 2 samples are interleaved per block in PCM_DVD */
337 n = 2 * avctx->channels * avctx->bits_per_sample/8;
338
339 if(n && buf_size % n){
340 av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
341 return -1;
342 }
343
ac66834c
MN
344 buf_size= FFMIN(buf_size, *data_size/2);
345 *data_size=0;
a8d02f2b 346
ff66caab 347 n = buf_size/sample_size;
725d86bf 348
a96b68b7 349 switch(avctx->codec->id) {
aa29709e 350 case CODEC_ID_PCM_F32BE:
5e8ecfde
PR
351 case CODEC_ID_PCM_S32BE:
352 DECODE(int32_t, be32, src, samples, n, 0, 0)
aa29709e 353 break;
b461b3bc 354 case CODEC_ID_PCM_S32LE:
5e8ecfde 355 DECODE(int32_t, le32, src, samples, n, 0, 0)
b461b3bc
RD
356 break;
357 case CODEC_ID_PCM_U32LE:
5e8ecfde 358 DECODE(uint32_t, le32, src, samples, n, 0, 0x80000000)
b461b3bc
RD
359 break;
360 case CODEC_ID_PCM_U32BE:
5e8ecfde 361 DECODE(uint32_t, be32, src, samples, n, 0, 0x80000000)
b461b3bc
RD
362 break;
363 case CODEC_ID_PCM_S24LE:
5e8ecfde 364 DECODE(int32_t, le24, src, samples, n, 8, 0)
b461b3bc
RD
365 break;
366 case CODEC_ID_PCM_S24BE:
5e8ecfde 367 DECODE(int32_t, be24, src, samples, n, 8, 0)
b461b3bc
RD
368 break;
369 case CODEC_ID_PCM_U24LE:
5e8ecfde 370 DECODE(uint32_t, le24, src, samples, n, 8, 0x800000)
b461b3bc
RD
371 break;
372 case CODEC_ID_PCM_U24BE:
5e8ecfde 373 DECODE(uint32_t, be24, src, samples, n, 8, 0x800000)
b461b3bc
RD
374 break;
375 case CODEC_ID_PCM_S24DAUD:
b461b3bc 376 for(;n>0;n--) {
5a2f421a 377 uint32_t v = bytestream_get_be24(&src);
b461b3bc
RD
378 v >>= 4; // sync flags are here
379 *samples++ = ff_reverse[(v >> 8) & 0xff] +
380 (ff_reverse[v & 0xff] << 8);
b461b3bc
RD
381 }
382 break;
a96b68b7 383 case CODEC_ID_PCM_S16LE:
5e8ecfde 384 DECODE(int16_t, le16, src, samples, n, 0, 0)
a96b68b7 385 break;
725d86bf 386 case CODEC_ID_PCM_S16LE_PLANAR:
ff66caab
PR
387 n /= avctx->channels;
388 for(c=0;c<avctx->channels;c++)
389 src2[c] = &src[c*n];
725d86bf
AJ
390 for(n>>=1;n>0;n--)
391 for(c=0;c<avctx->channels;c++)
392 *samples++ = bytestream_get_le16(&src2[c]);
393 src = src2[avctx->channels-1];
394 break;
a96b68b7 395 case CODEC_ID_PCM_S16BE:
5e8ecfde 396 DECODE(int16_t, be16, src, samples, n, 0, 0)
a96b68b7
FB
397 break;
398 case CODEC_ID_PCM_U16LE:
5e8ecfde 399 DECODE(uint16_t, le16, src, samples, n, 0, 0x8000)
a96b68b7
FB
400 break;
401 case CODEC_ID_PCM_U16BE:
5e8ecfde 402 DECODE(uint16_t, be16, src, samples, n, 0, 0x8000)
a96b68b7
FB
403 break;
404 case CODEC_ID_PCM_S8:
5e8ecfde 405 dstu8= (uint8_t*)samples;
a96b68b7 406 for(;n>0;n--) {
5e8ecfde 407 *dstu8++ = *src++ + 128;
a96b68b7 408 }
5e8ecfde 409 samples= (short*)dstu8;
a96b68b7
FB
410 break;
411 case CODEC_ID_PCM_U8:
5e8ecfde
PR
412 memcpy(samples, src, n);
413 src += n;
3b4b1137 414 samples = (short*)((uint8_t*)data + n);
a96b68b7 415 break;
a11c2a2c 416 case CODEC_ID_PCM_ZORK:
a11c2a2c
MN
417 for(;n>0;n--) {
418 int x= *src++;
419 if(x&128) x-= 128;
420 else x = -x;
421 *samples++ = x << 8;
422 }
423 break;
a96b68b7
FB
424 case CODEC_ID_PCM_ALAW:
425 case CODEC_ID_PCM_MULAW:
a96b68b7 426 for(;n>0;n--) {
a4461664 427 *samples++ = s->table[*src++];
a96b68b7
FB
428 }
429 break;
1472b7dd
LT
430 case CODEC_ID_PCM_DVD:
431 if(avctx->bits_per_sample != 20 && avctx->bits_per_sample != 24) {
432 av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
433 return -1;
434 } else {
435 int jump = avctx->channels * (avctx->bits_per_sample-16) / 4;
436 n = buf_size / (avctx->channels * 2 * avctx->bits_per_sample / 8);
437 while (n--) {
438 for (c=0; c < 2*avctx->channels; c++)
439 *samples++ = bytestream_get_be16(&src);
440 src += jump;
441 }
442 }
443 break;
a96b68b7 444 default:
a96b68b7
FB
445 return -1;
446 }
0c1a9eda 447 *data_size = (uint8_t *)samples - (uint8_t *)data;
a96b68b7
FB
448 return src - buf;
449}
450
2b045c9c 451#ifdef CONFIG_ENCODERS
fd76c37f 452#define PCM_ENCODER(id,sample_fmt_,name,long_name_) \
a96b68b7
FB
453AVCodec name ## _encoder = { \
454 #name, \
455 CODEC_TYPE_AUDIO, \
456 id, \
457 0, \
bb270c08
DB
458 pcm_encode_init, \
459 pcm_encode_frame, \
460 pcm_encode_close, \
a96b68b7 461 NULL, \
fd76c37f 462 .sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
fe4bf374 463 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
2b045c9c
AJ
464};
465#else
fd76c37f 466#define PCM_ENCODER(id,sample_fmt_,name,long_name_)
2b045c9c
AJ
467#endif
468
469#ifdef CONFIG_DECODERS
0fd7e57e 470#define PCM_DECODER(id,sample_fmt_,name,long_name_) \
a96b68b7
FB
471AVCodec name ## _decoder = { \
472 #name, \
473 CODEC_TYPE_AUDIO, \
474 id, \
475 sizeof(PCMDecode), \
bb270c08 476 pcm_decode_init, \
a96b68b7
FB
477 NULL, \
478 NULL, \
cd4af68a 479 pcm_decode_frame, \
0fd7e57e 480 .sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
fe4bf374 481 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
2b045c9c
AJ
482};
483#else
0fd7e57e 484#define PCM_DECODER(id,sample_fmt_,name,long_name_)
2b045c9c
AJ
485#endif
486
fd76c37f 487#define PCM_CODEC(id, sample_fmt_, name, long_name_) \
0fd7e57e 488 PCM_ENCODER(id,sample_fmt_,name,long_name_) PCM_DECODER(id,sample_fmt_,name,long_name_)
44caa86d 489
bbdfa06d 490/* Note: Do not forget to add new entries to the Makefile as well. */
fd76c37f
PR
491PCM_CODEC (CODEC_ID_PCM_ALAW, SAMPLE_FMT_S16, pcm_alaw, "A-law PCM");
492PCM_CODEC (CODEC_ID_PCM_DVD, SAMPLE_FMT_S16, pcm_dvd, "signed 16|20|24-bit big-endian PCM");
493PCM_CODEC (CODEC_ID_PCM_F32BE, SAMPLE_FMT_FLT, pcm_f32be, "32-bit floating point big-endian PCM");
494PCM_CODEC (CODEC_ID_PCM_MULAW, SAMPLE_FMT_S16, pcm_mulaw, "mu-law PCM");
5e8ecfde 495PCM_CODEC (CODEC_ID_PCM_S8, SAMPLE_FMT_U8, pcm_s8, "signed 8-bit PCM");
fd76c37f
PR
496PCM_CODEC (CODEC_ID_PCM_S16BE, SAMPLE_FMT_S16, pcm_s16be, "signed 16-bit big-endian PCM");
497PCM_CODEC (CODEC_ID_PCM_S16LE, SAMPLE_FMT_S16, pcm_s16le, "signed 16-bit little-endian PCM");
0fd7e57e 498PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, SAMPLE_FMT_S16, pcm_s16le_planar, "16-bit little-endian planar PCM");
5e8ecfde 499PCM_CODEC (CODEC_ID_PCM_S24BE, SAMPLE_FMT_S32, pcm_s24be, "signed 24-bit big-endian PCM");
fd76c37f 500PCM_CODEC (CODEC_ID_PCM_S24DAUD, SAMPLE_FMT_S16, pcm_s24daud, "D-Cinema audio signed 24-bit PCM");
5e8ecfde
PR
501PCM_CODEC (CODEC_ID_PCM_S24LE, SAMPLE_FMT_S32, pcm_s24le, "signed 24-bit little-endian PCM");
502PCM_CODEC (CODEC_ID_PCM_S32BE, SAMPLE_FMT_S32, pcm_s32be, "signed 32-bit big-endian PCM");
503PCM_CODEC (CODEC_ID_PCM_S32LE, SAMPLE_FMT_S32, pcm_s32le, "signed 32-bit little-endian PCM");
504PCM_CODEC (CODEC_ID_PCM_U8, SAMPLE_FMT_U8, pcm_u8, "unsigned 8-bit PCM");
fd76c37f
PR
505PCM_CODEC (CODEC_ID_PCM_U16BE, SAMPLE_FMT_S16, pcm_u16be, "unsigned 16-bit big-endian PCM");
506PCM_CODEC (CODEC_ID_PCM_U16LE, SAMPLE_FMT_S16, pcm_u16le, "unsigned 16-bit little-endian PCM");
5e8ecfde
PR
507PCM_CODEC (CODEC_ID_PCM_U24BE, SAMPLE_FMT_S32, pcm_u24be, "unsigned 24-bit big-endian PCM");
508PCM_CODEC (CODEC_ID_PCM_U24LE, SAMPLE_FMT_S32, pcm_u24le, "unsigned 24-bit little-endian PCM");
509PCM_CODEC (CODEC_ID_PCM_U32BE, SAMPLE_FMT_S32, pcm_u32be, "unsigned 32-bit big-endian PCM");
510PCM_CODEC (CODEC_ID_PCM_U32LE, SAMPLE_FMT_S32, pcm_u32le, "unsigned 32-bit little-endian PCM");
fd76c37f 511PCM_CODEC (CODEC_ID_PCM_ZORK, SAMPLE_FMT_S16, pcm_zork, "Zork PCM");