2 * Copyright (c) 2001-2003 The ffmpeg Project
4 * This file is part of Libav.
6 * Libav 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 * Libav 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 Libav; 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"
31 * First version by Francois Revol (revol@free.fr)
32 * Fringe ADPCM codecs (e.g., DK3, DK4, Westwood)
33 * by Mike Melanson (melanson@pcisys.net)
35 * See ADPCM decoder reference documents for codec information.
38 typedef struct TrellisPath {
43 typedef struct TrellisNode {
51 typedef struct ADPCMEncodeContext {
52 ADPCMChannelStatus status[6];
54 TrellisNode *node_buf;
55 TrellisNode **nodep_buf;
56 uint8_t *trellis_hash;
59 #define FREEZE_INTERVAL 128
61 static av_cold int adpcm_encode_init(AVCodecContext *avctx)
63 ADPCMEncodeContext *s = avctx->priv_data;
66 if (avctx->channels > 2)
67 return -1; /* only stereo or mono =) */
69 if(avctx->trellis && (unsigned)avctx->trellis > 16U){
70 av_log(avctx, AV_LOG_ERROR, "invalid trellis size\n");
75 int frontier = 1 << avctx->trellis;
76 int max_paths = frontier * FREEZE_INTERVAL;
77 FF_ALLOC_OR_GOTO(avctx, s->paths, max_paths * sizeof(*s->paths), error);
78 FF_ALLOC_OR_GOTO(avctx, s->node_buf, 2 * frontier * sizeof(*s->node_buf), error);
79 FF_ALLOC_OR_GOTO(avctx, s->nodep_buf, 2 * frontier * sizeof(*s->nodep_buf), error);
80 FF_ALLOC_OR_GOTO(avctx, s->trellis_hash, 65536 * sizeof(*s->trellis_hash), error);
83 avctx->bits_per_coded_sample = av_get_bits_per_sample(avctx->codec->id);
85 switch(avctx->codec->id) {
86 case CODEC_ID_ADPCM_IMA_WAV:
87 avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1; /* each 16 bits sample gives one nibble */
88 /* and we have 4 bytes per channel overhead */
89 avctx->block_align = BLKSIZE;
90 /* seems frame_size isn't taken into account... have to buffer the samples :-( */
92 case CODEC_ID_ADPCM_IMA_QT:
93 avctx->frame_size = 64;
94 avctx->block_align = 34 * avctx->channels;
96 case CODEC_ID_ADPCM_MS:
97 avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2; /* each 16 bits sample gives one nibble */
98 /* and we have 7 bytes per channel overhead */
99 avctx->block_align = BLKSIZE;
100 avctx->extradata_size = 32;
101 extradata = avctx->extradata = av_malloc(avctx->extradata_size);
103 return AVERROR(ENOMEM);
104 bytestream_put_le16(&extradata, avctx->frame_size);
105 bytestream_put_le16(&extradata, 7); /* wNumCoef */
106 for (i = 0; i < 7; i++) {
107 bytestream_put_le16(&extradata, ff_adpcm_AdaptCoeff1[i] * 4);
108 bytestream_put_le16(&extradata, ff_adpcm_AdaptCoeff2[i] * 4);
111 case CODEC_ID_ADPCM_YAMAHA:
112 avctx->frame_size = BLKSIZE * avctx->channels;
113 avctx->block_align = BLKSIZE;
115 case CODEC_ID_ADPCM_SWF:
116 if (avctx->sample_rate != 11025 &&
117 avctx->sample_rate != 22050 &&
118 avctx->sample_rate != 44100) {
119 av_log(avctx, AV_LOG_ERROR, "Sample rate must be 11025, 22050 or 44100\n");
122 avctx->frame_size = 512 * (avctx->sample_rate / 11025);
128 avctx->coded_frame= avcodec_alloc_frame();
129 avctx->coded_frame->key_frame= 1;
134 av_freep(&s->node_buf);
135 av_freep(&s->nodep_buf);
136 av_freep(&s->trellis_hash);
140 static av_cold int adpcm_encode_close(AVCodecContext *avctx)
142 ADPCMEncodeContext *s = avctx->priv_data;
143 av_freep(&avctx->coded_frame);
145 av_freep(&s->node_buf);
146 av_freep(&s->nodep_buf);
147 av_freep(&s->trellis_hash);
153 static inline unsigned char adpcm_ima_compress_sample(ADPCMChannelStatus *c, short sample)
155 int delta = sample - c->prev_sample;
156 int nibble = FFMIN(7, abs(delta)*4/ff_adpcm_step_table[c->step_index]) + (delta<0)*8;
157 c->prev_sample += ((ff_adpcm_step_table[c->step_index] * ff_adpcm_yamaha_difflookup[nibble]) / 8);
158 c->prev_sample = av_clip_int16(c->prev_sample);
159 c->step_index = av_clip(c->step_index + ff_adpcm_index_table[nibble], 0, 88);
163 static inline unsigned char adpcm_ima_qt_compress_sample(ADPCMChannelStatus *c, short sample)
165 int delta = sample - c->prev_sample;
166 int mask, step = ff_adpcm_step_table[c->step_index];
167 int diff = step >> 3;
175 for (mask = 4; mask;) {
186 c->prev_sample -= diff;
188 c->prev_sample += diff;
190 c->prev_sample = av_clip_int16(c->prev_sample);
191 c->step_index = av_clip(c->step_index + ff_adpcm_index_table[nibble], 0, 88);
196 static inline unsigned char adpcm_ms_compress_sample(ADPCMChannelStatus *c, short sample)
198 int predictor, nibble, bias;
200 predictor = (((c->sample1) * (c->coeff1)) + ((c->sample2) * (c->coeff2))) / 64;
202 nibble= sample - predictor;
203 if(nibble>=0) bias= c->idelta/2;
204 else bias=-c->idelta/2;
206 nibble= (nibble + bias) / c->idelta;
207 nibble= av_clip(nibble, -8, 7)&0x0F;
209 predictor += (signed)((nibble & 0x08)?(nibble - 0x10):(nibble)) * c->idelta;
211 c->sample2 = c->sample1;
212 c->sample1 = av_clip_int16(predictor);
214 c->idelta = (ff_adpcm_AdaptationTable[(int)nibble] * c->idelta) >> 8;
215 if (c->idelta < 16) c->idelta = 16;
220 static inline unsigned char adpcm_yamaha_compress_sample(ADPCMChannelStatus *c, short sample)
229 delta = sample - c->predictor;
231 nibble = FFMIN(7, abs(delta)*4/c->step) + (delta<0)*8;
233 c->predictor += ((c->step * ff_adpcm_yamaha_difflookup[nibble]) / 8);
234 c->predictor = av_clip_int16(c->predictor);
235 c->step = (c->step * ff_adpcm_yamaha_indexscale[nibble]) >> 8;
236 c->step = av_clip(c->step, 127, 24567);
241 static void adpcm_compress_trellis(AVCodecContext *avctx, const short *samples,
242 uint8_t *dst, ADPCMChannelStatus *c, int n)
244 //FIXME 6% faster if frontier is a compile-time constant
245 ADPCMEncodeContext *s = avctx->priv_data;
246 const int frontier = 1 << avctx->trellis;
247 const int stride = avctx->channels;
248 const int version = avctx->codec->id;
249 TrellisPath *paths = s->paths, *p;
250 TrellisNode *node_buf = s->node_buf;
251 TrellisNode **nodep_buf = s->nodep_buf;
252 TrellisNode **nodes = nodep_buf; // nodes[] is always sorted by .ssd
253 TrellisNode **nodes_next = nodep_buf + frontier;
254 int pathn = 0, froze = -1, i, j, k, generation = 0;
255 uint8_t *hash = s->trellis_hash;
256 memset(hash, 0xff, 65536 * sizeof(*hash));
258 memset(nodep_buf, 0, 2 * frontier * sizeof(*nodep_buf));
259 nodes[0] = node_buf + frontier;
262 nodes[0]->step = c->step_index;
263 nodes[0]->sample1 = c->sample1;
264 nodes[0]->sample2 = c->sample2;
265 if((version == CODEC_ID_ADPCM_IMA_WAV) || (version == CODEC_ID_ADPCM_IMA_QT) || (version == CODEC_ID_ADPCM_SWF))
266 nodes[0]->sample1 = c->prev_sample;
267 if(version == CODEC_ID_ADPCM_MS)
268 nodes[0]->step = c->idelta;
269 if(version == CODEC_ID_ADPCM_YAMAHA) {
271 nodes[0]->step = 127;
272 nodes[0]->sample1 = 0;
274 nodes[0]->step = c->step;
275 nodes[0]->sample1 = c->predictor;
280 TrellisNode *t = node_buf + frontier*(i&1);
282 int sample = samples[i*stride];
284 memset(nodes_next, 0, frontier*sizeof(TrellisNode*));
285 for(j=0; j<frontier && nodes[j]; j++) {
286 // higher j have higher ssd already, so they're likely to yield a suboptimal next sample too
287 const int range = (j < frontier/2) ? 1 : 0;
288 const int step = nodes[j]->step;
290 if(version == CODEC_ID_ADPCM_MS) {
291 const int predictor = ((nodes[j]->sample1 * c->coeff1) + (nodes[j]->sample2 * c->coeff2)) / 64;
292 const int div = (sample - predictor) / step;
293 const int nmin = av_clip(div-range, -8, 6);
294 const int nmax = av_clip(div+range, -7, 7);
295 for(nidx=nmin; nidx<=nmax; nidx++) {
296 const int nibble = nidx & 0xf;
297 int dec_sample = predictor + nidx * step;
298 #define STORE_NODE(NAME, STEP_INDEX)\
304 dec_sample = av_clip_int16(dec_sample);\
305 d = sample - dec_sample;\
306 ssd = nodes[j]->ssd + d*d;\
307 /* Check for wraparound, skip such samples completely. \
308 * Note, changing ssd to a 64 bit variable would be \
309 * simpler, avoiding this check, but it's slower on \
310 * x86 32 bit at the moment. */\
311 if (ssd < nodes[j]->ssd)\
313 /* Collapse any two states with the same previous sample value. \
314 * One could also distinguish states by step and by 2nd to last
315 * sample, but the effects of that are negligible.
316 * Since nodes in the previous generation are iterated
317 * through a heap, they're roughly ordered from better to
318 * worse, but not strictly ordered. Therefore, an earlier
319 * node with the same sample value is better in most cases
320 * (and thus the current is skipped), but not strictly
321 * in all cases. Only skipping samples where ssd >=
322 * ssd of the earlier node with the same sample gives
323 * slightly worse quality, though, for some reason. */ \
324 h = &hash[(uint16_t) dec_sample];\
325 if (*h == generation)\
327 if (heap_pos < frontier) {\
330 /* Try to replace one of the leaf nodes with the new \
331 * one, but try a different slot each time. */\
332 pos = (frontier >> 1) + (heap_pos & ((frontier >> 1) - 1));\
333 if (ssd > nodes_next[pos]->ssd)\
338 u = nodes_next[pos];\
340 assert(pathn < FREEZE_INTERVAL<<avctx->trellis);\
342 nodes_next[pos] = u;\
346 u->step = STEP_INDEX;\
347 u->sample2 = nodes[j]->sample1;\
348 u->sample1 = dec_sample;\
349 paths[u->path].nibble = nibble;\
350 paths[u->path].prev = nodes[j]->path;\
351 /* Sift the newly inserted node up in the heap to \
352 * restore the heap property. */\
354 int parent = (pos - 1) >> 1;\
355 if (nodes_next[parent]->ssd <= ssd)\
357 FFSWAP(TrellisNode*, nodes_next[parent], nodes_next[pos]);\
361 STORE_NODE(ms, FFMAX(16, (ff_adpcm_AdaptationTable[nibble] * step) >> 8));
363 } else if((version == CODEC_ID_ADPCM_IMA_WAV)|| (version == CODEC_ID_ADPCM_IMA_QT)|| (version == CODEC_ID_ADPCM_SWF)) {
364 #define LOOP_NODES(NAME, STEP_TABLE, STEP_INDEX)\
365 const int predictor = nodes[j]->sample1;\
366 const int div = (sample - predictor) * 4 / STEP_TABLE;\
367 int nmin = av_clip(div-range, -7, 6);\
368 int nmax = av_clip(div+range, -6, 7);\
369 if(nmin<=0) nmin--; /* distinguish -0 from +0 */\
371 for(nidx=nmin; nidx<=nmax; nidx++) {\
372 const int nibble = nidx<0 ? 7-nidx : nidx;\
373 int dec_sample = predictor + (STEP_TABLE * ff_adpcm_yamaha_difflookup[nibble]) / 8;\
374 STORE_NODE(NAME, STEP_INDEX);\
376 LOOP_NODES(ima, ff_adpcm_step_table[step], av_clip(step + ff_adpcm_index_table[nibble], 0, 88));
377 } else { //CODEC_ID_ADPCM_YAMAHA
378 LOOP_NODES(yamaha, step, av_clip((step * ff_adpcm_yamaha_indexscale[nibble]) >> 8, 127, 24567));
389 if (generation == 255) {
390 memset(hash, 0xff, 65536 * sizeof(*hash));
395 if(nodes[0]->ssd > (1<<28)) {
396 for(j=1; j<frontier && nodes[j]; j++)
397 nodes[j]->ssd -= nodes[0]->ssd;
401 // merge old paths to save memory
402 if(i == froze + FREEZE_INTERVAL) {
403 p = &paths[nodes[0]->path];
404 for(k=i; k>froze; k--) {
410 // other nodes might use paths that don't coincide with the frozen one.
411 // checking which nodes do so is too slow, so just kill them all.
412 // this also slightly improves quality, but I don't know why.
413 memset(nodes+1, 0, (frontier-1)*sizeof(TrellisNode*));
417 p = &paths[nodes[0]->path];
418 for(i=n-1; i>froze; i--) {
423 c->predictor = nodes[0]->sample1;
424 c->sample1 = nodes[0]->sample1;
425 c->sample2 = nodes[0]->sample2;
426 c->step_index = nodes[0]->step;
427 c->step = nodes[0]->step;
428 c->idelta = nodes[0]->step;
431 static int adpcm_encode_frame(AVCodecContext *avctx,
432 unsigned char *frame, int buf_size, void *data)
437 ADPCMEncodeContext *c = avctx->priv_data;
441 samples = (short *)data;
442 st= avctx->channels == 2;
443 /* n = (BLKSIZE - 4 * avctx->channels) / (2 * 8 * avctx->channels); */
445 switch(avctx->codec->id) {
446 case CODEC_ID_ADPCM_IMA_WAV:
447 n = avctx->frame_size / 8;
448 c->status[0].prev_sample = (signed short)samples[0]; /* XXX */
449 /* c->status[0].step_index = 0; *//* XXX: not sure how to init the state machine */
450 bytestream_put_le16(&dst, c->status[0].prev_sample);
451 *dst++ = (unsigned char)c->status[0].step_index;
452 *dst++ = 0; /* unknown */
454 if (avctx->channels == 2) {
455 c->status[1].prev_sample = (signed short)samples[0];
456 /* c->status[1].step_index = 0; */
457 bytestream_put_le16(&dst, c->status[1].prev_sample);
458 *dst++ = (unsigned char)c->status[1].step_index;
463 /* stereo: 4 bytes (8 samples) for left, 4 bytes for right, 4 bytes left, ... */
464 if(avctx->trellis > 0) {
465 FF_ALLOC_OR_GOTO(avctx, buf, 2*n*8, error);
466 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n*8);
467 if(avctx->channels == 2)
468 adpcm_compress_trellis(avctx, samples+1, buf + n*8, &c->status[1], n*8);
470 *dst++ = buf[8*i+0] | (buf[8*i+1] << 4);
471 *dst++ = buf[8*i+2] | (buf[8*i+3] << 4);
472 *dst++ = buf[8*i+4] | (buf[8*i+5] << 4);
473 *dst++ = buf[8*i+6] | (buf[8*i+7] << 4);
474 if (avctx->channels == 2) {
475 uint8_t *buf1 = buf + n*8;
476 *dst++ = buf1[8*i+0] | (buf1[8*i+1] << 4);
477 *dst++ = buf1[8*i+2] | (buf1[8*i+3] << 4);
478 *dst++ = buf1[8*i+4] | (buf1[8*i+5] << 4);
479 *dst++ = buf1[8*i+6] | (buf1[8*i+7] << 4);
485 *dst = adpcm_ima_compress_sample(&c->status[0], samples[0]);
486 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels]) << 4;
488 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 2]);
489 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 3]) << 4;
491 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 4]);
492 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 5]) << 4;
494 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 6]);
495 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 7]) << 4;
498 if (avctx->channels == 2) {
499 *dst = adpcm_ima_compress_sample(&c->status[1], samples[1]);
500 *dst |= adpcm_ima_compress_sample(&c->status[1], samples[3]) << 4;
502 *dst = adpcm_ima_compress_sample(&c->status[1], samples[5]);
503 *dst |= adpcm_ima_compress_sample(&c->status[1], samples[7]) << 4;
505 *dst = adpcm_ima_compress_sample(&c->status[1], samples[9]);
506 *dst |= adpcm_ima_compress_sample(&c->status[1], samples[11]) << 4;
508 *dst = adpcm_ima_compress_sample(&c->status[1], samples[13]);
509 *dst |= adpcm_ima_compress_sample(&c->status[1], samples[15]) << 4;
512 samples += 8 * avctx->channels;
515 case CODEC_ID_ADPCM_IMA_QT:
519 init_put_bits(&pb, dst, buf_size*8);
521 for(ch=0; ch<avctx->channels; ch++){
522 put_bits(&pb, 9, (c->status[ch].prev_sample + 0x10000) >> 7);
523 put_bits(&pb, 7, c->status[ch].step_index);
524 if(avctx->trellis > 0) {
526 adpcm_compress_trellis(avctx, samples+ch, buf, &c->status[ch], 64);
528 put_bits(&pb, 4, buf[i^1]);
530 for (i=0; i<64; i+=2){
532 t1 = adpcm_ima_qt_compress_sample(&c->status[ch], samples[avctx->channels*(i+0)+ch]);
533 t2 = adpcm_ima_qt_compress_sample(&c->status[ch], samples[avctx->channels*(i+1)+ch]);
534 put_bits(&pb, 4, t2);
535 put_bits(&pb, 4, t1);
541 dst += put_bits_count(&pb)>>3;
544 case CODEC_ID_ADPCM_SWF:
548 init_put_bits(&pb, dst, buf_size*8);
550 n = avctx->frame_size-1;
552 //Store AdpcmCodeSize
553 put_bits(&pb, 2, 2); //Set 4bits flash adpcm format
555 //Init the encoder state
556 for(i=0; i<avctx->channels; i++){
557 c->status[i].step_index = av_clip(c->status[i].step_index, 0, 63); // clip step so it fits 6 bits
558 put_sbits(&pb, 16, samples[i]);
559 put_bits(&pb, 6, c->status[i].step_index);
560 c->status[i].prev_sample = (signed short)samples[i];
563 if(avctx->trellis > 0) {
564 FF_ALLOC_OR_GOTO(avctx, buf, 2*n, error);
565 adpcm_compress_trellis(avctx, samples+2, buf, &c->status[0], n);
566 if (avctx->channels == 2)
567 adpcm_compress_trellis(avctx, samples+3, buf+n, &c->status[1], n);
569 put_bits(&pb, 4, buf[i]);
570 if (avctx->channels == 2)
571 put_bits(&pb, 4, buf[n+i]);
575 for (i=1; i<avctx->frame_size; i++) {
576 put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels*i]));
577 if (avctx->channels == 2)
578 put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[1], samples[2*i+1]));
582 dst += put_bits_count(&pb)>>3;
585 case CODEC_ID_ADPCM_MS:
586 for(i=0; i<avctx->channels; i++){
590 c->status[i].coeff1 = ff_adpcm_AdaptCoeff1[predictor];
591 c->status[i].coeff2 = ff_adpcm_AdaptCoeff2[predictor];
593 for(i=0; i<avctx->channels; i++){
594 if (c->status[i].idelta < 16)
595 c->status[i].idelta = 16;
597 bytestream_put_le16(&dst, c->status[i].idelta);
599 for(i=0; i<avctx->channels; i++){
600 c->status[i].sample2= *samples++;
602 for(i=0; i<avctx->channels; i++){
603 c->status[i].sample1= *samples++;
605 bytestream_put_le16(&dst, c->status[i].sample1);
607 for(i=0; i<avctx->channels; i++)
608 bytestream_put_le16(&dst, c->status[i].sample2);
610 if(avctx->trellis > 0) {
611 int n = avctx->block_align - 7*avctx->channels;
612 FF_ALLOC_OR_GOTO(avctx, buf, 2*n, error);
613 if(avctx->channels == 1) {
614 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n);
616 *dst++ = (buf[i] << 4) | buf[i+1];
618 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n);
619 adpcm_compress_trellis(avctx, samples+1, buf+n, &c->status[1], n);
621 *dst++ = (buf[i] << 4) | buf[n+i];
625 for(i=7*avctx->channels; i<avctx->block_align; i++) {
627 nibble = adpcm_ms_compress_sample(&c->status[ 0], *samples++)<<4;
628 nibble|= adpcm_ms_compress_sample(&c->status[st], *samples++);
632 case CODEC_ID_ADPCM_YAMAHA:
633 n = avctx->frame_size / 2;
634 if(avctx->trellis > 0) {
635 FF_ALLOC_OR_GOTO(avctx, buf, 2*n*2, error);
637 if(avctx->channels == 1) {
638 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n);
640 *dst++ = buf[i] | (buf[i+1] << 4);
642 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n);
643 adpcm_compress_trellis(avctx, samples+1, buf+n, &c->status[1], n);
645 *dst++ = buf[i] | (buf[n+i] << 4);
649 for (n *= avctx->channels; n>0; n--) {
651 nibble = adpcm_yamaha_compress_sample(&c->status[ 0], *samples++);
652 nibble |= adpcm_yamaha_compress_sample(&c->status[st], *samples++) << 4;
664 #define ADPCM_ENCODER(id_, name_, long_name_) \
665 AVCodec ff_ ## name_ ## _encoder = { \
667 .type = AVMEDIA_TYPE_AUDIO, \
669 .priv_data_size = sizeof(ADPCMEncodeContext), \
670 .init = adpcm_encode_init, \
671 .encode = adpcm_encode_frame, \
672 .close = adpcm_encode_close, \
673 .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, \
674 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
677 ADPCM_ENCODER(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt, "ADPCM IMA QuickTime");
678 ADPCM_ENCODER(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav, "ADPCM IMA WAV");
679 ADPCM_ENCODER(CODEC_ID_ADPCM_MS, adpcm_ms, "ADPCM Microsoft");
680 ADPCM_ENCODER(CODEC_ID_ADPCM_SWF, adpcm_swf, "ADPCM Shockwave Flash");
681 ADPCM_ENCODER(CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha, "ADPCM Yamaha");