Lines Matching +full:- +full:lm
1 /* Copyright (c) 2007-2008 CSIRO
2 Copyright (c) 2007-2010 Xiph.Org Foundation
4 Written by Jean-Marc Valin and Gregory Maxwell */
10 - Redistributions of source code must retain the above copyright
13 - Redistributions in binary form must reproduce the above copyright
59 /* The maximum pitch lag to allow in the pitch-based PLC. It's possible to save
63 /* The minimum pitch lag to allow in the pitch-based PLC. This corresponds to a
117 celt_sig _decode_mem[1]; /* Size = channels*(DECODE_BUFFER_SIZE+mode->overlap) */
119 /* opus_val16 oldEBands[], Size = 2*mode->nbEBands */
120 /* opus_val16 oldLogE[], Size = 2*mode->nbEBands */
121 /* opus_val16 oldLogE2[], Size = 2*mode->nbEBands */
122 /* opus_val16 backgroundLogE[], Size = 2*mode->nbEBands */
131 celt_assert(st->mode == opus_custom_mode_create(48000, 960, NULL)); in validate_celt_decoder()
132 celt_assert(st->overlap == 120); in validate_celt_decoder()
133 celt_assert(st->end <= 21); in validate_celt_decoder()
139 celt_assert(st->end <= 25); in validate_celt_decoder()
141 celt_assert(st->channels == 1 || st->channels == 2); in validate_celt_decoder()
142 celt_assert(st->stream_channels == 1 || st->stream_channels == 2); in validate_celt_decoder()
143 celt_assert(st->downsample > 0); in validate_celt_decoder()
144 celt_assert(st->start == 0 || st->start == 17); in validate_celt_decoder()
145 celt_assert(st->start < st->end); in validate_celt_decoder()
147 celt_assert(st->arch >= 0); in validate_celt_decoder()
148 celt_assert(st->arch <= OPUS_ARCHMASK); in validate_celt_decoder()
150 celt_assert(st->last_pitch_index <= PLC_PITCH_LAG_MAX); in validate_celt_decoder()
151 celt_assert(st->last_pitch_index >= PLC_PITCH_LAG_MIN || st->last_pitch_index == 0); in validate_celt_decoder()
152 celt_assert(st->postfilter_period < MAX_PERIOD); in validate_celt_decoder()
153 celt_assert(st->postfilter_period >= COMBFILTER_MINPERIOD || st->postfilter_period == 0); in validate_celt_decoder()
154 celt_assert(st->postfilter_period_old < MAX_PERIOD); in validate_celt_decoder()
155 celt_assert(st->postfilter_period_old >= COMBFILTER_MINPERIOD || st->postfilter_period_old == 0); in validate_celt_decoder()
156 celt_assert(st->postfilter_tapset <= 2); in validate_celt_decoder()
157 celt_assert(st->postfilter_tapset >= 0); in validate_celt_decoder()
158 celt_assert(st->postfilter_tapset_old <= 2); in validate_celt_decoder()
159 celt_assert(st->postfilter_tapset_old >= 0); in validate_celt_decoder()
172 + (channels*(DECODE_BUFFER_SIZE+mode->overlap)-1)*sizeof(celt_sig) in opus_custom_decoder_get_size()
174 + 4*2*mode->nbEBands*sizeof(opus_val16); in opus_custom_decoder_get_size()
201 st->downsample = resampling_factor(sampling_rate); in celt_decoder_init()
202 if (st->downsample==0) in celt_decoder_init()
218 st->mode = mode; in opus_custom_decoder_init()
219 st->overlap = mode->overlap; in opus_custom_decoder_init()
220 st->stream_channels = st->channels = channels; in opus_custom_decoder_init()
222 st->downsample = 1; in opus_custom_decoder_init()
223 st->start = 0; in opus_custom_decoder_init()
224 st->end = st->mode->effEBands; in opus_custom_decoder_init()
225 st->signalling = 1; in opus_custom_decoder_init()
227 st->disable_inv = channels == 1; in opus_custom_decoder_init()
229 st->disable_inv = 0; in opus_custom_decoder_init()
231 st->arch = opus_select_arch(); in opus_custom_decoder_init()
319 - MULT16_32_Q15(coef1, x[j]); in deemphasis()
328 /* Shortcut for the standard (non-custom modes) case */ in deemphasis()
337 /* Shortcut for the standard (non-custom modes) case */ in deemphasis()
362 /* Perform down-sampling */ in deemphasis()
384 int isTransient, int LM, int downsample, in celt_synthesis() argument
398 overlap = mode->overlap; in celt_synthesis()
399 nbEBands = mode->nbEBands; in celt_synthesis()
400 N = mode->shortMdctSize<<LM; in celt_synthesis()
402 M = 1<<LM; in celt_synthesis()
407 NB = mode->shortMdctSize; in celt_synthesis()
408 shift = mode->maxLM; in celt_synthesis()
411 NB = mode->shortMdctSize<<LM; in celt_synthesis()
412 shift = mode->maxLM-LM; in celt_synthesis()
425 … clt_mdct_backward(&mode->mdct, &freq2[b], out_syn[0]+NB*b, mode->window, overlap, shift, B, arch); in celt_synthesis()
427 … clt_mdct_backward(&mode->mdct, &freq[b], out_syn[1]+NB*b, mode->window, overlap, shift, B, arch); in celt_synthesis()
441 … clt_mdct_backward(&mode->mdct, &freq[b], out_syn[0]+NB*b, mode->window, overlap, shift, B, arch); in celt_synthesis()
448 … clt_mdct_backward(&mode->mdct, &freq[b], out_syn[c]+NB*b, mode->window, overlap, shift, B, arch); in celt_synthesis()
460 static void tf_decode(int start, int end, int isTransient, int *tf_res, int LM, ec_dec *dec) in tf_decode() argument
469 budget = dec->storage*8; in tf_decode()
472 tf_select_rsv = LM>0 && tell+logp+1<=budget; in tf_decode()
473 budget -= tf_select_rsv; in tf_decode()
488 tf_select_table[LM][4*isTransient+0+tf_changed] != in tf_decode()
489 tf_select_table[LM][4*isTransient+2+tf_changed]) in tf_decode()
495 tf_res[i] = tf_select_table[LM][4*isTransient+2*tf_select+tf_res[i]]; in tf_decode()
508 DECODE_BUFFER_SIZE-PLC_PITCH_LAG_MAX, in celt_plc_pitch_search()
509 PLC_PITCH_LAG_MAX-PLC_PITCH_LAG_MIN, &pitch_index, arch); in celt_plc_pitch_search()
510 pitch_index = PLC_PITCH_LAG_MAX-pitch_index; in celt_plc_pitch_search()
524 mode = st->mode; in prefilter_and_fold()
525 overlap = st->overlap; in prefilter_and_fold()
526 CC = st->channels; in prefilter_and_fold()
529 decode_mem[c] = st->_decode_mem + c*(DECODE_BUFFER_SIZE+overlap); in prefilter_and_fold()
533 /* Apply the pre-filter to the MDCT overlap for the next frame because in prefilter_and_fold()
534 the post-filter will be re-applied in the decoder after the MDCT in prefilter_and_fold()
536 comb_filter(etmp, decode_mem[c]+DECODE_BUFFER_SIZE-N, in prefilter_and_fold()
537 st->postfilter_period_old, st->postfilter_period, overlap, in prefilter_and_fold()
538 -st->postfilter_gain_old, -st->postfilter_gain, in prefilter_and_fold()
539 st->postfilter_tapset_old, st->postfilter_tapset, NULL, 0, st->arch); in prefilter_and_fold()
545 decode_mem[c][DECODE_BUFFER_SIZE-N+i] = in prefilter_and_fold()
546 MULT16_32_Q15(mode->window[i], etmp[overlap-1-i]) in prefilter_and_fold()
547 + MULT16_32_Q15(mode->window[overlap-i-1], etmp[i]); in prefilter_and_fold()
555 /* h=cos(pi/2*abs(sin([-24:24]/48*pi*23./24)).^2);
556 b=sinc([-24:24]/3*1.02).*h;
559 …4.2931e-05f, -0.000190293f, -0.000816132f, -0.000637162f, 0.00141662f, 0.00354764f, 0.00184368f, -…
560 …-0.00856105f, -0.0034003f, 0.00930201f, 0.0159616f, 0.00489785f, -0.0169649f, -0.0259484f, -0.0059…
561 …0.0286551f, 0.0405872f, 0.00649994f, -0.0509284f, -0.0716655f, -0.00665212f, 0.134336f, 0.278927…
562 …0.339995f, 0.278927f, 0.134336f, -0.00665212f, -0.0716655f, -0.0509284f, 0.00649994f, 0.0405872f,
563 …0.0286551f, -0.00596856f, -0.0259484f, -0.0169649f, 0.00489785f, 0.0159616f, 0.00930201f, -0.00340…
564 …-0.00856105f, -0.00428274f, 0.00184368f, 0.00354764f, 0.00141662f, -0.000637162f, -0.000816132f, -…
565 4.2931e-05f
581 /* Down-sample the last 40 ms. */ in update_plc_state()
582 for (i=1;i<DECODE_BUFFER_SIZE;i++) buf48k[i] += PREEMPHASIS*buf48k[i-1]; in update_plc_state()
583 *plc_preemphasis_mem = buf48k[DECODE_BUFFER_SIZE-1]; in update_plc_state()
584 offset = DECODE_BUFFER_SIZE-SINC_ORDER-1 - 3*(PLC_UPDATE_SAMPLES-1); in update_plc_state()
585 celt_assert(3*(PLC_UPDATE_SAMPLES-1) + SINC_ORDER + offset == DECODE_BUFFER_SIZE-1); in update_plc_state()
592 buf16k[i] = float2int(MIN32(32767.f, MAX32(-32767.f, sum))); in update_plc_state()
594 tmp_read_post = lpcnet->fec_read_pos; in update_plc_state()
595 tmp_fec_skip = lpcnet->fec_skip; in update_plc_state()
599 lpcnet->fec_read_pos = tmp_read_post; in update_plc_state()
600 lpcnet->fec_skip = tmp_fec_skip; in update_plc_state()
604 static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, int N, int LM in celt_decode_lost() argument
612 const int C = st->channels; in celt_decode_lost()
626 mode = st->mode; in celt_decode_lost()
627 nbEBands = mode->nbEBands; in celt_decode_lost()
628 overlap = mode->overlap; in celt_decode_lost()
629 eBands = mode->eBands; in celt_decode_lost()
632 decode_mem[c] = st->_decode_mem + c*(DECODE_BUFFER_SIZE+overlap); in celt_decode_lost()
633 out_syn[c] = decode_mem[c]+DECODE_BUFFER_SIZE-N; in celt_decode_lost()
635 lpc = (opus_val16*)(st->_decode_mem+(DECODE_BUFFER_SIZE+overlap)*C); in celt_decode_lost()
641 loss_duration = st->loss_duration; in celt_decode_lost()
642 start = st->start; in celt_decode_lost()
644 noise_based = start != 0 || (lpcnet->fec_fill_pos == 0 && (st->skip_plc || loss_duration >= 80)); in celt_decode_lost()
646 noise_based = loss_duration >= 40 || start != 0 || st->skip_plc; in celt_decode_lost()
650 /* Noise-based PLC/CNG */ in celt_decode_lost()
656 end = st->end; in celt_decode_lost()
657 effEnd = IMAX(start, IMIN(end, mode->effEBands)); in celt_decode_lost()
662 DECODE_BUFFER_SIZE-N+overlap); in celt_decode_lost()
665 if (st->prefilter_and_fold) { in celt_decode_lost()
674 … oldBandE[c*nbEBands+i] = MAX16(backgroundLogE[c*nbEBands+i], oldBandE[c*nbEBands+i] - decay); in celt_decode_lost()
676 seed = st->rng; in celt_decode_lost()
684 boffs = N*c+(eBands[i]<<LM); in celt_decode_lost()
685 blen = (eBands[i+1]-eBands[i])<<LM; in celt_decode_lost()
691 renormalise_vector(X+boffs, blen, Q15ONE, st->arch); in celt_decode_lost()
694 st->rng = seed; in celt_decode_lost()
696 …celt_synthesis(mode, X, out_syn, oldBandE, start, effEnd, C, C, 0, LM, st->downsample, 0, st->arch… in celt_decode_lost()
697 st->prefilter_and_fold = 0; in celt_decode_lost()
699 st->skip_plc = 1; in celt_decode_lost()
702 /* Pitch-based PLC */ in celt_decode_lost()
713 if (lpcnet->loaded) update_plc_state(lpcnet, decode_mem, &st->plc_preemphasis_mem, C); in celt_decode_lost()
715 st->last_pitch_index = pitch_index = celt_plc_pitch_search(decode_mem, C, st->arch); in celt_decode_lost()
717 pitch_index = st->last_pitch_index; in celt_decode_lost()
728 window = mode->window; in celt_decode_lost()
740 … exc[i-CELT_LPC_ORDER] = SROUND16(buf[DECODE_BUFFER_SIZE-MAX_PERIOD-CELT_LPC_ORDER+i], SIG_SHIFT); in celt_decode_lost()
746 the first loss so we can work in the excitation-filter domain. */ in celt_decode_lost()
748 CELT_LPC_ORDER, MAX_PERIOD, st->arch); in celt_decode_lost()
749 /* Add a noise floor of -40 dB. */ in celt_decode_lost()
755 /* Use lag windowing to stabilize the Levinson-Durbin recursion. */ in celt_decode_lost()
758 /*ac[i] *= exp(-.5*(2*M_PI*.002*i)*(2*M_PI*.002*i));*/ in celt_decode_lost()
760 ac[i] -= MULT16_32_Q15(2*i*i, ac[i]); in celt_decode_lost()
762 ac[i] -= ac[i]*(0.008f*0.008f)*i*i; in celt_decode_lost()
767 /* For fixed-point, apply bandwidth expansion until we can guarantee that in celt_decode_lost()
788 because celt_fir() cannot filter in-place. */ in celt_decode_lost()
789 celt_fir(exc+MAX_PERIOD-exc_length, lpc+c*CELT_LPC_ORDER, in celt_decode_lost()
790 fir_tmp, exc_length, CELT_LPC_ORDER, st->arch); in celt_decode_lost()
791 OPUS_COPY(exc+MAX_PERIOD-exc_length, fir_tmp, exc_length); in celt_decode_lost()
801 … int shift = IMAX(0,2*celt_zlog2(celt_maxabs16(&exc[MAX_PERIOD-exc_length], exc_length))-20); in celt_decode_lost()
807 e = exc[MAX_PERIOD-decay_length+i]; in celt_decode_lost()
809 e = exc[MAX_PERIOD-2*decay_length+i]; in celt_decode_lost()
819 OPUS_MOVE(buf, buf+N, DECODE_BUFFER_SIZE-N); in celt_decode_lost()
824 extrapolation_offset = MAX_PERIOD-pitch_index; in celt_decode_lost()
834 j -= pitch_index; in celt_decode_lost()
837 buf[DECODE_BUFFER_SIZE-N+i] = in celt_decode_lost()
843 buf[DECODE_BUFFER_SIZE-MAX_PERIOD-N+extrapolation_offset+j], in celt_decode_lost()
852 lpc_mem[i] = SROUND16(buf[DECODE_BUFFER_SIZE-N-1-i], SIG_SHIFT); in celt_decode_lost()
855 celt_iir(buf+DECODE_BUFFER_SIZE-N, lpc+c*CELT_LPC_ORDER, in celt_decode_lost()
856 buf+DECODE_BUFFER_SIZE-N, extrapolation_len, CELT_LPC_ORDER, in celt_decode_lost()
857 lpc_mem, st->arch); in celt_decode_lost()
860 buf[DECODE_BUFFER_SIZE-N+i] = SATURATE(buf[DECODE_BUFFER_SIZE-N+i], SIG_SAT); in celt_decode_lost()
871 opus_val16 tmp = SROUND16(buf[DECODE_BUFFER_SIZE-N+i], SIG_SHIFT); in celt_decode_lost()
884 buf[DECODE_BUFFER_SIZE-N+i] = 0; in celt_decode_lost()
891 - MULT16_16_Q15(window[i], Q15ONE-ratio); in celt_decode_lost()
892 buf[DECODE_BUFFER_SIZE-N+i] = in celt_decode_lost()
893 MULT16_32_Q15(tmp_g, buf[DECODE_BUFFER_SIZE-N+i]); in celt_decode_lost()
897 buf[DECODE_BUFFER_SIZE-N+i] = in celt_decode_lost()
898 MULT16_32_Q15(ratio, buf[DECODE_BUFFER_SIZE-N+i]); in celt_decode_lost()
906 if (lpcnet->loaded && (st->complexity >= 5 || lpcnet->fec_fill_pos > 0)) { in celt_decode_lost()
914 OPUS_COPY(buf_copy+c*overlap, &decode_mem[c][DECODE_BUFFER_SIZE-N], overlap); in celt_decode_lost()
921 st->plc_fill = 0; in celt_decode_lost()
923 while (st->plc_fill < samples_needed16k) { in celt_decode_lost()
924 lpcnet_plc_conceal(lpcnet, &st->plc_pcm[st->plc_fill]); in celt_decode_lost()
925 st->plc_fill += FRAME_SIZE; in celt_decode_lost()
931 for (sum=0, j=0;j<17;j++) sum += 3*st->plc_pcm[i+j]*sinc_filter[3*j]; in celt_decode_lost()
932 buf[DECODE_BUFFER_SIZE-N+3*i] = sum; in celt_decode_lost()
933 for (sum=0, j=0;j<16;j++) sum += 3*st->plc_pcm[i+j+1]*sinc_filter[3*j+2]; in celt_decode_lost()
934 buf[DECODE_BUFFER_SIZE-N+3*i+1] = sum; in celt_decode_lost()
935 for (sum=0, j=0;j<16;j++) sum += 3*st->plc_pcm[i+j+1]*sinc_filter[3*j+1]; in celt_decode_lost()
936 buf[DECODE_BUFFER_SIZE-N+3*i+2] = sum; in celt_decode_lost()
938 OPUS_MOVE(st->plc_pcm, &st->plc_pcm[N/3], st->plc_fill-N/3); in celt_decode_lost()
939 st->plc_fill -= N/3; in celt_decode_lost()
941 float tmp = buf[DECODE_BUFFER_SIZE-N+i]; in celt_decode_lost()
942 buf[DECODE_BUFFER_SIZE-N+i] -= PREEMPHASIS*st->plc_preemphasis_mem; in celt_decode_lost()
943 st->plc_preemphasis_mem = tmp; in celt_decode_lost()
945 overlap_mem = st->plc_preemphasis_mem; in celt_decode_lost()
948 buf[DECODE_BUFFER_SIZE+i] -= PREEMPHASIS*overlap_mem; in celt_decode_lost()
954 … /* Cross-fade with 48-kHz non-neural PLC for the first 2.5 ms to avoid a discontinuity. */ in celt_decode_lost()
956 …ecode_mem[c][DECODE_BUFFER_SIZE-N+i] = (1-window[i])*buf_copy[c*overlap+i] + (window[i])*decode_me… in celt_decode_lost()
961 st->prefilter_and_fold = 1; in celt_decode_lost()
964 /* Saturate to soemthing large to avoid wrap-around. */ in celt_decode_lost()
965 st->loss_duration = IMIN(10000, loss_duration+(1<<LM)); in celt_decode_lost()
997 const int CC = st->channels;
998 int LM, M; local
1016 int C = st->stream_channels;
1025 mode = st->mode;
1026 nbEBands = mode->nbEBands;
1027 overlap = mode->overlap;
1028 eBands = mode->eBands;
1029 start = st->start;
1030 end = st->end;
1031 frame_size *= st->downsample;
1033 lpc = (opus_val16*)(st->_decode_mem+(DECODE_BUFFER_SIZE+overlap)*CC);
1040 if (st->signalling && data!=NULL)
1044 if (mode->Fs==48000 && mode->shortMdctSize==120)
1050 st->end = end = IMAX(1, mode->effEBands-2*(data0>>5));
1051 LM = (data0>>3)&0x3;
1054 len--;
1055 if (LM>mode->maxLM)
1057 if (frame_size < mode->shortMdctSize<<LM)
1060 frame_size = mode->shortMdctSize<<LM;
1065 for (LM=0;LM<=mode->maxLM;LM++)
1066 if (mode->shortMdctSize<<LM==frame_size)
1068 if (LM>mode->maxLM)
1071 M=1<<LM;
1076 N = M*mode->shortMdctSize;
1078 decode_mem[c] = st->_decode_mem + c*(DECODE_BUFFER_SIZE+overlap);
1079 out_syn[c] = decode_mem[c]+DECODE_BUFFER_SIZE-N;
1083 if (effEnd > mode->effEBands)
1084 effEnd = mode->effEBands;
1088 celt_decode_lost(st, N, LM
1093 deemphasis(out_syn, pcm, N, CC, st->downsample, mode->preemph, st->preemph_memD, accum);
1095 return frame_size/st->downsample;
1100 if (lpcnet) lpcnet->blend = 0;
1105 * turning on the pitch-based PLC */
1106 if (st->loss_duration == 0) st->skip_plc = 0;
1133 dec->nbits_total+=tell-ec_tell(dec);
1145 postfilter_pitch = (16<<octave)+ec_dec_bits(dec, 4+octave)-1;
1154 if (LM > 0 && tell+3 <= total_bits)
1171 if (!intra_ener && st->loss_duration != 0) {
1175 int missing = IMIN(10, st->loss_duration>>LM);
1176 if (LM==0) safety = QCONST16(1.5f,DB_SHIFT);
1177 else if (LM==1) safety = QCONST16(.5f,DB_SHIFT);
1187 slope = MAX32(E1 - E0, HALF32(E2 - E0));
1188 E0 -= MAX32(0, (1+missing)*slope);
1189 oldBandE[c*nbEBands+i] = MAX32(-QCONST16(20.f,DB_SHIFT), E0);
1194 /* Shorter frames have more natural fluctuations -- play it safe. */
1195 oldBandE[c*nbEBands+i] -= safety;
1201 intra_ener, dec, C, LM);
1204 tf_decode(start, end, isTransient, tf_res, LM, dec);
1213 init_caps(mode,cap,LM,C);
1225 width = C*(eBands[i+1]-eBands[i])<<LM;
1239 total_bits -= quanta;
1245 dynalloc_logp = IMAX(2, dynalloc_logp-1);
1252 bits = (((opus_int32)len*8)<<BITRES) - ec_tell_frac(dec) - 1;
1253 anti_collapse_rsv = isTransient&&LM>=2&&bits>=((LM+2)<<BITRES) ? (1<<BITRES) : 0;
1254 bits -= anti_collapse_rsv;
1261 fine_quant, fine_priority, C, LM, dec, 0, 0, 0);
1266 OPUS_MOVE(decode_mem[c], decode_mem[c]+N, DECODE_BUFFER_SIZE-N+overlap);
1276 len*(8<<BITRES)-anti_collapse_rsv, balance, dec, LM, codedBands, &st->rng, 0,
1277 st->arch, st->disable_inv);
1285 fine_quant, fine_priority, len*8-ec_tell(dec), dec, C);
1288 anti_collapse(mode, X, collapse_masks, LM, C, N,
1289 start, end, oldBandE, oldLogE, oldLogE2, pulses, st->rng, st->arch);
1294 oldBandE[i] = -QCONST16(28.f,DB_SHIFT);
1296 if (st->prefilter_and_fold) {
1300 C, CC, isTransient, LM, st->downsample, silence, st->arch);
1303 st->postfilter_period=IMAX(st->postfilter_period, COMBFILTER_MINPERIOD);
1304 st->postfilter_period_old=IMAX(st->postfilter_period_old, COMBFILTER_MINPERIOD);
1305 …comb_filter(out_syn[c], out_syn[c], st->postfilter_period_old, st->postfilter_period, mode->shortM…
1306 … st->postfilter_gain_old, st->postfilter_gain, st->postfilter_tapset_old, st->postfilter_tapset,
1307 mode->window, overlap, st->arch);
1308 if (LM!=0)
1309 …comb_filter(out_syn[c]+mode->shortMdctSize, out_syn[c]+mode->shortMdctSize, st->postfilter_period,…
1310 st->postfilter_gain, postfilter_gain, st->postfilter_tapset, postfilter_tapset,
1311 mode->window, overlap, st->arch);
1314 st->postfilter_period_old = st->postfilter_period;
1315 st->postfilter_gain_old = st->postfilter_gain;
1316 st->postfilter_tapset_old = st->postfilter_tapset;
1317 st->postfilter_period = postfilter_pitch;
1318 st->postfilter_gain = postfilter_gain;
1319 st->postfilter_tapset = postfilter_tapset;
1320 if (LM!=0)
1322 st->postfilter_period_old = st->postfilter_period;
1323 st->postfilter_gain_old = st->postfilter_gain;
1324 st->postfilter_tapset_old = st->postfilter_tapset;
1341 max_background_increase = IMIN(160, st->loss_duration+M)*QCONST16(0.001f,DB_SHIFT);
1350 oldLogE[c*nbEBands+i]=oldLogE2[c*nbEBands+i]=-QCONST16(28.f,DB_SHIFT);
1355 oldLogE[c*nbEBands+i]=oldLogE2[c*nbEBands+i]=-QCONST16(28.f,DB_SHIFT);
1358 st->rng = dec->rng;
1360 deemphasis(out_syn, pcm, N, CC, st->downsample, mode->preemph, st->preemph_memD, accum);
1361 st->loss_duration = 0;
1362 st->prefilter_and_fold = 0;
1367 st->error = 1;
1368 return frame_size/st->downsample;
1399 C = st->channels;
1429 C = st->channels;
1460 st->complexity = value;
1470 *value = st->complexity;
1476 if (value<0 || value>=st->mode->nbEBands)
1478 st->start = value;
1484 if (value<1 || value>st->mode->nbEBands)
1486 st->end = value;
1494 st->stream_channels = value;
1502 *value=st->error;
1503 st->error = 0;
1511 *value = st->overlap/st->downsample;
1518 lpc = (opus_val16*)(st->_decode_mem+(DECODE_BUFFER_SIZE+st->overlap)*st->channels);
1519 oldBandE = lpc+st->channels*CELT_LPC_ORDER;
1520 oldLogE = oldBandE + 2*st->mode->nbEBands;
1521 oldLogE2 = oldLogE + 2*st->mode->nbEBands;
1522 OPUS_CLEAR((char*)&st->DECODER_RESET_START,
1523 opus_custom_decoder_get_size(st->mode, st->channels)-
1524 ((char*)&st->DECODER_RESET_START - (char*)st));
1525 for (i=0;i<2*st->mode->nbEBands;i++)
1526 oldLogE[i]=oldLogE2[i]=-QCONST16(28.f,DB_SHIFT);
1527 st->skip_plc = 1;
1535 *value = st->postfilter_period;
1543 *value=st->mode;
1549 st->signalling = value;
1557 *value=st->rng;
1567 st->disable_inv = value;
1577 *value = st->disable_inv;