Lines Matching refs:band

106  * information for single band used by 3GPP TS26.403-inspired psychoacoustic model
109 float energy; ///< band energy
124 AacPsyBand band[128]; ///< bands information
142 float barks; ///< Bark value for each spectral band in long frame
537 static float calc_pe_3gpp(AacPsyBand *band)
541 band->pe = 0.0f;
542 band->pe_const = 0.0f;
543 band->active_lines = 0.0f;
544 if (band->energy > band->thr) {
545 a = log2f(band->energy);
546 pe = a - log2f(band->thr);
547 band->active_lines = band->nz_lines;
551 band->active_lines *= PSY_3GPP_C3;
553 band->pe = pe * band->nz_lines;
554 band->pe_const = a * band->nz_lines;
557 return band->pe;
574 static float calc_reduced_thr_3gpp(AacPsyBand *band, float min_snr,
577 float thr = band->thr;
579 if (band->energy > thr) {
590 if (thr > band->energy * min_snr && band->avoid_holes != PSY_3GPP_AH_NONE) {
591 thr = FFMAX(band->thr, band->energy * min_snr);
592 band->avoid_holes = PSY_3GPP_AH_ACTIVE;
608 AacPsyBand *band = &pch->band[w+g];
612 band->energy = 0.0f;
615 band->energy += coefs[start+i] * coefs[start+i];
619 Temp = band->energy > 0 ? sqrtf((float)band_sizes[g] / band->energy) : 0;
620 band->thr = band->energy * 0.001258925f;
621 band->nz_lines = form_factor * sqrtf(Temp);
650 * Calculate band thresholds as suggested in 3GPP TS26.403
673 AacPsyBand *bands = &pch->band[w];
687 AacPsyBand *band = &bands[g];
689 band->thr_quiet = band->thr = FFMAX(band->thr, coeffs[g].ath);
692 band->thr = FFMAX(PSY_3GPP_RPEMIN*band->thr, FFMIN(band->thr,
696 pe += calc_pe_3gpp(band);
697 a += band->pe_const;
698 active_lines += band->active_lines;
701 if (spread_en[w+g] * avoid_hole_thr > band->energy || coeffs[g].min_snr > 1.0f)
702 band->avoid_holes = PSY_3GPP_AH_NONE;
704 band->avoid_holes = PSY_3GPP_AH_INACTIVE;
749 AacPsyBand *band = &pch->band[w+g];
751 band->thr = calc_reduced_thr_3gpp(band, coeffs[g].min_snr, reduction);
753 pe += calc_pe_3gpp(band);
754 a += band->pe_const;
755 active_lines += band->active_lines;
765 AacPsyBand *band = &pch->band[w+g];
767 if (band->avoid_holes != PSY_3GPP_AH_ACTIVE) {
768 pe_no_ah += band->pe;
769 a += band->pe_const;
770 active_lines += band->active_lines;
781 AacPsyBand *band = &pch->band[w+g];
784 band->thr = calc_reduced_thr_3gpp(band, coeffs[g].min_snr, reduction);
785 pe += calc_pe_3gpp(band);
786 if (band->thr > 0.0f)
787 band->norm_fac = band->active_lines / band->thr;
789 band->norm_fac = 0.0f;
790 norm_fac += band->norm_fac;
803 AacPsyBand *band = &pch->band[w+g];
805 if (band->active_lines > 0.5f) {
806 float delta_sfb_pe = band->norm_fac * norm_fac * delta_pe;
807 float thr = band->thr;
809 thr *= exp2f(delta_sfb_pe / band->active_lines);
810 if (thr > coeffs[g].min_snr * band->energy && band->avoid_holes == PSY_3GPP_AH_INACTIVE)
811 thr = FFMAX(band->thr, coeffs[g].min_snr * band->energy);
812 band->thr = thr;
821 AacPsyBand *band = &pch->band[w+g];
822 if (band->avoid_holes != PSY_3GPP_AH_NONE && coeffs[g].min_snr < PSY_SNR_1DB) {
824 band->thr = band->energy * PSY_SNR_1DB;
825 pe += band->active_lines * 1.5f - band->pe;
835 AacPsyBand *band = &pch->band[w+g];
838 psy_band->threshold = band->thr;
839 psy_band->energy = band->energy;
840 psy_band->spread = band->active_lines * 2.0f / band_sizes[g];
841 psy_band->bits = PSY_3GPP_PE_TO_BITS(band->pe);
845 memcpy(pch->prev_band, pch->band, sizeof(pch->band));