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.

577 lines
19KB

  1. /*
  2. * SIPR / ACELP.NET decoder
  3. *
  4. * Copyright (c) 2008 Vladimir Voroshilov
  5. * Copyright (c) 2009 Vitor Sessak
  6. *
  7. * This file is part of Libav.
  8. *
  9. * Libav is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation; either
  12. * version 2.1 of the License, or (at your option) any later version.
  13. *
  14. * Libav is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with Libav; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. */
  23. #include <math.h>
  24. #include <stdint.h>
  25. #include <string.h>
  26. #include "libavutil/channel_layout.h"
  27. #include "libavutil/float_dsp.h"
  28. #include "libavutil/mathematics.h"
  29. #define BITSTREAM_READER_LE
  30. #include "avcodec.h"
  31. #include "bitstream.h"
  32. #include "internal.h"
  33. #include "lsp.h"
  34. #include "acelp_vectors.h"
  35. #include "acelp_pitch_delay.h"
  36. #include "acelp_filters.h"
  37. #include "celp_filters.h"
  38. #define MAX_SUBFRAME_COUNT 5
  39. #include "sipr.h"
  40. #include "siprdata.h"
  41. typedef struct SiprModeParam {
  42. const char *mode_name;
  43. uint16_t bits_per_frame;
  44. uint8_t subframe_count;
  45. uint8_t frames_per_packet;
  46. float pitch_sharp_factor;
  47. /* bitstream parameters */
  48. uint8_t number_of_fc_indexes;
  49. uint8_t ma_predictor_bits; ///< size in bits of the switched MA predictor
  50. /** size in bits of the i-th stage vector of quantizer */
  51. uint8_t vq_indexes_bits[5];
  52. /** size in bits of the adaptive-codebook index for every subframe */
  53. uint8_t pitch_delay_bits[5];
  54. uint8_t gp_index_bits;
  55. uint8_t fc_index_bits[10]; ///< size in bits of the fixed codebook indexes
  56. uint8_t gc_index_bits; ///< size in bits of the gain codebook indexes
  57. } SiprModeParam;
  58. static const SiprModeParam modes[MODE_COUNT] = {
  59. [MODE_16k] = {
  60. .mode_name = "16k",
  61. .bits_per_frame = 160,
  62. .subframe_count = SUBFRAME_COUNT_16k,
  63. .frames_per_packet = 1,
  64. .pitch_sharp_factor = 0.00,
  65. .number_of_fc_indexes = 10,
  66. .ma_predictor_bits = 1,
  67. .vq_indexes_bits = {7, 8, 7, 7, 7},
  68. .pitch_delay_bits = {9, 6},
  69. .gp_index_bits = 4,
  70. .fc_index_bits = {4, 5, 4, 5, 4, 5, 4, 5, 4, 5},
  71. .gc_index_bits = 5
  72. },
  73. [MODE_8k5] = {
  74. .mode_name = "8k5",
  75. .bits_per_frame = 152,
  76. .subframe_count = 3,
  77. .frames_per_packet = 1,
  78. .pitch_sharp_factor = 0.8,
  79. .number_of_fc_indexes = 3,
  80. .ma_predictor_bits = 0,
  81. .vq_indexes_bits = {6, 7, 7, 7, 5},
  82. .pitch_delay_bits = {8, 5, 5},
  83. .gp_index_bits = 0,
  84. .fc_index_bits = {9, 9, 9},
  85. .gc_index_bits = 7
  86. },
  87. [MODE_6k5] = {
  88. .mode_name = "6k5",
  89. .bits_per_frame = 232,
  90. .subframe_count = 3,
  91. .frames_per_packet = 2,
  92. .pitch_sharp_factor = 0.8,
  93. .number_of_fc_indexes = 3,
  94. .ma_predictor_bits = 0,
  95. .vq_indexes_bits = {6, 7, 7, 7, 5},
  96. .pitch_delay_bits = {8, 5, 5},
  97. .gp_index_bits = 0,
  98. .fc_index_bits = {5, 5, 5},
  99. .gc_index_bits = 7
  100. },
  101. [MODE_5k0] = {
  102. .mode_name = "5k0",
  103. .bits_per_frame = 296,
  104. .subframe_count = 5,
  105. .frames_per_packet = 2,
  106. .pitch_sharp_factor = 0.85,
  107. .number_of_fc_indexes = 1,
  108. .ma_predictor_bits = 0,
  109. .vq_indexes_bits = {6, 7, 7, 7, 5},
  110. .pitch_delay_bits = {8, 5, 8, 5, 5},
  111. .gp_index_bits = 0,
  112. .fc_index_bits = {10},
  113. .gc_index_bits = 7
  114. }
  115. };
  116. const float ff_pow_0_5[] = {
  117. 1.0/(1 << 1), 1.0/(1 << 2), 1.0/(1 << 3), 1.0/(1 << 4),
  118. 1.0/(1 << 5), 1.0/(1 << 6), 1.0/(1 << 7), 1.0/(1 << 8),
  119. 1.0/(1 << 9), 1.0/(1 << 10), 1.0/(1 << 11), 1.0/(1 << 12),
  120. 1.0/(1 << 13), 1.0/(1 << 14), 1.0/(1 << 15), 1.0/(1 << 16)
  121. };
  122. static void dequant(float *out, const int *idx, const float * const cbs[])
  123. {
  124. int i;
  125. int stride = 2;
  126. int num_vec = 5;
  127. for (i = 0; i < num_vec; i++)
  128. memcpy(out + stride*i, cbs[i] + stride*idx[i], stride*sizeof(float));
  129. }
  130. static void lsf_decode_fp(float *lsfnew, float *lsf_history,
  131. const SiprParameters *parm)
  132. {
  133. int i;
  134. float lsf_tmp[LP_FILTER_ORDER];
  135. dequant(lsf_tmp, parm->vq_indexes, lsf_codebooks);
  136. for (i = 0; i < LP_FILTER_ORDER; i++)
  137. lsfnew[i] = lsf_history[i] * 0.33 + lsf_tmp[i] + mean_lsf[i];
  138. ff_sort_nearly_sorted_floats(lsfnew, LP_FILTER_ORDER - 1);
  139. /* Note that a minimum distance is not enforced between the last value and
  140. the previous one, contrary to what is done in ff_acelp_reorder_lsf() */
  141. ff_set_min_dist_lsf(lsfnew, LSFQ_DIFF_MIN, LP_FILTER_ORDER - 1);
  142. lsfnew[9] = FFMIN(lsfnew[LP_FILTER_ORDER - 1], 1.3 * M_PI);
  143. memcpy(lsf_history, lsf_tmp, LP_FILTER_ORDER * sizeof(*lsf_history));
  144. for (i = 0; i < LP_FILTER_ORDER - 1; i++)
  145. lsfnew[i] = cos(lsfnew[i]);
  146. lsfnew[LP_FILTER_ORDER - 1] *= 6.153848 / M_PI;
  147. }
  148. /** Apply pitch lag to the fixed vector (AMR section 6.1.2). */
  149. static void pitch_sharpening(int pitch_lag_int, float beta,
  150. float *fixed_vector)
  151. {
  152. int i;
  153. for (i = pitch_lag_int; i < SUBFR_SIZE; i++)
  154. fixed_vector[i] += beta * fixed_vector[i - pitch_lag_int];
  155. }
  156. /**
  157. * Extract decoding parameters from the input bitstream.
  158. * @param parms parameters structure
  159. * @param bc pointer to initialized BitstreamContext structure
  160. */
  161. static void decode_parameters(SiprParameters* parms, BitstreamContext *bc,
  162. const SiprModeParam *p)
  163. {
  164. int i, j;
  165. if (p->ma_predictor_bits)
  166. parms->ma_pred_switch = bitstream_read(bc, p->ma_predictor_bits);
  167. for (i = 0; i < 5; i++)
  168. parms->vq_indexes[i] = bitstream_read(bc, p->vq_indexes_bits[i]);
  169. for (i = 0; i < p->subframe_count; i++) {
  170. parms->pitch_delay[i] = bitstream_read(bc, p->pitch_delay_bits[i]);
  171. if (p->gp_index_bits)
  172. parms->gp_index[i] = bitstream_read(bc, p->gp_index_bits);
  173. for (j = 0; j < p->number_of_fc_indexes; j++)
  174. parms->fc_indexes[i][j] = bitstream_read(bc, p->fc_index_bits[j]);
  175. parms->gc_index[i] = bitstream_read(bc, p->gc_index_bits);
  176. }
  177. }
  178. static void sipr_decode_lp(float *lsfnew, const float *lsfold, float *Az,
  179. int num_subfr)
  180. {
  181. double lsfint[LP_FILTER_ORDER];
  182. int i,j;
  183. float t, t0 = 1.0 / num_subfr;
  184. t = t0 * 0.5;
  185. for (i = 0; i < num_subfr; i++) {
  186. for (j = 0; j < LP_FILTER_ORDER; j++)
  187. lsfint[j] = lsfold[j] * (1 - t) + t * lsfnew[j];
  188. ff_amrwb_lsp2lpc(lsfint, Az, LP_FILTER_ORDER);
  189. Az += LP_FILTER_ORDER;
  190. t += t0;
  191. }
  192. }
  193. /**
  194. * Evaluate the adaptive impulse response.
  195. */
  196. static void eval_ir(const float *Az, int pitch_lag, float *freq,
  197. float pitch_sharp_factor)
  198. {
  199. float tmp1[SUBFR_SIZE+1], tmp2[LP_FILTER_ORDER+1];
  200. int i;
  201. tmp1[0] = 1.0;
  202. for (i = 0; i < LP_FILTER_ORDER; i++) {
  203. tmp1[i+1] = Az[i] * ff_pow_0_55[i];
  204. tmp2[i ] = Az[i] * ff_pow_0_7 [i];
  205. }
  206. memset(tmp1 + 11, 0, 37 * sizeof(float));
  207. ff_celp_lp_synthesis_filterf(freq, tmp2, tmp1, SUBFR_SIZE,
  208. LP_FILTER_ORDER);
  209. pitch_sharpening(pitch_lag, pitch_sharp_factor, freq);
  210. }
  211. /**
  212. * Evaluate the convolution of a vector with a sparse vector.
  213. */
  214. static void convolute_with_sparse(float *out, const AMRFixed *pulses,
  215. const float *shape, int length)
  216. {
  217. int i, j;
  218. memset(out, 0, length*sizeof(float));
  219. for (i = 0; i < pulses->n; i++)
  220. for (j = pulses->x[i]; j < length; j++)
  221. out[j] += pulses->y[i] * shape[j - pulses->x[i]];
  222. }
  223. /**
  224. * Apply postfilter, very similar to AMR one.
  225. */
  226. static void postfilter_5k0(SiprContext *ctx, const float *lpc, float *samples)
  227. {
  228. float buf[SUBFR_SIZE + LP_FILTER_ORDER];
  229. float *pole_out = buf + LP_FILTER_ORDER;
  230. float lpc_n[LP_FILTER_ORDER];
  231. float lpc_d[LP_FILTER_ORDER];
  232. int i;
  233. for (i = 0; i < LP_FILTER_ORDER; i++) {
  234. lpc_d[i] = lpc[i] * ff_pow_0_75[i];
  235. lpc_n[i] = lpc[i] * ff_pow_0_5 [i];
  236. };
  237. memcpy(pole_out - LP_FILTER_ORDER, ctx->postfilter_mem,
  238. LP_FILTER_ORDER*sizeof(float));
  239. ff_celp_lp_synthesis_filterf(pole_out, lpc_d, samples, SUBFR_SIZE,
  240. LP_FILTER_ORDER);
  241. memcpy(ctx->postfilter_mem, pole_out + SUBFR_SIZE - LP_FILTER_ORDER,
  242. LP_FILTER_ORDER*sizeof(float));
  243. ff_tilt_compensation(&ctx->tilt_mem, 0.4, pole_out, SUBFR_SIZE);
  244. memcpy(pole_out - LP_FILTER_ORDER, ctx->postfilter_mem5k0,
  245. LP_FILTER_ORDER*sizeof(*pole_out));
  246. memcpy(ctx->postfilter_mem5k0, pole_out + SUBFR_SIZE - LP_FILTER_ORDER,
  247. LP_FILTER_ORDER*sizeof(*pole_out));
  248. ff_celp_lp_zero_synthesis_filterf(samples, lpc_n, pole_out, SUBFR_SIZE,
  249. LP_FILTER_ORDER);
  250. }
  251. static void decode_fixed_sparse(AMRFixed *fixed_sparse, const int16_t *pulses,
  252. SiprMode mode, int low_gain)
  253. {
  254. int i;
  255. switch (mode) {
  256. case MODE_6k5:
  257. for (i = 0; i < 3; i++) {
  258. fixed_sparse->x[i] = 3 * (pulses[i] & 0xf) + i;
  259. fixed_sparse->y[i] = pulses[i] & 0x10 ? -1 : 1;
  260. }
  261. fixed_sparse->n = 3;
  262. break;
  263. case MODE_8k5:
  264. for (i = 0; i < 3; i++) {
  265. fixed_sparse->x[2*i ] = 3 * ((pulses[i] >> 4) & 0xf) + i;
  266. fixed_sparse->x[2*i + 1] = 3 * ( pulses[i] & 0xf) + i;
  267. fixed_sparse->y[2*i ] = (pulses[i] & 0x100) ? -1.0: 1.0;
  268. fixed_sparse->y[2*i + 1] =
  269. (fixed_sparse->x[2*i + 1] < fixed_sparse->x[2*i]) ?
  270. -fixed_sparse->y[2*i ] : fixed_sparse->y[2*i];
  271. }
  272. fixed_sparse->n = 6;
  273. break;
  274. case MODE_5k0:
  275. default:
  276. if (low_gain) {
  277. int offset = (pulses[0] & 0x200) ? 2 : 0;
  278. int val = pulses[0];
  279. for (i = 0; i < 3; i++) {
  280. int index = (val & 0x7) * 6 + 4 - i*2;
  281. fixed_sparse->y[i] = (offset + index) & 0x3 ? -1 : 1;
  282. fixed_sparse->x[i] = index;
  283. val >>= 3;
  284. }
  285. fixed_sparse->n = 3;
  286. } else {
  287. int pulse_subset = (pulses[0] >> 8) & 1;
  288. fixed_sparse->x[0] = ((pulses[0] >> 4) & 15) * 3 + pulse_subset;
  289. fixed_sparse->x[1] = ( pulses[0] & 15) * 3 + pulse_subset + 1;
  290. fixed_sparse->y[0] = pulses[0] & 0x200 ? -1 : 1;
  291. fixed_sparse->y[1] = -fixed_sparse->y[0];
  292. fixed_sparse->n = 2;
  293. }
  294. break;
  295. }
  296. }
  297. static void decode_frame(SiprContext *ctx, SiprParameters *params,
  298. float *out_data)
  299. {
  300. int i, j;
  301. int subframe_count = modes[ctx->mode].subframe_count;
  302. int frame_size = subframe_count * SUBFR_SIZE;
  303. float Az[LP_FILTER_ORDER * MAX_SUBFRAME_COUNT];
  304. float *excitation;
  305. float ir_buf[SUBFR_SIZE + LP_FILTER_ORDER];
  306. float lsf_new[LP_FILTER_ORDER];
  307. float *impulse_response = ir_buf + LP_FILTER_ORDER;
  308. float *synth = ctx->synth_buf + 16; // 16 instead of LP_FILTER_ORDER for
  309. // memory alignment
  310. int t0_first = 0;
  311. AMRFixed fixed_cb;
  312. memset(ir_buf, 0, LP_FILTER_ORDER * sizeof(float));
  313. lsf_decode_fp(lsf_new, ctx->lsf_history, params);
  314. sipr_decode_lp(lsf_new, ctx->lsp_history, Az, subframe_count);
  315. memcpy(ctx->lsp_history, lsf_new, LP_FILTER_ORDER * sizeof(float));
  316. excitation = ctx->excitation + PITCH_DELAY_MAX + L_INTERPOL;
  317. for (i = 0; i < subframe_count; i++) {
  318. float *pAz = Az + i*LP_FILTER_ORDER;
  319. float fixed_vector[SUBFR_SIZE];
  320. int T0,T0_frac;
  321. float pitch_gain, gain_code, avg_energy;
  322. ff_decode_pitch_lag(&T0, &T0_frac, params->pitch_delay[i], t0_first, i,
  323. ctx->mode == MODE_5k0, 6);
  324. if (i == 0 || (i == 2 && ctx->mode == MODE_5k0))
  325. t0_first = T0;
  326. ff_acelp_interpolatef(excitation, excitation - T0 + (T0_frac <= 0),
  327. ff_b60_sinc, 6,
  328. 2 * ((2 + T0_frac)%3 + 1), LP_FILTER_ORDER,
  329. SUBFR_SIZE);
  330. decode_fixed_sparse(&fixed_cb, params->fc_indexes[i], ctx->mode,
  331. ctx->past_pitch_gain < 0.8);
  332. eval_ir(pAz, T0, impulse_response, modes[ctx->mode].pitch_sharp_factor);
  333. convolute_with_sparse(fixed_vector, &fixed_cb, impulse_response,
  334. SUBFR_SIZE);
  335. avg_energy = (0.01 + avpriv_scalarproduct_float_c(fixed_vector,
  336. fixed_vector,
  337. SUBFR_SIZE)) /
  338. SUBFR_SIZE;
  339. ctx->past_pitch_gain = pitch_gain = gain_cb[params->gc_index[i]][0];
  340. gain_code = ff_amr_set_fixed_gain(gain_cb[params->gc_index[i]][1],
  341. avg_energy, ctx->energy_history,
  342. 34 - 15.0/(0.05*M_LN10/M_LN2),
  343. pred);
  344. ff_weighted_vector_sumf(excitation, excitation, fixed_vector,
  345. pitch_gain, gain_code, SUBFR_SIZE);
  346. pitch_gain *= 0.5 * pitch_gain;
  347. pitch_gain = FFMIN(pitch_gain, 0.4);
  348. ctx->gain_mem = 0.7 * ctx->gain_mem + 0.3 * pitch_gain;
  349. ctx->gain_mem = FFMIN(ctx->gain_mem, pitch_gain);
  350. gain_code *= ctx->gain_mem;
  351. for (j = 0; j < SUBFR_SIZE; j++)
  352. fixed_vector[j] = excitation[j] - gain_code * fixed_vector[j];
  353. if (ctx->mode == MODE_5k0) {
  354. postfilter_5k0(ctx, pAz, fixed_vector);
  355. ff_celp_lp_synthesis_filterf(ctx->postfilter_syn5k0 + LP_FILTER_ORDER + i*SUBFR_SIZE,
  356. pAz, excitation, SUBFR_SIZE,
  357. LP_FILTER_ORDER);
  358. }
  359. ff_celp_lp_synthesis_filterf(synth + i*SUBFR_SIZE, pAz, fixed_vector,
  360. SUBFR_SIZE, LP_FILTER_ORDER);
  361. excitation += SUBFR_SIZE;
  362. }
  363. memcpy(synth - LP_FILTER_ORDER, synth + frame_size - LP_FILTER_ORDER,
  364. LP_FILTER_ORDER * sizeof(float));
  365. if (ctx->mode == MODE_5k0) {
  366. for (i = 0; i < subframe_count; i++) {
  367. float energy = avpriv_scalarproduct_float_c(ctx->postfilter_syn5k0 + LP_FILTER_ORDER + i * SUBFR_SIZE,
  368. ctx->postfilter_syn5k0 + LP_FILTER_ORDER + i * SUBFR_SIZE,
  369. SUBFR_SIZE);
  370. ff_adaptive_gain_control(&synth[i * SUBFR_SIZE],
  371. &synth[i * SUBFR_SIZE], energy,
  372. SUBFR_SIZE, 0.9, &ctx->postfilter_agc);
  373. }
  374. memcpy(ctx->postfilter_syn5k0, ctx->postfilter_syn5k0 + frame_size,
  375. LP_FILTER_ORDER*sizeof(float));
  376. }
  377. memmove(ctx->excitation, excitation - PITCH_DELAY_MAX - L_INTERPOL,
  378. (PITCH_DELAY_MAX + L_INTERPOL) * sizeof(float));
  379. ff_acelp_apply_order_2_transfer_function(out_data, synth,
  380. (const float[2]) {-1.99997 , 1.000000000},
  381. (const float[2]) {-1.93307352, 0.935891986},
  382. 0.939805806,
  383. ctx->highpass_filt_mem,
  384. frame_size);
  385. }
  386. static av_cold int sipr_decoder_init(AVCodecContext * avctx)
  387. {
  388. SiprContext *ctx = avctx->priv_data;
  389. int i;
  390. switch (avctx->block_align) {
  391. case 20: ctx->mode = MODE_16k; break;
  392. case 19: ctx->mode = MODE_8k5; break;
  393. case 29: ctx->mode = MODE_6k5; break;
  394. case 37: ctx->mode = MODE_5k0; break;
  395. default:
  396. if (avctx->bit_rate > 12200) ctx->mode = MODE_16k;
  397. else if (avctx->bit_rate > 7500 ) ctx->mode = MODE_8k5;
  398. else if (avctx->bit_rate > 5750 ) ctx->mode = MODE_6k5;
  399. else ctx->mode = MODE_5k0;
  400. av_log(avctx, AV_LOG_WARNING,
  401. "Invalid block_align: %d. Mode %s guessed based on bitrate: %d\n",
  402. avctx->block_align, modes[ctx->mode].mode_name, avctx->bit_rate);
  403. }
  404. av_log(avctx, AV_LOG_DEBUG, "Mode: %s\n", modes[ctx->mode].mode_name);
  405. if (ctx->mode == MODE_16k) {
  406. ff_sipr_init_16k(ctx);
  407. ctx->decode_frame = ff_sipr_decode_frame_16k;
  408. } else {
  409. ctx->decode_frame = decode_frame;
  410. }
  411. for (i = 0; i < LP_FILTER_ORDER; i++)
  412. ctx->lsp_history[i] = cos((i+1) * M_PI / (LP_FILTER_ORDER + 1));
  413. for (i = 0; i < 4; i++)
  414. ctx->energy_history[i] = -14;
  415. avctx->channels = 1;
  416. avctx->channel_layout = AV_CH_LAYOUT_MONO;
  417. avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
  418. return 0;
  419. }
  420. static int sipr_decode_frame(AVCodecContext *avctx, void *data,
  421. int *got_frame_ptr, AVPacket *avpkt)
  422. {
  423. SiprContext *ctx = avctx->priv_data;
  424. AVFrame *frame = data;
  425. const uint8_t *buf=avpkt->data;
  426. SiprParameters parm;
  427. const SiprModeParam *mode_par = &modes[ctx->mode];
  428. BitstreamContext bc;
  429. float *samples;
  430. int subframe_size = ctx->mode == MODE_16k ? L_SUBFR_16k : SUBFR_SIZE;
  431. int i, ret;
  432. ctx->avctx = avctx;
  433. if (avpkt->size < (mode_par->bits_per_frame >> 3)) {
  434. av_log(avctx, AV_LOG_ERROR,
  435. "Error processing packet: packet size (%d) too small\n",
  436. avpkt->size);
  437. return -1;
  438. }
  439. /* get output buffer */
  440. frame->nb_samples = mode_par->frames_per_packet * subframe_size *
  441. mode_par->subframe_count;
  442. if ((ret = ff_get_buffer(avctx, frame, 0)) < 0) {
  443. av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
  444. return ret;
  445. }
  446. samples = (float *)frame->data[0];
  447. bitstream_init(&bc, buf, mode_par->bits_per_frame);
  448. for (i = 0; i < mode_par->frames_per_packet; i++) {
  449. decode_parameters(&parm, &bc, mode_par);
  450. ctx->decode_frame(ctx, &parm, samples);
  451. samples += subframe_size * mode_par->subframe_count;
  452. }
  453. *got_frame_ptr = 1;
  454. return mode_par->bits_per_frame >> 3;
  455. }
  456. AVCodec ff_sipr_decoder = {
  457. .name = "sipr",
  458. .long_name = NULL_IF_CONFIG_SMALL("RealAudio SIPR / ACELP.NET"),
  459. .type = AVMEDIA_TYPE_AUDIO,
  460. .id = AV_CODEC_ID_SIPR,
  461. .priv_data_size = sizeof(SiprContext),
  462. .init = sipr_decoder_init,
  463. .decode = sipr_decode_frame,
  464. .capabilities = AV_CODEC_CAP_DR1,
  465. };