pcm.c 18 KB

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