Add SAMPLE_FMT_DBL.
[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) {
b461b3bc 175 case CODEC_ID_PCM_U32LE:
5e8ecfde 176 ENCODE(uint32_t, le32, samples, dst, n, 0, 0x80000000)
b461b3bc
RD
177 break;
178 case CODEC_ID_PCM_U32BE:
5e8ecfde 179 ENCODE(uint32_t, be32, samples, dst, n, 0, 0x80000000)
b461b3bc
RD
180 break;
181 case CODEC_ID_PCM_S24LE:
5e8ecfde 182 ENCODE(int32_t, le24, samples, dst, n, 8, 0)
b461b3bc
RD
183 break;
184 case CODEC_ID_PCM_S24BE:
5e8ecfde 185 ENCODE(int32_t, be24, samples, dst, n, 8, 0)
b461b3bc
RD
186 break;
187 case CODEC_ID_PCM_U24LE:
5e8ecfde 188 ENCODE(uint32_t, le24, samples, dst, n, 8, 0x800000)
b461b3bc
RD
189 break;
190 case CODEC_ID_PCM_U24BE:
5e8ecfde 191 ENCODE(uint32_t, be24, samples, dst, n, 8, 0x800000)
b461b3bc
RD
192 break;
193 case CODEC_ID_PCM_S24DAUD:
194 for(;n>0;n--) {
13dbd9b7 195 uint32_t tmp = ff_reverse[(*samples >> 8) & 0xff] +
b461b3bc
RD
196 (ff_reverse[*samples & 0xff] << 8);
197 tmp <<= 4; // sync flags would go here
5a2f421a 198 bytestream_put_be24(&dst, tmp);
b461b3bc 199 samples++;
b461b3bc
RD
200 }
201 break;
a96b68b7 202 case CODEC_ID_PCM_U16LE:
5e8ecfde 203 ENCODE(uint16_t, le16, samples, dst, n, 0, 0x8000)
a96b68b7
FB
204 break;
205 case CODEC_ID_PCM_U16BE:
5e8ecfde 206 ENCODE(uint16_t, be16, samples, dst, n, 0, 0x8000)
a96b68b7
FB
207 break;
208 case CODEC_ID_PCM_S8:
5e8ecfde 209 srcu8= data;
a96b68b7 210 for(;n>0;n--) {
5e8ecfde
PR
211 v = *srcu8++;
212 *dst++ = v - 128;
a96b68b7
FB
213 }
214 break;
38a1c7f2
PR
215#if WORDS_BIGENDIAN
216 case CODEC_ID_PCM_S32LE:
217 ENCODE(int32_t, le32, samples, dst, n, 0, 0)
218 break;
219 case CODEC_ID_PCM_S16LE:
220 ENCODE(int16_t, le16, samples, dst, n, 0, 0)
221 break;
222 case CODEC_ID_PCM_F32BE:
223 case CODEC_ID_PCM_S32BE:
224 case CODEC_ID_PCM_S16BE:
225#else
226 case CODEC_ID_PCM_F32BE:
227 case CODEC_ID_PCM_S32BE:
228 ENCODE(int32_t, be32, samples, dst, n, 0, 0)
229 break;
230 case CODEC_ID_PCM_S16BE:
231 ENCODE(int16_t, be16, samples, dst, n, 0, 0)
232 break;
233 case CODEC_ID_PCM_S32LE:
234 case CODEC_ID_PCM_S16LE:
235#endif /* WORDS_BIGENDIAN */
a96b68b7 236 case CODEC_ID_PCM_U8:
38a1c7f2
PR
237 memcpy(dst, samples, n*sample_size);
238 dst += n*sample_size;
a96b68b7 239 break;
a11c2a2c
MN
240 case CODEC_ID_PCM_ZORK:
241 for(;n>0;n--) {
242 v= *samples++ >> 8;
243 if(v<0) v = -v;
244 else v+= 128;
245 *dst++ = v;
246 }
247 break;
a96b68b7
FB
248 case CODEC_ID_PCM_ALAW:
249 for(;n>0;n--) {
250 v = *samples++;
a4461664 251 *dst++ = linear_to_alaw[(v + 32768) >> 2];
a96b68b7
FB
252 }
253 break;
254 case CODEC_ID_PCM_MULAW:
255 for(;n>0;n--) {
256 v = *samples++;
a4461664 257 *dst++ = linear_to_ulaw[(v + 32768) >> 2];
a96b68b7
FB
258 }
259 break;
260 default:
261 return -1;
262 }
13a0314f 263 //avctx->frame_size = (dst - frame) / (sample_size * avctx->channels);
4c3d2e5f 264
a96b68b7
FB
265 return dst - frame;
266}
267
268typedef struct PCMDecode {
269 short table[256];
270} PCMDecode;
271
98a6fff9 272static av_cold int pcm_decode_init(AVCodecContext * avctx)
a96b68b7
FB
273{
274 PCMDecode *s = avctx->priv_data;
275 int i;
276
277 switch(avctx->codec->id) {
278 case CODEC_ID_PCM_ALAW:
279 for(i=0;i<256;i++)
280 s->table[i] = alaw2linear(i);
281 break;
282 case CODEC_ID_PCM_MULAW:
283 for(i=0;i<256;i++)
284 s->table[i] = ulaw2linear(i);
285 break;
286 default:
287 break;
288 }
aa29709e 289
0fd7e57e 290 avctx->sample_fmt = avctx->codec->sample_fmts[0];
a96b68b7
FB
291 return 0;
292}
293
b461b3bc 294/**
3ee573a3
PR
295 * Read PCM samples macro
296 * @param type Datatype of native machine format
297 * @param endian bytestream_get_xxx() endian suffix
298 * @param src Source pointer (variable name)
299 * @param dst Destination pointer (variable name)
300 * @param n Total number of samples (variable name)
5e8ecfde 301 * @param shift Bitshift (bits)
3ee573a3
PR
302 * @param offset Sample value offset
303 */
5e8ecfde
PR
304#define DECODE(type, endian, src, dst, n, shift, offset) \
305 dst_##type = (type*)dst; \
3ee573a3
PR
306 for(;n>0;n--) { \
307 register type v = bytestream_get_##endian(&src); \
5e8ecfde 308 *dst_##type++ = (v - offset) << shift; \
3ee573a3 309 } \
5e8ecfde 310 dst = (short*)dst_##type;
3ee573a3 311
cd4af68a 312static int pcm_decode_frame(AVCodecContext *avctx,
bb270c08 313 void *data, int *data_size,
7993df65 314 const uint8_t *buf, int buf_size)
a96b68b7
FB
315{
316 PCMDecode *s = avctx->priv_data;
ff66caab 317 int sample_size, c, n;
a96b68b7 318 short *samples;
7993df65 319 const uint8_t *src, *src2[MAX_CHANNELS];
5e8ecfde
PR
320 uint8_t *dstu8;
321 int16_t *dst_int16_t;
322 int32_t *dst_int32_t;
323 uint16_t *dst_uint16_t;
324 uint32_t *dst_uint32_t;
a96b68b7
FB
325
326 samples = data;
327 src = buf;
328
5e8ecfde
PR
329 if (avctx->sample_fmt!=avctx->codec->sample_fmts[0]) {
330 av_log(avctx, AV_LOG_ERROR, "invalid sample_fmt\n");
331 return -1;
332 }
333
3426d575 334 if(avctx->channels <= 0 || avctx->channels > MAX_CHANNELS){
335 av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
336 return -1;
337 }
b2a581dc 338
ff66caab
PR
339 sample_size = av_get_bits_per_sample(avctx->codec_id)/8;
340
341 n = avctx->channels * sample_size;
1472b7dd
LT
342 /* av_get_bits_per_sample returns 0 for CODEC_ID_PCM_DVD */
343 if (CODEC_ID_PCM_DVD == avctx->codec_id)
344 /* 2 samples are interleaved per block in PCM_DVD */
345 n = 2 * avctx->channels * avctx->bits_per_sample/8;
346
347 if(n && buf_size % n){
348 av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
349 return -1;
350 }
351
ac66834c
MN
352 buf_size= FFMIN(buf_size, *data_size/2);
353 *data_size=0;
a8d02f2b 354
ff66caab 355 n = buf_size/sample_size;
725d86bf 356
a96b68b7 357 switch(avctx->codec->id) {
b461b3bc 358 case CODEC_ID_PCM_U32LE:
5e8ecfde 359 DECODE(uint32_t, le32, src, samples, n, 0, 0x80000000)
b461b3bc
RD
360 break;
361 case CODEC_ID_PCM_U32BE:
5e8ecfde 362 DECODE(uint32_t, be32, src, samples, n, 0, 0x80000000)
b461b3bc
RD
363 break;
364 case CODEC_ID_PCM_S24LE:
5e8ecfde 365 DECODE(int32_t, le24, src, samples, n, 8, 0)
b461b3bc
RD
366 break;
367 case CODEC_ID_PCM_S24BE:
5e8ecfde 368 DECODE(int32_t, be24, src, samples, n, 8, 0)
b461b3bc
RD
369 break;
370 case CODEC_ID_PCM_U24LE:
5e8ecfde 371 DECODE(uint32_t, le24, src, samples, n, 8, 0x800000)
b461b3bc
RD
372 break;
373 case CODEC_ID_PCM_U24BE:
5e8ecfde 374 DECODE(uint32_t, be24, src, samples, n, 8, 0x800000)
b461b3bc
RD
375 break;
376 case CODEC_ID_PCM_S24DAUD:
b461b3bc 377 for(;n>0;n--) {
5a2f421a 378 uint32_t v = bytestream_get_be24(&src);
b461b3bc
RD
379 v >>= 4; // sync flags are here
380 *samples++ = ff_reverse[(v >> 8) & 0xff] +
381 (ff_reverse[v & 0xff] << 8);
b461b3bc
RD
382 }
383 break;
725d86bf 384 case CODEC_ID_PCM_S16LE_PLANAR:
ff66caab
PR
385 n /= avctx->channels;
386 for(c=0;c<avctx->channels;c++)
4efbd755
PR
387 src2[c] = &src[c*n*2];
388 for(;n>0;n--)
725d86bf
AJ
389 for(c=0;c<avctx->channels;c++)
390 *samples++ = bytestream_get_le16(&src2[c]);
391 src = src2[avctx->channels-1];
392 break;
a96b68b7 393 case CODEC_ID_PCM_U16LE:
5e8ecfde 394 DECODE(uint16_t, le16, src, samples, n, 0, 0x8000)
a96b68b7
FB
395 break;
396 case CODEC_ID_PCM_U16BE:
5e8ecfde 397 DECODE(uint16_t, be16, src, samples, n, 0, 0x8000)
a96b68b7
FB
398 break;
399 case CODEC_ID_PCM_S8:
5e8ecfde 400 dstu8= (uint8_t*)samples;
a96b68b7 401 for(;n>0;n--) {
5e8ecfde 402 *dstu8++ = *src++ + 128;
a96b68b7 403 }
5e8ecfde 404 samples= (short*)dstu8;
a96b68b7 405 break;
38a1c7f2
PR
406#if WORDS_BIGENDIAN
407 case CODEC_ID_PCM_S32LE:
408 DECODE(int32_t, le32, src, samples, n, 0, 0)
409 break;
410 case CODEC_ID_PCM_S16LE:
411 DECODE(int16_t, le16, src, samples, n, 0, 0)
412 break;
413 case CODEC_ID_PCM_F32BE:
414 case CODEC_ID_PCM_S32BE:
415 case CODEC_ID_PCM_S16BE:
416#else
417 case CODEC_ID_PCM_F32BE:
418 case CODEC_ID_PCM_S32BE:
419 DECODE(int32_t, be32, src, samples, n, 0, 0)
420 break;
421 case CODEC_ID_PCM_S16BE:
422 DECODE(int16_t, be16, src, samples, n, 0, 0)
423 break;
424 case CODEC_ID_PCM_S32LE:
425 case CODEC_ID_PCM_S16LE:
426#endif /* WORDS_BIGENDIAN */
a96b68b7 427 case CODEC_ID_PCM_U8:
38a1c7f2
PR
428 memcpy(samples, src, n*sample_size);
429 src += n*sample_size;
430 samples = (short*)((uint8_t*)data + n*sample_size);
a96b68b7 431 break;
a11c2a2c 432 case CODEC_ID_PCM_ZORK:
a11c2a2c
MN
433 for(;n>0;n--) {
434 int x= *src++;
435 if(x&128) x-= 128;
436 else x = -x;
437 *samples++ = x << 8;
438 }
439 break;
a96b68b7
FB
440 case CODEC_ID_PCM_ALAW:
441 case CODEC_ID_PCM_MULAW:
a96b68b7 442 for(;n>0;n--) {
a4461664 443 *samples++ = s->table[*src++];
a96b68b7
FB
444 }
445 break;
1472b7dd
LT
446 case CODEC_ID_PCM_DVD:
447 if(avctx->bits_per_sample != 20 && avctx->bits_per_sample != 24) {
448 av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
449 return -1;
450 } else {
451 int jump = avctx->channels * (avctx->bits_per_sample-16) / 4;
452 n = buf_size / (avctx->channels * 2 * avctx->bits_per_sample / 8);
453 while (n--) {
454 for (c=0; c < 2*avctx->channels; c++)
455 *samples++ = bytestream_get_be16(&src);
456 src += jump;
457 }
458 }
459 break;
a96b68b7 460 default:
a96b68b7
FB
461 return -1;
462 }
0c1a9eda 463 *data_size = (uint8_t *)samples - (uint8_t *)data;
a96b68b7
FB
464 return src - buf;
465}
466
2b045c9c 467#ifdef CONFIG_ENCODERS
fd76c37f 468#define PCM_ENCODER(id,sample_fmt_,name,long_name_) \
a96b68b7
FB
469AVCodec name ## _encoder = { \
470 #name, \
471 CODEC_TYPE_AUDIO, \
472 id, \
473 0, \
bb270c08
DB
474 pcm_encode_init, \
475 pcm_encode_frame, \
476 pcm_encode_close, \
a96b68b7 477 NULL, \
fd76c37f 478 .sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
fe4bf374 479 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
2b045c9c
AJ
480};
481#else
fd76c37f 482#define PCM_ENCODER(id,sample_fmt_,name,long_name_)
2b045c9c
AJ
483#endif
484
485#ifdef CONFIG_DECODERS
0fd7e57e 486#define PCM_DECODER(id,sample_fmt_,name,long_name_) \
a96b68b7
FB
487AVCodec name ## _decoder = { \
488 #name, \
489 CODEC_TYPE_AUDIO, \
490 id, \
491 sizeof(PCMDecode), \
bb270c08 492 pcm_decode_init, \
a96b68b7
FB
493 NULL, \
494 NULL, \
cd4af68a 495 pcm_decode_frame, \
0fd7e57e 496 .sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
fe4bf374 497 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
2b045c9c
AJ
498};
499#else
0fd7e57e 500#define PCM_DECODER(id,sample_fmt_,name,long_name_)
2b045c9c
AJ
501#endif
502
fd76c37f 503#define PCM_CODEC(id, sample_fmt_, name, long_name_) \
0fd7e57e 504 PCM_ENCODER(id,sample_fmt_,name,long_name_) PCM_DECODER(id,sample_fmt_,name,long_name_)
44caa86d 505
bbdfa06d 506/* Note: Do not forget to add new entries to the Makefile as well. */
fd76c37f
PR
507PCM_CODEC (CODEC_ID_PCM_ALAW, SAMPLE_FMT_S16, pcm_alaw, "A-law PCM");
508PCM_CODEC (CODEC_ID_PCM_DVD, SAMPLE_FMT_S16, pcm_dvd, "signed 16|20|24-bit big-endian PCM");
509PCM_CODEC (CODEC_ID_PCM_F32BE, SAMPLE_FMT_FLT, pcm_f32be, "32-bit floating point big-endian PCM");
510PCM_CODEC (CODEC_ID_PCM_MULAW, SAMPLE_FMT_S16, pcm_mulaw, "mu-law PCM");
5e8ecfde 511PCM_CODEC (CODEC_ID_PCM_S8, SAMPLE_FMT_U8, pcm_s8, "signed 8-bit PCM");
fd76c37f
PR
512PCM_CODEC (CODEC_ID_PCM_S16BE, SAMPLE_FMT_S16, pcm_s16be, "signed 16-bit big-endian PCM");
513PCM_CODEC (CODEC_ID_PCM_S16LE, SAMPLE_FMT_S16, pcm_s16le, "signed 16-bit little-endian PCM");
0fd7e57e 514PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, SAMPLE_FMT_S16, pcm_s16le_planar, "16-bit little-endian planar PCM");
5e8ecfde 515PCM_CODEC (CODEC_ID_PCM_S24BE, SAMPLE_FMT_S32, pcm_s24be, "signed 24-bit big-endian PCM");
fd76c37f 516PCM_CODEC (CODEC_ID_PCM_S24DAUD, SAMPLE_FMT_S16, pcm_s24daud, "D-Cinema audio signed 24-bit PCM");
5e8ecfde
PR
517PCM_CODEC (CODEC_ID_PCM_S24LE, SAMPLE_FMT_S32, pcm_s24le, "signed 24-bit little-endian PCM");
518PCM_CODEC (CODEC_ID_PCM_S32BE, SAMPLE_FMT_S32, pcm_s32be, "signed 32-bit big-endian PCM");
519PCM_CODEC (CODEC_ID_PCM_S32LE, SAMPLE_FMT_S32, pcm_s32le, "signed 32-bit little-endian PCM");
520PCM_CODEC (CODEC_ID_PCM_U8, SAMPLE_FMT_U8, pcm_u8, "unsigned 8-bit PCM");
fd76c37f
PR
521PCM_CODEC (CODEC_ID_PCM_U16BE, SAMPLE_FMT_S16, pcm_u16be, "unsigned 16-bit big-endian PCM");
522PCM_CODEC (CODEC_ID_PCM_U16LE, SAMPLE_FMT_S16, pcm_u16le, "unsigned 16-bit little-endian PCM");
5e8ecfde
PR
523PCM_CODEC (CODEC_ID_PCM_U24BE, SAMPLE_FMT_S32, pcm_u24be, "unsigned 24-bit big-endian PCM");
524PCM_CODEC (CODEC_ID_PCM_U24LE, SAMPLE_FMT_S32, pcm_u24le, "unsigned 24-bit little-endian PCM");
525PCM_CODEC (CODEC_ID_PCM_U32BE, SAMPLE_FMT_S32, pcm_u32be, "unsigned 32-bit big-endian PCM");
526PCM_CODEC (CODEC_ID_PCM_U32LE, SAMPLE_FMT_S32, pcm_u32le, "unsigned 32-bit little-endian PCM");
fd76c37f 527PCM_CODEC (CODEC_ID_PCM_ZORK, SAMPLE_FMT_S16, pcm_zork, "Zork PCM");