Lines Matching refs:st
118 CELTDecoder *st = (CELTDecoder *)opus_alloc(opus_custom_decoder_get_size(mode, channels)); in opus_custom_decoder_create() local
119 ret = opus_custom_decoder_init(st, mode, channels); in opus_custom_decoder_create()
122 opus_custom_decoder_destroy(st); in opus_custom_decoder_create()
123 st = NULL; in opus_custom_decoder_create()
127 return st; in opus_custom_decoder_create()
131 int celt_decoder_init(CELTDecoder *st, opus_int32 sampling_rate, int channels) in celt_decoder_init() argument
134 ret = opus_custom_decoder_init(st, opus_custom_mode_create(48000, 960, NULL), channels); in celt_decoder_init()
137 st->downsample = resampling_factor(sampling_rate); in celt_decoder_init()
138 if (st->downsample==0) in celt_decoder_init()
144 OPUS_CUSTOM_NOSTATIC int opus_custom_decoder_init(CELTDecoder *st, const CELTMode *mode, int channe… in opus_custom_decoder_init() argument
149 if (st==NULL) in opus_custom_decoder_init()
152 OPUS_CLEAR((char*)st, opus_custom_decoder_get_size(mode, channels)); in opus_custom_decoder_init()
154 st->mode = mode; in opus_custom_decoder_init()
155 st->overlap = mode->overlap; in opus_custom_decoder_init()
156 st->stream_channels = st->channels = channels; in opus_custom_decoder_init()
158 st->downsample = 1; in opus_custom_decoder_init()
159 st->start = 0; in opus_custom_decoder_init()
160 st->end = st->mode->effEBands; in opus_custom_decoder_init()
161 st->signalling = 1; in opus_custom_decoder_init()
162 st->arch = opus_select_arch(); in opus_custom_decoder_init()
164 st->loss_count = 0; in opus_custom_decoder_init()
166 opus_custom_decoder_ctl(st, OPUS_RESET_STATE); in opus_custom_decoder_init()
172 void opus_custom_decoder_destroy(CELTDecoder *st) in opus_custom_decoder_destroy() argument
174 opus_free(st); in opus_custom_decoder_destroy()
333 static void celt_decode_lost(CELTDecoder * OPUS_RESTRICT st, opus_val16 * OPUS_RESTRICT pcm, int N,… in celt_decode_lost() argument
337 const int C = st->channels; in celt_decode_lost()
353 mode = st->mode; in celt_decode_lost()
359 decode_mem[c] = st->_decode_mem + c*(DECODE_BUFFER_SIZE+overlap); in celt_decode_lost()
362 lpc = (opus_val16*)(st->_decode_mem+(DECODE_BUFFER_SIZE+overlap)*C); in celt_decode_lost()
368 loss_count = st->loss_count; in celt_decode_lost()
369 start = st->start; in celt_decode_lost()
370 downsample = st->downsample; in celt_decode_lost()
383 end = st->end; in celt_decode_lost()
404 seed = st->rng; in celt_decode_lost()
422 st->rng = seed; in celt_decode_lost()
451 DECODE_BUFFER_SIZE, C, st->arch); in celt_decode_lost()
454 PLC_PITCH_LAG_MAX-PLC_PITCH_LAG_MIN, &pitch_index, st->arch); in celt_decode_lost()
456 st->last_pitch_index = pitch_index; in celt_decode_lost()
458 pitch_index = st->last_pitch_index; in celt_decode_lost()
486 LPC_ORDER, MAX_PERIOD, st->arch); in celt_decode_lost()
632 st->postfilter_period, st->postfilter_period, overlap, in celt_decode_lost()
633 -st->postfilter_gain, -st->postfilter_gain, in celt_decode_lost()
634 st->postfilter_tapset, st->postfilter_tapset, NULL, 0); in celt_decode_lost()
648 mode->preemph, st->preemph_memD, scratch); in celt_decode_lost()
650 st->loss_count = loss_count+1; in celt_decode_lost()
655 int celt_decode_with_ec(CELTDecoder * OPUS_RESTRICT st, const unsigned char *data, int len, opus_va… argument
678 const int CC = st->channels;
695 int C = st->stream_channels;
702 mode = st->mode;
706 frame_size *= st->downsample;
709 decode_mem[c] = st->_decode_mem + c*(DECODE_BUFFER_SIZE+overlap);
711 lpc = (opus_val16*)(st->_decode_mem+(DECODE_BUFFER_SIZE+overlap)*CC);
718 if (st->signalling && data!=NULL)
728 st->end = IMAX(1, mode->effEBands-2*(data0>>5));
756 effEnd = st->end;
762 celt_decode_lost(st, pcm, N, LM);
764 return frame_size/st->downsample;
798 if (st->start==0 && tell+16 <= total_bits)
829 unquant_coarse_energy(mode, st->start, st->end, oldBandE,
833 tf_decode(st->start, st->end, isTransient, tf_res, LM, dec);
849 for (i=st->start;i<st->end;i++)
888 codedBands = compute_allocation(mode, st->start, st->end, offsets, cap,
892 unquant_fine_energy(mode, st->start, st->end, oldBandE, fine_quant, dec, C);
898 quant_all_bands(0, mode, st->start, st->end, X, C==2 ? X+N : NULL, collapse_masks,
900 len*(8<<BITRES)-anti_collapse_rsv, balance, dec, LM, codedBands, &st->rng);
907 unquant_energy_finalise(mode, st->start, st->end, oldBandE,
912 st->start, st->end, oldBandE, oldLogE, oldLogE2, pulses, st->rng);
924 denormalise_bands(mode, X, freq, oldBandE, st->start, effEnd, C, M);
932 if (st->downsample!=1)
933 bound = IMIN(bound, N/st->downsample);
957 st->postfilter_period=IMAX(st->postfilter_period, COMBFILTER_MINPERIOD);
958 st->postfilter_period_old=IMAX(st->postfilter_period_old, COMBFILTER_MINPERIOD);
959 …comb_filter(out_syn[c], out_syn[c], st->postfilter_period_old, st->postfilter_period, mode->shortM…
960 … st->postfilter_gain_old, st->postfilter_gain, st->postfilter_tapset_old, st->postfilter_tapset,
963 …comb_filter(out_syn[c]+mode->shortMdctSize, out_syn[c]+mode->shortMdctSize, st->postfilter_period,…
964 st->postfilter_gain, postfilter_gain, st->postfilter_tapset, postfilter_tapset,
968 st->postfilter_period_old = st->postfilter_period;
969 st->postfilter_gain_old = st->postfilter_gain;
970 st->postfilter_tapset_old = st->postfilter_tapset;
971 st->postfilter_period = postfilter_pitch;
972 st->postfilter_gain = postfilter_gain;
973 st->postfilter_tapset = postfilter_tapset;
976 st->postfilter_period_old = st->postfilter_period;
977 st->postfilter_gain_old = st->postfilter_gain;
978 st->postfilter_tapset_old = st->postfilter_tapset;
1001 for (i=0;i<st->start;i++)
1006 for (i=st->end;i<nbEBands;i++)
1012 st->rng = dec->rng;
1015 deemphasis(out_syn, pcm, N, CC, st->downsample, mode->preemph, st->preemph_memD, freq);
1016 st->loss_count = 0;
1021 st->error = 1;
1022 return frame_size/st->downsample;
1029 int opus_custom_decode(CELTDecoder * OPUS_RESTRICT st, const unsigned char *data, int len, opus_int… argument
1031 return celt_decode_with_ec(st, data, len, pcm, frame_size, NULL);
1035 int opus_custom_decode_float(CELTDecoder * OPUS_RESTRICT st, const unsigned char *data, int len, fl… argument
1044 C = st->channels;
1048 ret=celt_decode_with_ec(st, data, len, out, frame_size, NULL);
1060 int opus_custom_decode_float(CELTDecoder * OPUS_RESTRICT st, const unsigned char *data, int len, fl… argument
1062 return celt_decode_with_ec(st, data, len, pcm, frame_size, NULL);
1065 int opus_custom_decode(CELTDecoder * OPUS_RESTRICT st, const unsigned char *data, int len, opus_int… argument
1074 C = st->channels;
1078 ret=celt_decode_with_ec(st, data, len, out, frame_size, NULL);
1091 int opus_custom_decoder_ctl(CELTDecoder * OPUS_RESTRICT st, int request, ...) argument
1101 if (value<0 || value>=st->mode->nbEBands)
1103 st->start = value;
1109 if (value<1 || value>st->mode->nbEBands)
1111 st->end = value;
1119 st->stream_channels = value;
1127 *value=st->error;
1128 st->error = 0;
1136 *value = st->overlap/st->downsample;
1143 lpc = (opus_val16*)(st->_decode_mem+(DECODE_BUFFER_SIZE+st->overlap)*st->channels);
1144 oldBandE = lpc+st->channels*LPC_ORDER;
1145 oldLogE = oldBandE + 2*st->mode->nbEBands;
1146 oldLogE2 = oldLogE + 2*st->mode->nbEBands;
1147 OPUS_CLEAR((char*)&st->DECODER_RESET_START,
1148 opus_custom_decoder_get_size(st->mode, st->channels)-
1149 ((char*)&st->DECODER_RESET_START - (char*)st));
1150 for (i=0;i<2*st->mode->nbEBands;i++)
1159 *value = st->postfilter_period;
1167 *value=st->mode;
1173 st->signalling = value;
1181 *value=st->rng;