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.

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