Lines Matching refs:ltp
44 put_bits(&s->pb, 1, ics->ltp.present);
45 if (!ics->ltp.present)
47 put_bits(&s->pb, 11, ics->ltp.lag);
48 put_bits(&s->pb, 3, ics->ltp.coef_idx);
50 put_bits(&s->pb, 1, ics->ltp.used[i]);
69 sce->ics.ltp.lag = 0;
75 static void get_lag(float *buf, const float *new, LongTermPrediction *ltp)
94 ltp->lag = FFMAX(av_clip_uintp2(lag, 11), 0);
95 ltp->coef_idx = quant_array_idx(max_ratio, ltp_coef, 8);
96 ltp->coef = ltp_coef[ltp->coef_idx];
99 static void generate_samples(float *buf, LongTermPrediction *ltp)
102 if (!ltp->lag) {
103 ltp->present = 0;
105 } else if (ltp->lag < 1024) {
106 samples_num = ltp->lag + 1024;
109 buf[i] = ltp->coef*buf[i + 2048 - ltp->lag];
126 get_lag(pred_signal, samples, &sce->ics.ltp);
127 generate_samples(pred_signal, &sce->ics.ltp);
139 sce0->ics.ltp.present = 0;
144 int sum = sce0->ics.ltp.used[sfb] + sce1->ics.ltp.used[sfb];
146 sce0->ics.ltp.used[sfb] = 0;
152 sce0->ics.ltp.present = !!count;
169 if (sce->ics.ltp.lag) {
171 memset(&sce->ics.ltp, 0, sizeof(LongTermPrediction));
176 if (!sce->ics.ltp.lag || s->lambda > 120.0f)
209 sce->ics.ltp.used[w*16+g] = 1;
217 sce->ics.ltp.present = !!count && (saved_bits >= 0);
218 sce->ics.predictor_present = !!sce->ics.ltp.present;
221 if (!sce->ics.ltp.present && !!count) {
225 if (sce->ics.ltp.used[w*16+g]) {