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.

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