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.

579 lines
19KB

  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 "get_bits.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. AVPacket *avpkt)
  293. {
  294. const uint8_t *buf = avpkt->data;
  295. int buf_size = avpkt->size;
  296. PCMDecode *s = avctx->priv_data;
  297. int sample_size, c, n;
  298. short *samples;
  299. const uint8_t *src, *src8, *src2[MAX_CHANNELS];
  300. uint8_t *dstu8;
  301. int16_t *dst_int16_t;
  302. int32_t *dst_int32_t;
  303. int64_t *dst_int64_t;
  304. uint16_t *dst_uint16_t;
  305. uint32_t *dst_uint32_t;
  306. samples = data;
  307. src = buf;
  308. if (avctx->sample_fmt!=avctx->codec->sample_fmts[0]) {
  309. av_log(avctx, AV_LOG_ERROR, "invalid sample_fmt\n");
  310. return -1;
  311. }
  312. if(avctx->channels <= 0 || avctx->channels > MAX_CHANNELS){
  313. av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
  314. return -1;
  315. }
  316. sample_size = av_get_bits_per_sample(avctx->codec_id)/8;
  317. /* av_get_bits_per_sample returns 0 for CODEC_ID_PCM_DVD */
  318. if (CODEC_ID_PCM_DVD == avctx->codec_id)
  319. /* 2 samples are interleaved per block in PCM_DVD */
  320. sample_size = avctx->bits_per_coded_sample * 2 / 8;
  321. n = avctx->channels * sample_size;
  322. if(n && buf_size % n){
  323. if (buf_size < n) {
  324. av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
  325. return -1;
  326. }else
  327. buf_size -= buf_size % n;
  328. }
  329. buf_size= FFMIN(buf_size, *data_size/2);
  330. *data_size=0;
  331. n = buf_size/sample_size;
  332. switch(avctx->codec->id) {
  333. case CODEC_ID_PCM_U32LE:
  334. DECODE(uint32_t, le32, src, samples, n, 0, 0x80000000)
  335. break;
  336. case CODEC_ID_PCM_U32BE:
  337. DECODE(uint32_t, be32, src, samples, n, 0, 0x80000000)
  338. break;
  339. case CODEC_ID_PCM_S24LE:
  340. DECODE(int32_t, le24, src, samples, n, 8, 0)
  341. break;
  342. case CODEC_ID_PCM_S24BE:
  343. DECODE(int32_t, be24, src, samples, n, 8, 0)
  344. break;
  345. case CODEC_ID_PCM_U24LE:
  346. DECODE(uint32_t, le24, src, samples, n, 8, 0x800000)
  347. break;
  348. case CODEC_ID_PCM_U24BE:
  349. DECODE(uint32_t, be24, src, samples, n, 8, 0x800000)
  350. break;
  351. case CODEC_ID_PCM_S24DAUD:
  352. for(;n>0;n--) {
  353. uint32_t v = bytestream_get_be24(&src);
  354. v >>= 4; // sync flags are here
  355. *samples++ = ff_reverse[(v >> 8) & 0xff] +
  356. (ff_reverse[v & 0xff] << 8);
  357. }
  358. break;
  359. case CODEC_ID_PCM_S16LE_PLANAR:
  360. n /= avctx->channels;
  361. for(c=0;c<avctx->channels;c++)
  362. src2[c] = &src[c*n*2];
  363. for(;n>0;n--)
  364. for(c=0;c<avctx->channels;c++)
  365. *samples++ = bytestream_get_le16(&src2[c]);
  366. src = src2[avctx->channels-1];
  367. break;
  368. case CODEC_ID_PCM_U16LE:
  369. DECODE(uint16_t, le16, src, samples, n, 0, 0x8000)
  370. break;
  371. case CODEC_ID_PCM_U16BE:
  372. DECODE(uint16_t, be16, src, samples, n, 0, 0x8000)
  373. break;
  374. case CODEC_ID_PCM_S8:
  375. dstu8= (uint8_t*)samples;
  376. for(;n>0;n--) {
  377. *dstu8++ = *src++ + 128;
  378. }
  379. samples= (short*)dstu8;
  380. break;
  381. #ifdef WORDS_BIGENDIAN
  382. case CODEC_ID_PCM_F64LE:
  383. DECODE(int64_t, le64, src, samples, n, 0, 0)
  384. break;
  385. case CODEC_ID_PCM_S32LE:
  386. case CODEC_ID_PCM_F32LE:
  387. DECODE(int32_t, le32, src, samples, n, 0, 0)
  388. break;
  389. case CODEC_ID_PCM_S16LE:
  390. DECODE(int16_t, le16, src, samples, n, 0, 0)
  391. break;
  392. case CODEC_ID_PCM_F64BE:
  393. case CODEC_ID_PCM_F32BE:
  394. case CODEC_ID_PCM_S32BE:
  395. case CODEC_ID_PCM_S16BE:
  396. #else
  397. case CODEC_ID_PCM_F64BE:
  398. DECODE(int64_t, be64, src, samples, n, 0, 0)
  399. break;
  400. case CODEC_ID_PCM_F32BE:
  401. case CODEC_ID_PCM_S32BE:
  402. DECODE(int32_t, be32, src, samples, n, 0, 0)
  403. break;
  404. case CODEC_ID_PCM_S16BE:
  405. DECODE(int16_t, be16, src, samples, n, 0, 0)
  406. break;
  407. case CODEC_ID_PCM_F64LE:
  408. case CODEC_ID_PCM_F32LE:
  409. case CODEC_ID_PCM_S32LE:
  410. case CODEC_ID_PCM_S16LE:
  411. #endif /* WORDS_BIGENDIAN */
  412. case CODEC_ID_PCM_U8:
  413. memcpy(samples, src, n*sample_size);
  414. src += n*sample_size;
  415. samples = (short*)((uint8_t*)data + n*sample_size);
  416. break;
  417. case CODEC_ID_PCM_ZORK:
  418. for(;n>0;n--) {
  419. int x= *src++;
  420. if(x&128) x-= 128;
  421. else x = -x;
  422. *samples++ = x << 8;
  423. }
  424. break;
  425. case CODEC_ID_PCM_ALAW:
  426. case CODEC_ID_PCM_MULAW:
  427. for(;n>0;n--) {
  428. *samples++ = s->table[*src++];
  429. }
  430. break;
  431. case CODEC_ID_PCM_DVD:
  432. dst_int32_t = data;
  433. n /= avctx->channels;
  434. switch (avctx->bits_per_coded_sample) {
  435. case 20:
  436. while (n--) {
  437. c = avctx->channels;
  438. src8 = src + 4*c;
  439. while (c--) {
  440. *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8 &0xf0) << 8);
  441. *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++ &0x0f) << 12);
  442. }
  443. src = src8;
  444. }
  445. break;
  446. case 24:
  447. while (n--) {
  448. c = avctx->channels;
  449. src8 = src + 4*c;
  450. while (c--) {
  451. *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8);
  452. *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8);
  453. }
  454. src = src8;
  455. }
  456. break;
  457. default:
  458. av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
  459. return -1;
  460. break;
  461. }
  462. samples = (short *) dst_int32_t;
  463. break;
  464. default:
  465. return -1;
  466. }
  467. *data_size = (uint8_t *)samples - (uint8_t *)data;
  468. return src - buf;
  469. }
  470. #if CONFIG_ENCODERS
  471. #define PCM_ENCODER(id,sample_fmt_,name,long_name_) \
  472. AVCodec name ## _encoder = { \
  473. #name, \
  474. CODEC_TYPE_AUDIO, \
  475. id, \
  476. 0, \
  477. pcm_encode_init, \
  478. pcm_encode_frame, \
  479. pcm_encode_close, \
  480. NULL, \
  481. .sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
  482. .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
  483. };
  484. #else
  485. #define PCM_ENCODER(id,sample_fmt_,name,long_name_)
  486. #endif
  487. #if CONFIG_DECODERS
  488. #define PCM_DECODER(id,sample_fmt_,name,long_name_) \
  489. AVCodec name ## _decoder = { \
  490. #name, \
  491. CODEC_TYPE_AUDIO, \
  492. id, \
  493. sizeof(PCMDecode), \
  494. pcm_decode_init, \
  495. NULL, \
  496. NULL, \
  497. pcm_decode_frame, \
  498. .sample_fmts = (enum SampleFormat[]){sample_fmt_,SAMPLE_FMT_NONE}, \
  499. .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
  500. };
  501. #else
  502. #define PCM_DECODER(id,sample_fmt_,name,long_name_)
  503. #endif
  504. #define PCM_CODEC(id, sample_fmt_, name, long_name_) \
  505. PCM_ENCODER(id,sample_fmt_,name,long_name_) PCM_DECODER(id,sample_fmt_,name,long_name_)
  506. /* Note: Do not forget to add new entries to the Makefile as well. */
  507. PCM_CODEC (CODEC_ID_PCM_ALAW, SAMPLE_FMT_S16, pcm_alaw, "PCM A-law");
  508. PCM_CODEC (CODEC_ID_PCM_DVD, SAMPLE_FMT_S32, pcm_dvd, "PCM signed 20|24-bit big-endian");
  509. PCM_CODEC (CODEC_ID_PCM_F32BE, SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian");
  510. PCM_CODEC (CODEC_ID_PCM_F32LE, SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian");
  511. PCM_CODEC (CODEC_ID_PCM_F64BE, SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian");
  512. PCM_CODEC (CODEC_ID_PCM_F64LE, SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit floating point little-endian");
  513. PCM_CODEC (CODEC_ID_PCM_MULAW, SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law");
  514. PCM_CODEC (CODEC_ID_PCM_S8, SAMPLE_FMT_U8, pcm_s8, "PCM signed 8-bit");
  515. PCM_CODEC (CODEC_ID_PCM_S16BE, SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian");
  516. PCM_CODEC (CODEC_ID_PCM_S16LE, SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian");
  517. PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, SAMPLE_FMT_S16, pcm_s16le_planar, "PCM 16-bit little-endian planar");
  518. PCM_CODEC (CODEC_ID_PCM_S24BE, SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian");
  519. PCM_CODEC (CODEC_ID_PCM_S24DAUD, SAMPLE_FMT_S16, pcm_s24daud, "PCM D-Cinema audio signed 24-bit");
  520. PCM_CODEC (CODEC_ID_PCM_S24LE, SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian");
  521. PCM_CODEC (CODEC_ID_PCM_S32BE, SAMPLE_FMT_S32, pcm_s32be, "PCM signed 32-bit big-endian");
  522. PCM_CODEC (CODEC_ID_PCM_S32LE, SAMPLE_FMT_S32, pcm_s32le, "PCM signed 32-bit little-endian");
  523. PCM_CODEC (CODEC_ID_PCM_U8, SAMPLE_FMT_U8, pcm_u8, "PCM unsigned 8-bit");
  524. PCM_CODEC (CODEC_ID_PCM_U16BE, SAMPLE_FMT_S16, pcm_u16be, "PCM unsigned 16-bit big-endian");
  525. PCM_CODEC (CODEC_ID_PCM_U16LE, SAMPLE_FMT_S16, pcm_u16le, "PCM unsigned 16-bit little-endian");
  526. PCM_CODEC (CODEC_ID_PCM_U24BE, SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-bit big-endian");
  527. PCM_CODEC (CODEC_ID_PCM_U24LE, SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned 24-bit little-endian");
  528. PCM_CODEC (CODEC_ID_PCM_U32BE, SAMPLE_FMT_S32, pcm_u32be, "PCM unsigned 32-bit big-endian");
  529. PCM_CODEC (CODEC_ID_PCM_U32LE, SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned 32-bit little-endian");
  530. PCM_CODEC (CODEC_ID_PCM_ZORK, SAMPLE_FMT_S16, pcm_zork, "PCM Zork");