• Home
  • Raw
  • Download

Lines Matching refs:sce

59 static inline int ff_pns_bits(SingleChannelElement *sce, int w, int g)  in ff_pns_bits()  argument
61 return (!g || !sce->zeroes[w*16+g-1] || !sce->can_pns[w*16+g-1]) ? 9 : 5; in ff_pns_bits()
69 SingleChannelElement *sce, in search_for_quantizers_twoloop() argument
156 sfoffs = sce->ics.num_windows - 1; in search_for_quantizers_twoloop()
176 int wlen = 1024 / sce->ics.num_windows; in search_for_quantizers_twoloop()
219 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
220 for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) { in search_for_quantizers_twoloop()
223 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { in search_for_quantizers_twoloop()
226 sce->zeroes[(w+w2)*16+g] = 1; in search_for_quantizers_twoloop()
235 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { in search_for_quantizers_twoloop()
248 sce->zeroes[w*16+g] = !nz; in search_for_quantizers_twoloop()
250 if (nz && sce->can_pns[w*16+g]) { in search_for_quantizers_twoloop()
264 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
265 for (g = 0; g < sce->ics.num_swb; g++) { in search_for_quantizers_twoloop()
266 if (sce->zeroes[w*16+g]) { in search_for_quantizers_twoloop()
267 sce->sf_idx[w*16+g] = SCALE_ONE_POS; in search_for_quantizers_twoloop()
276 sce->sf_idx[w*16+g] = av_clip( in search_for_quantizers_twoloop()
278 + 1.75*log2f(FFMAX(0.00125f,uplims[w*16+g]) / sce->ics.swb_sizes[g]) in search_for_quantizers_twoloop()
281 minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
287 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) in search_for_quantizers_twoloop()
288 for (g = 0; g < sce->ics.num_swb; g++) in search_for_quantizers_twoloop()
289 if (!sce->zeroes[w*16+g]) in search_for_quantizers_twoloop()
290sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], minscaler, minscaler + SCALE_MAX_DIFF - 1); in search_for_quantizers_twoloop()
294 s->abs_pow34(s->scoefs, sce->coeffs, 1024); in search_for_quantizers_twoloop()
299 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
301 for (g = 0; g < sce->ics.num_swb; g++) { in search_for_quantizers_twoloop()
304 maxvals[w*16+g] = find_max_val(sce->ics.group_len[w], sce->ics.swb_sizes[g], scaled); in search_for_quantizers_twoloop()
307 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) in search_for_quantizers_twoloop()
310 start += sce->ics.swb_sizes[g]; in search_for_quantizers_twoloop()
322 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
324 float de_psy_factor = (sce->ics.num_windows > 1) ? 8.0f / sce->ics.group_len[w] : 1.0f; in search_for_quantizers_twoloop()
326 for (g = 0; g < sce->ics.num_swb; g++) { in search_for_quantizers_twoloop()
330 sce->ics.group_len[w], sce->ics.swb_sizes[g], in search_for_quantizers_twoloop()
331 uplims[w*16+g] / (nzs[g] * sce->ics.swb_sizes[w]), in search_for_quantizers_twoloop()
332 sce->coeffs + start, in search_for_quantizers_twoloop()
341 * sce->ics.group_len[w]; in search_for_quantizers_twoloop()
344 sce->ics.group_len[w], sce->ics.swb_sizes[g], in search_for_quantizers_twoloop()
345 uplims[w*16+g] / (nzs[g] * sce->ics.swb_sizes[w]), in search_for_quantizers_twoloop()
346 sce->coeffs + start, in search_for_quantizers_twoloop()
354 euplims[w*16+g] *= av_clipf(rdlambda * energy2uplim * sce->ics.group_len[w], in search_for_quantizers_twoloop()
357 start += sce->ics.swb_sizes[g]; in search_for_quantizers_twoloop()
375 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
377 for (g = 0; g < sce->ics.num_swb; g++) { in search_for_quantizers_twoloop()
378 const float *coefs = &sce->coeffs[start]; in search_for_quantizers_twoloop()
385 if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) { in search_for_quantizers_twoloop()
386 start += sce->ics.swb_sizes[g]; in search_for_quantizers_twoloop()
387 if (sce->can_pns[w*16+g]) { in search_for_quantizers_twoloop()
389 tbits += ff_pns_bits(sce, w, g); in search_for_quantizers_twoloop()
393 cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
394 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { in search_for_quantizers_twoloop()
399 sce->ics.swb_sizes[g], in search_for_quantizers_twoloop()
400 sce->sf_idx[w*16+g], in search_for_quantizers_twoloop()
412 … int sfdiff = av_clip(sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO, 0, 2*SCALE_MAX_DIFF); in search_for_quantizers_twoloop()
416 start += sce->ics.swb_sizes[g]; in search_for_quantizers_twoloop()
417 prev = sce->sf_idx[w*16+g]; in search_for_quantizers_twoloop()
423 if (sce->sf_idx[i] < (SCALE_MAX_POS - SCALE_DIV_512)) { in search_for_quantizers_twoloop()
425 int new_sf = FFMIN(maxsf_i, sce->sf_idx[i] + qstep); in search_for_quantizers_twoloop()
426 if (new_sf != sce->sf_idx[i]) { in search_for_quantizers_twoloop()
427 sce->sf_idx[i] = new_sf; in search_for_quantizers_twoloop()
435 if (sce->sf_idx[i] > SCALE_ONE_POS) { in search_for_quantizers_twoloop()
436 int new_sf = FFMAX3(minsf[i], SCALE_ONE_POS, sce->sf_idx[i] - qstep); in search_for_quantizers_twoloop()
437 if (new_sf != sce->sf_idx[i]) { in search_for_quantizers_twoloop()
438 sce->sf_idx[i] = new_sf; in search_for_quantizers_twoloop()
445 if (!qstep && tbits > toomanybits && sce->sf_idx[0] < 217 && changed) in search_for_quantizers_twoloop()
456 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
458 for (g = 0; g < sce->ics.num_swb; g++) { in search_for_quantizers_twoloop()
459 const float *coefs = sce->coeffs + start; in search_for_quantizers_twoloop()
466 if (sce->zeroes[w*16+g] || sce->sf_idx[w*16+g] >= 218) { in search_for_quantizers_twoloop()
467 start += sce->ics.swb_sizes[g]; in search_for_quantizers_twoloop()
468 if (sce->can_pns[w*16+g]) { in search_for_quantizers_twoloop()
470 tbits += ff_pns_bits(sce, w, g); in search_for_quantizers_twoloop()
474 cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
475 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { in search_for_quantizers_twoloop()
480 sce->ics.swb_sizes[g], in search_for_quantizers_twoloop()
481 sce->sf_idx[w*16+g], in search_for_quantizers_twoloop()
493 … int sfdiff = av_clip(sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO, 0, 2*SCALE_MAX_DIFF); in search_for_quantizers_twoloop()
497 start += sce->ics.swb_sizes[g]; in search_for_quantizers_twoloop()
498 prev = sce->sf_idx[w*16+g]; in search_for_quantizers_twoloop()
506 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
507 for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) { in search_for_quantizers_twoloop()
508 …if (!sce->zeroes[w*16+g] && sce->sf_idx[w*16+g] > SCALE_ONE_POS && dists[w*16+g] > uplims[w*16+g]*… in search_for_quantizers_twoloop()
525 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
526 … for (g = start = 0; g < sce->ics.num_swb; start += sce->ics.swb_sizes[g++]) { in search_for_quantizers_twoloop()
527 … if (start >= pns_start_pos && !sce->zeroes[w*16+g] && sce->can_pns[w*16+g]) { in search_for_quantizers_twoloop()
553 for (g = sce->ics.num_swb-1; g > 0 && zeroed < maxzeroed; g--) { in search_for_quantizers_twoloop()
554 if (sce->ics.swb_offset[g] < pns_start_pos) in search_for_quantizers_twoloop()
556 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
557 … if (!sce->zeroes[w*16+g] && sce->can_pns[w*16+g] && spread_thr_r[w*16+g] <= zspread in search_for_quantizers_twoloop()
558 && sce->sf_idx[w*16+g] > loopminsf in search_for_quantizers_twoloop()
559 …6+g] > loopovrfactor*uplims[w*16+g] || !(mcb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g])) in search_for_quantizers_twoloop()
561 sce->zeroes[w*16+g] = 1; in search_for_quantizers_twoloop()
562 sce->band_type[w*16+g] = 0; in search_for_quantizers_twoloop()
578 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
579 for (g = 0; g < sce->ics.num_swb; g++) { in search_for_quantizers_twoloop()
580 if (!sce->zeroes[w*16+g]) { in search_for_quantizers_twoloop()
581 minscaler = FFMIN(minscaler, sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
582 maxscaler = FFMAX(maxscaler, sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
589 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
596 for (g = 0; g < sce->ics.num_swb; g++) { in search_for_quantizers_twoloop()
597 int prevsc = sce->sf_idx[w*16+g]; in search_for_quantizers_twoloop()
598 if (prev < 0 && !sce->zeroes[w*16+g]) in search_for_quantizers_twoloop()
599 prev = sce->sf_idx[0]; in search_for_quantizers_twoloop()
600 if (!sce->zeroes[w*16+g]) { in search_for_quantizers_twoloop()
601 const float *coefs = sce->coeffs + start; in search_for_quantizers_twoloop()
603 int cmb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
606 …if ((!cmb || dists[w*16+g] > uplims[w*16+g]) && sce->sf_idx[w*16+g] > FFMAX(mindeltasf, minsf[w*16… in search_for_quantizers_twoloop()
613 for (i = 0; i < edepth && sce->sf_idx[w*16+g] > mindeltasf; ++i) { in search_for_quantizers_twoloop()
616 int mb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]-1); in search_for_quantizers_twoloop()
617 cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
621 maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g]-1, maxsf[w*16+g]); in search_for_quantizers_twoloop()
629 if (!g && sce->ics.num_windows > 1 && dists[w*16+g] >= euplims[w*16+g]) in search_for_quantizers_twoloop()
630 maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g], maxsf[w*16+g]); in search_for_quantizers_twoloop()
631 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { in search_for_quantizers_twoloop()
636 sce->ics.swb_sizes[g], in search_for_quantizers_twoloop()
637 sce->sf_idx[w*16+g]-1, in search_for_quantizers_twoloop()
646 sce->sf_idx[w*16+g]--; in search_for_quantizers_twoloop()
649 if (mb && (sce->sf_idx[w*16+g] < mindeltasf || ( in search_for_quantizers_twoloop()
656 … } else if (tbits > toofewbits && sce->sf_idx[w*16+g] < FFMIN(maxdeltasf, maxsf[w*16+g]) in search_for_quantizers_twoloop()
661 for (i = 0; i < depth && sce->sf_idx[w*16+g] < maxdeltasf; ++i) { in search_for_quantizers_twoloop()
664 cb = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]+1); in search_for_quantizers_twoloop()
668 for (w2 = 0; w2 < sce->ics.group_len[w]; w2++) { in search_for_quantizers_twoloop()
673 sce->ics.swb_sizes[g], in search_for_quantizers_twoloop()
674 sce->sf_idx[w*16+g]+1, in search_for_quantizers_twoloop()
685 sce->sf_idx[w*16+g]++; in search_for_quantizers_twoloop()
692 maxsf[w*16+g] = FFMIN(sce->sf_idx[w*16+g], maxsf[w*16+g]); in search_for_quantizers_twoloop()
697 … prev = sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], mindeltasf, maxdeltasf); in search_for_quantizers_twoloop()
698 if (sce->sf_idx[w*16+g] != prevsc) in search_for_quantizers_twoloop()
700 nminscaler = FFMIN(nminscaler, sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
701 sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
703 start += sce->ics.swb_sizes[g]; in search_for_quantizers_twoloop()
709 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
710 for (g = 0; g < sce->ics.num_swb; g++) { in search_for_quantizers_twoloop()
711 if (!sce->zeroes[w*16+g]) { in search_for_quantizers_twoloop()
712 int prevsf = sce->sf_idx[w*16+g]; in search_for_quantizers_twoloop()
715sce->sf_idx[w*16+g] = av_clip(sce->sf_idx[w*16+g], prev - SCALE_MAX_DIFF, prev + SCALE_MAX_DIFF); in search_for_quantizers_twoloop()
716 sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
717 prev = sce->sf_idx[w*16+g]; in search_for_quantizers_twoloop()
718 if (!fflag && prevsf != sce->sf_idx[w*16+g]) in search_for_quantizers_twoloop()
728 ff_init_nextband_map(sce, nextband); in search_for_quantizers_twoloop()
731 for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) { in search_for_quantizers_twoloop()
733 for (g = 0; g < sce->ics.num_swb; g++) { in search_for_quantizers_twoloop()
734 if (!sce->zeroes[w*16+g]) { in search_for_quantizers_twoloop()
735 sce->band_type[w*16+g] = find_min_book(maxvals[w*16+g], sce->sf_idx[w*16+g]); in search_for_quantizers_twoloop()
736 if (sce->band_type[w*16+g] <= 0) { in search_for_quantizers_twoloop()
737 if (!ff_sfdelta_can_remove_band(sce, nextband, prev, w*16+g)) { in search_for_quantizers_twoloop()
739 sce->band_type[w*16+g] = 1; in search_for_quantizers_twoloop()
741 sce->zeroes[w*16+g] = 1; in search_for_quantizers_twoloop()
742 sce->band_type[w*16+g] = 0; in search_for_quantizers_twoloop()
746 sce->band_type[w*16+g] = 0; in search_for_quantizers_twoloop()
749 if (!sce->zeroes[w*16+g]) { in search_for_quantizers_twoloop()
751 av_unused int sfdiff = sce->sf_idx[w*16+g] - prev + SCALE_DIFF_ZERO; in search_for_quantizers_twoloop()
753 } else if (sce->zeroes[0]) { in search_for_quantizers_twoloop()
755 sce->sf_idx[0] = sce->sf_idx[w*16+g]; in search_for_quantizers_twoloop()
757 prev = sce->sf_idx[w*16+g]; in search_for_quantizers_twoloop()