avcodec: change number of plane pointers from 4 to 8 at next major bump.
[libav.git] / libavcodec / pcm.c
CommitLineData
a96b68b7
FB
1/*
2 * PCM codecs
406792e7 3 * Copyright (c) 2001 Fabrice Bellard
a96b68b7 4 *
2912e87a 5 * This file is part of Libav.
b78e7197 6 *
2912e87a 7 * Libav 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 *
2912e87a 12 * Libav 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
2912e87a 18 * License along with Libav; 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 22/**
ba87f080 23 * @file
1ab3d669
MN
24 * PCM codecs
25 */
115329f1 26
a96b68b7 27#include "avcodec.h"
91cc5d37 28#include "libavutil/common.h" /* for av_reverse */
5a2f421a 29#include "bytestream.h"
fa034b44 30#include "pcm_tablegen.h"
a96b68b7 31
725d86bf
AJ
32#define MAX_CHANNELS 64
33
98a6fff9 34static av_cold int pcm_encode_init(AVCodecContext *avctx)
a96b68b7
FB
35{
36 avctx->frame_size = 1;
37 switch(avctx->codec->id) {
38 case CODEC_ID_PCM_ALAW:
fa034b44 39 pcm_alaw_tableinit();
a96b68b7
FB
40 break;
41 case CODEC_ID_PCM_MULAW:
fa034b44 42 pcm_ulaw_tableinit();
a96b68b7
FB
43 break;
44 default:
45 break;
46 }
115329f1 47
dd1c8f3e
LA
48 avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
49 avctx->block_align = avctx->channels * avctx->bits_per_coded_sample/8;
492cd3a9
MN
50 avctx->coded_frame= avcodec_alloc_frame();
51 avctx->coded_frame->key_frame= 1;
115329f1 52
a96b68b7
FB
53 return 0;
54}
55
98a6fff9 56static av_cold int pcm_encode_close(AVCodecContext *avctx)
a96b68b7 57{
492cd3a9
MN
58 av_freep(&avctx->coded_frame);
59
a96b68b7
FB
60 return 0;
61}
62
b461b3bc 63/**
3ee573a3
PR
64 * Write PCM samples macro
65 * @param type Datatype of native machine format
66 * @param endian bytestream_put_xxx() suffix
67 * @param src Source pointer (variable name)
68 * @param dst Destination pointer (variable name)
69 * @param n Total number of samples (variable name)
5e8ecfde 70 * @param shift Bitshift (bits)
3ee573a3
PR
71 * @param offset Sample value offset
72 */
5e8ecfde 73#define ENCODE(type, endian, src, dst, n, shift, offset) \
151cd4f9 74 samples_##type = (const type*) src; \
3ee573a3 75 for(;n>0;n--) { \
5e8ecfde 76 register type v = (*samples_##type++ >> shift) + offset; \
3ee573a3 77 bytestream_put_##endian(&dst, v); \
5e8ecfde 78 }
3ee573a3 79
cd4af68a 80static int pcm_encode_frame(AVCodecContext *avctx,
bb270c08 81 unsigned char *frame, int buf_size, void *data)
a96b68b7
FB
82{
83 int n, sample_size, v;
edac49da 84 const short *samples;
a96b68b7 85 unsigned char *dst;
edac49da
RD
86 const uint8_t *srcu8;
87 const int16_t *samples_int16_t;
88 const int32_t *samples_int32_t;
89 const int64_t *samples_int64_t;
90 const uint16_t *samples_uint16_t;
91 const uint32_t *samples_uint32_t;
a96b68b7 92
cc0b6129 93 sample_size = av_get_bits_per_sample(avctx->codec->id)/8;
a96b68b7
FB
94 n = buf_size / sample_size;
95 samples = data;
96 dst = frame;
97
98 switch(avctx->codec->id) {
b461b3bc 99 case CODEC_ID_PCM_U32LE:
5e8ecfde 100 ENCODE(uint32_t, le32, samples, dst, n, 0, 0x80000000)
b461b3bc
RD
101 break;
102 case CODEC_ID_PCM_U32BE:
5e8ecfde 103 ENCODE(uint32_t, be32, samples, dst, n, 0, 0x80000000)
b461b3bc
RD
104 break;
105 case CODEC_ID_PCM_S24LE:
5e8ecfde 106 ENCODE(int32_t, le24, samples, dst, n, 8, 0)
b461b3bc
RD
107 break;
108 case CODEC_ID_PCM_S24BE:
5e8ecfde 109 ENCODE(int32_t, be24, samples, dst, n, 8, 0)
b461b3bc
RD
110 break;
111 case CODEC_ID_PCM_U24LE:
5e8ecfde 112 ENCODE(uint32_t, le24, samples, dst, n, 8, 0x800000)
b461b3bc
RD
113 break;
114 case CODEC_ID_PCM_U24BE:
5e8ecfde 115 ENCODE(uint32_t, be24, samples, dst, n, 8, 0x800000)
b461b3bc
RD
116 break;
117 case CODEC_ID_PCM_S24DAUD:
118 for(;n>0;n--) {
91cc5d37
FL
119 uint32_t tmp = av_reverse[(*samples >> 8) & 0xff] +
120 (av_reverse[*samples & 0xff] << 8);
b461b3bc 121 tmp <<= 4; // sync flags would go here
5a2f421a 122 bytestream_put_be24(&dst, tmp);
b461b3bc 123 samples++;
b461b3bc
RD
124 }
125 break;
a96b68b7 126 case CODEC_ID_PCM_U16LE:
5e8ecfde 127 ENCODE(uint16_t, le16, samples, dst, n, 0, 0x8000)
a96b68b7
FB
128 break;
129 case CODEC_ID_PCM_U16BE:
5e8ecfde 130 ENCODE(uint16_t, be16, samples, dst, n, 0, 0x8000)
a96b68b7
FB
131 break;
132 case CODEC_ID_PCM_S8:
5e8ecfde 133 srcu8= data;
a96b68b7 134 for(;n>0;n--) {
5e8ecfde
PR
135 v = *srcu8++;
136 *dst++ = v - 128;
a96b68b7
FB
137 }
138 break;
63613fe6 139#if HAVE_BIGENDIAN
143a5d6f
PR
140 case CODEC_ID_PCM_F64LE:
141 ENCODE(int64_t, le64, samples, dst, n, 0, 0)
142 break;
38a1c7f2 143 case CODEC_ID_PCM_S32LE:
143a5d6f 144 case CODEC_ID_PCM_F32LE:
38a1c7f2
PR
145 ENCODE(int32_t, le32, samples, dst, n, 0, 0)
146 break;
147 case CODEC_ID_PCM_S16LE:
148 ENCODE(int16_t, le16, samples, dst, n, 0, 0)
149 break;
143a5d6f 150 case CODEC_ID_PCM_F64BE:
38a1c7f2
PR
151 case CODEC_ID_PCM_F32BE:
152 case CODEC_ID_PCM_S32BE:
153 case CODEC_ID_PCM_S16BE:
154#else
143a5d6f
PR
155 case CODEC_ID_PCM_F64BE:
156 ENCODE(int64_t, be64, samples, dst, n, 0, 0)
157 break;
38a1c7f2
PR
158 case CODEC_ID_PCM_F32BE:
159 case CODEC_ID_PCM_S32BE:
160 ENCODE(int32_t, be32, samples, dst, n, 0, 0)
161 break;
162 case CODEC_ID_PCM_S16BE:
163 ENCODE(int16_t, be16, samples, dst, n, 0, 0)
164 break;
143a5d6f
PR
165 case CODEC_ID_PCM_F64LE:
166 case CODEC_ID_PCM_F32LE:
38a1c7f2
PR
167 case CODEC_ID_PCM_S32LE:
168 case CODEC_ID_PCM_S16LE:
63613fe6 169#endif /* HAVE_BIGENDIAN */
a96b68b7 170 case CODEC_ID_PCM_U8:
38a1c7f2
PR
171 memcpy(dst, samples, n*sample_size);
172 dst += n*sample_size;
a96b68b7
FB
173 break;
174 case CODEC_ID_PCM_ALAW:
175 for(;n>0;n--) {
176 v = *samples++;
a4461664 177 *dst++ = linear_to_alaw[(v + 32768) >> 2];
a96b68b7
FB
178 }
179 break;
180 case CODEC_ID_PCM_MULAW:
181 for(;n>0;n--) {
182 v = *samples++;
a4461664 183 *dst++ = linear_to_ulaw[(v + 32768) >> 2];
a96b68b7
FB
184 }
185 break;
186 default:
187 return -1;
188 }
13a0314f 189 //avctx->frame_size = (dst - frame) / (sample_size * avctx->channels);
4c3d2e5f 190
a96b68b7
FB
191 return dst - frame;
192}
193
194typedef struct PCMDecode {
195 short table[256];
196} PCMDecode;
197
98a6fff9 198static av_cold int pcm_decode_init(AVCodecContext * avctx)
a96b68b7
FB
199{
200 PCMDecode *s = avctx->priv_data;
201 int i;
202
d94e29ca
JR
203 if (avctx->channels <= 0 || avctx->channels > MAX_CHANNELS) {
204 av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
205 return AVERROR(EINVAL);
206 }
207
a96b68b7
FB
208 switch(avctx->codec->id) {
209 case CODEC_ID_PCM_ALAW:
210 for(i=0;i<256;i++)
211 s->table[i] = alaw2linear(i);
212 break;
213 case CODEC_ID_PCM_MULAW:
214 for(i=0;i<256;i++)
215 s->table[i] = ulaw2linear(i);
216 break;
217 default:
218 break;
219 }
aa29709e 220
0fd7e57e 221 avctx->sample_fmt = avctx->codec->sample_fmts[0];
4dbcfa6f 222
5d6e4c16 223 if (avctx->sample_fmt == AV_SAMPLE_FMT_S32)
4dbcfa6f
JR
224 avctx->bits_per_raw_sample = av_get_bits_per_sample(avctx->codec->id);
225
a96b68b7
FB
226 return 0;
227}
228
b461b3bc 229/**
3ee573a3 230 * Read PCM samples macro
b45eb9d6 231 * @param size Data size of native machine format
3ee573a3
PR
232 * @param endian bytestream_get_xxx() endian suffix
233 * @param src Source pointer (variable name)
234 * @param dst Destination pointer (variable name)
235 * @param n Total number of samples (variable name)
5e8ecfde 236 * @param shift Bitshift (bits)
3ee573a3
PR
237 * @param offset Sample value offset
238 */
b45eb9d6 239#define DECODE(size, endian, src, dst, n, shift, offset) \
3ee573a3 240 for(;n>0;n--) { \
b45eb9d6
MR
241 uint##size##_t v = bytestream_get_##endian(&src); \
242 AV_WN##size##A(dst, (v - offset) << shift); \
243 dst += size / 8; \
244 }
3ee573a3 245
cd4af68a 246static int pcm_decode_frame(AVCodecContext *avctx,
bb270c08 247 void *data, int *data_size,
7a00bbad 248 AVPacket *avpkt)
a96b68b7 249{
0093f96d 250 const uint8_t *src = avpkt->data;
7a00bbad 251 int buf_size = avpkt->size;
a96b68b7 252 PCMDecode *s = avctx->priv_data;
f1901180 253 int sample_size, c, n, out_size;
b45eb9d6 254 uint8_t *samples;
5e8ecfde 255 int32_t *dst_int32_t;
a96b68b7
FB
256
257 samples = data;
a96b68b7 258
ff66caab
PR
259 sample_size = av_get_bits_per_sample(avctx->codec_id)/8;
260
1472b7dd 261 /* av_get_bits_per_sample returns 0 for CODEC_ID_PCM_DVD */
381e195b
JR
262 if (CODEC_ID_PCM_DVD == avctx->codec_id) {
263 if (avctx->bits_per_coded_sample != 20 &&
264 avctx->bits_per_coded_sample != 24) {
265 av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
266 return AVERROR(EINVAL);
267 }
1472b7dd 268 /* 2 samples are interleaved per block in PCM_DVD */
dd1c8f3e 269 sample_size = avctx->bits_per_coded_sample * 2 / 8;
381e195b 270 } else if (avctx->codec_id == CODEC_ID_PCM_LXF)
fbeabfca
TH
271 /* we process 40-bit blocks per channel for LXF */
272 sample_size = 5;
2cd04cf9 273
e048a9ca
DK
274 if (sample_size == 0) {
275 av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n");
276 return AVERROR(EINVAL);
277 }
278
2cd04cf9 279 n = avctx->channels * sample_size;
1472b7dd
LT
280
281 if(n && buf_size % n){
012e4f5a 282 if (buf_size < n) {
34365443
MN
283 av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
284 return -1;
012e4f5a
MN
285 }else
286 buf_size -= buf_size % n;
1472b7dd
LT
287 }
288
ff66caab 289 n = buf_size/sample_size;
725d86bf 290
f1901180
JR
291 out_size = n * av_get_bytes_per_sample(avctx->sample_fmt);
292 if (avctx->codec_id == CODEC_ID_PCM_DVD ||
293 avctx->codec_id == CODEC_ID_PCM_LXF)
294 out_size *= 2;
295 if (*data_size < out_size) {
296 av_log(avctx, AV_LOG_ERROR, "output buffer too small\n");
297 return AVERROR(EINVAL);
298 }
299
a96b68b7 300 switch(avctx->codec->id) {
b461b3bc 301 case CODEC_ID_PCM_U32LE:
b45eb9d6 302 DECODE(32, le32, src, samples, n, 0, 0x80000000)
b461b3bc
RD
303 break;
304 case CODEC_ID_PCM_U32BE:
b45eb9d6 305 DECODE(32, be32, src, samples, n, 0, 0x80000000)
b461b3bc
RD
306 break;
307 case CODEC_ID_PCM_S24LE:
b45eb9d6 308 DECODE(32, le24, src, samples, n, 8, 0)
b461b3bc
RD
309 break;
310 case CODEC_ID_PCM_S24BE:
b45eb9d6 311 DECODE(32, be24, src, samples, n, 8, 0)
b461b3bc
RD
312 break;
313 case CODEC_ID_PCM_U24LE:
b45eb9d6 314 DECODE(32, le24, src, samples, n, 8, 0x800000)
b461b3bc
RD
315 break;
316 case CODEC_ID_PCM_U24BE:
b45eb9d6 317 DECODE(32, be24, src, samples, n, 8, 0x800000)
b461b3bc
RD
318 break;
319 case CODEC_ID_PCM_S24DAUD:
b461b3bc 320 for(;n>0;n--) {
5a2f421a 321 uint32_t v = bytestream_get_be24(&src);
b461b3bc 322 v >>= 4; // sync flags are here
b45eb9d6
MR
323 AV_WN16A(samples, av_reverse[(v >> 8) & 0xff] +
324 (av_reverse[v & 0xff] << 8));
325 samples += 2;
b461b3bc
RD
326 }
327 break;
725d86bf 328 case CODEC_ID_PCM_S16LE_PLANAR:
154cd253
JR
329 {
330 const uint8_t *src2[MAX_CHANNELS];
ff66caab
PR
331 n /= avctx->channels;
332 for(c=0;c<avctx->channels;c++)
4efbd755
PR
333 src2[c] = &src[c*n*2];
334 for(;n>0;n--)
b45eb9d6
MR
335 for(c=0;c<avctx->channels;c++) {
336 AV_WN16A(samples, bytestream_get_le16(&src2[c]));
337 samples += 2;
338 }
725d86bf 339 break;
154cd253 340 }
a96b68b7 341 case CODEC_ID_PCM_U16LE:
b45eb9d6 342 DECODE(16, le16, src, samples, n, 0, 0x8000)
a96b68b7
FB
343 break;
344 case CODEC_ID_PCM_U16BE:
b45eb9d6 345 DECODE(16, be16, src, samples, n, 0, 0x8000)
a96b68b7
FB
346 break;
347 case CODEC_ID_PCM_S8:
a96b68b7 348 for(;n>0;n--) {
b45eb9d6 349 *samples++ = *src++ + 128;
a96b68b7
FB
350 }
351 break;
63613fe6 352#if HAVE_BIGENDIAN
143a5d6f 353 case CODEC_ID_PCM_F64LE:
b45eb9d6 354 DECODE(64, le64, src, samples, n, 0, 0)
143a5d6f 355 break;
38a1c7f2 356 case CODEC_ID_PCM_S32LE:
143a5d6f 357 case CODEC_ID_PCM_F32LE:
b45eb9d6 358 DECODE(32, le32, src, samples, n, 0, 0)
38a1c7f2
PR
359 break;
360 case CODEC_ID_PCM_S16LE:
b45eb9d6 361 DECODE(16, le16, src, samples, n, 0, 0)
38a1c7f2 362 break;
143a5d6f 363 case CODEC_ID_PCM_F64BE:
38a1c7f2
PR
364 case CODEC_ID_PCM_F32BE:
365 case CODEC_ID_PCM_S32BE:
366 case CODEC_ID_PCM_S16BE:
367#else
143a5d6f 368 case CODEC_ID_PCM_F64BE:
b45eb9d6 369 DECODE(64, be64, src, samples, n, 0, 0)
143a5d6f 370 break;
38a1c7f2
PR
371 case CODEC_ID_PCM_F32BE:
372 case CODEC_ID_PCM_S32BE:
b45eb9d6 373 DECODE(32, be32, src, samples, n, 0, 0)
38a1c7f2
PR
374 break;
375 case CODEC_ID_PCM_S16BE:
b45eb9d6 376 DECODE(16, be16, src, samples, n, 0, 0)
38a1c7f2 377 break;
143a5d6f
PR
378 case CODEC_ID_PCM_F64LE:
379 case CODEC_ID_PCM_F32LE:
38a1c7f2
PR
380 case CODEC_ID_PCM_S32LE:
381 case CODEC_ID_PCM_S16LE:
63613fe6 382#endif /* HAVE_BIGENDIAN */
a96b68b7 383 case CODEC_ID_PCM_U8:
38a1c7f2 384 memcpy(samples, src, n*sample_size);
a96b68b7 385 break;
a11c2a2c 386 case CODEC_ID_PCM_ZORK:
67a3b67c
JR
387 for (; n > 0; n--) {
388 int v = *src++;
389 if (v < 128)
390 v = 128 - v;
391 *samples++ = v;
a11c2a2c
MN
392 }
393 break;
a96b68b7
FB
394 case CODEC_ID_PCM_ALAW:
395 case CODEC_ID_PCM_MULAW:
a96b68b7 396 for(;n>0;n--) {
b45eb9d6
MR
397 AV_WN16A(samples, s->table[*src++]);
398 samples += 2;
a96b68b7
FB
399 }
400 break;
1472b7dd 401 case CODEC_ID_PCM_DVD:
154cd253
JR
402 {
403 const uint8_t *src8;
0cdc6ec9
PR
404 dst_int32_t = data;
405 n /= avctx->channels;
dd1c8f3e 406 switch (avctx->bits_per_coded_sample) {
0cdc6ec9 407 case 20:
1472b7dd 408 while (n--) {
0cdc6ec9
PR
409 c = avctx->channels;
410 src8 = src + 4*c;
411 while (c--) {
412 *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8 &0xf0) << 8);
413 *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++ &0x0f) << 12);
414 }
415 src = src8;
1472b7dd 416 }
0cdc6ec9
PR
417 break;
418 case 24:
419 while (n--) {
420 c = avctx->channels;
421 src8 = src + 4*c;
422 while (c--) {
423 *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8);
424 *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8);
425 }
426 src = src8;
427 }
428 break;
1472b7dd
LT
429 }
430 break;
154cd253 431 }
fbeabfca 432 case CODEC_ID_PCM_LXF:
154cd253
JR
433 {
434 int i;
435 const uint8_t *src8;
fbeabfca
TH
436 dst_int32_t = data;
437 n /= avctx->channels;
438 //unpack and de-planerize
439 for (i = 0; i < n; i++) {
440 for (c = 0, src8 = src + i*5; c < avctx->channels; c++, src8 += n*5) {
441 //extract low 20 bits and expand to 32 bits
442 *dst_int32_t++ = (src8[2] << 28) | (src8[1] << 20) | (src8[0] << 12) |
443 ((src8[2] & 0xF) << 8) | src8[1];
444 }
445
446 for (c = 0, src8 = src + i*5; c < avctx->channels; c++, src8 += n*5) {
447 //extract high 20 bits and expand to 32 bits
448 *dst_int32_t++ = (src8[4] << 24) | (src8[3] << 16) |
449 ((src8[2] & 0xF0) << 8) | (src8[4] << 4) | (src8[3] >> 4);
450 }
451 }
fbeabfca 452 break;
154cd253 453 }
a96b68b7 454 default:
a96b68b7
FB
455 return -1;
456 }
f1901180 457 *data_size = out_size;
0093f96d 458 return buf_size;
a96b68b7
FB
459}
460
b250f9c6 461#if CONFIG_ENCODERS
a5b588bc 462#define PCM_ENCODER(id_,sample_fmt_,name_,long_name_) \
d36beb3f 463AVCodec ff_ ## name_ ## _encoder = { \
a5b588bc
PR
464 .name = #name_, \
465 .type = AVMEDIA_TYPE_AUDIO, \
466 .id = id_, \
467 .init = pcm_encode_init, \
468 .encode = pcm_encode_frame, \
469 .close = pcm_encode_close, \
5d6e4c16 470 .sample_fmts = (const enum AVSampleFormat[]){sample_fmt_,AV_SAMPLE_FMT_NONE}, \
fe4bf374 471 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
44adbebe 472}
2b045c9c 473#else
fd76c37f 474#define PCM_ENCODER(id,sample_fmt_,name,long_name_)
2b045c9c
AJ
475#endif
476
b250f9c6 477#if CONFIG_DECODERS
a5b588bc 478#define PCM_DECODER(id_,sample_fmt_,name_,long_name_) \
d36beb3f 479AVCodec ff_ ## name_ ## _decoder = { \
a5b588bc
PR
480 .name = #name_, \
481 .type = AVMEDIA_TYPE_AUDIO, \
482 .id = id_, \
483 .priv_data_size = sizeof(PCMDecode), \
484 .init = pcm_decode_init, \
485 .decode = pcm_decode_frame, \
5d6e4c16 486 .sample_fmts = (const enum AVSampleFormat[]){sample_fmt_,AV_SAMPLE_FMT_NONE}, \
fe4bf374 487 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
44adbebe 488}
2b045c9c 489#else
0fd7e57e 490#define PCM_DECODER(id,sample_fmt_,name,long_name_)
2b045c9c
AJ
491#endif
492
fd76c37f 493#define PCM_CODEC(id, sample_fmt_, name, long_name_) \
44adbebe 494 PCM_ENCODER(id,sample_fmt_,name,long_name_); PCM_DECODER(id,sample_fmt_,name,long_name_)
44caa86d 495
bbdfa06d 496/* Note: Do not forget to add new entries to the Makefile as well. */
5d6e4c16 497PCM_CODEC (CODEC_ID_PCM_ALAW, AV_SAMPLE_FMT_S16, pcm_alaw, "PCM A-law");
5b5083b5 498PCM_DECODER(CODEC_ID_PCM_DVD, AV_SAMPLE_FMT_S32, pcm_dvd, "PCM signed 20|24-bit big-endian");
5d6e4c16
SS
499PCM_CODEC (CODEC_ID_PCM_F32BE, AV_SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian");
500PCM_CODEC (CODEC_ID_PCM_F32LE, AV_SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian");
501PCM_CODEC (CODEC_ID_PCM_F64BE, AV_SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian");
502PCM_CODEC (CODEC_ID_PCM_F64LE, AV_SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit floating point little-endian");
503PCM_DECODER(CODEC_ID_PCM_LXF, AV_SAMPLE_FMT_S32, pcm_lxf, "PCM signed 20-bit little-endian planar");
504PCM_CODEC (CODEC_ID_PCM_MULAW, AV_SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law");
505PCM_CODEC (CODEC_ID_PCM_S8, AV_SAMPLE_FMT_U8, pcm_s8, "PCM signed 8-bit");
506PCM_CODEC (CODEC_ID_PCM_S16BE, AV_SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian");
507PCM_CODEC (CODEC_ID_PCM_S16LE, AV_SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian");
508PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16, pcm_s16le_planar, "PCM 16-bit little-endian planar");
509PCM_CODEC (CODEC_ID_PCM_S24BE, AV_SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian");
510PCM_CODEC (CODEC_ID_PCM_S24DAUD, AV_SAMPLE_FMT_S16, pcm_s24daud, "PCM D-Cinema audio signed 24-bit");
511PCM_CODEC (CODEC_ID_PCM_S24LE, AV_SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian");
512PCM_CODEC (CODEC_ID_PCM_S32BE, AV_SAMPLE_FMT_S32, pcm_s32be, "PCM signed 32-bit big-endian");
513PCM_CODEC (CODEC_ID_PCM_S32LE, AV_SAMPLE_FMT_S32, pcm_s32le, "PCM signed 32-bit little-endian");
514PCM_CODEC (CODEC_ID_PCM_U8, AV_SAMPLE_FMT_U8, pcm_u8, "PCM unsigned 8-bit");
515PCM_CODEC (CODEC_ID_PCM_U16BE, AV_SAMPLE_FMT_S16, pcm_u16be, "PCM unsigned 16-bit big-endian");
516PCM_CODEC (CODEC_ID_PCM_U16LE, AV_SAMPLE_FMT_S16, pcm_u16le, "PCM unsigned 16-bit little-endian");
517PCM_CODEC (CODEC_ID_PCM_U24BE, AV_SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-bit big-endian");
518PCM_CODEC (CODEC_ID_PCM_U24LE, AV_SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned 24-bit little-endian");
519PCM_CODEC (CODEC_ID_PCM_U32BE, AV_SAMPLE_FMT_S32, pcm_u32be, "PCM unsigned 32-bit big-endian");
520PCM_CODEC (CODEC_ID_PCM_U32LE, AV_SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned 32-bit little-endian");
85579b63 521PCM_DECODER(CODEC_ID_PCM_ZORK, AV_SAMPLE_FMT_U8, pcm_zork, "PCM Zork");