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.

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