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.

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