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"
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 * Reference documents:
36 * http://www.pcisys.net/~melanson/codecs/simpleaudio.html
37 * http://www.geocities.com/SiliconValley/8682/aud3.txt
38 * http://openquicktime.sourceforge.net/plugins.htm
39 * XAnim sources (xa_codec.c) http://www.rasnaimaging.com/people/lapus/download.html
40 * http://www.cs.ucla.edu/~leec/mediabench/applications.html
41 * SoX source code http://home.sprynet.com/~cbagwell/sox.html
44 typedef struct TrellisPath {
49 typedef struct TrellisNode {
57 typedef struct ADPCMEncodeContext {
58 ADPCMChannelStatus status[6];
60 TrellisNode *node_buf;
61 TrellisNode **nodep_buf;
62 uint8_t *trellis_hash;
65 #define FREEZE_INTERVAL 128
67 static av_cold int adpcm_encode_init(AVCodecContext *avctx)
69 ADPCMEncodeContext *s = avctx->priv_data;
72 if (avctx->channels > 2)
73 return -1; /* only stereo or mono =) */
75 if(avctx->trellis && (unsigned)avctx->trellis > 16U){
76 av_log(avctx, AV_LOG_ERROR, "invalid trellis size\n");
81 int frontier = 1 << avctx->trellis;
82 int max_paths = frontier * FREEZE_INTERVAL;
83 FF_ALLOC_OR_GOTO(avctx, s->paths, max_paths * sizeof(*s->paths), error);
84 FF_ALLOC_OR_GOTO(avctx, s->node_buf, 2 * frontier * sizeof(*s->node_buf), error);
85 FF_ALLOC_OR_GOTO(avctx, s->nodep_buf, 2 * frontier * sizeof(*s->nodep_buf), error);
86 FF_ALLOC_OR_GOTO(avctx, s->trellis_hash, 65536 * sizeof(*s->trellis_hash), error);
89 switch(avctx->codec->id) {
90 case CODEC_ID_ADPCM_IMA_WAV:
91 avctx->frame_size = (BLKSIZE - 4 * avctx->channels) * 8 / (4 * avctx->channels) + 1; /* each 16 bits sample gives one nibble */
92 /* and we have 4 bytes per channel overhead */
93 avctx->block_align = BLKSIZE;
94 avctx->bits_per_coded_sample = 4;
95 /* seems frame_size isn't taken into account... have to buffer the samples :-( */
97 case CODEC_ID_ADPCM_IMA_QT:
98 avctx->frame_size = 64;
99 avctx->block_align = 34 * avctx->channels;
101 case CODEC_ID_ADPCM_MS:
102 avctx->frame_size = (BLKSIZE - 7 * avctx->channels) * 2 / avctx->channels + 2; /* each 16 bits sample gives one nibble */
103 /* and we have 7 bytes per channel overhead */
104 avctx->block_align = BLKSIZE;
105 avctx->bits_per_coded_sample = 4;
106 avctx->extradata_size = 32;
107 extradata = avctx->extradata = av_malloc(avctx->extradata_size);
109 return AVERROR(ENOMEM);
110 bytestream_put_le16(&extradata, avctx->frame_size);
111 bytestream_put_le16(&extradata, 7); /* wNumCoef */
112 for (i = 0; i < 7; i++) {
113 bytestream_put_le16(&extradata, ff_adpcm_AdaptCoeff1[i] * 4);
114 bytestream_put_le16(&extradata, ff_adpcm_AdaptCoeff2[i] * 4);
117 case CODEC_ID_ADPCM_YAMAHA:
118 avctx->frame_size = BLKSIZE * avctx->channels;
119 avctx->block_align = BLKSIZE;
121 case CODEC_ID_ADPCM_SWF:
122 if (avctx->sample_rate != 11025 &&
123 avctx->sample_rate != 22050 &&
124 avctx->sample_rate != 44100) {
125 av_log(avctx, AV_LOG_ERROR, "Sample rate must be 11025, 22050 or 44100\n");
128 avctx->frame_size = 512 * (avctx->sample_rate / 11025);
134 avctx->coded_frame= avcodec_alloc_frame();
135 avctx->coded_frame->key_frame= 1;
140 av_freep(&s->node_buf);
141 av_freep(&s->nodep_buf);
142 av_freep(&s->trellis_hash);
146 static av_cold int adpcm_encode_close(AVCodecContext *avctx)
148 ADPCMEncodeContext *s = avctx->priv_data;
149 av_freep(&avctx->coded_frame);
151 av_freep(&s->node_buf);
152 av_freep(&s->nodep_buf);
153 av_freep(&s->trellis_hash);
159 static inline unsigned char adpcm_ima_compress_sample(ADPCMChannelStatus *c, short sample)
161 int delta = sample - c->prev_sample;
162 int nibble = FFMIN(7, abs(delta)*4/ff_adpcm_step_table[c->step_index]) + (delta<0)*8;
163 c->prev_sample += ((ff_adpcm_step_table[c->step_index] * ff_adpcm_yamaha_difflookup[nibble]) / 8);
164 c->prev_sample = av_clip_int16(c->prev_sample);
165 c->step_index = av_clip(c->step_index + ff_adpcm_index_table[nibble], 0, 88);
169 static inline unsigned char adpcm_ima_qt_compress_sample(ADPCMChannelStatus *c, short sample)
171 int delta = sample - c->prev_sample;
172 int diff, step = ff_adpcm_step_table[c->step_index];
173 int nibble = 8*(delta < 0);
176 diff = delta + (step >> 3);
195 c->prev_sample -= diff;
197 c->prev_sample += diff;
199 c->prev_sample = av_clip_int16(c->prev_sample);
200 c->step_index = av_clip(c->step_index + ff_adpcm_index_table[nibble], 0, 88);
205 static inline unsigned char adpcm_ms_compress_sample(ADPCMChannelStatus *c, short sample)
207 int predictor, nibble, bias;
209 predictor = (((c->sample1) * (c->coeff1)) + ((c->sample2) * (c->coeff2))) / 64;
211 nibble= sample - predictor;
212 if(nibble>=0) bias= c->idelta/2;
213 else bias=-c->idelta/2;
215 nibble= (nibble + bias) / c->idelta;
216 nibble= av_clip(nibble, -8, 7)&0x0F;
218 predictor += (signed)((nibble & 0x08)?(nibble - 0x10):(nibble)) * c->idelta;
220 c->sample2 = c->sample1;
221 c->sample1 = av_clip_int16(predictor);
223 c->idelta = (ff_adpcm_AdaptationTable[(int)nibble] * c->idelta) >> 8;
224 if (c->idelta < 16) c->idelta = 16;
229 static inline unsigned char adpcm_yamaha_compress_sample(ADPCMChannelStatus *c, short sample)
238 delta = sample - c->predictor;
240 nibble = FFMIN(7, abs(delta)*4/c->step) + (delta<0)*8;
242 c->predictor += ((c->step * ff_adpcm_yamaha_difflookup[nibble]) / 8);
243 c->predictor = av_clip_int16(c->predictor);
244 c->step = (c->step * ff_adpcm_yamaha_indexscale[nibble]) >> 8;
245 c->step = av_clip(c->step, 127, 24567);
250 static void adpcm_compress_trellis(AVCodecContext *avctx, const short *samples,
251 uint8_t *dst, ADPCMChannelStatus *c, int n)
253 //FIXME 6% faster if frontier is a compile-time constant
254 ADPCMEncodeContext *s = avctx->priv_data;
255 const int frontier = 1 << avctx->trellis;
256 const int stride = avctx->channels;
257 const int version = avctx->codec->id;
258 TrellisPath *paths = s->paths, *p;
259 TrellisNode *node_buf = s->node_buf;
260 TrellisNode **nodep_buf = s->nodep_buf;
261 TrellisNode **nodes = nodep_buf; // nodes[] is always sorted by .ssd
262 TrellisNode **nodes_next = nodep_buf + frontier;
263 int pathn = 0, froze = -1, i, j, k, generation = 0;
264 uint8_t *hash = s->trellis_hash;
265 memset(hash, 0xff, 65536 * sizeof(*hash));
267 memset(nodep_buf, 0, 2 * frontier * sizeof(*nodep_buf));
268 nodes[0] = node_buf + frontier;
271 nodes[0]->step = c->step_index;
272 nodes[0]->sample1 = c->sample1;
273 nodes[0]->sample2 = c->sample2;
274 if((version == CODEC_ID_ADPCM_IMA_WAV) || (version == CODEC_ID_ADPCM_IMA_QT) || (version == CODEC_ID_ADPCM_SWF))
275 nodes[0]->sample1 = c->prev_sample;
276 if(version == CODEC_ID_ADPCM_MS)
277 nodes[0]->step = c->idelta;
278 if(version == CODEC_ID_ADPCM_YAMAHA) {
280 nodes[0]->step = 127;
281 nodes[0]->sample1 = 0;
283 nodes[0]->step = c->step;
284 nodes[0]->sample1 = c->predictor;
289 TrellisNode *t = node_buf + frontier*(i&1);
291 int sample = samples[i*stride];
293 memset(nodes_next, 0, frontier*sizeof(TrellisNode*));
294 for(j=0; j<frontier && nodes[j]; j++) {
295 // higher j have higher ssd already, so they're likely to yield a suboptimal next sample too
296 const int range = (j < frontier/2) ? 1 : 0;
297 const int step = nodes[j]->step;
299 if(version == CODEC_ID_ADPCM_MS) {
300 const int predictor = ((nodes[j]->sample1 * c->coeff1) + (nodes[j]->sample2 * c->coeff2)) / 64;
301 const int div = (sample - predictor) / step;
302 const int nmin = av_clip(div-range, -8, 6);
303 const int nmax = av_clip(div+range, -7, 7);
304 for(nidx=nmin; nidx<=nmax; nidx++) {
305 const int nibble = nidx & 0xf;
306 int dec_sample = predictor + nidx * step;
307 #define STORE_NODE(NAME, STEP_INDEX)\
313 dec_sample = av_clip_int16(dec_sample);\
314 d = sample - dec_sample;\
315 ssd = nodes[j]->ssd + d*d;\
316 /* Check for wraparound, skip such samples completely. \
317 * Note, changing ssd to a 64 bit variable would be \
318 * simpler, avoiding this check, but it's slower on \
319 * x86 32 bit at the moment. */\
320 if (ssd < nodes[j]->ssd)\
322 /* Collapse any two states with the same previous sample value. \
323 * One could also distinguish states by step and by 2nd to last
324 * sample, but the effects of that are negligible.
325 * Since nodes in the previous generation are iterated
326 * through a heap, they're roughly ordered from better to
327 * worse, but not strictly ordered. Therefore, an earlier
328 * node with the same sample value is better in most cases
329 * (and thus the current is skipped), but not strictly
330 * in all cases. Only skipping samples where ssd >=
331 * ssd of the earlier node with the same sample gives
332 * slightly worse quality, though, for some reason. */ \
333 h = &hash[(uint16_t) dec_sample];\
334 if (*h == generation)\
336 if (heap_pos < frontier) {\
339 /* Try to replace one of the leaf nodes with the new \
340 * one, but try a different slot each time. */\
341 pos = (frontier >> 1) + (heap_pos & ((frontier >> 1) - 1));\
342 if (ssd > nodes_next[pos]->ssd)\
347 u = nodes_next[pos];\
349 assert(pathn < FREEZE_INTERVAL<<avctx->trellis);\
351 nodes_next[pos] = u;\
355 u->step = STEP_INDEX;\
356 u->sample2 = nodes[j]->sample1;\
357 u->sample1 = dec_sample;\
358 paths[u->path].nibble = nibble;\
359 paths[u->path].prev = nodes[j]->path;\
360 /* Sift the newly inserted node up in the heap to \
361 * restore the heap property. */\
363 int parent = (pos - 1) >> 1;\
364 if (nodes_next[parent]->ssd <= ssd)\
366 FFSWAP(TrellisNode*, nodes_next[parent], nodes_next[pos]);\
370 STORE_NODE(ms, FFMAX(16, (ff_adpcm_AdaptationTable[nibble] * step) >> 8));
372 } else if((version == CODEC_ID_ADPCM_IMA_WAV)|| (version == CODEC_ID_ADPCM_IMA_QT)|| (version == CODEC_ID_ADPCM_SWF)) {
373 #define LOOP_NODES(NAME, STEP_TABLE, STEP_INDEX)\
374 const int predictor = nodes[j]->sample1;\
375 const int div = (sample - predictor) * 4 / STEP_TABLE;\
376 int nmin = av_clip(div-range, -7, 6);\
377 int nmax = av_clip(div+range, -6, 7);\
378 if(nmin<=0) nmin--; /* distinguish -0 from +0 */\
380 for(nidx=nmin; nidx<=nmax; nidx++) {\
381 const int nibble = nidx<0 ? 7-nidx : nidx;\
382 int dec_sample = predictor + (STEP_TABLE * ff_adpcm_yamaha_difflookup[nibble]) / 8;\
383 STORE_NODE(NAME, STEP_INDEX);\
385 LOOP_NODES(ima, ff_adpcm_step_table[step], av_clip(step + ff_adpcm_index_table[nibble], 0, 88));
386 } else { //CODEC_ID_ADPCM_YAMAHA
387 LOOP_NODES(yamaha, step, av_clip((step * ff_adpcm_yamaha_indexscale[nibble]) >> 8, 127, 24567));
398 if (generation == 255) {
399 memset(hash, 0xff, 65536 * sizeof(*hash));
404 if(nodes[0]->ssd > (1<<28)) {
405 for(j=1; j<frontier && nodes[j]; j++)
406 nodes[j]->ssd -= nodes[0]->ssd;
410 // merge old paths to save memory
411 if(i == froze + FREEZE_INTERVAL) {
412 p = &paths[nodes[0]->path];
413 for(k=i; k>froze; k--) {
419 // other nodes might use paths that don't coincide with the frozen one.
420 // checking which nodes do so is too slow, so just kill them all.
421 // this also slightly improves quality, but I don't know why.
422 memset(nodes+1, 0, (frontier-1)*sizeof(TrellisNode*));
426 p = &paths[nodes[0]->path];
427 for(i=n-1; i>froze; i--) {
432 c->predictor = nodes[0]->sample1;
433 c->sample1 = nodes[0]->sample1;
434 c->sample2 = nodes[0]->sample2;
435 c->step_index = nodes[0]->step;
436 c->step = nodes[0]->step;
437 c->idelta = nodes[0]->step;
440 static int adpcm_encode_frame(AVCodecContext *avctx,
441 unsigned char *frame, int buf_size, void *data)
446 ADPCMEncodeContext *c = avctx->priv_data;
450 samples = (short *)data;
451 st= avctx->channels == 2;
452 /* n = (BLKSIZE - 4 * avctx->channels) / (2 * 8 * avctx->channels); */
454 switch(avctx->codec->id) {
455 case CODEC_ID_ADPCM_IMA_WAV:
456 n = avctx->frame_size / 8;
457 c->status[0].prev_sample = (signed short)samples[0]; /* XXX */
458 /* c->status[0].step_index = 0; *//* XXX: not sure how to init the state machine */
459 bytestream_put_le16(&dst, c->status[0].prev_sample);
460 *dst++ = (unsigned char)c->status[0].step_index;
461 *dst++ = 0; /* unknown */
463 if (avctx->channels == 2) {
464 c->status[1].prev_sample = (signed short)samples[0];
465 /* c->status[1].step_index = 0; */
466 bytestream_put_le16(&dst, c->status[1].prev_sample);
467 *dst++ = (unsigned char)c->status[1].step_index;
472 /* stereo: 4 bytes (8 samples) for left, 4 bytes for right, 4 bytes left, ... */
473 if(avctx->trellis > 0) {
474 FF_ALLOC_OR_GOTO(avctx, buf, 2*n*8, error);
475 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n*8);
476 if(avctx->channels == 2)
477 adpcm_compress_trellis(avctx, samples+1, buf + n*8, &c->status[1], n*8);
479 *dst++ = buf[8*i+0] | (buf[8*i+1] << 4);
480 *dst++ = buf[8*i+2] | (buf[8*i+3] << 4);
481 *dst++ = buf[8*i+4] | (buf[8*i+5] << 4);
482 *dst++ = buf[8*i+6] | (buf[8*i+7] << 4);
483 if (avctx->channels == 2) {
484 uint8_t *buf1 = buf + n*8;
485 *dst++ = buf1[8*i+0] | (buf1[8*i+1] << 4);
486 *dst++ = buf1[8*i+2] | (buf1[8*i+3] << 4);
487 *dst++ = buf1[8*i+4] | (buf1[8*i+5] << 4);
488 *dst++ = buf1[8*i+6] | (buf1[8*i+7] << 4);
494 *dst = adpcm_ima_compress_sample(&c->status[0], samples[0]);
495 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels]) << 4;
497 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 2]);
498 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 3]) << 4;
500 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 4]);
501 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 5]) << 4;
503 *dst = adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 6]);
504 *dst |= adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels * 7]) << 4;
507 if (avctx->channels == 2) {
508 *dst = adpcm_ima_compress_sample(&c->status[1], samples[1]);
509 *dst |= adpcm_ima_compress_sample(&c->status[1], samples[3]) << 4;
511 *dst = adpcm_ima_compress_sample(&c->status[1], samples[5]);
512 *dst |= adpcm_ima_compress_sample(&c->status[1], samples[7]) << 4;
514 *dst = adpcm_ima_compress_sample(&c->status[1], samples[9]);
515 *dst |= adpcm_ima_compress_sample(&c->status[1], samples[11]) << 4;
517 *dst = adpcm_ima_compress_sample(&c->status[1], samples[13]);
518 *dst |= adpcm_ima_compress_sample(&c->status[1], samples[15]) << 4;
521 samples += 8 * avctx->channels;
524 case CODEC_ID_ADPCM_IMA_QT:
528 init_put_bits(&pb, dst, buf_size*8);
530 for(ch=0; ch<avctx->channels; ch++){
531 put_bits(&pb, 9, (c->status[ch].prev_sample + 0x10000) >> 7);
532 put_bits(&pb, 7, c->status[ch].step_index);
533 if(avctx->trellis > 0) {
535 adpcm_compress_trellis(avctx, samples+ch, buf, &c->status[ch], 64);
537 put_bits(&pb, 4, buf[i^1]);
539 for (i=0; i<64; i+=2){
541 t1 = adpcm_ima_qt_compress_sample(&c->status[ch], samples[avctx->channels*(i+0)+ch]);
542 t2 = adpcm_ima_qt_compress_sample(&c->status[ch], samples[avctx->channels*(i+1)+ch]);
543 put_bits(&pb, 4, t2);
544 put_bits(&pb, 4, t1);
550 dst += put_bits_count(&pb)>>3;
553 case CODEC_ID_ADPCM_SWF:
557 init_put_bits(&pb, dst, buf_size*8);
559 n = avctx->frame_size-1;
561 //Store AdpcmCodeSize
562 put_bits(&pb, 2, 2); //Set 4bits flash adpcm format
564 //Init the encoder state
565 for(i=0; i<avctx->channels; i++){
566 c->status[i].step_index = av_clip(c->status[i].step_index, 0, 63); // clip step so it fits 6 bits
567 put_sbits(&pb, 16, samples[i]);
568 put_bits(&pb, 6, c->status[i].step_index);
569 c->status[i].prev_sample = (signed short)samples[i];
572 if(avctx->trellis > 0) {
573 FF_ALLOC_OR_GOTO(avctx, buf, 2*n, error);
574 adpcm_compress_trellis(avctx, samples+2, buf, &c->status[0], n);
575 if (avctx->channels == 2)
576 adpcm_compress_trellis(avctx, samples+3, buf+n, &c->status[1], n);
578 put_bits(&pb, 4, buf[i]);
579 if (avctx->channels == 2)
580 put_bits(&pb, 4, buf[n+i]);
584 for (i=1; i<avctx->frame_size; i++) {
585 put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[0], samples[avctx->channels*i]));
586 if (avctx->channels == 2)
587 put_bits(&pb, 4, adpcm_ima_compress_sample(&c->status[1], samples[2*i+1]));
591 dst += put_bits_count(&pb)>>3;
594 case CODEC_ID_ADPCM_MS:
595 for(i=0; i<avctx->channels; i++){
599 c->status[i].coeff1 = ff_adpcm_AdaptCoeff1[predictor];
600 c->status[i].coeff2 = ff_adpcm_AdaptCoeff2[predictor];
602 for(i=0; i<avctx->channels; i++){
603 if (c->status[i].idelta < 16)
604 c->status[i].idelta = 16;
606 bytestream_put_le16(&dst, c->status[i].idelta);
608 for(i=0; i<avctx->channels; i++){
609 c->status[i].sample2= *samples++;
611 for(i=0; i<avctx->channels; i++){
612 c->status[i].sample1= *samples++;
614 bytestream_put_le16(&dst, c->status[i].sample1);
616 for(i=0; i<avctx->channels; i++)
617 bytestream_put_le16(&dst, c->status[i].sample2);
619 if(avctx->trellis > 0) {
620 int n = avctx->block_align - 7*avctx->channels;
621 FF_ALLOC_OR_GOTO(avctx, buf, 2*n, error);
622 if(avctx->channels == 1) {
623 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n);
625 *dst++ = (buf[i] << 4) | buf[i+1];
627 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n);
628 adpcm_compress_trellis(avctx, samples+1, buf+n, &c->status[1], n);
630 *dst++ = (buf[i] << 4) | buf[n+i];
634 for(i=7*avctx->channels; i<avctx->block_align; i++) {
636 nibble = adpcm_ms_compress_sample(&c->status[ 0], *samples++)<<4;
637 nibble|= adpcm_ms_compress_sample(&c->status[st], *samples++);
641 case CODEC_ID_ADPCM_YAMAHA:
642 n = avctx->frame_size / 2;
643 if(avctx->trellis > 0) {
644 FF_ALLOC_OR_GOTO(avctx, buf, 2*n*2, error);
646 if(avctx->channels == 1) {
647 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n);
649 *dst++ = buf[i] | (buf[i+1] << 4);
651 adpcm_compress_trellis(avctx, samples, buf, &c->status[0], n);
652 adpcm_compress_trellis(avctx, samples+1, buf+n, &c->status[1], n);
654 *dst++ = buf[i] | (buf[n+i] << 4);
658 for (n *= avctx->channels; n>0; n--) {
660 nibble = adpcm_yamaha_compress_sample(&c->status[ 0], *samples++);
661 nibble |= adpcm_yamaha_compress_sample(&c->status[st], *samples++) << 4;
673 #define ADPCM_ENCODER(id,name,long_name_) \
674 AVCodec ff_ ## name ## _encoder = { \
676 AVMEDIA_TYPE_AUDIO, \
678 sizeof(ADPCMEncodeContext), \
680 adpcm_encode_frame, \
681 adpcm_encode_close, \
683 .sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_S16,AV_SAMPLE_FMT_NONE}, \
684 .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
687 ADPCM_ENCODER(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt, "ADPCM IMA QuickTime");
688 ADPCM_ENCODER(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav, "ADPCM IMA WAV");
689 ADPCM_ENCODER(CODEC_ID_ADPCM_MS, adpcm_ms, "ADPCM Microsoft");
690 ADPCM_ENCODER(CODEC_ID_ADPCM_SWF, adpcm_swf, "ADPCM Shockwave Flash");
691 ADPCM_ENCODER(CODEC_ID_ADPCM_YAMAHA, adpcm_yamaha, "ADPCM Yamaha");