Go to the documentation of this file.
50 #define MAX_LSPS_ALIGN16 16
53 #define MAX_FRAMESIZE 160
54 #define MAX_SIGNAL_HISTORY 416
55 #define MAX_SFRAMESIZE (MAX_FRAMESIZE * MAX_FRAMES)
57 #define SFRAME_CACHE_MAXSIZE 256
303 int cntr[8] = { 0 }, n, res;
305 memset(vbm_tree, 0xff,
sizeof(vbm_tree[0]) * 25);
306 for (n = 0; n < 17; n++) {
310 vbm_tree[res * 3 + cntr[res]++] = n;
317 static const uint8_t
bits[] = {
320 10, 10, 10, 12, 12, 12,
323 static const uint16_t codes[] = {
324 0x0000, 0x0001, 0x0002,
325 0x000c, 0x000d, 0x000e,
326 0x003c, 0x003d, 0x003e,
327 0x00fc, 0x00fd, 0x00fe,
328 0x03fc, 0x03fd, 0x03fe,
329 0x0ffc, 0x0ffd, 0x0ffe,
330 0x3ffc, 0x3ffd, 0x3ffe, 0x3fff
334 bits, 1, 1, codes, 2, 2, 132);
342 s->postfilter_agc = 0;
343 s->sframe_cache_size = 0;
344 s->skip_bits_next = 0;
345 for (n = 0; n <
s->lsps; n++)
346 s->prev_lsps[n] =
M_PI * (n + 1.0) / (
s->lsps + 1.0);
347 memset(
s->excitation_history, 0,
349 memset(
s->synth_history, 0,
351 memset(
s->gain_pred_err, 0,
352 sizeof(
s->gain_pred_err));
356 sizeof(*
s->synth_filter_out_buf) *
s->lsps);
357 memset(
s->dcf_mem, 0,
358 sizeof(*
s->dcf_mem) * 2);
359 memset(
s->zero_exc_pf, 0,
360 sizeof(*
s->zero_exc_pf) *
s->history_nsamples);
361 memset(
s->denoise_filter_cache, 0,
sizeof(
s->denoise_filter_cache));
371 int n,
flags, pitch_range, lsp16_flag,
ret;
384 if (
ctx->extradata_size != 46) {
386 "Invalid extradata size %d (should be 46)\n",
387 ctx->extradata_size);
390 if (
ctx->block_align <= 0 ||
ctx->block_align > (1<<22)) {
406 memcpy(&
s->sin[255],
s->cos, 256 *
sizeof(
s->cos[0]));
407 for (n = 0; n < 255; n++) {
408 s->sin[n] = -
s->sin[510 - n];
409 s->cos[510 - n] =
s->cos[n];
412 s->denoise_strength = (
flags >> 2) & 0xF;
413 if (
s->denoise_strength >= 12) {
415 "Invalid denoise filter strength %d (max=11)\n",
416 s->denoise_strength);
419 s->denoise_tilt_corr = !!(
flags & 0x40);
420 s->dc_level = (
flags >> 7) & 0xF;
421 s->lsp_q_mode = !!(
flags & 0x2000);
422 s->lsp_def_mode = !!(
flags & 0x4000);
423 lsp16_flag =
flags & 0x1000;
429 for (n = 0; n <
s->lsps; n++)
430 s->prev_lsps[n] =
M_PI * (n + 1.0) / (
s->lsps + 1.0);
438 if (
ctx->sample_rate >= INT_MAX / (256 * 37))
441 s->min_pitch_val = ((
ctx->sample_rate << 8) / 400 + 50) >> 8;
442 s->max_pitch_val = ((
ctx->sample_rate << 8) * 37 / 2000 + 50) >> 8;
443 pitch_range =
s->max_pitch_val -
s->min_pitch_val;
444 if (pitch_range <= 0) {
449 s->last_pitch_val = 40;
451 s->history_nsamples =
s->max_pitch_val + 8;
454 int min_sr = ((((1 << 8) - 50) * 400) + 0xFF) >> 8,
458 "Unsupported samplerate %d (min=%d, max=%d)\n",
459 ctx->sample_rate, min_sr, max_sr);
464 s->block_conv_table[0] =
s->min_pitch_val;
465 s->block_conv_table[1] = (pitch_range * 25) >> 6;
466 s->block_conv_table[2] = (pitch_range * 44) >> 6;
467 s->block_conv_table[3] =
s->max_pitch_val - 1;
468 s->block_delta_pitch_hrange = (pitch_range >> 3) & ~0xF;
469 if (
s->block_delta_pitch_hrange <= 0) {
473 s->block_delta_pitch_nbits = 1 +
av_ceil_log2(
s->block_delta_pitch_hrange);
474 s->block_pitch_range =
s->block_conv_table[2] +
475 s->block_conv_table[3] + 1 +
476 2 * (
s->block_conv_table[1] - 2 *
s->min_pitch_val);
508 const float *speech_synth,
512 float speech_energy = 0.0, postfilter_energy = 0.0, gain_scale_factor;
513 float mem = *gain_mem;
516 speech_energy +=
fabsf(speech_synth[
i]);
517 postfilter_energy +=
fabsf(in[
i]);
519 gain_scale_factor = postfilter_energy == 0.0 ? 0.0 :
520 (1.0 -
alpha) * speech_energy / postfilter_energy;
523 mem =
alpha * mem + gain_scale_factor;
524 out[
i] = in[
i] * mem;
549 const float *in,
float *
out,
int size)
552 float optimal_gain = 0, dot;
553 const float *ptr = &in[-
FFMAX(
s->min_pitch_val, pitch - 3)],
554 *end = &in[-
FFMIN(
s->max_pitch_val, pitch + 3)],
555 *best_hist_ptr =
NULL;
560 if (dot > optimal_gain) {
564 }
while (--ptr >= end);
566 if (optimal_gain <= 0)
572 if (optimal_gain <= dot) {
573 dot = dot / (dot + 0.6 * optimal_gain);
578 for (n = 0; n <
size; n++)
579 out[n] = best_hist_ptr[n] + dot * (in[n] - best_hist_ptr[n]);
608 int fcb_type,
float *coeffs,
int remainder)
611 float irange, angle_mul, gain_mul, range, sq;
615 s->rdft.rdft_calc(&
s->rdft, lpcs);
616 #define log_range(var, assign) do { \
617 float tmp = log10f(assign); var = tmp; \
618 max = FFMAX(max, tmp); min = FFMIN(min, tmp); \
621 for (n = 1; n < 64; n++)
622 log_range(lpcs[n], lpcs[n * 2] * lpcs[n * 2] +
623 lpcs[n * 2 + 1] * lpcs[n * 2 + 1]);
634 irange = 64.0 / range;
638 for (n = 0; n <= 64; n++) {
641 idx =
lrint((
max - lpcs[n]) * irange - 1);
644 lpcs[n] = angle_mul * pwr;
647 idx =
av_clipf((pwr * gain_mul - 0.0295) * 70.570526123, 0, INT_MAX / 2);
651 powf(1.0331663, idx - 127);
660 s->dct.dct_calc(&
s->dct, lpcs);
661 s->dst.dct_calc(&
s->dst, lpcs);
664 idx = 255 +
av_clip(lpcs[64], -255, 255);
665 coeffs[0] = coeffs[0] *
s->cos[idx];
666 idx = 255 +
av_clip(lpcs[64] - 2 * lpcs[63], -255, 255);
669 idx = 255 +
av_clip(-lpcs[64] - 2 * lpcs[n - 1], -255, 255);
670 coeffs[n * 2 + 1] = coeffs[n] *
s->sin[idx];
671 coeffs[n * 2] = coeffs[n] *
s->cos[idx];
675 idx = 255 +
av_clip( lpcs[64] - 2 * lpcs[n - 1], -255, 255);
676 coeffs[n * 2 + 1] = coeffs[n] *
s->sin[idx];
677 coeffs[n * 2] = coeffs[n] *
s->cos[idx];
682 s->irdft.rdft_calc(&
s->irdft, coeffs);
685 memset(&coeffs[remainder], 0,
sizeof(coeffs[0]) * (128 - remainder));
686 if (
s->denoise_tilt_corr) {
689 coeffs[remainder - 1] = 0;
696 for (n = 0; n < remainder; n++)
727 float *synth_pf,
int size,
730 int remainder, lim, n;
733 float *tilted_lpcs =
s->tilted_lpcs_pf,
734 *coeffs =
s->denoise_coeffs_pf, tilt_mem = 0;
736 tilted_lpcs[0] = 1.0;
737 memcpy(&tilted_lpcs[1], lpcs,
sizeof(lpcs[0]) *
s->lsps);
738 memset(&tilted_lpcs[
s->lsps + 1], 0,
739 sizeof(tilted_lpcs[0]) * (128 -
s->lsps - 1));
741 tilted_lpcs,
s->lsps + 2);
752 memset(&synth_pf[
size], 0,
sizeof(synth_pf[0]) * (128 -
size));
753 s->rdft.rdft_calc(&
s->rdft, synth_pf);
754 s->rdft.rdft_calc(&
s->rdft, coeffs);
755 synth_pf[0] *= coeffs[0];
756 synth_pf[1] *= coeffs[1];
757 for (n = 1; n < 64; n++) {
758 float v1 = synth_pf[n * 2], v2 = synth_pf[n * 2 + 1];
759 synth_pf[n * 2] = v1 * coeffs[n * 2] - v2 * coeffs[n * 2 + 1];
760 synth_pf[n * 2 + 1] = v2 * coeffs[n * 2] + v1 * coeffs[n * 2 + 1];
762 s->irdft.rdft_calc(&
s->irdft, synth_pf);
766 if (
s->denoise_filter_cache_size) {
767 lim =
FFMIN(
s->denoise_filter_cache_size,
size);
768 for (n = 0; n < lim; n++)
769 synth_pf[n] +=
s->denoise_filter_cache[n];
770 s->denoise_filter_cache_size -= lim;
771 memmove(
s->denoise_filter_cache, &
s->denoise_filter_cache[
size],
772 sizeof(
s->denoise_filter_cache[0]) *
s->denoise_filter_cache_size);
777 lim =
FFMIN(remainder,
s->denoise_filter_cache_size);
778 for (n = 0; n < lim; n++)
779 s->denoise_filter_cache[n] += synth_pf[
size + n];
780 if (lim < remainder) {
781 memcpy(&
s->denoise_filter_cache[lim], &synth_pf[
size + lim],
782 sizeof(
s->denoise_filter_cache[0]) * (remainder - lim));
783 s->denoise_filter_cache_size = remainder;
810 const float *lpcs,
float *zero_exc_pf,
811 int fcb_type,
int pitch)
815 *synth_filter_in = zero_exc_pf;
824 synth_filter_in = synth_filter_in_buf;
828 synth_filter_in,
size,
s->lsps);
829 memcpy(&synth_pf[-
s->lsps], &synth_pf[
size -
s->lsps],
830 sizeof(synth_pf[0]) *
s->lsps);
837 if (
s->dc_level > 8) {
842 (
const float[2]) { -1.99997, 1.0 },
843 (
const float[2]) { -1.9330735188, 0.93589198496 },
844 0.93980580475,
s->dcf_mem,
size);
864 const uint16_t *
sizes,
865 int n_stages,
const uint8_t *
table,
867 const double *base_q)
871 memset(lsps, 0, num *
sizeof(*lsps));
872 for (n = 0; n < n_stages; n++) {
874 double base = base_q[n],
mul = mul_q[n];
876 for (m = 0; m < num; m++)
877 lsps[m] +=
base +
mul * t_off[m];
895 static const uint16_t vec_sizes[4] = { 256, 64, 32, 32 };
896 static const double mul_lsf[4] = {
897 5.2187144800e-3, 1.4626986422e-3,
898 9.6179549166e-4, 1.1325736225e-3
900 static const double base_lsf[4] = {
901 M_PI * -2.15522e-1,
M_PI * -6.1646e-2,
902 M_PI * -3.3486e-2,
M_PI * -5.7408e-2
920 double *i_lsps,
const double *old,
921 double *
a1,
double *
a2,
int q_mode)
923 static const uint16_t vec_sizes[3] = { 128, 64, 64 };
924 static const double mul_lsf[3] = {
925 2.5807601174e-3, 1.2354460219e-3, 1.1763821673e-3
927 static const double base_lsf[3] = {
928 M_PI * -1.07448e-1,
M_PI * -5.2706e-2,
M_PI * -5.1634e-2
930 const float (*ipol_tab)[2][10] = q_mode ?
942 for (n = 0; n < 10; n++) {
943 double delta = old[n] - i_lsps[n];
957 static const uint16_t vec_sizes[5] = { 256, 64, 128, 64, 128 };
958 static const double mul_lsf[5] = {
959 3.3439586280e-3, 6.9908173703e-4,
960 3.3216608306e-3, 1.0334960326e-3,
963 static const double base_lsf[5] = {
964 M_PI * -1.27576e-1,
M_PI * -2.4292e-2,
965 M_PI * -1.28094e-1,
M_PI * -3.2128e-2,
989 double *i_lsps,
const double *old,
990 double *
a1,
double *
a2,
int q_mode)
992 static const uint16_t vec_sizes[3] = { 128, 128, 128 };
993 static const double mul_lsf[3] = {
994 1.2232979501e-3, 1.4062241527e-3, 1.6114744851e-3
996 static const double base_lsf[3] = {
999 const float (*ipol_tab)[2][16] = q_mode ?
1011 for (n = 0; n < 16; n++) {
1012 double delta = old[n] - i_lsps[n];
1041 static const int16_t start_offset[94] = {
1042 -11, -9, -7, -5, -3, -1, 1, 3, 5, 7, 9, 11,
1043 13, 15, 18, 17, 19, 20, 21, 22, 23, 24, 25, 26,
1044 27, 28, 29, 30, 31, 32, 33, 35, 37, 39, 41, 43,
1045 45, 47, 49, 51, 53, 55, 57, 59, 61, 63, 65, 67,
1046 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91,
1047 93, 95, 97, 99, 101, 103, 105, 107, 109, 111, 113, 115,
1048 117, 119, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139,
1049 141, 143, 145, 147, 149, 151, 153, 155, 157, 159
1054 s->aw_idx_is_ext = 0;
1056 s->aw_idx_is_ext = 1;
1062 s->aw_pulse_range =
FFMIN(pitch[0], pitch[1]) > 32 ? 24 : 16;
1065 s->aw_first_pulse_off[0] =
offset -
s->aw_pulse_range / 2;
1066 offset +=
s->aw_n_pulses[0] * pitch[0];
1074 while (
s->aw_first_pulse_off[1] - pitch[1] +
s->aw_pulse_range > 0)
1075 s->aw_first_pulse_off[1] -= pitch[1];
1076 if (start_offset[
bits] < 0)
1077 while (
s->aw_first_pulse_off[0] - pitch[0] +
s->aw_pulse_range > 0)
1078 s->aw_first_pulse_off[0] -= pitch[0];
1093 uint16_t use_mask_mem[9];
1094 uint16_t *use_mask = use_mask_mem + 2;
1102 int pulse_off =
s->aw_first_pulse_off[block_idx],
1103 pulse_start, n, idx, range, aidx, start_off = 0;
1106 if (
s->aw_n_pulses[block_idx] > 0)
1107 while (pulse_off +
s->aw_pulse_range < 1)
1111 if (
s->aw_n_pulses[0] > 0) {
1112 if (block_idx == 0) {
1116 if (
s->aw_n_pulses[block_idx] > 0)
1117 pulse_off =
s->aw_next_pulse_off_cache;
1121 pulse_start =
s->aw_n_pulses[block_idx] > 0 ? pulse_off - range / 2 : 0;
1126 memset(&use_mask[-2], 0, 2 *
sizeof(use_mask[0]));
1127 memset( use_mask, -1, 5 *
sizeof(use_mask[0]));
1128 memset(&use_mask[5], 0, 2 *
sizeof(use_mask[0]));
1129 if (
s->aw_n_pulses[block_idx] > 0)
1131 int excl_range =
s->aw_pulse_range;
1132 uint16_t *use_mask_ptr = &use_mask[idx >> 4];
1133 int first_sh = 16 - (idx & 15);
1134 *use_mask_ptr++ &= 0xFFFF
u << first_sh;
1135 excl_range -= first_sh;
1136 if (excl_range >= 16) {
1137 *use_mask_ptr++ = 0;
1138 *use_mask_ptr &= 0xFFFF >> (excl_range - 16);
1140 *use_mask_ptr &= 0xFFFF >> excl_range;
1144 aidx =
get_bits(gb,
s->aw_n_pulses[0] > 0 ? 5 - 2 * block_idx : 4);
1145 for (n = 0; n <= aidx; pulse_start++) {
1146 for (idx = pulse_start; idx < 0; idx += fcb->
pitch_lag) ;
1148 if (use_mask[0]) idx = 0x0F;
1149 else if (use_mask[1]) idx = 0x1F;
1150 else if (use_mask[2]) idx = 0x2F;
1151 else if (use_mask[3]) idx = 0x3F;
1152 else if (use_mask[4]) idx = 0x4F;
1156 if (use_mask[idx >> 4] & (0x8000 >> (idx & 15))) {
1157 use_mask[idx >> 4] &= ~(0x8000 >> (idx & 15));
1163 fcb->
x[fcb->
n] = start_off;
1169 s->aw_next_pulse_off_cache = n ? fcb->
pitch_lag - n : 0;
1183 int val =
get_bits(gb, 12 - 2 * (
s->aw_idx_is_ext && !block_idx));
1186 if (
s->aw_n_pulses[block_idx] > 0) {
1187 int n, v_mask, i_mask, sh, n_pulses;
1189 if (
s->aw_pulse_range == 24) {
1201 for (n = n_pulses - 1; n >= 0; n--,
val >>= sh) {
1202 fcb->
y[fcb->
n] = (
val & v_mask) ? -1.0 : 1.0;
1203 fcb->
x[fcb->
n] = (
val & i_mask) * n_pulses + n +
1204 s->aw_first_pulse_off[block_idx];
1205 while (fcb->
x[fcb->
n] < 0)
1211 int num2 = (
val & 0x1FF) >> 1,
delta, idx;
1213 if (num2 < 1 * 79) {
delta = 1; idx = num2 + 1; }
1214 else if (num2 < 2 * 78) {
delta = 3; idx = num2 + 1 - 1 * 77; }
1215 else if (num2 < 3 * 77) {
delta = 5; idx = num2 + 1 - 2 * 76; }
1216 else {
delta = 7; idx = num2 + 1 - 3 * 75; }
1217 v = (
val & 0x200) ? -1.0 : 1.0;
1222 fcb->
x[fcb->
n + 1] = idx;
1223 fcb->
y[fcb->
n + 1] = (
val & 1) ? -v : v;
1241 static int pRNG(
int frame_cntr,
int block_num,
int block_size)
1253 static const unsigned int div_tbl[9][2] = {
1254 { 8332, 3 * 715827883
U },
1255 { 4545, 0 * 390451573
U },
1256 { 3124, 11 * 268435456
U },
1257 { 2380, 15 * 204522253
U },
1258 { 1922, 23 * 165191050
U },
1259 { 1612, 23 * 138547333
U },
1260 { 1388, 27 * 119304648
U },
1261 { 1219, 16 * 104755300
U },
1262 { 1086, 39 * 93368855
U }
1264 unsigned int z, y, x =
MUL16(block_num, 1877) + frame_cntr;
1265 if (x >= 0xFFFF) x -= 0xFFFF;
1267 y = x - 9 *
MULH(477218589, x);
1268 z = (uint16_t) (x * div_tbl[y][0] +
UMULH(x, div_tbl[y][1]));
1270 return z % (1000 - block_size);
1278 int block_idx,
int size,
1289 r_idx =
pRNG(
s->frame_cntr, block_idx,
size);
1290 gain =
s->silence_gain;
1297 memset(
s->gain_pred_err, 0,
sizeof(
s->gain_pred_err));
1300 for (n = 0; n <
size; n++)
1309 int block_idx,
int size,
1310 int block_pitch_sh2,
1314 static const float gain_coeff[6] = {
1315 0.8169, -0.06545, 0.1726, 0.0185, -0.0359, 0.0458
1318 int n, idx, gain_weight;
1337 int r_idx =
pRNG(
s->frame_cntr, block_idx,
size);
1339 for (n = 0; n <
size; n++)
1351 for (n = 0; n < 5; n++) {
1357 fcb.
x[fcb.
n] = n + 5 * pos1;
1358 fcb.
y[fcb.
n++] = sign;
1359 if (n < frame_desc->dbl_pulses) {
1361 fcb.
x[fcb.
n] = n + 5 * pos2;
1362 fcb.
y[fcb.
n++] = (pos1 < pos2) ? -sign : sign;
1380 memmove(&
s->gain_pred_err[gain_weight],
s->gain_pred_err,
1381 sizeof(*
s->gain_pred_err) * (6 - gain_weight));
1382 for (n = 0; n < gain_weight; n++)
1383 s->gain_pred_err[n] = pred_err;
1388 for (n = 0; n <
size; n +=
len) {
1390 int abs_idx = block_idx *
size + n;
1391 int pitch_sh16 = (
s->last_pitch_val << 16) +
1392 s->pitch_diff_sh16 * abs_idx;
1393 int pitch = (pitch_sh16 + 0x6FFF) >> 16;
1394 int idx_sh16 = ((pitch << 16) - pitch_sh16) * 8 + 0x58000;
1395 idx = idx_sh16 >> 16;
1396 if (
s->pitch_diff_sh16) {
1397 if (
s->pitch_diff_sh16 > 0) {
1398 next_idx_sh16 = (idx_sh16) &~ 0xFFFF;
1400 next_idx_sh16 = (idx_sh16 + 0x10000) &~ 0xFFFF;
1401 len =
av_clip((idx_sh16 - next_idx_sh16) /
s->pitch_diff_sh16 / 8,
1411 int block_pitch = block_pitch_sh2 >> 2;
1412 idx = block_pitch_sh2 & 3;
1419 sizeof(
float) *
size);
1424 acb_gain, fcb_gain,
size);
1443 int block_idx,
int size,
1444 int block_pitch_sh2,
1445 const double *lsps,
const double *prev_lsps,
1447 float *excitation,
float *synth)
1458 frame_desc, excitation);
1461 fac = (block_idx + 0.5) / frame_desc->
n_blocks;
1462 for (n = 0; n <
s->lsps; n++)
1463 i_lsps[n] = cos(prev_lsps[n] + fac * (lsps[n] - prev_lsps[n]));
1486 const double *lsps,
const double *prev_lsps,
1487 float *excitation,
float *synth)
1490 int n, n_blocks_x2, log_n_blocks_x2,
av_uninit(cur_pitch_val);
1498 "Invalid frame type VLC code, skipping\n");
1512 cur_pitch_val =
s->min_pitch_val +
get_bits(gb,
s->pitch_nbits);
1513 cur_pitch_val =
FFMIN(cur_pitch_val,
s->max_pitch_val - 1);
1515 20 *
abs(cur_pitch_val -
s->last_pitch_val) >
1516 (cur_pitch_val +
s->last_pitch_val))
1517 s->last_pitch_val = cur_pitch_val;
1521 int fac = n * 2 + 1;
1523 pitch[n] = (
MUL16(fac, cur_pitch_val) +
1524 MUL16((n_blocks_x2 - fac),
s->last_pitch_val) +
1529 s->pitch_diff_sh16 =
1555 t1 = (
s->block_conv_table[1] -
s->block_conv_table[0]) << 2,
1556 t2 = (
s->block_conv_table[2] -
s->block_conv_table[1]) << 1,
1557 t3 =
s->block_conv_table[3] -
s->block_conv_table[2] + 1;
1560 block_pitch =
get_bits(gb,
s->block_pitch_nbits);
1562 block_pitch = last_block_pitch -
s->block_delta_pitch_hrange +
1563 get_bits(gb,
s->block_delta_pitch_nbits);
1565 last_block_pitch =
av_clip(block_pitch,
1566 s->block_delta_pitch_hrange,
1567 s->block_pitch_range -
1568 s->block_delta_pitch_hrange);
1571 if (block_pitch <
t1) {
1572 bl_pitch_sh2 = (
s->block_conv_table[0] << 2) + block_pitch;
1575 if (block_pitch <
t2) {
1577 (
s->block_conv_table[1] << 2) + (block_pitch << 1);
1580 if (block_pitch <
t3) {
1582 (
s->block_conv_table[2] + block_pitch) << 2;
1584 bl_pitch_sh2 =
s->block_conv_table[3] << 2;
1587 pitch[n] = bl_pitch_sh2 >> 2;
1592 bl_pitch_sh2 = pitch[n] << 2;
1603 &excitation[n * block_nsamples],
1604 &synth[n * block_nsamples]);
1613 for (n = 0; n <
s->lsps; n++)
1614 i_lsps[n] = cos(0.5 * (prev_lsps[n] + lsps[n]));
1620 for (n = 0; n <
s->lsps; n++)
1621 i_lsps[n] = cos(lsps[n]);
1624 &
s->zero_exc_pf[
s->history_nsamples +
MAX_FRAMESIZE * frame_idx + 80],
1627 memcpy(
samples, synth, 160 *
sizeof(synth[0]));
1631 if (
s->frame_cntr >= 0xFFFF)
s->frame_cntr -= 0xFFFF;
1635 s->last_pitch_val = 0;
1638 s->last_pitch_val = cur_pitch_val;
1667 lsps[0] =
FFMAX(lsps[0], 0.0015 *
M_PI);
1668 for (n = 1; n < num; n++)
1669 lsps[n] =
FFMAX(lsps[n], lsps[n - 1] + 0.0125 *
M_PI);
1670 lsps[num - 1] =
FFMIN(lsps[num - 1], 0.9985 *
M_PI);
1674 for (n = 1; n < num; n++) {
1675 if (lsps[n] < lsps[n - 1]) {
1676 for (m = 1; m < num; m++) {
1677 double tmp = lsps[m];
1678 for (l = m - 1; l >= 0; l--) {
1679 if (lsps[l] <=
tmp)
break;
1680 lsps[l + 1] = lsps[l];
1713 const double *
mean_lsf =
s->lsps == 16 ?
1719 memcpy(synth,
s->synth_history,
1720 s->lsps *
sizeof(*synth));
1721 memcpy(excitation,
s->excitation_history,
1722 s->history_nsamples *
sizeof(*excitation));
1724 if (
s->sframe_cache_size > 0) {
1727 s->sframe_cache_size = 0;
1743 "Superframe encodes > %d samples (%d), not allowed\n",
1750 if (
s->has_residual_lsps) {
1753 for (n = 0; n <
s->lsps; n++)
1754 prev_lsps[n] =
s->prev_lsps[n] -
mean_lsf[n];
1756 if (
s->lsps == 10) {
1761 for (n = 0; n <
s->lsps; n++) {
1763 lsps[1][n] =
mean_lsf[n] + (
a1[
s->lsps + n] -
a2[n * 2 + 1]);
1766 for (n = 0; n < 3; n++)
1778 frame->nb_samples = n_samples;
1782 for (n = 0; n < 3; n++) {
1783 if (!
s->has_residual_lsps) {
1786 if (
s->lsps == 10) {
1791 for (m = 0; m <
s->lsps; m++)
1798 lsps[n], n == 0 ?
s->prev_lsps : lsps[n - 1],
1822 memcpy(
s->prev_lsps, lsps[2],
1823 s->lsps *
sizeof(*
s->prev_lsps));
1825 s->lsps *
sizeof(*synth));
1827 s->history_nsamples *
sizeof(*excitation));
1830 s->history_nsamples *
sizeof(*
s->zero_exc_pf));
1845 unsigned int res, n_superframes = 0;
1855 n_superframes += res;
1856 }
while (res == 0x3F);
1857 s->spillover_nbits =
get_bits(gb,
s->spillover_bitsize);
1881 int rmn_bytes, rmn_bits;
1884 if (rmn_bits < nbits)
1888 rmn_bits &= 7; rmn_bytes >>= 3;
1889 if ((rmn_bits =
FFMIN(rmn_bits, nbits)) > 0)
1892 FFMIN(nbits - rmn_bits, rmn_bytes << 3));
1907 int *got_frame_ptr,
AVPacket *avpkt)
1924 if (!(
size %
ctx->block_align)) {
1926 s->spillover_nbits = 0;
1927 s->nb_superframes = 0;
1931 s->nb_superframes = res;
1937 if (
s->sframe_cache_size > 0) {
1939 if (cnt +
s->spillover_nbits > avpkt->
size * 8) {
1940 s->spillover_nbits = avpkt->
size * 8 - cnt;
1944 s->sframe_cache_size +=
s->spillover_nbits;
1947 cnt +=
s->spillover_nbits;
1948 s->skip_bits_next = cnt & 7;
1954 }
else if (
s->spillover_nbits) {
1957 }
else if (
s->skip_bits_next)
1961 s->sframe_cache_size = 0;
1962 s->skip_bits_next = 0;
1964 if (
s->nb_superframes-- == 0) {
1967 }
else if (
s->nb_superframes > 0) {
1970 }
else if (*got_frame_ptr) {
1972 s->skip_bits_next = cnt & 7;
1976 }
else if ((
s->sframe_cache_size =
pos) > 0) {
2002 .
p.
name =
"wmavoice",
int has_residual_lsps
if set, superframes contain one set of LSPs that cover all frames, encoded as independent and residua...
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static const float wmavoice_std_codebook[1000]
static int interpol(MBContext *s, uint32_t *color, int x, int y, int linesize)
#define MAX_LSPS
maximum filter order
int aw_next_pulse_off_cache
the position (relative to start of the second block) at which pulses should start to be positioned,...
int max_pitch_val
max value + 1 for pitch parsing
static int aw_pulse_set2(WMAVoiceContext *s, GetBitContext *gb, int block_idx, AMRFixed *fcb)
Apply second set of pitch-adaptive window pulses.
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
static int get_bits_left(GetBitContext *gb)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static const uint8_t wmavoice_dq_lsp10i[0xf00]
#define u(width, name, range_min, range_max)
static const struct frame_type_desc frame_descs[17]
#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)
static const uint8_t wmavoice_dq_lsp16r3[0x600]
static void dequant_lsps(double *lsps, int num, const uint16_t *values, const uint16_t *sizes, int n_stages, const uint8_t *table, const double *mul_q, const double *base_q)
Dequantize LSPs.
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
float excitation_history[MAX_SIGNAL_HISTORY]
cache of the signal of previous superframes, used as a history for signal generation
static int get_bits_count(const GetBitContext *s)
@ ACB_TYPE_NONE
no adaptive codebook (only hardcoded fixed)
int av_log2_16bit(unsigned v)
This structure describes decoded (raw) audio or video data.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
static void aw_pulse_set1(WMAVoiceContext *s, GetBitContext *gb, int block_idx, AMRFixed *fcb)
Apply first set of pitch-adaptive window pulses.
void ff_acelp_apply_order_2_transfer_function(float *out, const float *in, const float zero_coeffs[2], const float pole_coeffs[2], float gain, float mem[2], int n)
Apply an order 2 rational transfer function in-place.
RDFTContext irdft
contexts for FFT-calculation in the postfilter (for denoise filter)
static int pRNG(int frame_cntr, int block_num, int block_size)
Generate a random number from frame_cntr and block_idx, which will live in the range [0,...
const FFCodec ff_wmavoice_decoder
static const uint16_t table[]
float silence_gain
set for use in blocks if ACB_TYPE_NONE
int denoise_filter_cache_size
samples in denoise_filter_cache
static const float wmavoice_denoise_power_table[12][64]
LUT for f(x,y) = pow((y + 6.9) / 64, 0.025 * (x + 1)).
#define AV_CHANNEL_LAYOUT_MONO
static const float wmavoice_gain_codebook_acb[128]
void ff_celp_lp_synthesis_filterf(float *out, const float *filter_coeffs, const float *in, int buffer_length, int filter_length)
LP synthesis filter.
int aw_idx_is_ext
whether the AW index was encoded in 8 bits (instead of 6)
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
int dc_level
Predicted amount of DC noise, based on which a DC removal filter is used.
static const uint8_t wmavoice_dq_lsp16i1[0x640]
uint16_t block_conv_table[4]
boundaries for block pitch unit/scale conversion
uint8_t log_n_blocks
log2(n_blocks)
@ FCB_TYPE_HARDCODED
hardcoded (fixed) codebook with per-block gain values
static void skip_bits(GetBitContext *s, int n)
int aw_pulse_range
the range over which aw_pulse_set1() can apply the pulse, relative to the value in aw_first_pulse_off...
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length)
Copy the content of src to the bitstream.
AVCodec p
The public AVCodec.
float tilted_lpcs_pf[0x80]
aligned buffer for LPC tilting
static av_cold void wmavoice_flush(AVCodecContext *ctx)
static int put_bits_left(PutBitContext *s)
av_cold void ff_rdft_end(RDFTContext *s)
static void calc_input_response(WMAVoiceContext *s, float *lpcs, int fcb_type, float *coeffs, int remainder)
Derive denoise filter coefficients (in real domain) from the LPCs.
uint8_t n_blocks
amount of blocks per frame (each block (contains 160/n_blocks samples)
static double val(void *priv, double ch)
static void dequant_lsp10i(GetBitContext *gb, double *lsps)
Parse 10 independently-coded LSPs.
static void synth_block(WMAVoiceContext *s, GetBitContext *gb, int block_idx, int size, int block_pitch_sh2, const double *lsps, const double *prev_lsps, const struct frame_type_desc *frame_desc, float *excitation, float *synth)
Parse data in a single block.
#define MAX_SFRAMESIZE
maximum number of samples per superframe
static const float wmavoice_gain_codebook_fcb[128]
float denoise_filter_cache[MAX_FRAMESIZE]
static __device__ float fabsf(float a)
static int ff_thread_once(char *control, void(*routine)(void))
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
#define MAX_LSPS_ALIGN16
same as MAX_LSPS; needs to be multiple
void av_memcpy_backptr(uint8_t *dst, int back, int cnt)
Overlapping memcpy() implementation.
static const uint8_t wmavoice_dq_lsp10r[0x1400]
#define FF_CODEC_DECODE_CB(func)
int sframe_cache_size
set to >0 if we have data from an (incomplete) superframe from a previous packet that spilled over in...
int lsp_q_mode
defines quantizer defaults [0, 1]
uint8_t fcb_type
Fixed codebook type (FCB_TYPE_*)
#define log_range(var, assign)
double prev_lsps[MAX_LSPS]
LSPs of the last frame of the previous superframe.
int aw_n_pulses[2]
number of AW-pulses in each block; note that this number can be negative (in which case it basically ...
Sparse representation for the algebraic codebook (fixed) vector.
static void adaptive_gain_control(float *out, const float *in, const float *speech_synth, int size, float alpha, float *gain_mem)
Adaptive gain control (as used in postfilter).
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static const float wmavoice_lsp16_intercoeff_a[32][2][16]
static const double wmavoice_mean_lsf10[2][10]
int spillover_nbits
number of bits of the previous packet's last superframe preceding this packet's first full superframe...
static av_always_inline unsigned UMULH(unsigned a, unsigned b)
static const float wmavoice_gain_silence[256]
int8_t vbm_tree[25]
converts VLC codes to frame type
static float mul(float src0, float src1)
static const uint8_t wmavoice_dq_lsp16i3[0x300]
static void postfilter(WMAVoiceContext *s, const float *synth, float *samples, int size, const float *lpcs, float *zero_exc_pf, int fcb_type, int pitch)
Averaging projection filter, the postfilter used in WMAVoice.
static const int sizes[][2]
int history_nsamples
number of samples in history for signal prediction (through ACB)
float synth_history[MAX_LSPS]
see excitation_history
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static const uint8_t last_coeff[3]
int denoise_strength
strength of denoising in Wiener filter [0-11]
#define MAX_SIGNAL_HISTORY
maximum excitation signal history
uint8_t sframe_cache[SFRAME_CACHE_MAXSIZE+AV_INPUT_BUFFER_PADDING_SIZE]
cache for superframe data split over multiple packets
static unsigned int get_bits1(GetBitContext *s)
static void dequant_lsp10r(GetBitContext *gb, double *i_lsps, const double *old, double *a1, double *a2, int q_mode)
Parse 10 independently-coded LSPs, and then derive the tables to generate LSPs for the other frames f...
int pitch_nbits
number of bits used to specify the pitch value in the frame header
int block_delta_pitch_nbits
number of bits used to specify the delta pitch between this and the last block's pitch value,...
static int kalman_smoothen(WMAVoiceContext *s, int pitch, const float *in, float *out, int size)
Kalman smoothing function.
float denoise_coeffs_pf[0x80]
aligned buffer for denoise coefficients
int skip_bits_next
number of bits to skip at the next call to wmavoice_decode_packet() (since they're part of the previo...
static __device__ float sqrtf(float a)
#define MAX_FRAMESIZE
maximum number of samples per frame
#define MAX_FRAMES
maximum number of frames per superframe
static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, int bits, int max_depth)
Parse a vlc code.
static av_cold int decode_vbmtree(GetBitContext *gb, int8_t vbm_tree[25])
Set up the variable bit mode (VBM) tree from container extradata.
static void aw_parse_coords(WMAVoiceContext *s, GetBitContext *gb, const int *pitch)
Parse the offset of the first pitch-adaptive window pulses, and the distribution of pulses between th...
static av_cold void wmavoice_init_static_data(void)
void av_channel_layout_uninit(AVChannelLayout *channel_layout)
Free any allocated data in the channel layout and reset the channel count to 0.
float dcf_mem[2]
DC filter history.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
static int parse_packet_header(WMAVoiceContext *s)
Parse the packet header at the start of each packet (input data to this decoder).
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
An AVChannelLayout holds information about the channel layout of audio data.
static VLC frame_type_vlc
Frame type VLC coding.
int spillover_bitsize
number of bits used to specify spillover_nbits in the packet header = ceil(log2(ctx->block_align << 3...
PutBitContext pb
bitstream writer for sframe_cache
int last_pitch_val
pitch value of the previous frame
static void wiener_denoise(WMAVoiceContext *s, int fcb_type, float *synth_pf, int size, const float *lpcs)
This function applies a Wiener filter on the (noisy) speech signal as a means to denoise it.
static const float wmavoice_lsp10_intercoeff_b[32][2][10]
static void dequant_lsp16i(GetBitContext *gb, double *lsps)
Parse 16 independently-coded LSPs.
static const uint8_t wmavoice_dq_lsp16r1[0x500]
int aw_first_pulse_off[2]
index of first sample to which to apply AW-pulses, or -0xff if unset
float zero_exc_pf[MAX_SIGNAL_HISTORY+MAX_SFRAMESIZE]
zero filter output (i.e.
static const uint8_t wmavoice_dq_lsp16r2[0x500]
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
Description of frame types.
int block_pitch_range
range of the block pitch
static void stabilize_lsps(double *lsps, int num)
Ensure minimum value for first item, maximum value for last value, proper spacing between each value ...
av_cold void ff_dct_end(DCTContext *s)
void ff_tilt_compensation(float *mem, float tilt, float *samples, int size)
Apply tilt compensation filter, 1 - tilt * z-1.
static const float wmavoice_energy_table[128]
LUT for 1.071575641632 * pow(1.0331663, n - 127)
void ff_sine_window_init(float *window, int n)
Generate a sine window.
static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
Set up decoder with parameters from demuxer (extradata etc.).
int block_delta_pitch_hrange
1/2 range of the delta (full range is from -this to +this-1)
static const float wmavoice_ipol2_coeffs[32]
Hamming-window sinc function (num = 32, x = [ 0, 31 ]): (0.54 + 0.46 * cos(2 * M_PI * x / (num - 1)))...
av_cold int ff_rdft_init(RDFTContext *s, int nbits, enum RDFTransformType trans)
Set up a real FFT.
#define DECLARE_ALIGNED(n, t, v)
int pitch_diff_sh16
((cur_pitch_val - last_pitch_val) << 16) / MAX_FRAMESIZE
float gain_pred_err[6]
cache for gain prediction
av_cold int ff_dct_init(DCTContext *s, int nbits, enum DCTTransformType inverse)
Set up DCT.
#define i(width, name, range_min, range_max)
int nb_superframes
number of superframes in current packet
float cos[511]
8-bit cosine/sine windows over [-pi,pi] range
@ ACB_TYPE_ASYMMETRIC
adaptive codebook with per-frame pitch, which we interpolate to get a per-sample pitch.
int denoise_tilt_corr
Whether to apply tilt correction to the Wiener filter coefficients (postfilter)
static const float wmavoice_lsp16_intercoeff_b[32][2][16]
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
void av_frame_unref(AVFrame *frame)
Unreference all the buffers referenced by frame and reset the frame fields.
void ff_weighted_vector_sumf(float *out, const float *in_a, const float *in_b, float weight_coeff_a, float weight_coeff_b, int length)
float implementation of weighted sum of two vectors.
int lsp_def_mode
defines different sets of LSP defaults [0, 1]
static const float wmavoice_gain_universal[64]
const char * name
Name of the codec implementation.
float synth_filter_out_buf[0x80+MAX_LSPS_ALIGN16]
aligned buffer for postfilter speech synthesis
static float tilt_factor(const float *lpcs, int n_lpcs)
Get the tilt factor of a formant filter from its transfer function.
#define VLC_NBITS
number of bits to read per VLC iteration
Windows Media Voice (WMAVoice) tables.
int min_pitch_val
base value for pitch parsing code
int last_acb_type
frame type [0-2] of the previous frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
void ff_celp_lp_zero_synthesis_filterf(float *out, const float *filter_coeffs, const float *in, int buffer_length, int filter_length)
LP zero synthesis filter.
int do_apf
whether to apply the averaged projection filter (APF)
static const uint8_t wmavoice_dq_lsp16i2[0x3c0]
#define AV_INPUT_BUFFER_PADDING_SIZE
static const double wmavoice_mean_lsf16[2][16]
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
static av_cold int wmavoice_decode_end(AVCodecContext *ctx)
int lsps
number of LSPs per frame [10 or 16]
main external API structure.
static int wmavoice_decode_packet(AVCodecContext *ctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)
Packet decoding: a packet is anything that the (ASF) demuxer contains, and we expect that the demuxer...
DCTContext dst
contexts for phase shift (in Hilbert transform, part of postfilter)
int block_pitch_nbits
number of bits used to specify the first block's pitch value
@ ACB_TYPE_HAMMING
Per-block pitch with signal generation using a Hamming sinc window function.
static int synth_superframe(AVCodecContext *ctx, AVFrame *frame, int *got_frame_ptr)
Synthesize output samples for a single superframe.
int frame_cntr
current frame index [0 - 0xFFFE]; is only used for comfort noise in pRNG()
static const float wmavoice_ipol1_coeffs[17 *9]
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return values
void ff_set_fixed_vector(float *out, const AMRFixed *in, float scale, int size)
Add fixed vector to an array from a sparse representation.
static const float mean_lsf[10]
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Filter the word “frame” indicates either a video frame or a group of audio samples
static void copy_bits(PutBitContext *pb, const uint8_t *data, int size, GetBitContext *gb, int nbits)
Copy (unaligned) bits from gb/data/size to pb.
float avpriv_scalarproduct_float_c(const float *v1, const float *v2, int len)
Return the scalar product of two vectors.
static int synth_frame(AVCodecContext *ctx, GetBitContext *gb, int frame_idx, float *samples, const double *lsps, const double *prev_lsps, float *excitation, float *synth)
Synthesize output samples for a single frame.
#define AV_CODEC_CAP_SUBFRAMES
Codec can output multiple frames per AVPacket Normally demuxers return one frame at a time,...
GetBitContext gb
packet bitreader.
#define avpriv_request_sample(...)
static void synth_block_fcb_acb(WMAVoiceContext *s, GetBitContext *gb, int block_idx, int size, int block_pitch_sh2, const struct frame_type_desc *frame_desc, float *excitation)
Parse FCB/ACB signal for a single block.
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
static const int16_t alpha[]
This structure stores compressed data.
static void synth_block_hardcoded(WMAVoiceContext *s, GetBitContext *gb, int block_idx, int size, const struct frame_type_desc *frame_desc, float *excitation)
Parse hardcoded signal for a single block.
#define SFRAME_CACHE_MAXSIZE
maximum cache size for frame data that
#define flags(name, subs,...)
static const float wmavoice_lsp10_intercoeff_a[32][2][10]
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static void dequant_lsp16r(GetBitContext *gb, double *i_lsps, const double *old, double *a1, double *a2, int q_mode)
Parse 16 independently-coded LSPs, and then derive the tables to generate LSPs for the other frames f...
uint8_t dbl_pulses
how many pulse vectors have pulse pairs (rather than just one single pulse) only if fcb_type == FCB_T...
uint8_t acb_type
Adaptive codebook type (ACB_TYPE_*)
#define MAX_BLOCKS
maximum number of blocks per frame
void ff_acelp_lspd2lpc(const double *lsp, float *lpc, int lp_half_order)
Reconstruct LPC coefficients from the line spectral pair frequencies.
@ FCB_TYPE_AW_PULSES
Pitch-adaptive window (AW) pulse signals, used in particular for low-bitrate streams.
float postfilter_agc
gain control memory, used in adaptive_gain_control()
static const int8_t pulses[4]
Number of non-zero pulses in the MP-MLQ excitation.
void ff_acelp_interpolatef(float *out, const float *in, const float *filter_coeffs, int precision, int frac_pos, int filter_length, int length)
Floating point version of ff_acelp_interpolate()
@ FCB_TYPE_EXC_PULSES
Innovation (fixed) codebook pulse sets in combinations of either single pulses or pulse pairs.
void * priv_data
Format private data.
@ FCB_TYPE_SILENCE
comfort noise during silence generated from a hardcoded (fixed) codebook with per-frame (low) gain va...
WMA Voice decoding context.