Lines Matching refs:sfb
74 Word16 ch, sfb, sfbGrp;
81 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
99 Word16 ch, sfb, sfbOffs;
112 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
113 avgEn = L_add(avgEn, psyOutChan->sfbEnergy[sfbOffs+sfb]);
128 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
129 if (psyOutChan->sfbEnergy[sfbOffs+sfb] < startRatio_x_avgEn) {
134 dbRatio = log_avgEn - logSfbEnergy[ch][sfbOffs+sfb];
142 snrRed = minSnrRed * iLog4((psyOutChan->sfbMinSnr[sfbOffs+sfb] << 16));
149 psyOutChan->sfbMinSnr[sfbOffs+sfb] = min(newMinSnr, minSnrLimit);
170 Word16 ch, sfb, sfbGrp, shift;
180 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
189 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
209 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
212 if (sfb > 0)
213 sfbEnm1 = psyOutChan->sfbEnergy[sfbGrp+sfb-1];
217 if (sfb < (psyOutChan->maxSfbPerGroup-1))
218 sfbEnp1 = psyOutChan->sfbEnergy[sfbGrp+sfb+1];
220 sfbEnp1 = psyOutChan->sfbEnergy[sfbGrp+sfb];
222 sfbEn = psyOutChan->sfbEnergy[sfbGrp+sfb];
262 for (sfb=0; sfb<psyOutChanM->sfbCnt; sfb++) {
263 if (psyOutElement->toolsInfo.msMask[sfb]) {
264 Word32 sfbEnM = psyOutChanM->sfbEnergy[sfb];
265 Word32 sfbEnS = psyOutChanS->sfbEnergy[sfb];
267 Word32 maxThr = L_mpy_wx(maxSfbEn, psyOutChanM->sfbMinSnr[sfb]) >> 1;
270 psyOutChanM->sfbMinSnr[sfb] = MAX_16;
274 psyOutChanM->sfbMinSnr[sfb] = min(max(psyOutChanM->sfbMinSnr[sfb],
279 psyOutChanS->sfbMinSnr[sfb] = MAX_16;
283 psyOutChanS->sfbMinSnr[sfb] = min(max(psyOutChanS->sfbMinSnr[sfb],
288 if (sfbEnM > psyOutChanM->sfbSpreadedEnergy[sfb])
289 psyOutChanS->sfbSpreadedEnergy[sfb] = L_mpy_ls(sfbEnS, MS_THRSPREAD_COEF);
291 if (sfbEnS > psyOutChanS->sfbSpreadedEnergy[sfb])
292 psyOutChanM->sfbSpreadedEnergy[sfb] = L_mpy_ls(sfbEnM, MS_THRSPREAD_COEF);
303 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
305 if ((psyOutChan->sfbSpreadedEnergy[sfbGrp+sfb] > psyOutChan->sfbEnergy[sfbGrp+sfb]) ||
306 (psyOutChan->sfbEnergy[sfbGrp+sfb] <= psyOutChan->sfbThreshold[sfbGrp+sfb]) ||
307 (psyOutChan->sfbMinSnr[sfbGrp+sfb] == MAX_16)) {
314 for (sfb=psyOutChan->maxSfbPerGroup; sfb<psyOutChan->sfbPerGroup; sfb++) {
335 Word16 ch, sfb, sfbGrp;
345 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
347 if (ahFlag[ch][sfbGrp+sfb] < AH_ACTIVE) {
348 ipe = ipe + peChanData->sfbPe[sfbGrp+sfb];
349 iconstPart = iconstPart + peChanData->sfbConstPart[sfbGrp+sfb];
350 inActiveLines = inActiveLines + peChanData->sfbNActiveLines[sfbGrp+sfb];
375 Word16 ch, sfb, sfbGrp;
382 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
386 Word32 tmp = thrExp[ch][sfbGrp+sfb] + redVal;
390 tmp = L_mpy_ls(*psfbEn, psyOutChan->sfbMinSnr[sfbGrp+sfb]);
393 (ahFlag[ch][sfbGrp+sfb] != NO_AH)){
395 ahFlag[ch][sfbGrp+sfb] = AH_ACTIVE;
422 Word16 ch, sfb, sfbGrp,shift;
432 /* for each sfb calc relative factors for pe changes */
441 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
442 Word32 redThrExp = thrExp[ch][sfbGrp+sfb] + redVal;
467 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
468 /* pe difference for this sfb */
475 sfbEn = psyOutChan->sfbEnergy[sfbGrp+sfb];
476 sfbThr = psyOutChan->sfbThreshold[sfbGrp+sfb];
504 sfbEn = L_mpy_ls(sfbEn, psyOutChan->sfbMinSnr[sfbGrp+sfb]);
512 psyOutChan->sfbThreshold[sfbGrp+sfb] = sfbThrReduced;
534 Word16 ch, sfb, sfbSubWin;
543 for (sfb=sfbSubWin; sfb<psyOutChannel[0].sfbCnt;
544 sfb+=psyOutChannel[0].sfbPerGroup) {
549 if (ahFlag[ch][sfb] != NO_AH &&
550 psyOutCh->sfbMinSnr[sfb] < minSnrLimit) {
551 psyOutCh->sfbMinSnr[sfb] = minSnrLimit;
552 psyOutCh->sfbThreshold[sfb] =
553 L_mpy_ls(psyOutCh->sfbEnergy[sfb], psyOutCh->sfbMinSnr[sfb]);
556 deltaPe = ((peChan->sfbNLines4[sfb] + (peChan->sfbNLines4[sfb] >> 1)) >> 2) -
557 peChan->sfbPe[sfb];
586 Word16 ch, sfb;
597 for (sfb=0; sfb<psyOutChanL->sfbCnt; sfb++) {
600 if (psyOutElement->toolsInfo.msMask[sfb]) {
602 minEn = L_mpy_ls(psyOutChanL->sfbEnergy[sfb], (minSnrLimit * psyOutChanL->sfbMinSnr[sfb]) >> 16);
604 if (ahFlag[1][sfb] != NO_AH &&
605 minEn > psyOutChanR->sfbEnergy[sfb]) {
606 ahFlag[1][sfb] = NO_AH;
607 psyOutChanR->sfbThreshold[sfb] = L_add(psyOutChanR->sfbEnergy[sfb], psyOutChanR->sfbEnergy[sfb]);
608 actPe = actPe - peData->peChannelData[1].sfbPe[sfb];
612 minEn = L_mpy_ls(psyOutChanR->sfbEnergy[sfb], (minSnrLimit * psyOutChanR->sfbMinSnr[sfb]) >> 16);
614 if (ahFlag[0][sfb]!= NO_AH &&
615 minEn > psyOutChanL->sfbEnergy[sfb]) {
616 ahFlag[0][sfb] = NO_AH;
617 psyOutChanL->sfbThreshold[sfb] = L_add(psyOutChanL->sfbEnergy[sfb], psyOutChanL->sfbEnergy[sfb]);
618 actPe = actPe - peData->peChannelData[0].sfbPe[sfb];
653 for (sfb=startSfb[ch]; sfb<psyOutChan->sfbCnt; sfb++) {
655 if ((ahFlag[ch][sfb] != NO_AH) &&
656 (psyOutChan->sfbEnergy[sfb] > psyOutChan->sfbThreshold[sfb])) {
657 minEn = min(minEn, psyOutChan->sfbEnergy[sfb]);
658 avgEn = L_add(avgEn, psyOutChan->sfbEnergy[sfb]);
679 /* start with lowest energy border at highest sfb */
688 sfb = maxSfb;
696 if (sfb>=startSfb[ch] && sfb<psyOutChan->sfbCnt) {
697 /* sfb energy below border ? */
699 if (ahFlag[ch][sfb] != NO_AH && psyOutChan->sfbEnergy[sfb] < en[enIdx]){
701 ahFlag[ch][sfb] = NO_AH;
702 psyOutChan->sfbThreshold[sfb] = L_add(psyOutChan->sfbEnergy[sfb], psyOutChan->sfbEnergy[sfb]);
703 actPe = actPe - peData->peChannelData[ch].sfbPe[sfb];
712 sfb = sfb - 1;
714 if (sfb < minSfb) {
716 sfb = maxSfb;