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.

721 lines
18KB

  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. /** @file
  22. * Adaptive Multi-Rate (AMR) Audio decoder stub.
  23. *
  24. * This code implements both an AMR-NarrowBand (AMR-NB) and an AMR-WideBand
  25. * (AMR-WB) audio encoder/decoder through external reference code from
  26. * http://www.3gpp.org/. The license of the code from 3gpp is unclear so you
  27. * have to download the code separately. Two versions exists: One fixed-point
  28. * and one with floats. For some reason the float-encoder is significant faster
  29. * at least on a P4 1.5GHz (0.9s instead of 9.9s on a 30s audio clip at MR102).
  30. * Both float and fixed point are supported for AMR-NB, but only float for
  31. * AMR-WB.
  32. *
  33. * \section AMR-NB
  34. *
  35. * \subsection Float
  36. * The float version (default) can be downloaded from:
  37. * http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-610.zip
  38. * Extract the source into \c "ffmpeg/libavcodec/amr_float".
  39. * Enable it by passing \c "--enable-amr-nb" to \c "./configure".
  40. * If you try this on Alpha, you may need to change \c "Word32" to
  41. * \c "int" in \c "amr/typedef.h".
  42. *
  43. * \subsection Fixed-point
  44. * The fixed-point (TS26.073) can be downloaded from:
  45. * http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-600.zip
  46. * Extract the source into \c "ffmpeg/libavcodec/amr" and add \c "-DMMS_IO" to
  47. * \c "CFLAGS" in \c "libavcodec/amr/makefile", i.e.
  48. * \c "CFLAGS = -Wall -pedantic-errors -I. $(CFLAGS_$(MODE)) -D$(VAD) -DMMS_IO".
  49. * Enable it by passing \c "--enable-amr-nb-fixed" to \c "./configure".
  50. *
  51. * \subsection Specification
  52. * The specification for AMR-NB can be found in TS 26.071
  53. * (http://www.3gpp.org/ftp/Specs/html-info/26071.htm) and some other
  54. * info at http://www.3gpp.org/ftp/Specs/html-info/26-series.htm.
  55. *
  56. * \section AMR-WB
  57. * \subsection Float
  58. * The reference code can be downloaded from:
  59. * http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-600.zip
  60. * It should be extracted to \c "ffmpeg/libavcodec/amrwb_float".
  61. * Enable it by passing \c "--enable-amr-wb" to \c "./configure".
  62. *
  63. * \subsection Fixed-point
  64. * If someone wants to use the fixed point version it can be downloaded from:
  65. * http://www.3gpp.org/ftp/Specs/archive/26_series/26.173/26173-571.zip.
  66. *
  67. * \subsection Specification
  68. * The specification for AMR-WB can be found in TS 26.171
  69. * (http://www.3gpp.org/ftp/Specs/html-info/26171.htm) and some other
  70. * info at http://www.3gpp.org/ftp/Specs/html-info/26-series.htm.
  71. *
  72. */
  73. #include "avcodec.h"
  74. #ifdef CONFIG_AMR_NB_FIXED
  75. #define MMS_IO
  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. #else
  83. #include <amrnb/interf_dec.h>
  84. #include <amrnb/interf_enc.h>
  85. #endif
  86. static const char *nb_bitrate_unsupported =
  87. "bitrate not supported: use one of 4.75k, 5.15k, 5.9k, 6.7k, 7.4k, 7.95k, 10.2k or 12.2k\n";
  88. static const char *wb_bitrate_unsupported =
  89. "bitrate not supported: use one of 6.6k, 8.85k, 12.65k, 14.25k, 15.85k, 18.25k, 19.85k, 23.05k, or 23.85k\n";
  90. /* Common code for fixed and float version*/
  91. typedef struct AMR_bitrates
  92. {
  93. int rate;
  94. enum Mode mode;
  95. } AMR_bitrates;
  96. /* Match desired bitrate */
  97. static int getBitrateMode(int bitrate)
  98. {
  99. /* make the correspondance between bitrate and mode */
  100. AMR_bitrates rates[]={ {4750,MR475},
  101. {5150,MR515},
  102. {5900,MR59},
  103. {6700,MR67},
  104. {7400,MR74},
  105. {7950,MR795},
  106. {10200,MR102},
  107. {12200,MR122},
  108. };
  109. int i;
  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. static void amr_decode_fix_avctx(AVCodecContext * avctx)
  121. {
  122. const int is_amr_wb = 1 + (avctx->codec_id == CODEC_ID_AMR_WB);
  123. if(avctx->sample_rate == 0)
  124. {
  125. avctx->sample_rate = 8000 * is_amr_wb;
  126. }
  127. if(avctx->channels == 0)
  128. {
  129. avctx->channels = 1;
  130. }
  131. avctx->frame_size = 160 * is_amr_wb;
  132. }
  133. #ifdef CONFIG_AMR_NB_FIXED
  134. /* fixed point version*/
  135. /* frame size in serial bitstream file (frame type + serial stream + flags) */
  136. #define SERIAL_FRAMESIZE (1+MAX_SERIAL_SIZE+5)
  137. typedef struct AMRContext {
  138. int frameCount;
  139. Speech_Decode_FrameState *speech_decoder_state;
  140. enum RXFrameType rx_type;
  141. enum Mode mode;
  142. Word16 reset_flag;
  143. Word16 reset_flag_old;
  144. int enc_bitrate;
  145. Speech_Encode_FrameState *enstate;
  146. sid_syncState *sidstate;
  147. enum TXFrameType tx_frametype;
  148. } AMRContext;
  149. static int amr_nb_decode_init(AVCodecContext * avctx)
  150. {
  151. AMRContext *s = avctx->priv_data;
  152. s->frameCount=0;
  153. s->speech_decoder_state=NULL;
  154. s->rx_type = (enum RXFrameType)0;
  155. s->mode= (enum Mode)0;
  156. s->reset_flag=0;
  157. s->reset_flag_old=1;
  158. if(Speech_Decode_Frame_init(&s->speech_decoder_state, "Decoder"))
  159. {
  160. av_log(avctx, AV_LOG_ERROR, "Speech_Decode_Frame_init error\n");
  161. return -1;
  162. }
  163. amr_decode_fix_avctx(avctx);
  164. if(avctx->channels > 1)
  165. {
  166. av_log(avctx, AV_LOG_ERROR, "amr_nb: multichannel decoding not supported\n");
  167. return -1;
  168. }
  169. return 0;
  170. }
  171. static int amr_nb_encode_init(AVCodecContext * avctx)
  172. {
  173. AMRContext *s = avctx->priv_data;
  174. s->frameCount=0;
  175. s->speech_decoder_state=NULL;
  176. s->rx_type = (enum RXFrameType)0;
  177. s->mode= (enum Mode)0;
  178. s->reset_flag=0;
  179. s->reset_flag_old=1;
  180. if(avctx->sample_rate!=8000)
  181. {
  182. av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
  183. return -1;
  184. }
  185. if(avctx->channels!=1)
  186. {
  187. av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
  188. return -1;
  189. }
  190. avctx->frame_size=160;
  191. avctx->coded_frame= avcodec_alloc_frame();
  192. if(Speech_Encode_Frame_init(&s->enstate, 0, "encoder") || sid_sync_init (&s->sidstate))
  193. {
  194. av_log(avctx, AV_LOG_ERROR, "Speech_Encode_Frame_init error\n");
  195. return -1;
  196. }
  197. if((s->enc_bitrate=getBitrateMode(avctx->bit_rate))<0)
  198. {
  199. av_log(avctx, AV_LOG_ERROR, nb_bitrate_unsupported);
  200. return -1;
  201. }
  202. return 0;
  203. }
  204. static int amr_nb_encode_close(AVCodecContext * avctx)
  205. {
  206. AMRContext *s = avctx->priv_data;
  207. Speech_Encode_Frame_exit(&s->enstate);
  208. sid_sync_exit (&s->sidstate);
  209. av_freep(&avctx->coded_frame);
  210. return 0;
  211. }
  212. static int amr_nb_decode_close(AVCodecContext * avctx)
  213. {
  214. AMRContext *s = avctx->priv_data;
  215. Speech_Decode_Frame_exit(&s->speech_decoder_state);
  216. return 0;
  217. }
  218. static int amr_nb_decode_frame(AVCodecContext * avctx,
  219. void *data, int *data_size,
  220. uint8_t * buf, int buf_size)
  221. {
  222. AMRContext *s = avctx->priv_data;
  223. uint8_t*amrData=buf;
  224. int offset=0;
  225. UWord8 toc, q, ft;
  226. Word16 serial[SERIAL_FRAMESIZE]; /* coded bits */
  227. Word16 *synth;
  228. UWord8 *packed_bits;
  229. static Word16 packed_size[16] = {12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0};
  230. int i;
  231. //printf("amr_decode_frame data_size=%i buf=0x%X buf_size=%d frameCount=%d!!\n",*data_size,buf,buf_size,s->frameCount);
  232. synth=data;
  233. toc=amrData[offset];
  234. /* read rest of the frame based on ToC byte */
  235. q = (toc >> 2) & 0x01;
  236. ft = (toc >> 3) & 0x0F;
  237. //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]);
  238. offset++;
  239. packed_bits=amrData+offset;
  240. offset+=packed_size[ft];
  241. //Unsort and unpack bits
  242. s->rx_type = UnpackBits(q, ft, packed_bits, &s->mode, &serial[1]);
  243. //We have a new frame
  244. s->frameCount++;
  245. if (s->rx_type == RX_NO_DATA)
  246. {
  247. s->mode = s->speech_decoder_state->prev_mode;
  248. }
  249. else {
  250. s->speech_decoder_state->prev_mode = s->mode;
  251. }
  252. /* if homed: check if this frame is another homing frame */
  253. if (s->reset_flag_old == 1)
  254. {
  255. /* only check until end of first subframe */
  256. s->reset_flag = decoder_homing_frame_test_first(&serial[1], s->mode);
  257. }
  258. /* produce encoder homing frame if homed & input=decoder homing frame */
  259. if ((s->reset_flag != 0) && (s->reset_flag_old != 0))
  260. {
  261. for (i = 0; i < L_FRAME; i++)
  262. {
  263. synth[i] = EHF_MASK;
  264. }
  265. }
  266. else
  267. {
  268. /* decode frame */
  269. Speech_Decode_Frame(s->speech_decoder_state, s->mode, &serial[1], s->rx_type, synth);
  270. }
  271. //Each AMR-frame results in 160 16-bit samples
  272. *data_size=160*2;
  273. /* if not homed: check whether current frame is a homing frame */
  274. if (s->reset_flag_old == 0)
  275. {
  276. /* check whole frame */
  277. s->reset_flag = decoder_homing_frame_test(&serial[1], s->mode);
  278. }
  279. /* reset decoder if current frame is a homing frame */
  280. if (s->reset_flag != 0)
  281. {
  282. Speech_Decode_Frame_reset(s->speech_decoder_state);
  283. }
  284. s->reset_flag_old = s->reset_flag;
  285. return offset;
  286. }
  287. static int amr_nb_encode_frame(AVCodecContext *avctx,
  288. unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
  289. {
  290. short serial_data[250] = {0};
  291. AMRContext *s = avctx->priv_data;
  292. int written;
  293. s->reset_flag = encoder_homing_frame_test(data);
  294. Speech_Encode_Frame(s->enstate, s->enc_bitrate, data, &serial_data[1], &s->mode);
  295. /* add frame type and mode */
  296. sid_sync (s->sidstate, s->mode, &s->tx_frametype);
  297. written = PackBits(s->mode, s->enc_bitrate, s->tx_frametype, &serial_data[1], frame);
  298. if (s->reset_flag != 0)
  299. {
  300. Speech_Encode_Frame_reset(s->enstate);
  301. sid_sync_reset(s->sidstate);
  302. }
  303. return written;
  304. }
  305. #elif defined(CONFIG_AMR_NB) /* Float point version*/
  306. typedef struct AMRContext {
  307. int frameCount;
  308. void * decState;
  309. int *enstate;
  310. int enc_bitrate;
  311. } AMRContext;
  312. static int amr_nb_decode_init(AVCodecContext * avctx)
  313. {
  314. AMRContext *s = avctx->priv_data;
  315. s->frameCount=0;
  316. s->decState=Decoder_Interface_init();
  317. if(!s->decState)
  318. {
  319. av_log(avctx, AV_LOG_ERROR, "Decoder_Interface_init error\r\n");
  320. return -1;
  321. }
  322. amr_decode_fix_avctx(avctx);
  323. if(avctx->channels > 1)
  324. {
  325. av_log(avctx, AV_LOG_ERROR, "amr_nb: multichannel decoding not supported\n");
  326. return -1;
  327. }
  328. return 0;
  329. }
  330. static int amr_nb_encode_init(AVCodecContext * avctx)
  331. {
  332. AMRContext *s = avctx->priv_data;
  333. s->frameCount=0;
  334. if(avctx->sample_rate!=8000)
  335. {
  336. av_log(avctx, AV_LOG_ERROR, "Only 8000Hz sample rate supported\n");
  337. return -1;
  338. }
  339. if(avctx->channels!=1)
  340. {
  341. av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
  342. return -1;
  343. }
  344. avctx->frame_size=160;
  345. avctx->coded_frame= avcodec_alloc_frame();
  346. s->enstate=Encoder_Interface_init(0);
  347. if(!s->enstate)
  348. {
  349. av_log(avctx, AV_LOG_ERROR, "Encoder_Interface_init error\n");
  350. return -1;
  351. }
  352. if((s->enc_bitrate=getBitrateMode(avctx->bit_rate))<0)
  353. {
  354. av_log(avctx, AV_LOG_ERROR, nb_bitrate_unsupported);
  355. return -1;
  356. }
  357. return 0;
  358. }
  359. static int amr_nb_decode_close(AVCodecContext * avctx)
  360. {
  361. AMRContext *s = avctx->priv_data;
  362. Decoder_Interface_exit(s->decState);
  363. return 0;
  364. }
  365. static int amr_nb_encode_close(AVCodecContext * avctx)
  366. {
  367. AMRContext *s = avctx->priv_data;
  368. Encoder_Interface_exit(s->enstate);
  369. av_freep(&avctx->coded_frame);
  370. return 0;
  371. }
  372. static int amr_nb_decode_frame(AVCodecContext * avctx,
  373. void *data, int *data_size,
  374. uint8_t * buf, int buf_size)
  375. {
  376. AMRContext *s = avctx->priv_data;
  377. uint8_t*amrData=buf;
  378. static short block_size[16]={ 12, 13, 15, 17, 19, 20, 26, 31, 5, 0, 0, 0, 0, 0, 0, 0 };
  379. enum Mode dec_mode;
  380. int packet_size;
  381. /* av_log(NULL,AV_LOG_DEBUG,"amr_decode_frame buf=%p buf_size=%d frameCount=%d!!\n",buf,buf_size,s->frameCount); */
  382. dec_mode = (buf[0] >> 3) & 0x000F;
  383. packet_size = block_size[dec_mode]+1;
  384. if(packet_size > buf_size) {
  385. av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n", buf_size, packet_size);
  386. return -1;
  387. }
  388. s->frameCount++;
  389. /* 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]); */
  390. /* call decoder */
  391. Decoder_Interface_Decode(s->decState, amrData, data, 0);
  392. *data_size=160*2;
  393. return packet_size;
  394. }
  395. static int amr_nb_encode_frame(AVCodecContext *avctx,
  396. unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
  397. {
  398. AMRContext *s = avctx->priv_data;
  399. int written;
  400. if((s->enc_bitrate=getBitrateMode(avctx->bit_rate))<0)
  401. {
  402. av_log(avctx, AV_LOG_ERROR, nb_bitrate_unsupported);
  403. return -1;
  404. }
  405. written = Encoder_Interface_Encode(s->enstate,
  406. s->enc_bitrate,
  407. data,
  408. frame,
  409. 0);
  410. /* 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] ); */
  411. return written;
  412. }
  413. #endif
  414. #if defined(CONFIG_AMR_NB) || defined(CONFIG_AMR_NB_FIXED)
  415. AVCodec amr_nb_decoder =
  416. {
  417. "amr_nb",
  418. CODEC_TYPE_AUDIO,
  419. CODEC_ID_AMR_NB,
  420. sizeof(AMRContext),
  421. amr_nb_decode_init,
  422. NULL,
  423. amr_nb_decode_close,
  424. amr_nb_decode_frame,
  425. };
  426. AVCodec amr_nb_encoder =
  427. {
  428. "amr_nb",
  429. CODEC_TYPE_AUDIO,
  430. CODEC_ID_AMR_NB,
  431. sizeof(AMRContext),
  432. amr_nb_encode_init,
  433. amr_nb_encode_frame,
  434. amr_nb_encode_close,
  435. NULL,
  436. };
  437. #endif
  438. /* -----------AMR wideband ------------*/
  439. #ifdef CONFIG_AMR_WB
  440. #ifdef _TYPEDEF_H
  441. //To avoid duplicate typedefs from typdef in amr-nb
  442. #define typedef_h
  443. #endif
  444. #include <amrwb/enc_if.h>
  445. #include <amrwb/dec_if.h>
  446. #include <amrwb/if_rom.h>
  447. /* Common code for fixed and float version*/
  448. typedef struct AMRWB_bitrates
  449. {
  450. int rate;
  451. int mode;
  452. } AMRWB_bitrates;
  453. static int getWBBitrateMode(int bitrate)
  454. {
  455. /* make the correspondance between bitrate and mode */
  456. AMRWB_bitrates rates[]={ {6600,0},
  457. {8850,1},
  458. {12650,2},
  459. {14250,3},
  460. {15850,4},
  461. {18250,5},
  462. {19850,6},
  463. {23050,7},
  464. {23850,8},
  465. };
  466. int i;
  467. for(i=0;i<9;i++)
  468. {
  469. if(rates[i].rate==bitrate)
  470. {
  471. return(rates[i].mode);
  472. }
  473. }
  474. /* no bitrate matching, return an error */
  475. return -1;
  476. }
  477. typedef struct AMRWBContext {
  478. int frameCount;
  479. void *state;
  480. int mode;
  481. Word16 allow_dtx;
  482. } AMRWBContext;
  483. static int amr_wb_encode_init(AVCodecContext * avctx)
  484. {
  485. AMRWBContext *s = avctx->priv_data;
  486. s->frameCount=0;
  487. if(avctx->sample_rate!=16000)
  488. {
  489. av_log(avctx, AV_LOG_ERROR, "Only 16000Hz sample rate supported\n");
  490. return -1;
  491. }
  492. if(avctx->channels!=1)
  493. {
  494. av_log(avctx, AV_LOG_ERROR, "Only mono supported\n");
  495. return -1;
  496. }
  497. if((s->mode=getWBBitrateMode(avctx->bit_rate))<0)
  498. {
  499. av_log(avctx, AV_LOG_ERROR, wb_bitrate_unsupported);
  500. return -1;
  501. }
  502. avctx->frame_size=320;
  503. avctx->coded_frame= avcodec_alloc_frame();
  504. s->state = E_IF_init();
  505. s->allow_dtx=0;
  506. return 0;
  507. }
  508. static int amr_wb_encode_close(AVCodecContext * avctx)
  509. {
  510. AMRWBContext *s = avctx->priv_data;
  511. E_IF_exit(s->state);
  512. av_freep(&avctx->coded_frame);
  513. s->frameCount++;
  514. return 0;
  515. }
  516. static int amr_wb_encode_frame(AVCodecContext *avctx,
  517. unsigned char *frame/*out*/, int buf_size, void *data/*in*/)
  518. {
  519. AMRWBContext *s = avctx->priv_data;
  520. int size;
  521. if((s->mode=getWBBitrateMode(avctx->bit_rate))<0)
  522. {
  523. av_log(avctx, AV_LOG_ERROR, wb_bitrate_unsupported);
  524. return -1;
  525. }
  526. size = E_IF_encode(s->state, s->mode, data, frame, s->allow_dtx);
  527. return size;
  528. }
  529. static int amr_wb_decode_init(AVCodecContext * avctx)
  530. {
  531. AMRWBContext *s = avctx->priv_data;
  532. s->frameCount=0;
  533. s->state = D_IF_init();
  534. amr_decode_fix_avctx(avctx);
  535. if(avctx->channels > 1)
  536. {
  537. av_log(avctx, AV_LOG_ERROR, "amr_wb: multichannel decoding not supported\n");
  538. return -1;
  539. }
  540. return 0;
  541. }
  542. static int amr_wb_decode_frame(AVCodecContext * avctx,
  543. void *data, int *data_size,
  544. uint8_t * buf, int buf_size)
  545. {
  546. AMRWBContext *s = avctx->priv_data;
  547. uint8_t*amrData=buf;
  548. int mode;
  549. int packet_size;
  550. if(buf_size==0) {
  551. /* nothing to do */
  552. return 0;
  553. }
  554. mode = (amrData[0] >> 3) & 0x000F;
  555. packet_size = block_size[mode];
  556. if(packet_size > buf_size) {
  557. av_log(avctx, AV_LOG_ERROR, "amr frame too short (%u, should be %u)\n", buf_size, packet_size+1);
  558. return -1;
  559. }
  560. s->frameCount++;
  561. D_IF_decode( s->state, amrData, data, _good_frame);
  562. *data_size=320*2;
  563. return packet_size;
  564. }
  565. static int amr_wb_decode_close(AVCodecContext * avctx)
  566. {
  567. AMRWBContext *s = avctx->priv_data;
  568. D_IF_exit(s->state);
  569. return 0;
  570. }
  571. AVCodec amr_wb_decoder =
  572. {
  573. "amr_wb",
  574. CODEC_TYPE_AUDIO,
  575. CODEC_ID_AMR_WB,
  576. sizeof(AMRWBContext),
  577. amr_wb_decode_init,
  578. NULL,
  579. amr_wb_decode_close,
  580. amr_wb_decode_frame,
  581. };
  582. AVCodec amr_wb_encoder =
  583. {
  584. "amr_wb",
  585. CODEC_TYPE_AUDIO,
  586. CODEC_ID_AMR_WB,
  587. sizeof(AMRWBContext),
  588. amr_wb_encode_init,
  589. amr_wb_encode_frame,
  590. amr_wb_encode_close,
  591. NULL,
  592. };
  593. #endif //CONFIG_AMR_WB