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.

544 lines
20KB

  1. /*
  2. * PCM codecs
  3. * Copyright (c) 2001 Fabrice Bellard
  4. *
  5. * This file is part of Libav.
  6. *
  7. * Libav 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. * Libav 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 Libav; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. /**
  22. * @file
  23. * PCM codecs
  24. */
  25. #include "libavutil/attributes.h"
  26. #include "avcodec.h"
  27. #include "bytestream.h"
  28. #include "internal.h"
  29. #include "mathops.h"
  30. #include "pcm_tablegen.h"
  31. #define MAX_CHANNELS 64
  32. static av_cold int pcm_encode_init(AVCodecContext *avctx)
  33. {
  34. avctx->frame_size = 0;
  35. switch (avctx->codec->id) {
  36. case AV_CODEC_ID_PCM_ALAW:
  37. pcm_alaw_tableinit();
  38. break;
  39. case AV_CODEC_ID_PCM_MULAW:
  40. pcm_ulaw_tableinit();
  41. break;
  42. default:
  43. break;
  44. }
  45. avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
  46. avctx->block_align = avctx->channels * avctx->bits_per_coded_sample / 8;
  47. avctx->bit_rate = avctx->block_align * avctx->sample_rate * 8;
  48. avctx->coded_frame = avcodec_alloc_frame();
  49. if (!avctx->coded_frame)
  50. return AVERROR(ENOMEM);
  51. return 0;
  52. }
  53. static av_cold int pcm_encode_close(AVCodecContext *avctx)
  54. {
  55. av_freep(&avctx->coded_frame);
  56. return 0;
  57. }
  58. /**
  59. * Write PCM samples macro
  60. * @param type Datatype of native machine format
  61. * @param endian bytestream_put_xxx() suffix
  62. * @param src Source pointer (variable name)
  63. * @param dst Destination pointer (variable name)
  64. * @param n Total number of samples (variable name)
  65. * @param shift Bitshift (bits)
  66. * @param offset Sample value offset
  67. */
  68. #define ENCODE(type, endian, src, dst, n, shift, offset) \
  69. samples_ ## type = (const type *) src; \
  70. for (; n > 0; n--) { \
  71. register type v = (*samples_ ## type++ >> shift) + offset; \
  72. bytestream_put_ ## endian(&dst, v); \
  73. }
  74. static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
  75. const AVFrame *frame, int *got_packet_ptr)
  76. {
  77. int n, sample_size, v, ret;
  78. const short *samples;
  79. unsigned char *dst;
  80. const uint8_t *srcu8;
  81. const int16_t *samples_int16_t;
  82. const int32_t *samples_int32_t;
  83. const int64_t *samples_int64_t;
  84. const uint16_t *samples_uint16_t;
  85. const uint32_t *samples_uint32_t;
  86. sample_size = av_get_bits_per_sample(avctx->codec->id) / 8;
  87. n = frame->nb_samples * avctx->channels;
  88. samples = (const short *)frame->data[0];
  89. if ((ret = ff_alloc_packet(avpkt, n * sample_size))) {
  90. av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
  91. return ret;
  92. }
  93. dst = avpkt->data;
  94. switch (avctx->codec->id) {
  95. case AV_CODEC_ID_PCM_U32LE:
  96. ENCODE(uint32_t, le32, samples, dst, n, 0, 0x80000000)
  97. break;
  98. case AV_CODEC_ID_PCM_U32BE:
  99. ENCODE(uint32_t, be32, samples, dst, n, 0, 0x80000000)
  100. break;
  101. case AV_CODEC_ID_PCM_S24LE:
  102. ENCODE(int32_t, le24, samples, dst, n, 8, 0)
  103. break;
  104. case AV_CODEC_ID_PCM_S24BE:
  105. ENCODE(int32_t, be24, samples, dst, n, 8, 0)
  106. break;
  107. case AV_CODEC_ID_PCM_U24LE:
  108. ENCODE(uint32_t, le24, samples, dst, n, 8, 0x800000)
  109. break;
  110. case AV_CODEC_ID_PCM_U24BE:
  111. ENCODE(uint32_t, be24, samples, dst, n, 8, 0x800000)
  112. break;
  113. case AV_CODEC_ID_PCM_S24DAUD:
  114. for (; n > 0; n--) {
  115. uint32_t tmp = ff_reverse[(*samples >> 8) & 0xff] +
  116. (ff_reverse[*samples & 0xff] << 8);
  117. tmp <<= 4; // sync flags would go here
  118. bytestream_put_be24(&dst, tmp);
  119. samples++;
  120. }
  121. break;
  122. case AV_CODEC_ID_PCM_U16LE:
  123. ENCODE(uint16_t, le16, samples, dst, n, 0, 0x8000)
  124. break;
  125. case AV_CODEC_ID_PCM_U16BE:
  126. ENCODE(uint16_t, be16, samples, dst, n, 0, 0x8000)
  127. break;
  128. case AV_CODEC_ID_PCM_S8:
  129. srcu8 = frame->data[0];
  130. for (; n > 0; n--) {
  131. v = *srcu8++;
  132. *dst++ = v - 128;
  133. }
  134. break;
  135. #if HAVE_BIGENDIAN
  136. case AV_CODEC_ID_PCM_F64LE:
  137. ENCODE(int64_t, le64, samples, dst, n, 0, 0)
  138. break;
  139. case AV_CODEC_ID_PCM_S32LE:
  140. case AV_CODEC_ID_PCM_F32LE:
  141. ENCODE(int32_t, le32, samples, dst, n, 0, 0)
  142. break;
  143. case AV_CODEC_ID_PCM_S16LE:
  144. ENCODE(int16_t, le16, samples, dst, n, 0, 0)
  145. break;
  146. case AV_CODEC_ID_PCM_F64BE:
  147. case AV_CODEC_ID_PCM_F32BE:
  148. case AV_CODEC_ID_PCM_S32BE:
  149. case AV_CODEC_ID_PCM_S16BE:
  150. #else
  151. case AV_CODEC_ID_PCM_F64BE:
  152. ENCODE(int64_t, be64, samples, dst, n, 0, 0)
  153. break;
  154. case AV_CODEC_ID_PCM_F32BE:
  155. case AV_CODEC_ID_PCM_S32BE:
  156. ENCODE(int32_t, be32, samples, dst, n, 0, 0)
  157. break;
  158. case AV_CODEC_ID_PCM_S16BE:
  159. ENCODE(int16_t, be16, samples, dst, n, 0, 0)
  160. break;
  161. case AV_CODEC_ID_PCM_F64LE:
  162. case AV_CODEC_ID_PCM_F32LE:
  163. case AV_CODEC_ID_PCM_S32LE:
  164. case AV_CODEC_ID_PCM_S16LE:
  165. #endif /* HAVE_BIGENDIAN */
  166. case AV_CODEC_ID_PCM_U8:
  167. memcpy(dst, samples, n * sample_size);
  168. dst += n * sample_size;
  169. break;
  170. case AV_CODEC_ID_PCM_ALAW:
  171. for (; n > 0; n--) {
  172. v = *samples++;
  173. *dst++ = linear_to_alaw[(v + 32768) >> 2];
  174. }
  175. break;
  176. case AV_CODEC_ID_PCM_MULAW:
  177. for (; n > 0; n--) {
  178. v = *samples++;
  179. *dst++ = linear_to_ulaw[(v + 32768) >> 2];
  180. }
  181. break;
  182. default:
  183. return -1;
  184. }
  185. *got_packet_ptr = 1;
  186. return 0;
  187. }
  188. typedef struct PCMDecode {
  189. AVFrame frame;
  190. short table[256];
  191. } PCMDecode;
  192. static av_cold int pcm_decode_init(AVCodecContext *avctx)
  193. {
  194. PCMDecode *s = avctx->priv_data;
  195. int i;
  196. if (avctx->channels <= 0 || avctx->channels > MAX_CHANNELS) {
  197. av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
  198. return AVERROR(EINVAL);
  199. }
  200. switch (avctx->codec->id) {
  201. case AV_CODEC_ID_PCM_ALAW:
  202. for (i = 0; i < 256; i++)
  203. s->table[i] = alaw2linear(i);
  204. break;
  205. case AV_CODEC_ID_PCM_MULAW:
  206. for (i = 0; i < 256; i++)
  207. s->table[i] = ulaw2linear(i);
  208. break;
  209. default:
  210. break;
  211. }
  212. avctx->sample_fmt = avctx->codec->sample_fmts[0];
  213. if (avctx->sample_fmt == AV_SAMPLE_FMT_S32)
  214. avctx->bits_per_raw_sample = av_get_bits_per_sample(avctx->codec->id);
  215. avcodec_get_frame_defaults(&s->frame);
  216. avctx->coded_frame = &s->frame;
  217. return 0;
  218. }
  219. /**
  220. * Read PCM samples macro
  221. * @param size Data size of native machine format
  222. * @param endian bytestream_get_xxx() endian suffix
  223. * @param src Source pointer (variable name)
  224. * @param dst Destination pointer (variable name)
  225. * @param n Total number of samples (variable name)
  226. * @param shift Bitshift (bits)
  227. * @param offset Sample value offset
  228. */
  229. #define DECODE(size, endian, src, dst, n, shift, offset) \
  230. for (; n > 0; n--) { \
  231. uint ## size ## _t v = bytestream_get_ ## endian(&src); \
  232. AV_WN ## size ## A(dst, (v - offset) << shift); \
  233. dst += size / 8; \
  234. }
  235. static int pcm_decode_frame(AVCodecContext *avctx, void *data,
  236. int *got_frame_ptr, AVPacket *avpkt)
  237. {
  238. const uint8_t *src = avpkt->data;
  239. int buf_size = avpkt->size;
  240. PCMDecode *s = avctx->priv_data;
  241. int sample_size, c, n, ret, samples_per_block;
  242. uint8_t *samples;
  243. int32_t *dst_int32_t;
  244. sample_size = av_get_bits_per_sample(avctx->codec_id) / 8;
  245. /* av_get_bits_per_sample returns 0 for AV_CODEC_ID_PCM_DVD */
  246. samples_per_block = 1;
  247. if (AV_CODEC_ID_PCM_DVD == avctx->codec_id) {
  248. if (avctx->bits_per_coded_sample != 20 &&
  249. avctx->bits_per_coded_sample != 24) {
  250. av_log(avctx, AV_LOG_ERROR, "PCM DVD unsupported sample depth\n");
  251. return AVERROR(EINVAL);
  252. }
  253. /* 2 samples are interleaved per block in PCM_DVD */
  254. samples_per_block = 2;
  255. sample_size = avctx->bits_per_coded_sample * 2 / 8;
  256. } else if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) {
  257. /* we process 40-bit blocks per channel for LXF */
  258. samples_per_block = 2;
  259. sample_size = 5;
  260. }
  261. if (sample_size == 0) {
  262. av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n");
  263. return AVERROR(EINVAL);
  264. }
  265. n = avctx->channels * sample_size;
  266. if (n && buf_size % n) {
  267. if (buf_size < n) {
  268. av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
  269. return -1;
  270. } else
  271. buf_size -= buf_size % n;
  272. }
  273. n = buf_size / sample_size;
  274. /* get output buffer */
  275. s->frame.nb_samples = n * samples_per_block / avctx->channels;
  276. if ((ret = avctx->get_buffer(avctx, &s->frame)) < 0) {
  277. av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
  278. return ret;
  279. }
  280. samples = s->frame.data[0];
  281. switch (avctx->codec->id) {
  282. case AV_CODEC_ID_PCM_U32LE:
  283. DECODE(32, le32, src, samples, n, 0, 0x80000000)
  284. break;
  285. case AV_CODEC_ID_PCM_U32BE:
  286. DECODE(32, be32, src, samples, n, 0, 0x80000000)
  287. break;
  288. case AV_CODEC_ID_PCM_S24LE:
  289. DECODE(32, le24, src, samples, n, 8, 0)
  290. break;
  291. case AV_CODEC_ID_PCM_S24BE:
  292. DECODE(32, be24, src, samples, n, 8, 0)
  293. break;
  294. case AV_CODEC_ID_PCM_U24LE:
  295. DECODE(32, le24, src, samples, n, 8, 0x800000)
  296. break;
  297. case AV_CODEC_ID_PCM_U24BE:
  298. DECODE(32, be24, src, samples, n, 8, 0x800000)
  299. break;
  300. case AV_CODEC_ID_PCM_S24DAUD:
  301. for (; n > 0; n--) {
  302. uint32_t v = bytestream_get_be24(&src);
  303. v >>= 4; // sync flags are here
  304. AV_WN16A(samples, ff_reverse[(v >> 8) & 0xff] +
  305. (ff_reverse[v & 0xff] << 8));
  306. samples += 2;
  307. }
  308. break;
  309. case AV_CODEC_ID_PCM_S16LE_PLANAR:
  310. {
  311. const uint8_t *src2[MAX_CHANNELS];
  312. n /= avctx->channels;
  313. for (c = 0; c < avctx->channels; c++)
  314. src2[c] = &src[c * n * 2];
  315. for (; n > 0; n--)
  316. for (c = 0; c < avctx->channels; c++) {
  317. AV_WN16A(samples, bytestream_get_le16(&src2[c]));
  318. samples += 2;
  319. }
  320. break;
  321. }
  322. case AV_CODEC_ID_PCM_U16LE:
  323. DECODE(16, le16, src, samples, n, 0, 0x8000)
  324. break;
  325. case AV_CODEC_ID_PCM_U16BE:
  326. DECODE(16, be16, src, samples, n, 0, 0x8000)
  327. break;
  328. case AV_CODEC_ID_PCM_S8:
  329. for (; n > 0; n--)
  330. *samples++ = *src++ + 128;
  331. break;
  332. #if HAVE_BIGENDIAN
  333. case AV_CODEC_ID_PCM_F64LE:
  334. DECODE(64, le64, src, samples, n, 0, 0)
  335. break;
  336. case AV_CODEC_ID_PCM_S32LE:
  337. case AV_CODEC_ID_PCM_F32LE:
  338. DECODE(32, le32, src, samples, n, 0, 0)
  339. break;
  340. case AV_CODEC_ID_PCM_S16LE:
  341. DECODE(16, le16, src, samples, n, 0, 0)
  342. break;
  343. case AV_CODEC_ID_PCM_F64BE:
  344. case AV_CODEC_ID_PCM_F32BE:
  345. case AV_CODEC_ID_PCM_S32BE:
  346. case AV_CODEC_ID_PCM_S16BE:
  347. #else
  348. case AV_CODEC_ID_PCM_F64BE:
  349. DECODE(64, be64, src, samples, n, 0, 0)
  350. break;
  351. case AV_CODEC_ID_PCM_F32BE:
  352. case AV_CODEC_ID_PCM_S32BE:
  353. DECODE(32, be32, src, samples, n, 0, 0)
  354. break;
  355. case AV_CODEC_ID_PCM_S16BE:
  356. DECODE(16, be16, src, samples, n, 0, 0)
  357. break;
  358. case AV_CODEC_ID_PCM_F64LE:
  359. case AV_CODEC_ID_PCM_F32LE:
  360. case AV_CODEC_ID_PCM_S32LE:
  361. case AV_CODEC_ID_PCM_S16LE:
  362. #endif /* HAVE_BIGENDIAN */
  363. case AV_CODEC_ID_PCM_U8:
  364. memcpy(samples, src, n * sample_size);
  365. break;
  366. case AV_CODEC_ID_PCM_ZORK:
  367. for (; n > 0; n--) {
  368. int v = *src++;
  369. if (v < 128)
  370. v = 128 - v;
  371. *samples++ = v;
  372. }
  373. break;
  374. case AV_CODEC_ID_PCM_ALAW:
  375. case AV_CODEC_ID_PCM_MULAW:
  376. for (; n > 0; n--) {
  377. AV_WN16A(samples, s->table[*src++]);
  378. samples += 2;
  379. }
  380. break;
  381. case AV_CODEC_ID_PCM_DVD:
  382. {
  383. const uint8_t *src8;
  384. dst_int32_t = (int32_t *)s->frame.data[0];
  385. n /= avctx->channels;
  386. switch (avctx->bits_per_coded_sample) {
  387. case 20:
  388. while (n--) {
  389. c = avctx->channels;
  390. src8 = src + 4 * c;
  391. while (c--) {
  392. *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8 & 0xf0) << 8);
  393. *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++ & 0x0f) << 12);
  394. }
  395. src = src8;
  396. }
  397. break;
  398. case 24:
  399. while (n--) {
  400. c = avctx->channels;
  401. src8 = src + 4 * c;
  402. while (c--) {
  403. *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8);
  404. *dst_int32_t++ = (bytestream_get_be16(&src) << 16) + ((*src8++) << 8);
  405. }
  406. src = src8;
  407. }
  408. break;
  409. }
  410. break;
  411. }
  412. case AV_CODEC_ID_PCM_LXF:
  413. {
  414. int i;
  415. n /= avctx->channels;
  416. for (c = 0; c < avctx->channels; c++) {
  417. dst_int32_t = (int32_t *)s->frame.extended_data[c];
  418. for (i = 0; i < n; i++) {
  419. // extract low 20 bits and expand to 32 bits
  420. *dst_int32_t++ = (src[2] << 28) |
  421. (src[1] << 20) |
  422. (src[0] << 12) |
  423. ((src[2] & 0x0F) << 8) |
  424. src[1];
  425. // extract high 20 bits and expand to 32 bits
  426. *dst_int32_t++ = (src[4] << 24) |
  427. (src[3] << 16) |
  428. ((src[2] & 0xF0) << 8) |
  429. (src[4] << 4) |
  430. (src[3] >> 4);
  431. src += 5;
  432. }
  433. }
  434. break;
  435. }
  436. default:
  437. return -1;
  438. }
  439. *got_frame_ptr = 1;
  440. *(AVFrame *)data = s->frame;
  441. return buf_size;
  442. }
  443. #if CONFIG_ENCODERS
  444. #define PCM_ENCODER(id_, sample_fmt_, name_, long_name_) \
  445. AVCodec ff_ ## name_ ## _encoder = { \
  446. .name = #name_, \
  447. .type = AVMEDIA_TYPE_AUDIO, \
  448. .id = id_, \
  449. .init = pcm_encode_init, \
  450. .encode2 = pcm_encode_frame, \
  451. .close = pcm_encode_close, \
  452. .capabilities = CODEC_CAP_VARIABLE_FRAME_SIZE, \
  453. .sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \
  454. AV_SAMPLE_FMT_NONE }, \
  455. .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
  456. }
  457. #else
  458. #define PCM_ENCODER(id, sample_fmt_, name, long_name_)
  459. #endif
  460. #if CONFIG_DECODERS
  461. #define PCM_DECODER(id_, sample_fmt_, name_, long_name_) \
  462. AVCodec ff_ ## name_ ## _decoder = { \
  463. .name = #name_, \
  464. .type = AVMEDIA_TYPE_AUDIO, \
  465. .id = id_, \
  466. .priv_data_size = sizeof(PCMDecode), \
  467. .init = pcm_decode_init, \
  468. .decode = pcm_decode_frame, \
  469. .capabilities = CODEC_CAP_DR1, \
  470. .sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \
  471. AV_SAMPLE_FMT_NONE }, \
  472. .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
  473. }
  474. #else
  475. #define PCM_DECODER(id, sample_fmt_, name, long_name_)
  476. #endif
  477. #define PCM_CODEC(id, sample_fmt_, name, long_name_) \
  478. PCM_ENCODER(id, sample_fmt_, name, long_name_); \
  479. PCM_DECODER(id, sample_fmt_, name, long_name_)
  480. /* Note: Do not forget to add new entries to the Makefile as well. */
  481. PCM_CODEC (AV_CODEC_ID_PCM_ALAW, AV_SAMPLE_FMT_S16, pcm_alaw, "PCM A-law");
  482. PCM_DECODER(AV_CODEC_ID_PCM_DVD, AV_SAMPLE_FMT_S32, pcm_dvd, "PCM signed 20|24-bit big-endian");
  483. PCM_CODEC (AV_CODEC_ID_PCM_F32BE, AV_SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian");
  484. PCM_CODEC (AV_CODEC_ID_PCM_F32LE, AV_SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian");
  485. PCM_CODEC (AV_CODEC_ID_PCM_F64BE, AV_SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian");
  486. PCM_CODEC (AV_CODEC_ID_PCM_F64LE, AV_SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit floating point little-endian");
  487. PCM_DECODER(AV_CODEC_ID_PCM_LXF, AV_SAMPLE_FMT_S32P, pcm_lxf, "PCM signed 20-bit little-endian planar");
  488. PCM_CODEC (AV_CODEC_ID_PCM_MULAW, AV_SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law");
  489. PCM_CODEC (AV_CODEC_ID_PCM_S8, AV_SAMPLE_FMT_U8, pcm_s8, "PCM signed 8-bit");
  490. PCM_CODEC (AV_CODEC_ID_PCM_S16BE, AV_SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian");
  491. PCM_CODEC (AV_CODEC_ID_PCM_S16LE, AV_SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian");
  492. PCM_DECODER(AV_CODEC_ID_PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16, pcm_s16le_planar, "PCM 16-bit little-endian planar");
  493. PCM_CODEC (AV_CODEC_ID_PCM_S24BE, AV_SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian");
  494. PCM_CODEC (AV_CODEC_ID_PCM_S24DAUD, AV_SAMPLE_FMT_S16, pcm_s24daud, "PCM D-Cinema audio signed 24-bit");
  495. PCM_CODEC (AV_CODEC_ID_PCM_S24LE, AV_SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian");
  496. PCM_CODEC (AV_CODEC_ID_PCM_S32BE, AV_SAMPLE_FMT_S32, pcm_s32be, "PCM signed 32-bit big-endian");
  497. PCM_CODEC (AV_CODEC_ID_PCM_S32LE, AV_SAMPLE_FMT_S32, pcm_s32le, "PCM signed 32-bit little-endian");
  498. PCM_CODEC (AV_CODEC_ID_PCM_U8, AV_SAMPLE_FMT_U8, pcm_u8, "PCM unsigned 8-bit");
  499. PCM_CODEC (AV_CODEC_ID_PCM_U16BE, AV_SAMPLE_FMT_S16, pcm_u16be, "PCM unsigned 16-bit big-endian");
  500. PCM_CODEC (AV_CODEC_ID_PCM_U16LE, AV_SAMPLE_FMT_S16, pcm_u16le, "PCM unsigned 16-bit little-endian");
  501. PCM_CODEC (AV_CODEC_ID_PCM_U24BE, AV_SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-bit big-endian");
  502. PCM_CODEC (AV_CODEC_ID_PCM_U24LE, AV_SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned 24-bit little-endian");
  503. PCM_CODEC (AV_CODEC_ID_PCM_U32BE, AV_SAMPLE_FMT_S32, pcm_u32be, "PCM unsigned 32-bit big-endian");
  504. PCM_CODEC (AV_CODEC_ID_PCM_U32LE, AV_SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned 32-bit little-endian");
  505. PCM_DECODER(AV_CODEC_ID_PCM_ZORK, AV_SAMPLE_FMT_U8, pcm_zork, "PCM Zork");