2 * Copyright (c) 2001-2003 The ffmpeg Project
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 #include "bytestream.h"
26 #include "adpcm_data.h"
32 * First version by Francois Revol (revol@free.fr)
33 * Fringe ADPCM codecs (e.g., DK3, DK4, Westwood)
34 * by Mike Melanson (melanson@pcisys.net)
36 * See ADPCM decoder reference documents for codec information.
39 typedef struct TrellisPath {
44 typedef struct TrellisNode {
52 typedef struct ADPCMEncodeContext {
53 ADPCMChannelStatus status[6];
55 TrellisNode *node_buf;
56 TrellisNode **nodep_buf;
57 uint8_t *trellis_hash;
60 #define FREEZE_INTERVAL 128
62 static av_cold int adpcm_encode_close(AVCodecContext *avctx);
64 static av_cold int adpcm_encode_init(AVCodecContext *avctx)
66 ADPCMEncodeContext *s = avctx->priv_data;
69 int ret = AVERROR(ENOMEM);
71 if (avctx->channels > 2) {
72 av_log(avctx, AV_LOG_ERROR, "only stereo or mono is supported\n");
73 return AVERROR(EINVAL);
76 if (avctx->trellis && (unsigned)avctx->trellis > 16U) {
77 av_log(avctx, AV_LOG_ERROR, "invalid trellis size\n");
78 return AVERROR(EINVAL);
82 int frontier = 1 << avctx->trellis;
83 int max_paths = frontier * FREEZE_INTERVAL;
84 FF_ALLOC_OR_GOTO(avctx, s->paths,
85 max_paths * sizeof(*s->paths), error);
86 FF_ALLOC_OR_GOTO(avctx, s->node_buf,
87 2 * frontier * sizeof(*s->node_buf), error);
88 FF_ALLOC_OR_GOTO(avctx, s->nodep_buf,
89 2 * frontier * sizeof(*s->nodep_buf), error);
90 FF_ALLOC_OR_GOTO(avctx, s->trellis_hash,
91 65536 * sizeof(*s->trellis_hash), error);
94 avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
96 switch (avctx->codec->id) {
97 case AV_CODEC_ID_ADPCM_IMA_WAV:
98 /* each 16 bits sample gives one nibble
99 and we have 4 bytes per channel overhead */
100 avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 /
101 (4 * avctx->channels) + 1;
102 /* seems frame_size isn't taken into account...
103 have to buffer the samples :-( */
104 avctx->block_align = BLKSIZE;
105 avctx->bits_per_coded_sample = 4;
107 case AV_CODEC_ID_ADPCM_IMA_QT:
108 avctx->frame_size = 64;
109 avctx->block_align = 34 * avctx->channels;
111 case AV_CODEC_ID_ADPCM_MS:
112 /* each 16 bits sample gives one nibble
113 and we have 7 bytes per channel overhead */
114 avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2;
115 avctx->bits_per_coded_sample = 4;
116 avctx->block_align = BLKSIZE;
117 if (!(avctx->extradata = av_malloc(32 + FF_INPUT_BUFFER_PADDING_SIZE)))
119 avctx->extradata_size = 32;
120 extradata = avctx->extradata;
121 bytestream_put_le16(&extradata, avctx->frame_size);
122 bytestream_put_le16(&extradata, 7); /* wNumCoef */
123 for (i = 0; i < 7; i++) {
124 bytestream_put_le16(&extradata, ff_adpcm_AdaptCoeff1[i] * 4);
125 bytestream_put_le16(&extradata, ff_adpcm_AdaptCoeff2[i] * 4);
128 case AV_CODEC_ID_ADPCM_YAMAHA:
129 avctx->frame_size = BLKSIZE * 2 / avctx->channels;
130 avctx->block_align = BLKSIZE;
132 case AV_CODEC_ID_ADPCM_SWF:
133 if (avctx->sample_rate != 11025 &&
134 avctx->sample_rate != 22050 &&
135 avctx->sample_rate != 44100) {
136 av_log(avctx, AV_LOG_ERROR, "Sample rate must be 11025, "
138 ret = AVERROR(EINVAL);
141 avctx->frame_size = 512 * (avctx->sample_rate / 11025);
144 ret = AVERROR(EINVAL);
148 #if FF_API_OLD_ENCODE_AUDIO
149 if (!(avctx->coded_frame = avcodec_alloc_frame()))
155 adpcm_encode_close(avctx);
159 static av_cold int adpcm_encode_close(AVCodecContext *avctx)
161 ADPCMEncodeContext *s = avctx->priv_data;
162 #if FF_API_OLD_ENCODE_AUDIO
163 av_freep(&avctx->coded_frame);
166 av_freep(&s->node_buf);
167 av_freep(&s->nodep_buf);
168 av_freep(&s->trellis_hash);
174 static inline uint8_t adpcm_ima_compress_sample(ADPCMChannelStatus *c,
177 int delta = sample - c->prev_sample;
178 int nibble = FFMIN(7, abs(delta) * 4 /
179 ff_adpcm_step_table[c->step_index]) + (delta < 0) * 8;
180 c->prev_sample += ((ff_adpcm_step_table[c->step_index] *
181 ff_adpcm_yamaha_difflookup[nibble]) / 8);
182 c->prev_sample = av_clip_int16(c->prev_sample);
183 c->step_index = av_clip(c->step_index + ff_adpcm_index_table[nibble], 0, 88);
187 static inline uint8_t adpcm_ima_qt_compress_sample(ADPCMChannelStatus *c,
190 int delta = sample - c->prev_sample;
191 int diff, step = ff_adpcm_step_table[c->step_index];
192 int nibble = 8*(delta < 0);
195 diff = delta + (step >> 3);
214 c->prev_sample -= diff;
216 c->prev_sample += diff;
218 c->prev_sample = av_clip_int16(c->prev_sample);
219 c->step_index = av_clip(c->step_index + ff_adpcm_index_table[nibble], 0, 88);
224 static inline uint8_t adpcm_ms_compress_sample(ADPCMChannelStatus *c,
227 int predictor, nibble, bias;
229 predictor = (((c->sample1) * (c->coeff1)) +
230 (( c->sample2) * (c->coeff2))) / 64;
232 nibble = sample - predictor;
234 bias = c->idelta / 2;
236 bias = -c->idelta / 2;
238 nibble = (nibble + bias) / c->idelta;
239 nibble = av_clip(nibble, -8, 7) & 0x0F;
241 predictor += ((nibble & 0x08) ? (nibble - 0x10) : nibble) * c->idelta;
243 c->sample2 = c->sample1;
244 c->sample1 = av_clip_int16(predictor);
246 c->idelta = (ff_adpcm_AdaptationTable[nibble] * c->idelta) >> 8;
253 static inline uint8_t adpcm_yamaha_compress_sample(ADPCMChannelStatus *c,
263 delta = sample - c->predictor;
265 nibble = FFMIN(7, abs(delta) * 4 / c->step) + (delta < 0) * 8;
267 c->predictor += ((c->step * ff_adpcm_yamaha_difflookup[nibble]) / 8);
268 c->predictor = av_clip_int16(c->predictor);
269 c->step = (c->step * ff_adpcm_yamaha_indexscale[nibble]) >> 8;
270 c->step = av_clip(c->step, 127, 24567);
275 static void adpcm_compress_trellis(AVCodecContext *avctx,
276 const int16_t *samples, uint8_t *dst,
277 ADPCMChannelStatus *c, int n, int stride)
279 //FIXME 6% faster if frontier is a compile-time constant
280 ADPCMEncodeContext *s = avctx->priv_data;
281 const int frontier = 1 << avctx->trellis;
282 const int version = avctx->codec->id;
283 TrellisPath *paths = s->paths, *p;
284 TrellisNode *node_buf = s->node_buf;
285 TrellisNode **nodep_buf = s->nodep_buf;
286 TrellisNode **nodes = nodep_buf; // nodes[] is always sorted by .ssd
287 TrellisNode **nodes_next = nodep_buf + frontier;
288 int pathn = 0, froze = -1, i, j, k, generation = 0;
289 uint8_t *hash = s->trellis_hash;
290 memset(hash, 0xff, 65536 * sizeof(*hash));
292 memset(nodep_buf, 0, 2 * frontier * sizeof(*nodep_buf));
293 nodes[0] = node_buf + frontier;
296 nodes[0]->step = c->step_index;
297 nodes[0]->sample1 = c->sample1;
298 nodes[0]->sample2 = c->sample2;
299 if (version == AV_CODEC_ID_ADPCM_IMA_WAV ||
300 version == AV_CODEC_ID_ADPCM_IMA_QT ||
301 version == AV_CODEC_ID_ADPCM_SWF)
302 nodes[0]->sample1 = c->prev_sample;
303 if (version == AV_CODEC_ID_ADPCM_MS)
304 nodes[0]->step = c->idelta;
305 if (version == AV_CODEC_ID_ADPCM_YAMAHA) {
307 nodes[0]->step = 127;
308 nodes[0]->sample1 = 0;
310 nodes[0]->step = c->step;
311 nodes[0]->sample1 = c->predictor;
315 for (i = 0; i < n; i++) {
316 TrellisNode *t = node_buf + frontier*(i&1);
318 int sample = samples[i * stride];
320 memset(nodes_next, 0, frontier * sizeof(TrellisNode*));
321 for (j = 0; j < frontier && nodes[j]; j++) {
322 // higher j have higher ssd already, so they're likely
323 // to yield a suboptimal next sample too
324 const int range = (j < frontier / 2) ? 1 : 0;
325 const int step = nodes[j]->step;
327 if (version == AV_CODEC_ID_ADPCM_MS) {
328 const int predictor = ((nodes[j]->sample1 * c->coeff1) +
329 (nodes[j]->sample2 * c->coeff2)) / 64;
330 const int div = (sample - predictor) / step;
331 const int nmin = av_clip(div-range, -8, 6);
332 const int nmax = av_clip(div+range, -7, 7);
333 for (nidx = nmin; nidx <= nmax; nidx++) {
334 const int nibble = nidx & 0xf;
335 int dec_sample = predictor + nidx * step;
336 #define STORE_NODE(NAME, STEP_INDEX)\
342 dec_sample = av_clip_int16(dec_sample);\
343 d = sample - dec_sample;\
344 ssd = nodes[j]->ssd + d*d;\
345 /* Check for wraparound, skip such samples completely. \
346 * Note, changing ssd to a 64 bit variable would be \
347 * simpler, avoiding this check, but it's slower on \
348 * x86 32 bit at the moment. */\
349 if (ssd < nodes[j]->ssd)\
351 /* Collapse any two states with the same previous sample value. \
352 * One could also distinguish states by step and by 2nd to last
353 * sample, but the effects of that are negligible.
354 * Since nodes in the previous generation are iterated
355 * through a heap, they're roughly ordered from better to
356 * worse, but not strictly ordered. Therefore, an earlier
357 * node with the same sample value is better in most cases
358 * (and thus the current is skipped), but not strictly
359 * in all cases. Only skipping samples where ssd >=
360 * ssd of the earlier node with the same sample gives
361 * slightly worse quality, though, for some reason. */ \
362 h = &hash[(uint16_t) dec_sample];\
363 if (*h == generation)\
365 if (heap_pos < frontier) {\
368 /* Try to replace one of the leaf nodes with the new \
369 * one, but try a different slot each time. */\
370 pos = (frontier >> 1) +\
371 (heap_pos & ((frontier >> 1) - 1));\
372 if (ssd > nodes_next[pos]->ssd)\
377 u = nodes_next[pos];\
379 av_assert1(pathn < FREEZE_INTERVAL << avctx->trellis);\
381 nodes_next[pos] = u;\
385 u->step = STEP_INDEX;\
386 u->sample2 = nodes[j]->sample1;\
387 u->sample1 = dec_sample;\
388 paths[u->path].nibble = nibble;\
389 paths[u->path].prev = nodes[j]->path;\
390 /* Sift the newly inserted node up in the heap to \
391 * restore the heap property. */\
393 int parent = (pos - 1) >> 1;\
394 if (nodes_next[parent]->ssd <= ssd)\
396 FFSWAP(TrellisNode*, nodes_next[parent], nodes_next[pos]);\
400 STORE_NODE(ms, FFMAX(16,
401 (ff_adpcm_AdaptationTable[nibble] * step) >> 8));
403 } else if (version == AV_CODEC_ID_ADPCM_IMA_WAV ||
404 version == AV_CODEC_ID_ADPCM_IMA_QT ||
405 version == AV_CODEC_ID_ADPCM_SWF) {
406 #define LOOP_NODES(NAME, STEP_TABLE, STEP_INDEX)\
407 const int predictor = nodes[j]->sample1;\
408 const int div = (sample - predictor) * 4 / STEP_TABLE;\
409 int nmin = av_clip(div - range, -7, 6);\
410 int nmax = av_clip(div + range, -6, 7);\
412 nmin--; /* distinguish -0 from +0 */\
415 for (nidx = nmin; nidx <= nmax; nidx++) {\
416 const int nibble = nidx < 0 ? 7 - nidx : nidx;\
417 int dec_sample = predictor +\
419 ff_adpcm_yamaha_difflookup[nibble]) / 8;\
420 STORE_NODE(NAME, STEP_INDEX);\
422 LOOP_NODES(ima, ff_adpcm_step_table[step],
423 av_clip(step + ff_adpcm_index_table[nibble], 0, 88));
424 } else { //AV_CODEC_ID_ADPCM_YAMAHA
425 LOOP_NODES(yamaha, step,
426 av_clip((step * ff_adpcm_yamaha_indexscale[nibble]) >> 8,
438 if (generation == 255) {
439 memset(hash, 0xff, 65536 * sizeof(*hash));
444 if (nodes[0]->ssd > (1 << 28)) {
445 for (j = 1; j < frontier && nodes[j]; j++)
446 nodes[j]->ssd -= nodes[0]->ssd;
450 // merge old paths to save memory
451 if (i == froze + FREEZE_INTERVAL) {
452 p = &paths[nodes[0]->path];
453 for (k = i; k > froze; k--) {
459 // other nodes might use paths that don't coincide with the frozen one.
460 // checking which nodes do so is too slow, so just kill them all.
461 // this also slightly improves quality, but I don't know why.
462 memset(nodes + 1, 0, (frontier - 1) * sizeof(TrellisNode*));
466 p = &paths[nodes[0]->path];
467 for (i = n - 1; i > froze; i--) {
472 c->predictor = nodes[0]->sample1;
473 c->sample1 = nodes[0]->sample1;
474 c->sample2 = nodes[0]->sample2;
475 c->step_index = nodes[0]->step;
476 c->step = nodes[0]->step;
477 c->idelta = nodes[0]->step;
480 static int adpcm_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
481 const AVFrame *frame, int *got_packet_ptr)
483 int n, i, ch, st, pkt_size, ret;
484 const int16_t *samples;
487 ADPCMEncodeContext *c = avctx->priv_data;
490 samples = (const int16_t *)frame->data[0];
491 samples_p = (int16_t **)frame->extended_data;
492 st = avctx->channels == 2;
494 if (avctx->codec_id == AV_CODEC_ID_ADPCM_SWF)
495 pkt_size = (2 + avctx->channels * (22 + 4 * (frame->nb_samples - 1)) + 7) / 8;
497 pkt_size = avctx->block_align;
498 if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size)))
502 switch(avctx->codec->id) {
503 case AV_CODEC_ID_ADPCM_IMA_WAV:
507 blocks = (frame->nb_samples - 1) / 8;
509 for (ch = 0; ch < avctx->channels; ch++) {
510 ADPCMChannelStatus *status = &c->status[ch];
511 status->prev_sample = samples_p[ch][0];
512 /* status->step_index = 0;
513 XXX: not sure how to init the state machine */
514 bytestream_put_le16(&dst, status->prev_sample);
515 *dst++ = status->step_index;
516 *dst++ = 0; /* unknown */
519 /* stereo: 4 bytes (8 samples) for left, 4 bytes for right */
520 if (avctx->trellis > 0) {
521 FF_ALLOC_OR_GOTO(avctx, buf, avctx->channels * blocks * 8, error);
522 for (ch = 0; ch < avctx->channels; ch++) {
523 adpcm_compress_trellis(avctx, &samples_p[ch][1],
524 buf + ch * blocks * 8, &c->status[ch],
527 for (i = 0; i < blocks; i++) {
528 for (ch = 0; ch < avctx->channels; ch++) {
529 uint8_t *buf1 = buf + ch * blocks * 8 + i * 8;
530 for (j = 0; j < 8; j += 2)
531 *dst++ = buf1[j] | (buf1[j + 1] << 4);
536 for (i = 0; i < blocks; i++) {
537 for (ch = 0; ch < avctx->channels; ch++) {
538 ADPCMChannelStatus *status = &c->status[ch];
539 const int16_t *smp = &samples_p[ch][1 + i * 8];
540 for (j = 0; j < 8; j += 2) {
541 uint8_t v = adpcm_ima_compress_sample(status, smp[j ]);
542 v |= adpcm_ima_compress_sample(status, smp[j + 1]) << 4;
550 case AV_CODEC_ID_ADPCM_IMA_QT:
553 init_put_bits(&pb, dst, pkt_size * 8);
555 for (ch = 0; ch < avctx->channels; ch++) {
556 ADPCMChannelStatus *status = &c->status[ch];
557 put_bits(&pb, 9, (status->prev_sample & 0xFFFF) >> 7);
558 put_bits(&pb, 7, status->step_index);
559 if (avctx->trellis > 0) {
561 adpcm_compress_trellis(avctx, &samples_p[ch][1], buf, status,
563 for (i = 0; i < 64; i++)
564 put_bits(&pb, 4, buf[i ^ 1]);
566 for (i = 0; i < 64; i += 2) {
568 t1 = adpcm_ima_qt_compress_sample(status, samples_p[ch][i ]);
569 t2 = adpcm_ima_qt_compress_sample(status, samples_p[ch][i + 1]);
570 put_bits(&pb, 4, t2);
571 put_bits(&pb, 4, t1);
579 case AV_CODEC_ID_ADPCM_SWF:
582 init_put_bits(&pb, dst, pkt_size * 8);
584 n = frame->nb_samples - 1;
586 // store AdpcmCodeSize
587 put_bits(&pb, 2, 2); // set 4-bit flash adpcm format
589 // init the encoder state
590 for (i = 0; i < avctx->channels; i++) {
591 // clip step so it fits 6 bits
592 c->status[i].step_index = av_clip(c->status[i].step_index, 0, 63);
593 put_sbits(&pb, 16, samples[i]);
594 put_bits(&pb, 6, c->status[i].step_index);
595 c->status[i].prev_sample = samples[i];
598 if (avctx->trellis > 0) {
599 FF_ALLOC_OR_GOTO(avctx, buf, 2 * n, error);
600 adpcm_compress_trellis(avctx, samples + avctx->channels, buf,
601 &c->status[0], n, avctx->channels);
602 if (avctx->channels == 2)
603 adpcm_compress_trellis(avctx, samples + avctx->channels + 1,
604 buf + n, &c->status[1], n,
606 for (i = 0; i < n; i++) {
607 put_bits(&pb, 4, buf[i]);
608 if (avctx->channels == 2)
609 put_bits(&pb, 4, buf[n + i]);
613 for (i = 1; i < frame->nb_samples; i++) {
614 put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[0],
615 samples[avctx->channels * i]));
616 if (avctx->channels == 2)
617 put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[1],
618 samples[2 * i + 1]));
624 case AV_CODEC_ID_ADPCM_MS:
625 for (i = 0; i < avctx->channels; i++) {
628 c->status[i].coeff1 = ff_adpcm_AdaptCoeff1[predictor];
629 c->status[i].coeff2 = ff_adpcm_AdaptCoeff2[predictor];
631 for (i = 0; i < avctx->channels; i++) {
632 if (c->status[i].idelta < 16)
633 c->status[i].idelta = 16;
634 bytestream_put_le16(&dst, c->status[i].idelta);
636 for (i = 0; i < avctx->channels; i++)
637 c->status[i].sample2= *samples++;
638 for (i = 0; i < avctx->channels; i++) {
639 c->status[i].sample1 = *samples++;
640 bytestream_put_le16(&dst, c->status[i].sample1);
642 for (i = 0; i < avctx->channels; i++)
643 bytestream_put_le16(&dst, c->status[i].sample2);
645 if (avctx->trellis > 0) {
646 n = avctx->block_align - 7 * avctx->channels;
647 FF_ALLOC_OR_GOTO(avctx, buf, 2 * n, error);
648 if (avctx->channels == 1) {
649 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n,
651 for (i = 0; i < n; i += 2)
652 *dst++ = (buf[i] << 4) | buf[i + 1];
654 adpcm_compress_trellis(avctx, samples, buf,
655 &c->status[0], n, avctx->channels);
656 adpcm_compress_trellis(avctx, samples + 1, buf + n,
657 &c->status[1], n, avctx->channels);
658 for (i = 0; i < n; i++)
659 *dst++ = (buf[i] << 4) | buf[n + i];
663 for (i = 7 * avctx->channels; i < avctx->block_align; i++) {
665 nibble = adpcm_ms_compress_sample(&c->status[ 0], *samples++) << 4;
666 nibble |= adpcm_ms_compress_sample(&c->status[st], *samples++);
671 case AV_CODEC_ID_ADPCM_YAMAHA:
672 n = frame->nb_samples / 2;
673 if (avctx->trellis > 0) {
674 FF_ALLOC_OR_GOTO(avctx, buf, 2 * n * 2, error);
676 if (avctx->channels == 1) {
677 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n,
679 for (i = 0; i < n; i += 2)
680 *dst++ = buf[i] | (buf[i + 1] << 4);
682 adpcm_compress_trellis(avctx, samples, buf,
683 &c->status[0], n, avctx->channels);
684 adpcm_compress_trellis(avctx, samples + 1, buf + n,
685 &c->status[1], n, avctx->channels);
686 for (i = 0; i < n; i++)
687 *dst++ = buf[i] | (buf[n + i] << 4);
691 for (n *= avctx->channels; n > 0; n--) {
693 nibble = adpcm_yamaha_compress_sample(&c->status[ 0], *samples++);
694 nibble |= adpcm_yamaha_compress_sample(&c->status[st], *samples++) << 4;
699 return AVERROR(EINVAL);
702 avpkt->size = pkt_size;
706 return AVERROR(ENOMEM);
709 static const enum AVSampleFormat sample_fmts[] = {
710 AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE
713 static const enum AVSampleFormat sample_fmts_p[] = {
714 AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_NONE
717 #define ADPCM_ENCODER(id_, name_, sample_fmts_, long_name_) \
718 AVCodec ff_ ## name_ ## _encoder = { \
720 .type = AVMEDIA_TYPE_AUDIO, \
722 .priv_data_size = sizeof(ADPCMEncodeContext), \
723 .init = adpcm_encode_init, \
724 .encode2 = adpcm_encode_frame, \
725 .close = adpcm_encode_close, \
726 .sample_fmts = sample_fmts_, \
727 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
730 ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt, sample_fmts_p, "ADPCM IMA QuickTime");
731 ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav, sample_fmts_p, "ADPCM IMA WAV");
732 ADPCM_ENCODER(AV_CODEC_ID_ADPCM_MS, adpcm_ms, sample_fmts, "ADPCM Microsoft");
733 ADPCM_ENCODER(AV_CODEC_ID_ADPCM_SWF, adpcm_swf, sample_fmts, "ADPCM Shockwave Flash");
734 ADPCM_ENCODER(AV_CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha, sample_fmts, "ADPCM Yamaha");