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.

581 lines
22KB

  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
  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. static av_cold int pcm_encode_init(AVCodecContext *avctx)
  32. {
  33. avctx->frame_size = 0;
  34. switch (avctx->codec->id) {
  35. case AV_CODEC_ID_PCM_ALAW:
  36. pcm_alaw_tableinit();
  37. break;
  38. case AV_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 * 8LL * avctx->sample_rate;
  47. return 0;
  48. }
  49. /**
  50. * Write PCM samples macro
  51. * @param type Datatype of native machine format
  52. * @param endian bytestream_put_xxx() suffix
  53. * @param src Source pointer (variable name)
  54. * @param dst Destination pointer (variable name)
  55. * @param n Total number of samples (variable name)
  56. * @param shift Bitshift (bits)
  57. * @param offset Sample value offset
  58. */
  59. #define ENCODE(type, endian, src, dst, n, shift, offset) \
  60. samples_ ## type = (const type *) src; \
  61. for (; n > 0; n--) { \
  62. register type v = (*samples_ ## type++ >> shift) + offset; \
  63. bytestream_put_ ## endian(&dst, v); \
  64. }
  65. #define ENCODE_PLANAR(type, endian, dst, n, shift, offset) \
  66. n /= avctx->channels; \
  67. for (c = 0; c < avctx->channels; c++) { \
  68. int i; \
  69. samples_ ## type = (const type *) frame->extended_data[c]; \
  70. for (i = n; i > 0; i--) { \
  71. register type v = (*samples_ ## type++ >> shift) + offset; \
  72. bytestream_put_ ## endian(&dst, v); \
  73. } \
  74. }
  75. static int pcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
  76. const AVFrame *frame, int *got_packet_ptr)
  77. {
  78. int n, c, sample_size, v, ret;
  79. const short *samples;
  80. unsigned char *dst;
  81. const uint8_t *samples_uint8_t;
  82. const int16_t *samples_int16_t;
  83. const int32_t *samples_int32_t;
  84. const int64_t *samples_int64_t;
  85. const uint16_t *samples_uint16_t;
  86. const uint32_t *samples_uint32_t;
  87. sample_size = av_get_bits_per_sample(avctx->codec->id) / 8;
  88. n = frame->nb_samples * avctx->channels;
  89. samples = (const short *)frame->data[0];
  90. if ((ret = ff_alloc_packet2(avctx, avpkt, n * sample_size, n * sample_size)) < 0)
  91. return ret;
  92. dst = avpkt->data;
  93. switch (avctx->codec->id) {
  94. case AV_CODEC_ID_PCM_U32LE:
  95. ENCODE(uint32_t, le32, samples, dst, n, 0, 0x80000000)
  96. break;
  97. case AV_CODEC_ID_PCM_U32BE:
  98. ENCODE(uint32_t, be32, samples, dst, n, 0, 0x80000000)
  99. break;
  100. case AV_CODEC_ID_PCM_S24LE:
  101. ENCODE(int32_t, le24, samples, dst, n, 8, 0)
  102. break;
  103. case AV_CODEC_ID_PCM_S24LE_PLANAR:
  104. ENCODE_PLANAR(int32_t, le24, dst, n, 8, 0)
  105. break;
  106. case AV_CODEC_ID_PCM_S24BE:
  107. ENCODE(int32_t, be24, samples, dst, n, 8, 0)
  108. break;
  109. case AV_CODEC_ID_PCM_U24LE:
  110. ENCODE(uint32_t, le24, samples, dst, n, 8, 0x800000)
  111. break;
  112. case AV_CODEC_ID_PCM_U24BE:
  113. ENCODE(uint32_t, be24, samples, dst, n, 8, 0x800000)
  114. break;
  115. case AV_CODEC_ID_PCM_S24DAUD:
  116. for (; n > 0; n--) {
  117. uint32_t tmp = ff_reverse[(*samples >> 8) & 0xff] +
  118. (ff_reverse[*samples & 0xff] << 8);
  119. tmp <<= 4; // sync flags would go here
  120. bytestream_put_be24(&dst, tmp);
  121. samples++;
  122. }
  123. break;
  124. case AV_CODEC_ID_PCM_U16LE:
  125. ENCODE(uint16_t, le16, samples, dst, n, 0, 0x8000)
  126. break;
  127. case AV_CODEC_ID_PCM_U16BE:
  128. ENCODE(uint16_t, be16, samples, dst, n, 0, 0x8000)
  129. break;
  130. case AV_CODEC_ID_PCM_S8:
  131. ENCODE(uint8_t, byte, samples, dst, n, 0, -128)
  132. break;
  133. case AV_CODEC_ID_PCM_S8_PLANAR:
  134. ENCODE_PLANAR(uint8_t, byte, dst, n, 0, -128)
  135. break;
  136. #if HAVE_BIGENDIAN
  137. case AV_CODEC_ID_PCM_S64LE:
  138. case AV_CODEC_ID_PCM_F64LE:
  139. ENCODE(int64_t, le64, samples, dst, n, 0, 0)
  140. break;
  141. case AV_CODEC_ID_PCM_S32LE:
  142. case AV_CODEC_ID_PCM_F32LE:
  143. ENCODE(int32_t, le32, samples, dst, n, 0, 0)
  144. break;
  145. case AV_CODEC_ID_PCM_S32LE_PLANAR:
  146. ENCODE_PLANAR(int32_t, le32, dst, n, 0, 0)
  147. break;
  148. case AV_CODEC_ID_PCM_S16LE:
  149. ENCODE(int16_t, le16, samples, dst, n, 0, 0)
  150. break;
  151. case AV_CODEC_ID_PCM_S16LE_PLANAR:
  152. ENCODE_PLANAR(int16_t, le16, dst, n, 0, 0)
  153. break;
  154. case AV_CODEC_ID_PCM_F64BE:
  155. case AV_CODEC_ID_PCM_F32BE:
  156. case AV_CODEC_ID_PCM_S64BE:
  157. case AV_CODEC_ID_PCM_S32BE:
  158. case AV_CODEC_ID_PCM_S16BE:
  159. #else
  160. case AV_CODEC_ID_PCM_S64BE:
  161. case AV_CODEC_ID_PCM_F64BE:
  162. ENCODE(int64_t, be64, samples, dst, n, 0, 0)
  163. break;
  164. case AV_CODEC_ID_PCM_F32BE:
  165. case AV_CODEC_ID_PCM_S32BE:
  166. ENCODE(int32_t, be32, samples, dst, n, 0, 0)
  167. break;
  168. case AV_CODEC_ID_PCM_S16BE:
  169. ENCODE(int16_t, be16, samples, dst, n, 0, 0)
  170. break;
  171. case AV_CODEC_ID_PCM_S16BE_PLANAR:
  172. ENCODE_PLANAR(int16_t, be16, dst, n, 0, 0)
  173. break;
  174. case AV_CODEC_ID_PCM_F64LE:
  175. case AV_CODEC_ID_PCM_F32LE:
  176. case AV_CODEC_ID_PCM_S64LE:
  177. case AV_CODEC_ID_PCM_S32LE:
  178. case AV_CODEC_ID_PCM_S16LE:
  179. #endif /* HAVE_BIGENDIAN */
  180. case AV_CODEC_ID_PCM_U8:
  181. memcpy(dst, samples, n * sample_size);
  182. break;
  183. #if HAVE_BIGENDIAN
  184. case AV_CODEC_ID_PCM_S16BE_PLANAR:
  185. #else
  186. case AV_CODEC_ID_PCM_S16LE_PLANAR:
  187. case AV_CODEC_ID_PCM_S32LE_PLANAR:
  188. #endif /* HAVE_BIGENDIAN */
  189. n /= avctx->channels;
  190. for (c = 0; c < avctx->channels; c++) {
  191. const uint8_t *src = frame->extended_data[c];
  192. bytestream_put_buffer(&dst, src, n * sample_size);
  193. }
  194. break;
  195. case AV_CODEC_ID_PCM_ALAW:
  196. for (; n > 0; n--) {
  197. v = *samples++;
  198. *dst++ = linear_to_alaw[(v + 32768) >> 2];
  199. }
  200. break;
  201. case AV_CODEC_ID_PCM_MULAW:
  202. for (; n > 0; n--) {
  203. v = *samples++;
  204. *dst++ = linear_to_ulaw[(v + 32768) >> 2];
  205. }
  206. break;
  207. default:
  208. return -1;
  209. }
  210. *got_packet_ptr = 1;
  211. return 0;
  212. }
  213. typedef struct PCMDecode {
  214. short table[256];
  215. } PCMDecode;
  216. static av_cold int pcm_decode_init(AVCodecContext *avctx)
  217. {
  218. PCMDecode *s = avctx->priv_data;
  219. int i;
  220. if (avctx->channels <= 0) {
  221. av_log(avctx, AV_LOG_ERROR, "PCM channels out of bounds\n");
  222. return AVERROR(EINVAL);
  223. }
  224. switch (avctx->codec_id) {
  225. case AV_CODEC_ID_PCM_ALAW:
  226. for (i = 0; i < 256; i++)
  227. s->table[i] = alaw2linear(i);
  228. break;
  229. case AV_CODEC_ID_PCM_MULAW:
  230. for (i = 0; i < 256; i++)
  231. s->table[i] = ulaw2linear(i);
  232. break;
  233. default:
  234. break;
  235. }
  236. avctx->sample_fmt = avctx->codec->sample_fmts[0];
  237. if (avctx->sample_fmt == AV_SAMPLE_FMT_S32)
  238. avctx->bits_per_raw_sample = av_get_bits_per_sample(avctx->codec_id);
  239. return 0;
  240. }
  241. /**
  242. * Read PCM samples macro
  243. * @param size Data size of native machine format
  244. * @param endian bytestream_get_xxx() endian suffix
  245. * @param src Source pointer (variable name)
  246. * @param dst Destination pointer (variable name)
  247. * @param n Total number of samples (variable name)
  248. * @param shift Bitshift (bits)
  249. * @param offset Sample value offset
  250. */
  251. #define DECODE(size, endian, src, dst, n, shift, offset) \
  252. for (; n > 0; n--) { \
  253. uint ## size ## _t v = bytestream_get_ ## endian(&src); \
  254. AV_WN ## size ## A(dst, (v - offset) << shift); \
  255. dst += size / 8; \
  256. }
  257. #define DECODE_PLANAR(size, endian, src, dst, n, shift, offset) \
  258. n /= avctx->channels; \
  259. for (c = 0; c < avctx->channels; c++) { \
  260. int i; \
  261. dst = frame->extended_data[c]; \
  262. for (i = n; i > 0; i--) { \
  263. uint ## size ## _t v = bytestream_get_ ## endian(&src); \
  264. AV_WN ## size ## A(dst, (v - offset) << shift); \
  265. dst += size / 8; \
  266. } \
  267. }
  268. static int pcm_decode_frame(AVCodecContext *avctx, void *data,
  269. int *got_frame_ptr, AVPacket *avpkt)
  270. {
  271. const uint8_t *src = avpkt->data;
  272. int buf_size = avpkt->size;
  273. PCMDecode *s = avctx->priv_data;
  274. AVFrame *frame = data;
  275. int sample_size, c, n, ret, samples_per_block;
  276. uint8_t *samples;
  277. int32_t *dst_int32_t;
  278. sample_size = av_get_bits_per_sample(avctx->codec_id) / 8;
  279. /* av_get_bits_per_sample returns 0 for AV_CODEC_ID_PCM_DVD */
  280. samples_per_block = 1;
  281. if (avctx->codec_id == AV_CODEC_ID_PCM_LXF) {
  282. /* we process 40-bit blocks per channel for LXF */
  283. samples_per_block = 2;
  284. sample_size = 5;
  285. }
  286. if (sample_size == 0) {
  287. av_log(avctx, AV_LOG_ERROR, "Invalid sample_size\n");
  288. return AVERROR(EINVAL);
  289. }
  290. if (avctx->channels == 0) {
  291. av_log(avctx, AV_LOG_ERROR, "Invalid number of channels\n");
  292. return AVERROR(EINVAL);
  293. }
  294. if (avctx->codec_id != avctx->codec->id) {
  295. av_log(avctx, AV_LOG_ERROR, "codec ids mismatch\n");
  296. return AVERROR(EINVAL);
  297. }
  298. n = avctx->channels * sample_size;
  299. if (n && buf_size % n) {
  300. if (buf_size < n) {
  301. av_log(avctx, AV_LOG_ERROR,
  302. "Invalid PCM packet, data has size %d but at least a size of %d was expected\n",
  303. buf_size, n);
  304. return AVERROR_INVALIDDATA;
  305. } else
  306. buf_size -= buf_size % n;
  307. }
  308. n = buf_size / sample_size;
  309. /* get output buffer */
  310. frame->nb_samples = n * samples_per_block / avctx->channels;
  311. if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
  312. return ret;
  313. samples = frame->data[0];
  314. switch (avctx->codec_id) {
  315. case AV_CODEC_ID_PCM_U32LE:
  316. DECODE(32, le32, src, samples, n, 0, 0x80000000)
  317. break;
  318. case AV_CODEC_ID_PCM_U32BE:
  319. DECODE(32, be32, src, samples, n, 0, 0x80000000)
  320. break;
  321. case AV_CODEC_ID_PCM_S24LE:
  322. DECODE(32, le24, src, samples, n, 8, 0)
  323. break;
  324. case AV_CODEC_ID_PCM_S24LE_PLANAR:
  325. DECODE_PLANAR(32, le24, src, samples, n, 8, 0);
  326. break;
  327. case AV_CODEC_ID_PCM_S24BE:
  328. DECODE(32, be24, src, samples, n, 8, 0)
  329. break;
  330. case AV_CODEC_ID_PCM_U24LE:
  331. DECODE(32, le24, src, samples, n, 8, 0x800000)
  332. break;
  333. case AV_CODEC_ID_PCM_U24BE:
  334. DECODE(32, be24, src, samples, n, 8, 0x800000)
  335. break;
  336. case AV_CODEC_ID_PCM_S24DAUD:
  337. for (; n > 0; n--) {
  338. uint32_t v = bytestream_get_be24(&src);
  339. v >>= 4; // sync flags are here
  340. AV_WN16A(samples, ff_reverse[(v >> 8) & 0xff] +
  341. (ff_reverse[v & 0xff] << 8));
  342. samples += 2;
  343. }
  344. break;
  345. case AV_CODEC_ID_PCM_U16LE:
  346. DECODE(16, le16, src, samples, n, 0, 0x8000)
  347. break;
  348. case AV_CODEC_ID_PCM_U16BE:
  349. DECODE(16, be16, src, samples, n, 0, 0x8000)
  350. break;
  351. case AV_CODEC_ID_PCM_S8:
  352. for (; n > 0; n--)
  353. *samples++ = *src++ + 128;
  354. break;
  355. case AV_CODEC_ID_PCM_S8_PLANAR:
  356. n /= avctx->channels;
  357. for (c = 0; c < avctx->channels; c++) {
  358. int i;
  359. samples = frame->extended_data[c];
  360. for (i = n; i > 0; i--)
  361. *samples++ = *src++ + 128;
  362. }
  363. break;
  364. #if HAVE_BIGENDIAN
  365. case AV_CODEC_ID_PCM_S64LE:
  366. case AV_CODEC_ID_PCM_F64LE:
  367. DECODE(64, le64, src, samples, n, 0, 0)
  368. break;
  369. case AV_CODEC_ID_PCM_S32LE:
  370. case AV_CODEC_ID_PCM_F32LE:
  371. DECODE(32, le32, src, samples, n, 0, 0)
  372. break;
  373. case AV_CODEC_ID_PCM_S32LE_PLANAR:
  374. DECODE_PLANAR(32, le32, src, samples, n, 0, 0);
  375. break;
  376. case AV_CODEC_ID_PCM_S16LE:
  377. DECODE(16, le16, src, samples, n, 0, 0)
  378. break;
  379. case AV_CODEC_ID_PCM_S16LE_PLANAR:
  380. DECODE_PLANAR(16, le16, src, samples, n, 0, 0);
  381. break;
  382. case AV_CODEC_ID_PCM_F64BE:
  383. case AV_CODEC_ID_PCM_F32BE:
  384. case AV_CODEC_ID_PCM_S64BE:
  385. case AV_CODEC_ID_PCM_S32BE:
  386. case AV_CODEC_ID_PCM_S16BE:
  387. #else
  388. case AV_CODEC_ID_PCM_S64BE:
  389. case AV_CODEC_ID_PCM_F64BE:
  390. DECODE(64, be64, src, samples, n, 0, 0)
  391. break;
  392. case AV_CODEC_ID_PCM_F32BE:
  393. case AV_CODEC_ID_PCM_S32BE:
  394. DECODE(32, be32, src, samples, n, 0, 0)
  395. break;
  396. case AV_CODEC_ID_PCM_S16BE:
  397. DECODE(16, be16, src, samples, n, 0, 0)
  398. break;
  399. case AV_CODEC_ID_PCM_S16BE_PLANAR:
  400. DECODE_PLANAR(16, be16, src, samples, n, 0, 0);
  401. break;
  402. case AV_CODEC_ID_PCM_F64LE:
  403. case AV_CODEC_ID_PCM_F32LE:
  404. case AV_CODEC_ID_PCM_S64LE:
  405. case AV_CODEC_ID_PCM_S32LE:
  406. case AV_CODEC_ID_PCM_S16LE:
  407. #endif /* HAVE_BIGENDIAN */
  408. case AV_CODEC_ID_PCM_U8:
  409. memcpy(samples, src, n * sample_size);
  410. break;
  411. #if HAVE_BIGENDIAN
  412. case AV_CODEC_ID_PCM_S16BE_PLANAR:
  413. #else
  414. case AV_CODEC_ID_PCM_S16LE_PLANAR:
  415. case AV_CODEC_ID_PCM_S32LE_PLANAR:
  416. #endif /* HAVE_BIGENDIAN */
  417. n /= avctx->channels;
  418. for (c = 0; c < avctx->channels; c++) {
  419. samples = frame->extended_data[c];
  420. bytestream_get_buffer(&src, samples, n * sample_size);
  421. }
  422. break;
  423. case AV_CODEC_ID_PCM_ZORK:
  424. for (; n > 0; n--) {
  425. int v = *src++;
  426. if (v < 128)
  427. v = 128 - v;
  428. *samples++ = v;
  429. }
  430. break;
  431. case AV_CODEC_ID_PCM_ALAW:
  432. case AV_CODEC_ID_PCM_MULAW:
  433. for (; n > 0; n--) {
  434. AV_WN16A(samples, s->table[*src++]);
  435. samples += 2;
  436. }
  437. break;
  438. case AV_CODEC_ID_PCM_LXF:
  439. {
  440. int i;
  441. n /= avctx->channels;
  442. for (c = 0; c < avctx->channels; c++) {
  443. dst_int32_t = (int32_t *)frame->extended_data[c];
  444. for (i = 0; i < n; i++) {
  445. // extract low 20 bits and expand to 32 bits
  446. *dst_int32_t++ = (src[2] << 28) |
  447. (src[1] << 20) |
  448. (src[0] << 12) |
  449. ((src[2] & 0x0F) << 8) |
  450. src[1];
  451. // extract high 20 bits and expand to 32 bits
  452. *dst_int32_t++ = (src[4] << 24) |
  453. (src[3] << 16) |
  454. ((src[2] & 0xF0) << 8) |
  455. (src[4] << 4) |
  456. (src[3] >> 4);
  457. src += 5;
  458. }
  459. }
  460. break;
  461. }
  462. default:
  463. return -1;
  464. }
  465. *got_frame_ptr = 1;
  466. return buf_size;
  467. }
  468. #define PCM_ENCODER_0(id_, sample_fmt_, name_, long_name_)
  469. #define PCM_ENCODER_1(id_, sample_fmt_, name_, long_name_) \
  470. AVCodec ff_ ## name_ ## _encoder = { \
  471. .name = #name_, \
  472. .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
  473. .type = AVMEDIA_TYPE_AUDIO, \
  474. .id = AV_CODEC_ID_ ## id_, \
  475. .init = pcm_encode_init, \
  476. .encode2 = pcm_encode_frame, \
  477. .capabilities = AV_CODEC_CAP_VARIABLE_FRAME_SIZE, \
  478. .sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \
  479. AV_SAMPLE_FMT_NONE }, \
  480. }
  481. #define PCM_ENCODER_2(cf, id, sample_fmt, name, long_name) \
  482. PCM_ENCODER_ ## cf(id, sample_fmt, name, long_name)
  483. #define PCM_ENCODER_3(cf, id, sample_fmt, name, long_name) \
  484. PCM_ENCODER_2(cf, id, sample_fmt, name, long_name)
  485. #define PCM_ENCODER(id, sample_fmt, name, long_name) \
  486. PCM_ENCODER_3(CONFIG_ ## id ## _ENCODER, id, sample_fmt, name, long_name)
  487. #define PCM_DECODER_0(id, sample_fmt, name, long_name)
  488. #define PCM_DECODER_1(id_, sample_fmt_, name_, long_name_) \
  489. AVCodec ff_ ## name_ ## _decoder = { \
  490. .name = #name_, \
  491. .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
  492. .type = AVMEDIA_TYPE_AUDIO, \
  493. .id = AV_CODEC_ID_ ## id_, \
  494. .priv_data_size = sizeof(PCMDecode), \
  495. .init = pcm_decode_init, \
  496. .decode = pcm_decode_frame, \
  497. .capabilities = AV_CODEC_CAP_DR1, \
  498. .sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \
  499. AV_SAMPLE_FMT_NONE }, \
  500. }
  501. #define PCM_DECODER_2(cf, id, sample_fmt, name, long_name) \
  502. PCM_DECODER_ ## cf(id, sample_fmt, name, long_name)
  503. #define PCM_DECODER_3(cf, id, sample_fmt, name, long_name) \
  504. PCM_DECODER_2(cf, id, sample_fmt, name, long_name)
  505. #define PCM_DECODER(id, sample_fmt, name, long_name) \
  506. PCM_DECODER_3(CONFIG_ ## id ## _DECODER, id, sample_fmt, name, long_name)
  507. #define PCM_CODEC(id, sample_fmt_, name, long_name_) \
  508. PCM_ENCODER(id, sample_fmt_, name, long_name_); \
  509. PCM_DECODER(id, sample_fmt_, name, long_name_)
  510. /* Note: Do not forget to add new entries to the Makefile as well. */
  511. PCM_CODEC (PCM_ALAW, AV_SAMPLE_FMT_S16, pcm_alaw, "PCM A-law / G.711 A-law");
  512. PCM_CODEC (PCM_F32BE, AV_SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian");
  513. PCM_CODEC (PCM_F32LE, AV_SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian");
  514. PCM_CODEC (PCM_F64BE, AV_SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian");
  515. PCM_CODEC (PCM_F64LE, AV_SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit floating point little-endian");
  516. PCM_DECODER(PCM_LXF, AV_SAMPLE_FMT_S32P,pcm_lxf, "PCM signed 20-bit little-endian planar");
  517. PCM_CODEC (PCM_MULAW, AV_SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law / G.711 mu-law");
  518. PCM_CODEC (PCM_S8, AV_SAMPLE_FMT_U8, pcm_s8, "PCM signed 8-bit");
  519. PCM_CODEC (PCM_S8_PLANAR, AV_SAMPLE_FMT_U8P, pcm_s8_planar, "PCM signed 8-bit planar");
  520. PCM_CODEC (PCM_S16BE, AV_SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian");
  521. PCM_CODEC (PCM_S16BE_PLANAR, AV_SAMPLE_FMT_S16P,pcm_s16be_planar, "PCM signed 16-bit big-endian planar");
  522. PCM_CODEC (PCM_S16LE, AV_SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian");
  523. PCM_CODEC (PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16P,pcm_s16le_planar, "PCM signed 16-bit little-endian planar");
  524. PCM_CODEC (PCM_S24BE, AV_SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian");
  525. PCM_CODEC (PCM_S24DAUD, AV_SAMPLE_FMT_S16, pcm_s24daud, "PCM D-Cinema audio signed 24-bit");
  526. PCM_CODEC (PCM_S24LE, AV_SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian");
  527. PCM_CODEC (PCM_S24LE_PLANAR, AV_SAMPLE_FMT_S32P,pcm_s24le_planar, "PCM signed 24-bit little-endian planar");
  528. PCM_CODEC (PCM_S32BE, AV_SAMPLE_FMT_S32, pcm_s32be, "PCM signed 32-bit big-endian");
  529. PCM_CODEC (PCM_S32LE, AV_SAMPLE_FMT_S32, pcm_s32le, "PCM signed 32-bit little-endian");
  530. PCM_CODEC (PCM_S32LE_PLANAR, AV_SAMPLE_FMT_S32P,pcm_s32le_planar, "PCM signed 32-bit little-endian planar");
  531. PCM_CODEC (PCM_U8, AV_SAMPLE_FMT_U8, pcm_u8, "PCM unsigned 8-bit");
  532. PCM_CODEC (PCM_U16BE, AV_SAMPLE_FMT_S16, pcm_u16be, "PCM unsigned 16-bit big-endian");
  533. PCM_CODEC (PCM_U16LE, AV_SAMPLE_FMT_S16, pcm_u16le, "PCM unsigned 16-bit little-endian");
  534. PCM_CODEC (PCM_U24BE, AV_SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-bit big-endian");
  535. PCM_CODEC (PCM_U24LE, AV_SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned 24-bit little-endian");
  536. PCM_CODEC (PCM_U32BE, AV_SAMPLE_FMT_S32, pcm_u32be, "PCM unsigned 32-bit big-endian");
  537. PCM_CODEC (PCM_U32LE, AV_SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned 32-bit little-endian");
  538. PCM_DECODER(PCM_ZORK, AV_SAMPLE_FMT_U8, pcm_zork, "PCM Zork");
  539. PCM_CODEC (PCM_S64BE, AV_SAMPLE_FMT_S64, pcm_s64be, "PCM signed 64-bit big-endian");
  540. PCM_CODEC (PCM_S64LE, AV_SAMPLE_FMT_S64, pcm_s64le, "PCM signed 64-bit little-endian");