Lines Matching refs:ch

251   int i, ch, n, chInc = 0, resetChannels = 3;  in FDKaacEnc_psyInit()  local
263 for (ch = 0; ch < cm->elInfo[i].nChannelsInEl; ch++) { in FDKaacEnc_psyInit()
264 hPsy->psyElement[i]->psyStatic[ch] = hPsy->pStaticChannels[chInc]; in FDKaacEnc_psyInit()
267 FDKaacEnc_psyInitStates(hPsy, hPsy->psyElement[i]->psyStatic[ch], in FDKaacEnc_psyInit()
270 mdct_init(&(hPsy->psyElement[i]->psyStatic[ch]->mdctPers), NULL, 0); in FDKaacEnc_psyInit()
271 hPsy->psyElement[i]->psyStatic[ch]->isLFE = 0; in FDKaacEnc_psyInit()
273 hPsy->psyElement[i]->psyStatic[ch]->isLFE = 1; in FDKaacEnc_psyInit()
282 for (ch = 0; ch < cm->elInfo[i].nChannelsInEl; ch++) { in FDKaacEnc_psyInit()
283 phpsyOut[n]->psyOutElement[i]->psyOutChannel[ch] = in FDKaacEnc_psyInit()
305 int i, ch; in FDKaacEnc_psyMainInit() local
366 for (ch = 0; ch < cm->elInfo[i].nChannelsInEl; ch++) { in FDKaacEnc_psyMainInit()
369 FDKaacEnc_psyInitStates(hPsy, hPsy->psyElement[i]->psyStatic[ch], in FDKaacEnc_psyMainInit()
374 hPsy->psyElement[i]->psyStatic[ch]->sfbThresholdnm1, in FDKaacEnc_psyMainInit()
375 &hPsy->psyElement[i]->psyStatic[ch]->calcPreEcho, in FDKaacEnc_psyMainInit()
377 &hPsy->psyElement[i]->psyStatic[ch]->mdctScalenm1); in FDKaacEnc_psyMainInit()
416 INT ch; /* counts through channels */ in FDKaacEnc_psyMain() local
467 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
468 psyData[ch] = &psyDynamic->psyData[ch]; in FDKaacEnc_psyMain()
469 tnsData[ch] = &psyDynamic->tnsData[ch]; in FDKaacEnc_psyMain()
470 pnsData[ch] = &psyDynamic->pnsData[ch]; in FDKaacEnc_psyMain()
472 psyData[ch]->mdctSpectrum = psyOutChannel[ch]->mdctSpectrum; in FDKaacEnc_psyMain()
479 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
483 FDKmemcpy(pTimeSignal, pInput + chIdx[ch] * inputBufSize, in FDKaacEnc_psyMain()
486 FDKaacEnc_BlockSwitching(&psyStatic[ch]->blockSwitchingControl, in FDKaacEnc_psyMain()
487 nTimeSamples, psyStatic[ch]->isLFE, pTimeSignal); in FDKaacEnc_psyMain()
490 FDKmemcpy(psyStatic[ch]->psyInputBuffer + blockSwitchingOffset, in FDKaacEnc_psyMain()
508 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
510 FDKmemcpy(psyStatic[ch]->psyInputBuffer + blockSwitchingOffset, in FDKaacEnc_psyMain()
511 pInput + chIdx[ch] * inputBufSize, in FDKaacEnc_psyMain()
516 for (ch = 0; ch < channels; ch++) in FDKaacEnc_psyMain()
517 isShortWindow[ch] = in FDKaacEnc_psyMain()
518 (psyStatic[ch]->blockSwitchingControl.lastWindowSequence == in FDKaacEnc_psyMain()
522 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
523 if (isShortWindow[ch]) { in FDKaacEnc_psyMain()
524 hThisPsyConf[ch] = hPsyConfShort; in FDKaacEnc_psyMain()
525 windowLength[ch] = psyConf->granuleLength / TRANS_FAC; in FDKaacEnc_psyMain()
526 nWindows[ch] = TRANS_FAC; in FDKaacEnc_psyMain()
527 maxSfb[ch] = MAX_SFB_SHORT; in FDKaacEnc_psyMain()
529 pSfbMaxScaleSpec[ch] = psyData[ch]->sfbMaxScaleSpec.Short[0]; in FDKaacEnc_psyMain()
530 pSfbEnergy[ch] = psyData[ch]->sfbEnergy.Short[0]; in FDKaacEnc_psyMain()
531 pSfbSpreadEnergy[ch] = psyData[ch]->sfbSpreadEnergy.Short[0]; in FDKaacEnc_psyMain()
532 pSfbEnergyLdData[ch] = psyData[ch]->sfbEnergyLdData.Short[0]; in FDKaacEnc_psyMain()
533 pSfbEnergyMS[ch] = psyData[ch]->sfbEnergyMS.Short[0]; in FDKaacEnc_psyMain()
534 pSfbThreshold[ch] = psyData[ch]->sfbThreshold.Short[0]; in FDKaacEnc_psyMain()
537 hThisPsyConf[ch] = hPsyConfLong; in FDKaacEnc_psyMain()
538 windowLength[ch] = psyConf->granuleLength; in FDKaacEnc_psyMain()
539 nWindows[ch] = 1; in FDKaacEnc_psyMain()
540 maxSfb[ch] = MAX_GROUPED_SFB; in FDKaacEnc_psyMain()
542 pSfbMaxScaleSpec[ch] = psyData[ch]->sfbMaxScaleSpec.Long; in FDKaacEnc_psyMain()
543 pSfbEnergy[ch] = psyData[ch]->sfbEnergy.Long; in FDKaacEnc_psyMain()
544 pSfbSpreadEnergy[ch] = psyData[ch]->sfbSpreadEnergy.Long; in FDKaacEnc_psyMain()
545 pSfbEnergyLdData[ch] = psyData[ch]->sfbEnergyLdData.Long; in FDKaacEnc_psyMain()
546 pSfbEnergyMS[ch] = psyData[ch]->sfbEnergyMS.Long; in FDKaacEnc_psyMain()
547 pSfbThreshold[ch] = psyData[ch]->sfbThreshold.Long; in FDKaacEnc_psyMain()
552 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
554 if (psyStatic[ch]->isLFE) { in FDKaacEnc_psyMain()
555 psyData[ch]->sfbActive = hThisPsyConf[ch]->sfbActiveLFE; in FDKaacEnc_psyMain()
556 psyData[ch]->lowpassLine = hThisPsyConf[ch]->lowpassLineLFE; in FDKaacEnc_psyMain()
558 psyData[ch]->sfbActive = hThisPsyConf[ch]->sfbActive; in FDKaacEnc_psyMain()
559 psyData[ch]->lowpassLine = hThisPsyConf[ch]->lowpassLine; in FDKaacEnc_psyMain()
562 if (hThisPsyConf[ch]->filterbank == FB_ELD) { in FDKaacEnc_psyMain()
564 psyStatic[ch]->psyInputBuffer, psyData[ch]->mdctSpectrum, in FDKaacEnc_psyMain()
565 psyStatic[ch]->blockSwitchingControl.lastWindowSequence, in FDKaacEnc_psyMain()
566 psyStatic[ch]->blockSwitchingControl.windowShape, in FDKaacEnc_psyMain()
567 &psyStatic[ch]->blockSwitchingControl.lastWindowShape, in FDKaacEnc_psyMain()
568 nTimeSamples, &mdctSpectrum_e, hThisPsyConf[ch]->filterbank, in FDKaacEnc_psyMain()
569 psyStatic[ch]->overlapAddBuffer) != 0) { in FDKaacEnc_psyMain()
574 psyStatic[ch]->psyInputBuffer, psyData[ch]->mdctSpectrum, in FDKaacEnc_psyMain()
575 psyStatic[ch]->blockSwitchingControl.lastWindowSequence, in FDKaacEnc_psyMain()
576 psyStatic[ch]->blockSwitchingControl.windowShape, in FDKaacEnc_psyMain()
577 &psyStatic[ch]->blockSwitchingControl.lastWindowShape, in FDKaacEnc_psyMain()
578 &psyStatic[ch]->mdctPers, nTimeSamples, &mdctSpectrum_e, in FDKaacEnc_psyMain()
579 hThisPsyConf[ch]->filterbank) != 0) { in FDKaacEnc_psyMain()
584 for (w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
585 wOffset = w * windowLength[ch]; in FDKaacEnc_psyMain()
589 &psyData[ch]->mdctSpectrum[psyData[ch]->lowpassLine + wOffset], in FDKaacEnc_psyMain()
590 (windowLength[ch] - psyData[ch]->lowpassLine) * sizeof(FIXP_DBL)); in FDKaacEnc_psyMain()
593 (psyData[ch]->lowpassLine >= FADE_OUT_LEN)) { in FDKaacEnc_psyMain()
596 psyData[ch]->mdctSpectrum[psyData[ch]->lowpassLine + wOffset - in FDKaacEnc_psyMain()
598 fMult(psyData[ch]->mdctSpectrum[psyData[ch]->lowpassLine + in FDKaacEnc_psyMain()
606 for (line = 0; (line < psyData[ch]->lowpassLine) && (zeroSpec == TRUE); in FDKaacEnc_psyMain()
608 if (psyData[ch]->mdctSpectrum[line + wOffset] != (FIXP_DBL)0) { in FDKaacEnc_psyMain()
616 psyData[ch]->mdctScale = mdctSpectrum_e; in FDKaacEnc_psyMain()
619 FDKmemmove(psyStatic[ch]->psyInputBuffer, in FDKaacEnc_psyMain()
620 psyStatic[ch]->psyInputBuffer + nTimeSamples, in FDKaacEnc_psyMain()
624 FDKmemcpy(psyStatic[ch]->psyInputBuffer + nTimeSamples, in FDKaacEnc_psyMain()
626 chIdx[ch] * inputBufSize, in FDKaacEnc_psyMain()
641 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
642 for (w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
643 wOffset = w * windowLength[ch]; in FDKaacEnc_psyMain()
645 psyData[ch]->mdctSpectrum + wOffset, hThisPsyConf[ch]->sfbOffset, in FDKaacEnc_psyMain()
646 pSfbMaxScaleSpec[ch] + w * maxSfb[ch], psyData[ch]->sfbActive); in FDKaacEnc_psyMain()
648 for (sfb = 0; sfb < psyData[ch]->sfbActive; sfb++) in FDKaacEnc_psyMain()
650 (pSfbMaxScaleSpec[ch] + w * maxSfb[ch])[sfb]); in FDKaacEnc_psyMain()
656 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
657 for (w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
658 wOffset = w * windowLength[ch]; in FDKaacEnc_psyMain()
660 psyData[ch]->mdctSpectrum + wOffset, in FDKaacEnc_psyMain()
661 pSfbMaxScaleSpec[ch] + w * maxSfb[ch], hThisPsyConf[ch]->sfbOffset, in FDKaacEnc_psyMain()
662 psyData[ch]->sfbActive, pSfbEnergy[ch] + w * maxSfb[ch], in FDKaacEnc_psyMain()
663 pSfbEnergyLdData[ch] + w * maxSfb[ch], minSpecShift - 4); in FDKaacEnc_psyMain()
691 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
692 INT maxSfb_ch = maxSfb[ch]; in FDKaacEnc_psyMain()
694 for (w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
695 for (sfb = 0; sfb < psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
696 INT scale = fixMax(0, (pSfbMaxScaleSpec[ch] + w_maxSfb_ch)[sfb] - 4); in FDKaacEnc_psyMain()
699 (pSfbEnergy[ch] + w_maxSfb_ch)[sfb] >>= (scale); in FDKaacEnc_psyMain()
701 (pSfbEnergy[ch] + w_maxSfb_ch)[sfb] <<= (-scale); in FDKaacEnc_psyMain()
702 (pSfbThreshold[ch] + w_maxSfb_ch)[sfb] = in FDKaacEnc_psyMain()
703 fMult((pSfbEnergy[ch] + w_maxSfb_ch)[sfb], C_RATIO); in FDKaacEnc_psyMain()
704 (pSfbEnergyLdData[ch] + w_maxSfb_ch)[sfb] += ldShift; in FDKaacEnc_psyMain()
711 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
712 INT wLen = windowLength[ch]; in FDKaacEnc_psyMain()
713 INT lowpassLine = psyData[ch]->lowpassLine; in FDKaacEnc_psyMain()
715 FIXP_DBL *mdctSpectrum = &psyData[ch]->mdctSpectrum[0]; in FDKaacEnc_psyMain()
716 for (w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
724 for (sfb = 0; sfb < psyData[ch]->sfbActive; sfb++) in FDKaacEnc_psyMain()
725 (pSfbMaxScaleSpec[ch] + w * maxSfb[ch])[sfb] -= finalShift; in FDKaacEnc_psyMain()
728 psyData[ch]->mdctScale -= finalShift; in FDKaacEnc_psyMain()
734 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
735 psyData[ch]->mdctScale = in FDKaacEnc_psyMain()
740 for (w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
741 for (sfb = 0; sfb < psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
742 (pSfbMaxScaleSpec[ch] + w * maxSfb[ch])[sfb] = 0; in FDKaacEnc_psyMain()
743 (pSfbEnergy[ch] + w * maxSfb[ch])[sfb] = (FIXP_DBL)0; in FDKaacEnc_psyMain()
744 (pSfbEnergyLdData[ch] + w * maxSfb[ch])[sfb] = FL2FXCONST_DBL(-1.0f); in FDKaacEnc_psyMain()
745 (pSfbThreshold[ch] + w * maxSfb[ch])[sfb] = (FIXP_DBL)0; in FDKaacEnc_psyMain()
756 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
757 if (!isShortWindow[ch]) { in FDKaacEnc_psyMain()
760 psyData[ch]->mdctSpectrum, pSfbMaxScaleSpec[ch], in FDKaacEnc_psyMain()
761 pSfbEnergyLdData[ch], sfbTonality[ch], psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
762 hThisPsyConf[ch]->sfbOffset, hThisPsyConf[ch]->pnsConf.usePns); in FDKaacEnc_psyMain()
771 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
772 for (w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
773 wOffset = w * windowLength[ch]; in FDKaacEnc_psyMain()
776 tnsData[ch], &hThisPsyConf[ch]->tnsConf, in FDKaacEnc_psyMain()
777 &psyOutChannel[ch]->tnsInfo, hThisPsyConf[ch]->sfbCnt, in FDKaacEnc_psyMain()
778 psyData[ch]->mdctSpectrum + wOffset, w, in FDKaacEnc_psyMain()
779 psyStatic[ch]->blockSwitchingControl.lastWindowSequence); in FDKaacEnc_psyMain()
818 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
819 if (tnsActive[0] && !isShortWindow[ch]) { in FDKaacEnc_psyMain()
825 for (sfb = 0; sfb < hThisPsyConf[ch]->lowpassLine; sfb++) { in FDKaacEnc_psyMain()
826 psyData[ch]->mdctSpectrum[sfb] = in FDKaacEnc_psyMain()
827 psyData[ch]->mdctSpectrum[sfb] >> shift; in FDKaacEnc_psyMain()
831 for (sfb = 0; sfb < psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
832 pSfbThreshold[ch][sfb] >>= (2 * shift); in FDKaacEnc_psyMain()
835 psyData[ch]->mdctScale += shift; /* update mdctScale */ in FDKaacEnc_psyMain()
841 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
842 for (w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
843 wOffset = w * windowLength[ch]; in FDKaacEnc_psyMain()
845 &psyOutChannel[ch]->tnsInfo, tnsData[ch], in FDKaacEnc_psyMain()
846 hThisPsyConf[ch]->sfbCnt, &hThisPsyConf[ch]->tnsConf, in FDKaacEnc_psyMain()
847 hThisPsyConf[ch]->sfbOffset[psyData[ch]->sfbActive], in FDKaacEnc_psyMain()
851 psyData[ch]->mdctSpectrum + in FDKaacEnc_psyMain()
853 w, psyStatic[ch]->blockSwitchingControl.lastWindowSequence); in FDKaacEnc_psyMain()
860 FDKaacEnc_CalcSfbMaxScaleSpec(psyData[ch]->mdctSpectrum + wOffset, in FDKaacEnc_psyMain()
861 hThisPsyConf[ch]->sfbOffset, in FDKaacEnc_psyMain()
862 pSfbMaxScaleSpec[ch] + w * maxSfb[ch], in FDKaacEnc_psyMain()
863 psyData[ch]->sfbActive); in FDKaacEnc_psyMain()
868 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
869 for (w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
871 if (isShortWindow[ch]) { in FDKaacEnc_psyMain()
873 psyData[ch]->mdctSpectrum + w * windowLength[ch], in FDKaacEnc_psyMain()
874 pSfbMaxScaleSpec[ch] + w * maxSfb[ch], in FDKaacEnc_psyMain()
875 hThisPsyConf[ch]->sfbOffset, psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
876 pSfbEnergy[ch] + w * maxSfb[ch]); in FDKaacEnc_psyMain()
878 nrgScaling[ch] = /* with tns, energy calculation can overflow; -> in FDKaacEnc_psyMain()
881 psyData[ch]->mdctSpectrum, pSfbMaxScaleSpec[ch], in FDKaacEnc_psyMain()
882 hThisPsyConf[ch]->sfbOffset, psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
883 pSfbEnergy[ch], pSfbEnergyLdData[ch]); in FDKaacEnc_psyMain()
885 fixMax(tnsSpecShift, nrgScaling[ch]); /* nrgScaling is set in FDKaacEnc_psyMain()
894 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
895 if ((tnsSpecShift != 0) && !isShortWindow[ch]) { in FDKaacEnc_psyMain()
898 for (line = 0; line < hThisPsyConf[ch]->lowpassLine; line++) { in FDKaacEnc_psyMain()
899 psyData[ch]->mdctSpectrum[line] >>= tnsSpecShift; in FDKaacEnc_psyMain()
901 INT scale = (tnsSpecShift - nrgScaling[ch]) << 1; in FDKaacEnc_psyMain()
902 for (sfb = 0; sfb < psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
903 pSfbEnergyLdData[ch][sfb] -= in FDKaacEnc_psyMain()
905 pSfbEnergy[ch][sfb] >>= scale; in FDKaacEnc_psyMain()
906 pSfbThreshold[ch][sfb] >>= (tnsSpecShift << 1); in FDKaacEnc_psyMain()
908 psyData[ch]->mdctScale += tnsSpecShift; /* update mdctScale; not in FDKaacEnc_psyMain()
923 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
927 INT energyShift = psyData[ch]->mdctScale * 2; in FDKaacEnc_psyMain()
929 if (isShortWindow[ch]) in FDKaacEnc_psyMain()
935 clipEnergy = hThisPsyConf[ch]->clipEnergy >> clipNrgShift; in FDKaacEnc_psyMain()
937 clipEnergy = hThisPsyConf[ch]->clipEnergy << -clipNrgShift; in FDKaacEnc_psyMain()
941 for (w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
944 for (i = 0; i < psyData[ch]->sfbActive; i++) { in FDKaacEnc_psyMain()
945 *(pSfbThreshold[ch] + w * maxSfb[ch] + i) = in FDKaacEnc_psyMain()
946 fixMin(*(pSfbThreshold[ch] + w * maxSfb[ch] + i), clipEnergy); in FDKaacEnc_psyMain()
950 FDKaacEnc_SpreadingMax(psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
951 hThisPsyConf[ch]->sfbMaskLowFactor, in FDKaacEnc_psyMain()
952 hThisPsyConf[ch]->sfbMaskHighFactor, in FDKaacEnc_psyMain()
953 pSfbThreshold[ch] + w * maxSfb[ch]); in FDKaacEnc_psyMain()
959 for (i = 0; i < psyData[ch]->sfbActive; i++) { in FDKaacEnc_psyMain()
960 *(pSfbThreshold[ch] + w * maxSfb[ch] + i) = fixMax( in FDKaacEnc_psyMain()
961 *(pSfbThreshold[ch] + w * maxSfb[ch] + i) >> THR_SHIFTBITS, in FDKaacEnc_psyMain()
962 (hThisPsyConf[ch]->sfbPcmQuantThreshold[i] >> energyShift)); in FDKaacEnc_psyMain()
966 for (i = 0; i < psyData[ch]->sfbActive; i++) { in FDKaacEnc_psyMain()
967 *(pSfbThreshold[ch] + w * maxSfb[ch] + i) = fixMax( in FDKaacEnc_psyMain()
968 *(pSfbThreshold[ch] + w * maxSfb[ch] + i) >> THR_SHIFTBITS, in FDKaacEnc_psyMain()
969 (hThisPsyConf[ch]->sfbPcmQuantThreshold[i] << energyShift)); in FDKaacEnc_psyMain()
973 if (!psyStatic[ch]->isLFE) { in FDKaacEnc_psyMain()
975 if (psyStatic[ch]->blockSwitchingControl.lastWindowSequence == in FDKaacEnc_psyMain()
979 for (i = 0; i < psyData[ch]->sfbActive; i++) { in FDKaacEnc_psyMain()
980 psyStatic[ch]->sfbThresholdnm1[i] = (FIXP_DBL)MAXVAL_DBL; in FDKaacEnc_psyMain()
983 psyStatic[ch]->mdctScalenm1 = 0; in FDKaacEnc_psyMain()
984 psyStatic[ch]->calcPreEcho = 0; in FDKaacEnc_psyMain()
988 psyStatic[ch]->sfbThresholdnm1, psyStatic[ch]->calcPreEcho, in FDKaacEnc_psyMain()
989 psyData[ch]->sfbActive, hThisPsyConf[ch]->maxAllowedIncreaseFactor, in FDKaacEnc_psyMain()
990 hThisPsyConf[ch]->minRemainingThresholdFactor, in FDKaacEnc_psyMain()
991 pSfbThreshold[ch] + w * maxSfb[ch], psyData[ch]->mdctScale, in FDKaacEnc_psyMain()
992 &psyStatic[ch]->mdctScalenm1); in FDKaacEnc_psyMain()
994 psyStatic[ch]->calcPreEcho = 1; in FDKaacEnc_psyMain()
996 if (psyStatic[ch]->blockSwitchingControl.lastWindowSequence == in FDKaacEnc_psyMain()
1000 for (i = 0; i < psyData[ch]->sfbActive; i++) { in FDKaacEnc_psyMain()
1001 psyStatic[ch]->sfbThresholdnm1[i] = (FIXP_DBL)MAXVAL_DBL; in FDKaacEnc_psyMain()
1004 psyStatic[ch]->mdctScalenm1 = 0; in FDKaacEnc_psyMain()
1005 psyStatic[ch]->calcPreEcho = 0; in FDKaacEnc_psyMain()
1010 FDKmemcpy(pSfbSpreadEnergy[ch] + w * maxSfb[ch], in FDKaacEnc_psyMain()
1011 pSfbEnergy[ch] + w * maxSfb[ch], in FDKaacEnc_psyMain()
1012 psyData[ch]->sfbActive * sizeof(FIXP_DBL)); in FDKaacEnc_psyMain()
1014 FDKaacEnc_SpreadingMax(psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
1015 hThisPsyConf[ch]->sfbMaskLowFactorSprEn, in FDKaacEnc_psyMain()
1016 hThisPsyConf[ch]->sfbMaskHighFactorSprEn, in FDKaacEnc_psyMain()
1017 pSfbSpreadEnergy[ch] + w * maxSfb[ch]); in FDKaacEnc_psyMain()
1040 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
1041 if (isShortWindow[ch]) { in FDKaacEnc_psyMain()
1043 int noSfb = psyStatic[ch]->blockSwitchingControl.noOfGroups * in FDKaacEnc_psyMain()
1048 psyData[ch]->mdctSpectrum, &psyData[ch]->sfbThreshold, in FDKaacEnc_psyMain()
1049 &psyData[ch]->sfbEnergy, &psyData[ch]->sfbEnergyMS, in FDKaacEnc_psyMain()
1050 &psyData[ch]->sfbSpreadEnergy, hPsyConfShort->sfbCnt, in FDKaacEnc_psyMain()
1051 psyData[ch]->sfbActive, hPsyConfShort->sfbOffset, in FDKaacEnc_psyMain()
1052 hPsyConfShort->sfbMinSnrLdData, psyData[ch]->groupedSfbOffset, in FDKaacEnc_psyMain()
1053 &maxSfbPerGroup[ch], psyOutChannel[ch]->sfbMinSnrLdData, in FDKaacEnc_psyMain()
1054 psyStatic[ch]->blockSwitchingControl.noOfGroups, in FDKaacEnc_psyMain()
1055 psyStatic[ch]->blockSwitchingControl.groupLen, in FDKaacEnc_psyMain()
1061 LdDataVector(&psyData[ch]->sfbEnergy.Long[sfbGrp], in FDKaacEnc_psyMain()
1062 &psyOutChannel[ch]->sfbEnergyLdData[sfbGrp], in FDKaacEnc_psyMain()
1063 psyData[ch]->sfbActive); in FDKaacEnc_psyMain()
1068 LdDataVector(&psyData[ch]->sfbThreshold.Long[sfbGrp], in FDKaacEnc_psyMain()
1069 &psyOutChannel[ch]->sfbThresholdLdData[sfbGrp], in FDKaacEnc_psyMain()
1070 psyData[ch]->sfbActive); in FDKaacEnc_psyMain()
1071 for (sfb = 0; sfb < psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
1072 psyOutChannel[ch]->sfbThresholdLdData[sfbGrp + sfb] = in FDKaacEnc_psyMain()
1073 fixMax(psyOutChannel[ch]->sfbThresholdLdData[sfbGrp + sfb], in FDKaacEnc_psyMain()
1080 LdDataVector(&psyData[ch]->sfbEnergyMS.Long[sfbGrp], in FDKaacEnc_psyMain()
1081 &psyData[ch]->sfbEnergyMSLdData[sfbGrp], in FDKaacEnc_psyMain()
1082 psyData[ch]->sfbActive); in FDKaacEnc_psyMain()
1086 FDKmemcpy(psyOutChannel[ch]->sfbOffsets, psyData[ch]->groupedSfbOffset, in FDKaacEnc_psyMain()
1092 for (sfb = psyData[ch]->sfbActive - 1; sfb >= 0; sfb--) { in FDKaacEnc_psyMain()
1095 if (psyData[ch]->mdctSpectrum[line] != FL2FXCONST_SGL(0.0f)) break; in FDKaacEnc_psyMain()
1099 maxSfbPerGroup[ch] = sfb + 1; in FDKaacEnc_psyMain()
1100 maxSfbPerGroup[ch] = in FDKaacEnc_psyMain()
1101 fixMax(fixMin(5, psyData[ch]->sfbActive), maxSfbPerGroup[ch]); in FDKaacEnc_psyMain()
1105 FDKmemcpy(psyOutChannel[ch]->sfbEnergyLdData, in FDKaacEnc_psyMain()
1106 psyData[ch]->sfbEnergyLdData.Long, in FDKaacEnc_psyMain()
1107 psyData[ch]->sfbActive * sizeof(FIXP_DBL)); in FDKaacEnc_psyMain()
1109 FDKmemcpy(psyOutChannel[ch]->sfbOffsets, hPsyConfLong->sfbOffset, in FDKaacEnc_psyMain()
1113 FDKmemcpy(psyOutChannel[ch]->sfbMinSnrLdData, in FDKaacEnc_psyMain()
1115 psyData[ch]->sfbActive * sizeof(FIXP_DBL)); in FDKaacEnc_psyMain()
1121 LdDataVector(psyData[ch]->sfbThreshold.Long, in FDKaacEnc_psyMain()
1122 psyOutChannel[ch]->sfbThresholdLdData, in FDKaacEnc_psyMain()
1123 psyData[ch]->sfbActive); in FDKaacEnc_psyMain()
1124 for (i = 0; i < psyData[ch]->sfbActive; i++) { in FDKaacEnc_psyMain()
1125 psyOutChannel[ch]->sfbThresholdLdData[i] = in FDKaacEnc_psyMain()
1126 fixMax(psyOutChannel[ch]->sfbThresholdLdData[i], in FDKaacEnc_psyMain()
1135 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
1136 FDKmemclear(psyOutChannel[ch]->isBook, MAX_GROUPED_SFB * sizeof(INT)); in FDKaacEnc_psyMain()
1137 FDKmemclear(psyOutChannel[ch]->isScale, MAX_GROUPED_SFB * sizeof(INT)); in FDKaacEnc_psyMain()
1140 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
1141 INT win = (isShortWindow[ch] ? 1 : 0); in FDKaacEnc_psyMain()
1142 if (!psyStatic[ch]->isLFE) { in FDKaacEnc_psyMain()
1145 &(psyConf[0].pnsConf), pnsData[ch], in FDKaacEnc_psyMain()
1146 psyStatic[ch]->blockSwitchingControl.lastWindowSequence, in FDKaacEnc_psyMain()
1147 psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
1148 maxSfbPerGroup[ch], /* count of Sfb which are not zero. */ in FDKaacEnc_psyMain()
1149 psyOutChannel[ch]->sfbThresholdLdData, psyConf[win].sfbOffset, in FDKaacEnc_psyMain()
1150 psyData[ch]->mdctSpectrum, psyData[ch]->sfbMaxScaleSpec.Long, in FDKaacEnc_psyMain()
1151 sfbTonality[ch], psyOutChannel[ch]->tnsInfo.order[0][0], in FDKaacEnc_psyMain()
1152 tnsData[ch]->dataRaw.Long.subBlockInfo.predictionGain[HIFILT], in FDKaacEnc_psyMain()
1153 tnsData[ch]->dataRaw.Long.subBlockInfo.tnsActive[HIFILT], in FDKaacEnc_psyMain()
1154 psyOutChannel[ch]->sfbEnergyLdData, psyOutChannel[ch]->noiseNrg); in FDKaacEnc_psyMain()
1232 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
1233 if (psyStatic[ch]->isLFE) { in FDKaacEnc_psyMain()
1235 for (sfb = 0; sfb < psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
1236 psyOutChannel[ch]->noiseNrg[sfb] = NO_NOISE_PNS; in FDKaacEnc_psyMain()
1240 psyData[ch]->sfbActive, &(hThisPsyConf[ch]->pnsConf), in FDKaacEnc_psyMain()
1241 pnsData[ch]->pnsFlag, psyData[ch]->sfbEnergyLdData.Long, in FDKaacEnc_psyMain()
1242 psyOutChannel[ch]->noiseNrg, /* this is the energy that will be in FDKaacEnc_psyMain()
1244 psyOutChannel[ch]->sfbThresholdLdData); in FDKaacEnc_psyMain()
1251 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
1254 psyOutChannel[ch]->maxSfbPerGroup = maxSfbPerGroup[ch]; in FDKaacEnc_psyMain()
1255 psyOutChannel[ch]->mdctScale = psyData[ch]->mdctScale; in FDKaacEnc_psyMain()
1256 if (isShortWindow[ch] == 0) { in FDKaacEnc_psyMain()
1257 psyOutChannel[ch]->sfbCnt = hPsyConfLong->sfbActive; in FDKaacEnc_psyMain()
1258 psyOutChannel[ch]->sfbPerGroup = hPsyConfLong->sfbActive; in FDKaacEnc_psyMain()
1259 psyOutChannel[ch]->lastWindowSequence = in FDKaacEnc_psyMain()
1260 psyStatic[ch]->blockSwitchingControl.lastWindowSequence; in FDKaacEnc_psyMain()
1261 psyOutChannel[ch]->windowShape = in FDKaacEnc_psyMain()
1262 psyStatic[ch]->blockSwitchingControl.windowShape; in FDKaacEnc_psyMain()
1264 INT sfbCnt = psyStatic[ch]->blockSwitchingControl.noOfGroups * in FDKaacEnc_psyMain()
1267 psyOutChannel[ch]->sfbCnt = sfbCnt; in FDKaacEnc_psyMain()
1268 psyOutChannel[ch]->sfbPerGroup = hPsyConfShort->sfbCnt; in FDKaacEnc_psyMain()
1269 psyOutChannel[ch]->lastWindowSequence = SHORT_WINDOW; in FDKaacEnc_psyMain()
1270 psyOutChannel[ch]->windowShape = SINE_WINDOW; in FDKaacEnc_psyMain()
1274 for (grp = 0; grp < psyStatic[ch]->blockSwitchingControl.noOfGroups; in FDKaacEnc_psyMain()
1278 for (j = 1; j < psyStatic[ch]->blockSwitchingControl.groupLen[grp]; j++) { in FDKaacEnc_psyMain()
1282 psyOutChannel[ch]->groupingMask = mask; in FDKaacEnc_psyMain()
1285 FDKmemcpy(psyOutChannel[ch]->groupLen, in FDKaacEnc_psyMain()
1286 psyStatic[ch]->blockSwitchingControl.groupLen, in FDKaacEnc_psyMain()
1288 FDKmemcpy(psyOutChannel[ch]->sfbEnergy, (&psyData[ch]->sfbEnergy)->Long, in FDKaacEnc_psyMain()
1290 FDKmemcpy(psyOutChannel[ch]->sfbSpreadEnergy, in FDKaacEnc_psyMain()
1291 (&psyData[ch]->sfbSpreadEnergy)->Long, in FDKaacEnc_psyMain()