You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

573 lines
18KB

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