Lines Matching refs:sfb
386 INT ch, sfb, sfbGrp;
391 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
392 thrExpLdData = psyOutChannel[ch]->sfbThresholdLdData[sfbGrp+sfb]>>2 ;
393 thrExp[ch][sfbGrp+sfb] = CalcInvLdData(thrExpLdData);
409 INT ch, sfb, sfbGrp, nSfb;
421 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
422 accu += psyOutChannel[ch]->sfbEnergy[sfbGrp+sfb]>>6;
438 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
439 if ( (msaParam->startRatio + qcOutChannel[ch]->sfbEnergyLdData[sfbGrp+sfb]) < avgEnLD64 ) {
440 dbRatio = fMult((avgEnLD64 - qcOutChannel[ch]->sfbEnergyLdData[sfbGrp+sfb]),FL2FXCONST_DBL(0.3010299956f)); /* scaled by (1.0f/(10.0f*64.0f)) */
443 qcOutChannel[ch]->sfbMinSnrLdData[sfbGrp+sfb] = (fMult(qcOutChannel[ch]->sfbMinSnrLdData[sfbGrp+sfb],minSnrRed)) << 6;
444 qcOutChannel[ch]->sfbMinSnrLdData[sfbGrp+sfb] = fixMin(minSnrLimitLD64, qcOutChannel[ch]->sfbMinSnrLdData[sfbGrp+sfb]);
464 INT ch, sfb, sfbGrp;
472 INT sfbGrp, sfb;
477 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++)
478 qcOutChan->sfbSpreadEnergy[sfbGrp+sfb] >>= 1 ;
482 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++)
483 qcOutChan->sfbSpreadEnergy[sfbGrp+sfb] =
485 qcOutChan->sfbSpreadEnergy[sfbGrp+sfb]) ;
494 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
496 if (sfb > 0)
497 sfbEnm1 = qcOutChan->sfbEnergy[sfbGrp+sfb-1];
499 sfbEnm1 = qcOutChan->sfbEnergy[sfbGrp+sfb];
501 if (sfb < psyOutChannel[ch]->maxSfbPerGroup-1)
502 sfbEnp1 = qcOutChan->sfbEnergy[sfbGrp+sfb+1];
504 sfbEnp1 = qcOutChan->sfbEnergy[sfbGrp+sfb];
508 sfbEn = qcOutChan->sfbEnergy[sfbGrp+sfb];
509 sfbEnLdData = qcOutChan->sfbEnergyLdData[sfbGrp+sfb];
518 qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] =
519 fixMin(qcOutChan->sfbMinSnrLdData[sfbGrp+sfb], tmpMinSnrLdData);
523 FIXP_DBL tmpMinSnrLdData = avgEnLdData - sfbEnLdData -(FIXP_DBL)SnrLdMin4 + qcOutChan->sfbMinSnrLdData[sfbGrp+sfb];
525 qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] = fixMin(tmpMinSnrLdData,
526 (FIXP_DBL)(qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] + SnrLdMin2 ));
540 for (sfb=0; sfb<psyOutChanM->maxSfbPerGroup; sfb++) {
541 if (toolsInfo->msMask[sfbGrp+sfb]) {
542 FIXP_DBL maxSfbEnLd = fixMax(qcOutChanM->sfbEnergyLdData[sfbGrp+sfb],qcOutChanS->sfbEnergyLdData[sfbGrp+sfb]);
545 if ( ((SnrLdMin5>>1) + (maxSfbEnLd>>1) + (qcOutChanM->sfbMinSnrLdData[sfbGrp+sfb]>>1)) <= FL2FXCONST_DBL(-0.5f))
548 maxThrLd = SnrLdMin5 + maxSfbEnLd + qcOutChanM->sfbMinSnrLdData[sfbGrp+sfb];
550 if (qcOutChanM->sfbEnergy[sfbGrp+sfb] > FL2FXCONST_DBL(0.0f))
551 sfbMinSnrTmpLd = maxThrLd - qcOutChanM->sfbEnergyLdData[sfbGrp+sfb];
555 qcOutChanM->sfbMinSnrLdData[sfbGrp+sfb] = fixMax(qcOutChanM->sfbMinSnrLdData[sfbGrp+sfb],sfbMinSnrTmpLd);
557 if (qcOutChanM->sfbMinSnrLdData[sfbGrp+sfb] <= FL2FXCONST_DBL(0.0f))
558 qcOutChanM->sfbMinSnrLdData[sfbGrp+sfb] = fixMin(qcOutChanM->sfbMinSnrLdData[sfbGrp+sfb], (FIXP_DBL)SnrLdFac);
560 if (qcOutChanS->sfbEnergy[sfbGrp+sfb] > FL2FXCONST_DBL(0.0f))
561 sfbMinSnrTmpLd = maxThrLd - qcOutChanS->sfbEnergyLdData[sfbGrp+sfb];
565 qcOutChanS->sfbMinSnrLdData[sfbGrp+sfb] = fixMax(qcOutChanS->sfbMinSnrLdData[sfbGrp+sfb],sfbMinSnrTmpLd);
567 if (qcOutChanS->sfbMinSnrLdData[sfbGrp+sfb] <= FL2FXCONST_DBL(0.0f))
568 qcOutChanS->sfbMinSnrLdData[sfbGrp+sfb] = fixMin(qcOutChanS->sfbMinSnrLdData[sfbGrp+sfb],(FIXP_DBL)SnrLdFac);
570 if (qcOutChanM->sfbEnergy[sfbGrp+sfb]>qcOutChanM->sfbSpreadEnergy[sfbGrp+sfb])
571 qcOutChanS->sfbSpreadEnergy[sfbGrp+sfb] =
572 fMult(qcOutChanS->sfbEnergy[sfbGrp+sfb], FL2FXCONST_DBL(0.9f));
574 if (qcOutChanS->sfbEnergy[sfbGrp+sfb]>qcOutChanS->sfbSpreadEnergy[sfbGrp+sfb])
575 qcOutChanM->sfbSpreadEnergy[sfbGrp+sfb] =
576 fMult(qcOutChanM->sfbEnergy[sfbGrp+sfb], FL2FXCONST_DBL(0.9f));
587 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
588 if ((qcOutChan->sfbSpreadEnergy[sfbGrp+sfb] > qcOutChan->sfbEnergy[sfbGrp+sfb])
589 || (qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] > FL2FXCONST_DBL(0.0f))) {
590 ahFlag[ch][sfbGrp+sfb] = NO_AH;
593 ahFlag[ch][sfbGrp+sfb] = AH_INACTIVE;
683 int sfb, sfbGrp, nLinesSum = 0;
689 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
690 sfb]>>1); /* nrg^(1/2) */
691 FIXP_DBL nrgFac14 = CalcInvLdData(psyOutChan->sfbEnergyLdData[sfbGrp+sfb]>>2); /* nrg^(1/4) */
694 nLinesSum += peData->peChannelData[ch].sfbNLines[sfbGrp+sfb]; /* relevant lines */
695 nrgTotal += ( psyOutChan->sfbEnergy[sfbGrp+sfb] >> 6 ); /* sum up nrg */
714 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
719 if ((ch == 1) && (toolsInfo->msMask[sfbGrp+sfb])) {
726 if ( (sfbExePatch) && (psyOutChan->sfbEnergy[sfbGrp+sfb]>FL2FXCONST_DBL(0.f)) )
730 qcOutChannel[ch]->sfbEnFacLd[sfbGrp+sfb] = ( (nrgFacLd_14 + (psyOutChan->sfbEnergyLdData[sfbGrp+sfb]+(psyOutChan->sfbEnergyLdData[sfbGrp+sfb]>>1)))>>1 ); /* sfbEnergy^(3/4) */
733 qcOutChannel[ch]->sfbEnFacLd[sfbGrp+sfb] = ( (nrgFacLd_12 + psyOutChan->sfbEnergyLdData[sfbGrp+sfb])>>1 ); /* sfbEnergy^(2/4) */
736 qcOutChannel[ch]->sfbEnFacLd[sfbGrp+sfb] = ( (nrgFacLd_34 + (psyOutChan->sfbEnergyLdData[sfbGrp+sfb]>>1))>>1 ); /* sfbEnergy^(1/4) */
738 qcOutChannel[ch]->sfbEnFacLd[sfbGrp+sfb] = fixMin(qcOutChannel[ch]->sfbEnFacLd[sfbGrp+sfb],(FIXP_DBL)0);
742 } /* sfb loop */
810 int sfb, sfbGrp;
814 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
815 pQcOutCh->sfbWeightedEnergyLdData[sfb+sfbGrp] = pQcOutCh->sfbEnergyLdData[sfb+sfbGrp] - pQcOutCh->sfbEnFacLd[sfb+sfbGrp];
816 pQcOutCh->sfbThresholdLdData[sfb+sfbGrp] -= pQcOutCh->sfbEnFacLd[sfb+sfbGrp];
840 INT ch, sfb,sfbGrp;
848 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
849 if(ahFlag[ch][sfbGrp+sfb] < AH_ACTIVE) {
850 pe_tmp += peChanData->sfbPe[sfbGrp+sfb];
851 constPart_tmp += peChanData->sfbConstPart[sfbGrp+sfb];
852 nActiveLines_tmp += peChanData->sfbNActiveLines[sfbGrp+sfb];
879 INT ch, sfb, sfbGrp;
886 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
887 sfbEnLdData = qcOutChan->sfbWeightedEnergyLdData[sfbGrp+sfb];
888 sfbThrLdData = qcOutChan->sfbThresholdLdData[sfbGrp+sfb];
889 sfbThrExp = thrExp[ch][sfbGrp+sfb];
890 if ((sfbEnLdData > sfbThrLdData) && (ahFlag[ch][sfbGrp+sfb] != AH_ACTIVE)) {
893 float tmp = thrExp[ch][sfb]+redVal;
905 if ( ((sfbThrReducedLdData - sfbEnLdData) > qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] )
906 && (ahFlag[ch][sfbGrp+sfb] != NO_AH) )
908 if (qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] > (FL2FXCONST_DBL(-1.0f) - sfbEnLdData) ){
909 sfbThrReducedLdData = fixMax((qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] + sfbEnLdData), sfbThrLdData);
912 ahFlag[ch][sfbGrp+sfb] = AH_ACTIVE;
920 qcOutChan->sfbThresholdLdData[sfbGrp+sfb] = sfbThrReducedLdData;
937 INT sfbGrp, sfb;
944 for (sfb=0; sfb<psyOutChannel->maxSfbPerGroup; sfb++){
945 if (psyOutChannel->sfbEnergyLdData[sfbGrp+sfb] > psyOutChannel->sfbThresholdLdData[sfbGrp+sfb]) {
946 frameFormFactor += (CalcInvLdData(sfbFormFactorLdData[sfbGrp+sfb])>>SCALE_FORM_FAC);
947 frameNLines += (psyOutChannel->sfbOffsets[sfbGrp+sfb+1] - psyOutChannel->sfbOffsets[sfbGrp+sfb]);
948 frameEnergy += (psyOutChannel->sfbEnergy[sfbGrp+sfb]>>SCALE_NRGS);
965 /* assuming total chaos, if no sfb is above thresholds */
981 INT ch, sfbGrp, sfb;
1012 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++){
1013 chGroupEnergy[groupCnt][ch] += (psyOutChan->sfbEnergy[sfbGrp+sfb]>>SCALE_GROUP_ENERGY);
1087 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++){
1089 sfbEnLdData = (qcOutChan->sfbWeightedEnergyLdData[sfbGrp+sfb]);
1090 sfbThrLdData = (qcOutChan->sfbThresholdLdData[sfbGrp+sfb]);
1091 sfbThrExp = thrExp[ch][sfbGrp+sfb];
1093 if ( (sfbThrLdData>=MIN_LDTHRESH) && (sfbEnLdData > sfbThrLdData) && (ahFlag[ch][sfbGrp+sfb] != AH_ACTIVE)) {
1097 const int groupNumber = (int) sfb/psyOutChan->sfbPerGroup;
1132 if ( ((sfbThrReducedLdData - sfbEnLdData) > qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] )
1133 && (ahFlag[ch][sfbGrp+sfb] != NO_AH) )
1135 if (qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] > (FL2FXCONST_DBL(-1.0f) - sfbEnLdData) ){
1136 sfbThrReducedLdData = fixMax((qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] + sfbEnLdData), sfbThrLdData);
1139 ahFlag[ch][sfbGrp+sfb] = AH_ACTIVE;
1152 qcOutChan->sfbThresholdLdData[sfbGrp+sfb] = sfbThrReducedLdData;
1176 INT ch, sfb, sfbGrp;
1198 /* for each sfb calc relative factors for pe changes */
1211 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
1213 if ( peChanData->sfbNActiveLines[sfbGrp+sfb] == 0 ) {
1214 sfbNActiveLinesLdData[elementId][ch][sfbGrp+sfb] = FL2FXCONST_DBL(-1.0f);
1220 sfbNActiveLinesLdData[elementId][ch][sfbGrp+sfb] = CalcLdInt(peChanData->sfbNActiveLines[sfbGrp+sfb]);
1222 if ( ((ahFlag[elementId][ch][sfbGrp+sfb] < AH_ACTIVE) || (deltaPe > 0)) &&
1223 peChanData->sfbNActiveLines[sfbGrp+sfb] != 0 )
1225 if (thrExp[elementId][ch][sfbGrp+sfb] > -redVal[elementId]) {
1227 /* sfbPeFactors[ch][sfbGrp+sfb] = peChanData->sfbNActiveLines[sfbGrp+sfb] /
1228 (thrExp[elementId][ch][sfbGrp+sfb] + redVal[elementId]); */
1230 int minScale = fixMin(CountLeadingBits(thrExp[elementId][ch][sfbGrp+sfb]), CountLeadingBits(redVal[elementId]) - (DFRACT_BITS-1-redValScaling[elementId]) ) - 1;
1233 FIXP_DBL sumLd = CalcLdData(scaleValue(thrExp[elementId][ch][sfbGrp+sfb], minScale) + scaleValue(redVal[elementId], (DFRACT_BITS-1-redValScaling[elementId])+minScale))
1237 sfbPeFactorsLdData[elementId][ch][sfbGrp+sfb] = sfbNActiveLinesLdData[elementId][ch][sfbGrp+sfb] - sumLd;
1240 if ( sfbNActiveLinesLdData[elementId][ch][sfbGrp+sfb] > (FL2FXCONST_DBL(-1.f) + sumLd) ) {
1241 sfbPeFactorsLdData[elementId][ch][sfbGrp+sfb] = sfbNActiveLinesLdData[elementId][ch][sfbGrp+sfb] - sumLd;
1244 sfbPeFactorsLdData[elementId][ch][sfbGrp+sfb] = sfbNActiveLinesLdData[elementId][ch][sfbGrp+sfb];
1248 normFactorInt += (INT)CalcInvLdData(sfbPeFactorsLdData[elementId][ch][sfbGrp+sfb]);
1250 else sfbPeFactorsLdData[elementId][ch][sfbGrp+sfb] = FL2FXCONST_DBL(1.0f);
1252 else sfbPeFactorsLdData[elementId][ch][sfbGrp+sfb] = FL2FXCONST_DBL(-1.0f);
1273 for (sfb=0; sfb<psyOutChan->maxSfbPerGroup; sfb++) {
1275 if (peChanData->sfbNActiveLines[sfbGrp+sfb] > 0) {
1277 /* pe difference for this sfb */
1278 if ( (sfbPeFactorsLdData[elementId][ch][sfbGrp+sfb]==FL2FXCONST_DBL(-1.0f)) ||
1285 FIXP_DBL tmp = CalcInvLdData(sfbPeFactorsLdData[elementId][ch][sfbGrp+sfb] + normFactorLdData - sfbNActiveLinesLdData[elementId][ch][sfbGrp+sfb] - FL2FXCONST_DBL((float)LD_DATA_SHIFT/LD_DATA_SCALING));
1293 sfbThrLdData = qcOutChan->sfbThresholdLdData[sfbGrp+sfb];
1294 sfbEnLdData = qcOutChan->sfbWeightedEnergyLdData[sfbGrp+sfb];
1309 if ( (sfbThrReducedLdData - sfbEnLdData > qcOutChan->sfbMinSnrLdData[sfbGrp+sfb]) &&
1310 (ahFlag[elementId][ch][sfbGrp+sfb] == AH_INACTIVE) )
1313 if ( sfbEnLdData > (sfbThrLdData-qcOutChan->sfbMinSnrLdData[sfbGrp+sfb]) ) {
1314 sfbThrReducedLdData = qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] + sfbEnLdData;
1319 ahFlag[elementId][ch][sfbGrp+sfb] = AH_ACTIVE;
1322 qcOutChan->sfbThresholdLdData[sfbGrp+sfb] = sfbThrReducedLdData;
1370 INT sfb, sfbGrp;
1374 if (maxSfbPerGroup[ch]>=0) { /* sfb in next channel */
1376 sfb = maxSfbPerGroup[ch]--;
1381 if (ahFlag[elementId][ch][sfbGrp+sfb] != NO_AH &&
1382 qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] < SnrLdFac)
1385 qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] = SnrLdFac;
1388 if ( qcOutChan->sfbWeightedEnergyLdData[sfbGrp+sfb] >= qcOutChan->sfbThresholdLdData[sfbGrp+sfb] - qcOutChan->sfbMinSnrLdData[sfbGrp+sfb] ) {
1390 qcOutChan->sfbThresholdLdData[sfbGrp+sfb] = qcOutChan->sfbWeightedEnergyLdData[sfbGrp+sfb] + qcOutChan->sfbMinSnrLdData[sfbGrp+sfb];
1394 deltaPe -= (peData->peChannelData[ch].sfbPe[sfbGrp+sfb]>>PE_CONSTPART_SHIFT);
1397 peData->peChannelData[ch].sfbPe[sfbGrp+sfb] = (3*peData->peChannelData[ch].sfbNLines[sfbGrp+sfb]) << (PE_CONSTPART_SHIFT-1);
1398 deltaPe += (peData->peChannelData[ch].sfbPe[sfbGrp+sfb]>>PE_CONSTPART_SHIFT);
1413 } /* sfb > 0 */
1459 INT ch, sfb, sfbGrp;
1474 for (sfb=psyOutChannel[ch]->maxSfbPerGroup; sfb<psyOutChannel[ch]->sfbPerGroup; sfb++) {
1475 peData->peChannelData[ch].sfbPe[sfbGrp+sfb] = 0;
1483 for (sfb=0; sfb<psyOutChannel[0]->maxSfbPerGroup; sfb++) {
1485 if (psyOutElement[elementId]->toolsInfo.msMask[sfbGrp+sfb]) {
1486 FIXP_DBL EnergyLd_L = qcOutChannel[0]->sfbWeightedEnergyLdData[sfbGrp+sfb];
1487 FIXP_DBL EnergyLd_R = qcOutChannel[1]->sfbWeightedEnergyLdData[sfbGrp+sfb];
1490 if ( (ahFlag[elementId][1][sfbGrp+sfb] != NO_AH) &&
1491 (((FL2FXCONST_DBL(-0.02065512648f)>>1) + (qcOutChannel[0]->sfbMinSnrLdData[sfbGrp+sfb]>>1))
1494 ahFlag[elementId][1][sfbGrp+sfb] = NO_AH;
1495 qcOutChannel[1]->sfbThresholdLdData[sfbGrp+sfb] = FL2FXCONST_DBL(0.015625f) + EnergyLd_R;
1496 actPe -= peData->peChannelData[1].sfbPe[sfbGrp+sfb]>>PE_CONSTPART_SHIFT;
1499 else if ( (ahFlag[elementId][0][sfbGrp+sfb] != NO_AH) &&
1500 (((FL2FXCONST_DBL(-0.02065512648f)>>1) + (qcOutChannel[1]->sfbMinSnrLdData[sfbGrp+sfb]>>1))
1503 ahFlag[elementId][0][sfbGrp+sfb] = NO_AH;
1504 qcOutChannel[0]->sfbThresholdLdData[sfbGrp+sfb] = FL2FXCONST_DBL(0.015625f) + EnergyLd_L;
1505 actPe -= peData->peChannelData[0].sfbPe[sfbGrp+sfb]>>PE_CONSTPART_SHIFT;
1512 } /* sfb */
1541 sfb=startSfb[ch];
1544 for (; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
1545 if ((ahFlag[elementId][ch][sfbGrp+sfb]!=NO_AH) &&
1546 (qcOutChannel[ch]->sfbWeightedEnergyLdData[sfbGrp+sfb] > qcOutChannel[ch]->sfbThresholdLdData[sfbGrp+sfb])){
1547 minEnLD64 = fixMin(minEnLD64,qcOutChannel[ch]->sfbEnergyLdData[sfbGrp+sfb]);
1548 avgEn += qcOutChannel[ch]->sfbEnergy[sfbGrp+sfb] >> 6;
1554 sfb=0;
1595 INT sfb, sfbGrp;
1597 /* start with lowest energy border at highest sfb */
1598 if (maxSfbPerGroup[ch]>=startSfb[ch]) { /* sfb in next channel */
1599 sfb = maxSfbPerGroup[ch]--;
1603 /* sfb energy below border ? */
1604 if (ahFlag[elementId][ch][sfbGrp+sfb] != NO_AH && qcOutChannel[ch]->sfbEnergyLdData[sfbGrp+sfb] < enLD64[enIdx]) {
1606 ahFlag[elementId][ch][sfbGrp+sfb] = NO_AH;
1607 qcOutChannel[ch]->sfbThresholdLdData[sfbGrp+sfb] = FL2FXCONST_DBL(0.015625f) + qcOutChannel[ch]->sfbWeightedEnergyLdData[sfbGrp+sfb];
1608 actPe -= peData->peChannelData[ch].sfbPe[sfbGrp+sfb]>>PE_CONSTPART_SHIFT;
1615 } /* sfb > 0 */
1636 int ch, sfb, sfbGrp;
1640 for (sfb=0; sfb<psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
1641 if ( ahFlag[ch][sfbGrp+sfb] == AH_ACTIVE) {
1642 ahFlag[ch][sfbGrp+sfb] = AH_INACTIVE;
2638 int ch,sfb,sfbGrp;
2644 for (sfb=0; sfb<psyOutElement[i]->psyOutChannel[ch]->maxSfbPerGroup; sfb++) {
2645 pQcOutCh->sfbThresholdLdData[sfb+sfbGrp] += pQcOutCh->sfbEnFacLd[sfb+sfbGrp];