Statistics
| Branch: | Revision:

ffmpeg / libavcodec / amr.c @ 2c48a21c

History | View | Annotate | Download (17.8 KB)

1
/*
2
 * AMR Audio decoder stub
3
 * Copyright (c) 2003 the ffmpeg project
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
 * Adaptive Multi-Rate (AMR) Audio decoder stub.
24
 *
25
 * This code implements both an AMR-NarrowBand (AMR-NB) and an AMR-WideBand
26
 * (AMR-WB) audio encoder/decoder through external reference code from
27
 * http://www.3gpp.org/. The license of the code from 3gpp is unclear so you
28
 * have to download the code separately. Two versions exists: One fixed-point
29
 * and one with floats. For some reason the float-encoder is significant faster
30
 * at least on a P4 1.5GHz (0.9s instead of 9.9s on a 30s audio clip at MR102).
31
 * Both float and fixed point are supported for AMR-NB, but only float for
32
 * AMR-WB.
33
 *
34
 * \section AMR-NB
35
 *
36
 * \subsection Float
37
 * The float version (default) can be downloaded from:
38
 * http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-610.zip
39
 * Extract the source into \c "ffmpeg/libavcodec/amr_float".
40
 *
41
 * \subsection Fixed-point
42
 * The fixed-point (TS26.073) can be downloaded from:
43
 * http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip.
44
 * Extract the source into \c "ffmpeg/libavcodec/amr".
45
 * To use the fixed version run \c "./configure" with \c "--enable-amr_nb-fixed".
46
 *
47
 * \subsection Specification
48
 * The specification for AMR-NB can be found in TS 26.071
49
 * (http://www.3gpp.org/ftp/Specs/html-info/26071.htm) and some other
50
 * info at http://www.3gpp.org/ftp/Specs/html-info/26-series.htm.
51
 *
52
 * \section AMR-WB
53
 * \subsection Float
54
 * The reference code can be downloaded from:
55
 * http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-600.zip
56
 * It should be extracted to \c "ffmpeg/libavcodec/amrwb_float". Enable it with
57
 * \c "--enable-amr_wb".
58
 *
59
 * \subsection Fixed-point
60
 * If someone wants to use the fixed point version it can be downloaded from:
61
 * http://www.3gpp.org/ftp/Specs/archive/26_series/26.173/26173-571.zip.
62
 *
63
 * \subsection Specification
64
 * The specification for AMR-WB can be found in TS 26.171
65
 * (http://www.3gpp.org/ftp/Specs/html-info/26171.htm) and some other
66
 * info at http://www.3gpp.org/ftp/Specs/html-info/26-series.htm.
67
 *
68
 */
69

    
70
#include "avcodec.h"
71

    
72
#ifdef CONFIG_AMR_NB_FIXED
73

    
74
#define MMS_IO
75

    
76
#include "amr/sp_dec.h"
77
#include "amr/d_homing.h"
78
#include "amr/typedef.h"
79
#include "amr/sp_enc.h"
80
#include "amr/sid_sync.h"
81
#include "amr/e_homing.h"
82

    
83
#else
84
#include "amr_float/interf_dec.h"
85
#include "amr_float/interf_enc.h"
86
#endif
87

    
88
/* Common code for fixed and float version*/
89
typedef struct AMR_bitrates
90
{
91
    int rate;
92
    enum Mode mode;
93
} AMR_bitrates;
94

    
95
/* Match desired bitrate */
96
static int getBitrateMode(int bitrate)
97
{
98
    /* make the correspondance between bitrate and mode */
99
    AMR_bitrates rates[]={ {4750,MR475},
100
                           {5150,MR515},
101
                           {5900,MR59},
102
                           {6700,MR67},
103
                           {7400,MR74},
104
                           {7950,MR795},
105
                           {10200,MR102},
106
                           {12200,MR122},
107
                         };
108
    int i;
109

    
110
    for(i=0;i<8;i++)
111
    {
112
        if(rates[i].rate==bitrate)
113
        {
114
            return(rates[i].mode);
115
        }
116
    }
117
    /* no bitrate matching, return an error */
118
    return -1;
119
}
120

    
121
static void amr_decode_fix_avctx(AVCodecContext * avctx)
122
{
123
    const int is_amr_wb = 1 + (avctx->codec_id == CODEC_ID_AMR_WB);
124

    
125
    if(avctx->sample_rate == 0)
126
    {
127
        avctx->sample_rate = 8000 * is_amr_wb;
128
    }
129

    
130
    if(avctx->channels == 0)
131
    {
132
        avctx->channels = 1;
133
    }
134

    
135
    avctx->frame_size = 160 * is_amr_wb;
136
}
137

    
138
#ifdef CONFIG_AMR_NB_FIXED
139
/* fixed point version*/
140
/* frame size in serial bitstream file (frame type + serial stream + flags) */
141
#define SERIAL_FRAMESIZE (1+MAX_SERIAL_SIZE+5)
142

    
143
typedef struct AMRContext {
144
    int frameCount;
145
    Speech_Decode_FrameState *speech_decoder_state;
146
    enum RXFrameType rx_type;
147
    enum Mode mode;
148
    Word16 reset_flag;
149
    Word16 reset_flag_old;
150

    
151
    int enc_bitrate;
152
    Speech_Encode_FrameState *enstate;
153
    sid_syncState *sidstate;
154
    enum TXFrameType tx_frametype;
155
} AMRContext;
156

    
157
static int amr_nb_decode_init(AVCodecContext * avctx)
158
{
159
    AMRContext *s = avctx->priv_data;
160

    
161
    s->frameCount=0;
162
    s->speech_decoder_state=NULL;
163
    s->rx_type = (enum RXFrameType)0;
164
    s->mode= (enum Mode)0;
165
    s->reset_flag=0;
166
    s->reset_flag_old=1;
167

    
168
    if(Speech_Decode_Frame_init(&s->speech_decoder_state, "Decoder"))
169
    {
170
        av_log(avctx, AV_LOG_ERROR, "Speech_Decode_Frame_init error\n");
171
        return -1;
172
    }
173

    
174
    amr_decode_fix_avctx(avctx);
175

    
176
    if(avctx->channels > 1)
177
    {
178
        av_log(avctx, AV_LOG_ERROR, "amr_nb: multichannel decoding not supported\n");
179
        return -1;
180
    }
181

    
182
    return 0;
183
}
184

    
185
static int amr_nb_encode_init(AVCodecContext * avctx)
186
{
187
    AMRContext *s = avctx->priv_data;
188

    
189
    s->frameCount=0;
190
    s->speech_decoder_state=NULL;
191
    s->rx_type = (enum RXFrameType)0;
192
    s->mode= (enum Mode)0;
193
    s->reset_flag=0;
194
    s->reset_flag_old=1;
195

    
196
    if(avctx->sample_rate!=8000)
197
    {
198
        av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
199
        return -1;
200
    }
201

    
202
    if(avctx->channels!=1)
203
    {
204
        av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
205
        return -1;
206
    }
207

    
208
    avctx->frame_size=160;
209
    avctx->coded_frame= avcodec_alloc_frame();
210

    
211
    if(Speech_Encode_Frame_init(&s->enstate, 0, "encoder") || sid_sync_init (&s->sidstate))
212
    {
213
        av_log(avctx, AV_LOG_ERROR, "Speech_Encode_Frame_init error\n");
214
        return -1;
215
    }
216

    
217
    if((s->enc_bitrate=getBitrateMode(avctx->bit_rate))<0)
218
    {
219
        av_log(avctx, AV_LOG_ERROR, "bitrate not supported\n");
220
        return -1;
221
    }
222

    
223
    return 0;
224
}
225

    
226
static int amr_nb_encode_close(AVCodecContext * avctx)
227
{
228
    AMRContext *s = avctx->priv_data;
229

    
230
    Speech_Encode_Frame_exit(&s->enstate);
231
    sid_sync_exit (&s->sidstate);
232
    av_freep(&avctx->coded_frame);
233
    return 0;
234
}
235

    
236
static int amr_nb_decode_close(AVCodecContext * avctx)
237
{
238
    AMRContext *s = avctx->priv_data;
239

    
240
    Speech_Decode_Frame_exit(&s->speech_decoder_state);
241
    return 0;
242
}
243

    
244
static int amr_nb_decode_frame(AVCodecContext * avctx,
245
            void *data, int *data_size,
246
            uint8_t * buf, int buf_size)
247
{
248
    AMRContext *s = avctx->priv_data;
249
    uint8_t*amrData=buf;
250
    int offset=0;
251
    UWord8 toc, q, ft;
252
    Word16 serial[SERIAL_FRAMESIZE];   /* coded bits */
253
    Word16 *synth;
254
    UWord8 *packed_bits;
255
    static Word16 packed_size[16] = {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0};
256
    int i;
257

    
258
    //printf("amr_decode_frame data_size=%i buf=0x%X buf_size=%d frameCount=%d!!\n",*data_size,buf,buf_size,s->frameCount);
259

    
260
    synth=data;
261

    
262
//    while(offset<buf_size)
263
    {
264
        toc=amrData[offset];
265
        /* read rest of the frame based on ToC byte */
266
        q  = (toc >> 2) & 0x01;
267
        ft = (toc >> 3) & 0x0F;
268

    
269
        //printf("offset=%d, packet_size=%d amrData= 0x%X %X %X %X\n",offset,packed_size[ft],amrData[offset],amrData[offset+1],amrData[offset+2],amrData[offset+3]);
270

    
271
        offset++;
272

    
273
        packed_bits=amrData+offset;
274

    
275
        offset+=packed_size[ft];
276

    
277
        //Unsort and unpack bits
278
        s->rx_type = UnpackBits(q, ft, packed_bits, &s->mode, &serial[1]);
279

    
280
        //We have a new frame
281
        s->frameCount++;
282

    
283
        if (s->rx_type == RX_NO_DATA)
284
        {
285
            s->mode = s->speech_decoder_state->prev_mode;
286
        }
287
        else {
288
            s->speech_decoder_state->prev_mode = s->mode;
289
        }
290

    
291
        /* if homed: check if this frame is another homing frame */
292
        if (s->reset_flag_old == 1)
293
        {
294
            /* only check until end of first subframe */
295
            s->reset_flag = decoder_homing_frame_test_first(&serial[1], s->mode);
296
        }
297
        /* produce encoder homing frame if homed & input=decoder homing frame */
298
        if ((s->reset_flag != 0) && (s->reset_flag_old != 0))
299
        {
300
            for (i = 0; i < L_FRAME; i++)
301
            {
302
                synth[i] = EHF_MASK;
303
            }
304
        }
305
        else
306
        {
307
            /* decode frame */
308
            Speech_Decode_Frame(s->speech_decoder_state, s->mode, &serial[1], s->rx_type, synth);
309
        }
310

    
311
        //Each AMR-frame results in 160 16-bit samples
312
        *data_size+=160*2;
313
        synth+=160;
314

    
315
        /* if not homed: check whether current frame is a homing frame */
316
        if (s->reset_flag_old == 0)
317
        {
318
            /* check whole frame */
319
            s->reset_flag = decoder_homing_frame_test(&serial[1], s->mode);
320
        }
321
        /* reset decoder if current frame is a homing frame */
322
        if (s->reset_flag != 0)
323
        {
324
            Speech_Decode_Frame_reset(s->speech_decoder_state);
325
        }
326
        s->reset_flag_old = s->reset_flag;
327

    
328
    }
329
    return offset;
330
}
331

    
332

    
333
static int amr_nb_encode_frame(AVCodecContext *avctx,
334
                            unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
335
{
336
    short serial_data[250] = {0};
337
    AMRContext *s = avctx->priv_data;
338
    int written;
339

    
340
    s->reset_flag = encoder_homing_frame_test(data);
341

    
342
    Speech_Encode_Frame(s->enstate, s->enc_bitrate, data, &serial_data[1], &s->mode);
343

    
344
    /* add frame type and mode */
345
    sid_sync (s->sidstate, s->mode, &s->tx_frametype);
346

    
347
    written = PackBits(s->mode, s->enc_bitrate, s->tx_frametype, &serial_data[1], frame);
348

    
349
    if (s->reset_flag != 0)
350
    {
351
        Speech_Encode_Frame_reset(s->enstate);
352
        sid_sync_reset(s->sidstate);
353
    }
354
    return written;
355
}
356

    
357

    
358
#elif defined(CONFIG_AMR_NB) /* Float point version*/
359

    
360
typedef struct AMRContext {
361
    int frameCount;
362
    void * decState;
363
    int *enstate;
364
    int enc_bitrate;
365
} AMRContext;
366

    
367
static int amr_nb_decode_init(AVCodecContext * avctx)
368
{
369
    AMRContext *s = avctx->priv_data;
370

    
371
    s->frameCount=0;
372
    s->decState=Decoder_Interface_init();
373
    if(!s->decState)
374
    {
375
        av_log(avctx, AV_LOG_ERROR, "Decoder_Interface_init error\r\n");
376
        return -1;
377
    }
378

    
379
    amr_decode_fix_avctx(avctx);
380

    
381
    if(avctx->channels > 1)
382
    {
383
        av_log(avctx, AV_LOG_ERROR, "amr_nb: multichannel decoding not supported\n");
384
        return -1;
385
    }
386

    
387
    return 0;
388
}
389

    
390
static int amr_nb_encode_init(AVCodecContext * avctx)
391
{
392
    AMRContext *s = avctx->priv_data;
393

    
394
    s->frameCount=0;
395

    
396
    if(avctx->sample_rate!=8000)
397
    {
398
        av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
399
        return -1;
400
    }
401

    
402
    if(avctx->channels!=1)
403
    {
404
        av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
405
        return -1;
406
    }
407

    
408
    avctx->frame_size=160;
409
    avctx->coded_frame= avcodec_alloc_frame();
410

    
411
    s->enstate=Encoder_Interface_init(0);
412
    if(!s->enstate)
413
    {
414
        av_log(avctx, AV_LOG_ERROR, "Encoder_Interface_init error\n");
415
        return -1;
416
    }
417

    
418
    if((s->enc_bitrate=getBitrateMode(avctx->bit_rate))<0)
419
    {
420
        av_log(avctx, AV_LOG_ERROR, "bitrate not supported\n");
421
        return -1;
422
    }
423

    
424
    return 0;
425
}
426

    
427
static int amr_nb_decode_close(AVCodecContext * avctx)
428
{
429
    AMRContext *s = avctx->priv_data;
430

    
431
    Decoder_Interface_exit(s->decState);
432
    return 0;
433
}
434

    
435
static int amr_nb_encode_close(AVCodecContext * avctx)
436
{
437
    AMRContext *s = avctx->priv_data;
438

    
439
    Encoder_Interface_exit(s->enstate);
440
    av_freep(&avctx->coded_frame);
441
    return 0;
442
}
443

    
444
static int amr_nb_decode_frame(AVCodecContext * avctx,
445
            void *data, int *data_size,
446
            uint8_t * buf, int buf_size)
447
{
448
    AMRContext *s = avctx->priv_data;
449
    uint8_t*amrData=buf;
450
    static short block_size[16]={ 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };
451
    enum Mode dec_mode;
452
    int packet_size;
453

    
454
    /* av_log(NULL,AV_LOG_DEBUG,"amr_decode_frame buf=%p buf_size=%d frameCount=%d!!\n",buf,buf_size,s->frameCount); */
455

    
456
    dec_mode = (buf[0] >> 3) & 0x000F;
457
    packet_size = block_size[dec_mode]+1;
458

    
459
    if(packet_size > buf_size) {
460
        av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n", buf_size, packet_size);
461
        return -1;
462
    }
463

    
464
    s->frameCount++;
465
    /* av_log(NULL,AV_LOG_DEBUG,"packet_size=%d amrData= 0x%X %X %X %X\n",packet_size,amrData[0],amrData[1],amrData[2],amrData[3]); */
466
    /* call decoder */
467
    Decoder_Interface_Decode(s->decState, amrData, data, 0);
468
    *data_size=160*2;
469

    
470
    return packet_size;
471
}
472

    
473
static int amr_nb_encode_frame(AVCodecContext *avctx,
474
                            unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
475
{
476
    AMRContext *s = avctx->priv_data;
477
    int written;
478

    
479
    if((s->enc_bitrate=getBitrateMode(avctx->bit_rate))<0)
480
    {
481
        av_log(avctx, AV_LOG_ERROR, "bitrate not supported\n");
482
        return -1;
483
    }
484

    
485
    written = Encoder_Interface_Encode(s->enstate,
486
        s->enc_bitrate,
487
        data,
488
        frame,
489
        0);
490
    /* av_log(NULL,AV_LOG_DEBUG,"amr_nb_encode_frame encoded %u bytes, bitrate %u, first byte was %#02x\n",written, s->enc_bitrate, frame[0] ); */
491

    
492
    return written;
493
}
494

    
495
#endif
496

    
497
#if defined(CONFIG_AMR_NB) || defined(CONFIG_AMR_NB_FIXED)
498

    
499
AVCodec amr_nb_decoder =
500
{
501
    "amr_nb",
502
    CODEC_TYPE_AUDIO,
503
    CODEC_ID_AMR_NB,
504
    sizeof(AMRContext),
505
    amr_nb_decode_init,
506
    NULL,
507
    amr_nb_decode_close,
508
    amr_nb_decode_frame,
509
};
510

    
511
AVCodec amr_nb_encoder =
512
{
513
    "amr_nb",
514
    CODEC_TYPE_AUDIO,
515
    CODEC_ID_AMR_NB,
516
    sizeof(AMRContext),
517
    amr_nb_encode_init,
518
    amr_nb_encode_frame,
519
    amr_nb_encode_close,
520
    NULL,
521
};
522

    
523
#endif
524

    
525
/* -----------AMR wideband ------------*/
526
#ifdef CONFIG_AMR_WB
527

    
528
#ifdef _TYPEDEF_H
529
//To avoid duplicate typedefs from typdef in amr-nb
530
#define typedef_h
531
#endif
532

    
533
#include "amrwb_float/enc_if.h"
534
#include "amrwb_float/dec_if.h"
535

    
536
/* Common code for fixed and float version*/
537
typedef struct AMRWB_bitrates
538
{
539
    int rate;
540
    int mode;
541
} AMRWB_bitrates;
542

    
543
static int getWBBitrateMode(int bitrate)
544
{
545
    /* make the correspondance between bitrate and mode */
546
    AMRWB_bitrates rates[]={ {6600,0},
547
                           {8850,1},
548
                           {12650,2},
549
                           {14250,3},
550
                           {15850,4},
551
                           {18250,5},
552
                           {19850,6},
553
                           {23050,7},
554
                           {23850,8},
555
                         };
556
    int i;
557

    
558
    for(i=0;i<9;i++)
559
    {
560
        if(rates[i].rate==bitrate)
561
        {
562
            return(rates[i].mode);
563
        }
564
    }
565
    /* no bitrate matching, return an error */
566
    return -1;
567
}
568

    
569

    
570
typedef struct AMRWBContext {
571
    int frameCount;
572
    void *state;
573
    int mode;
574
    Word16 allow_dtx;
575
} AMRWBContext;
576

    
577
static int amr_wb_encode_init(AVCodecContext * avctx)
578
{
579
    AMRWBContext *s = avctx->priv_data;
580

    
581
    s->frameCount=0;
582

    
583
    if(avctx->sample_rate!=16000)
584
    {
585
        av_log(avctx, AV_LOG_ERROR, "Only 16000Hz sample rate supported\n");
586
        return -1;
587
    }
588

    
589
    if(avctx->channels!=1)
590
    {
591
        av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
592
        return -1;
593
    }
594

    
595
    if((s->mode=getWBBitrateMode(avctx->bit_rate))<0)
596
    {
597
        av_log(avctx, AV_LOG_ERROR, "bitrate not supported\n");
598
        return -1;
599
    }
600

    
601
    avctx->frame_size=320;
602
    avctx->coded_frame= avcodec_alloc_frame();
603

    
604
    s->state = E_IF_init();
605
    s->allow_dtx=0;
606

    
607
    return 0;
608
}
609

    
610
static int amr_wb_encode_close(AVCodecContext * avctx)
611
{
612
    AMRWBContext *s = avctx->priv_data;
613

    
614
    E_IF_exit(s->state);
615
    av_freep(&avctx->coded_frame);
616
    s->frameCount++;
617
    return 0;
618
}
619

    
620
static int amr_wb_encode_frame(AVCodecContext *avctx,
621
                            unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
622
{
623
    AMRWBContext *s = avctx->priv_data;
624
    int size;
625

    
626
    if((s->mode=getWBBitrateMode(avctx->bit_rate))<0)
627
    {
628
        av_log(avctx, AV_LOG_ERROR, "bitrate not supported\n");
629
        return -1;
630
    }
631
    size = E_IF_encode(s->state, s->mode, data, frame, s->allow_dtx);
632
    return size;
633
}
634

    
635
static int amr_wb_decode_init(AVCodecContext * avctx)
636
{
637
    AMRWBContext *s = avctx->priv_data;
638

    
639
    s->frameCount=0;
640
    s->state = D_IF_init();
641

    
642
    amr_decode_fix_avctx(avctx);
643

    
644
    if(avctx->channels > 1)
645
    {
646
        av_log(avctx, AV_LOG_ERROR, "amr_wb: multichannel decoding not supported\n");
647
        return -1;
648
    }
649

    
650
    return 0;
651
}
652

    
653
extern const UWord8 block_size[];
654

    
655
static int amr_wb_decode_frame(AVCodecContext * avctx,
656
            void *data, int *data_size,
657
            uint8_t * buf, int buf_size)
658
{
659
    AMRWBContext *s = avctx->priv_data;
660
    uint8_t*amrData=buf;
661
    int mode;
662
    int packet_size;
663

    
664
    if(buf_size==0) {
665
        /* nothing to do */
666
        return 0;
667
    }
668

    
669
    mode = (amrData[0] >> 3) & 0x000F;
670
    packet_size = block_size[mode];
671

    
672
    if(packet_size > buf_size) {
673
        av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n", buf_size, packet_size+1);
674
        return -1;
675
    }
676

    
677
    s->frameCount++;
678
    D_IF_decode( s->state, amrData, data, _good_frame);
679
    *data_size=320*2;
680
    return packet_size;
681
}
682

    
683
static int amr_wb_decode_close(AVCodecContext * avctx)
684
{
685
    AMRWBContext *s = avctx->priv_data;
686

    
687
    D_IF_exit(s->state);
688
    return 0;
689
}
690

    
691
AVCodec amr_wb_decoder =
692
{
693
    "amr_wb",
694
    CODEC_TYPE_AUDIO,
695
    CODEC_ID_AMR_WB,
696
    sizeof(AMRWBContext),
697
    amr_wb_decode_init,
698
    NULL,
699
    amr_wb_decode_close,
700
    amr_wb_decode_frame,
701
};
702

    
703
AVCodec amr_wb_encoder =
704
{
705
    "amr_wb",
706
    CODEC_TYPE_AUDIO,
707
    CODEC_ID_AMR_WB,
708
    sizeof(AMRWBContext),
709
    amr_wb_encode_init,
710
    amr_wb_encode_frame,
711
    amr_wb_encode_close,
712
    NULL,
713
};
714

    
715
#endif //CONFIG_AMR_WB