Lines Matching refs:ch

250   int i, ch, n, chInc = 0, resetChannels = 3;  in FDKaacEnc_psyInit()  local
262 for (ch=0; ch<cm->elInfo[i].nChannelsInEl; ch++) { in FDKaacEnc_psyInit()
264 hPsy->psyElement[i]->psyStatic[ch] = hPsy->pStaticChannels[chInc]; in FDKaacEnc_psyInit()
266 FDKaacEnc_psyInitStates(hPsy, hPsy->psyElement[i]->psyStatic[ch], audioObjectType); in FDKaacEnc_psyInit()
268 hPsy->psyElement[i]->psyStatic[ch]->isLFE = 0; in FDKaacEnc_psyInit()
271 hPsy->psyElement[i]->psyStatic[ch] = hPsy->pStaticChannels[nMaxChannels-1]; in FDKaacEnc_psyInit()
272 hPsy->psyElement[i]->psyStatic[ch]->isLFE = 1; in FDKaacEnc_psyInit()
281 for (ch=0; ch<cm->elInfo[i].nChannelsInEl; ch++) { in FDKaacEnc_psyInit()
282 phpsyOut[n]->psyOutElement[i]->psyOutChannel[ch] = phpsyOut[n]->pPsyOutChannels[chInc++]; in FDKaacEnc_psyInit()
313 int i, ch; in FDKaacEnc_psyMainInit() local
380 for (ch=0; ch<cm->elInfo[i].nChannelsInEl; ch++) { in FDKaacEnc_psyMainInit()
383 FDKaacEnc_psyInitStates(hPsy, hPsy->psyElement[i]->psyStatic[ch], audioObjectType); in FDKaacEnc_psyMainInit()
386 FDKaacEnc_InitPreEchoControl(hPsy->psyElement[i]->psyStatic[ch]->sfbThresholdnm1, in FDKaacEnc_psyMainInit()
387 &hPsy->psyElement[i]->psyStatic[ch]->calcPreEcho, in FDKaacEnc_psyMainInit()
390 &hPsy->psyElement[i]->psyStatic[ch]->mdctScalenm1); in FDKaacEnc_psyMainInit()
455 INT ch; /* counts through channels */ in FDKaacEnc_psyMain() local
497 for(ch = 0; ch < channels; ch++) in FDKaacEnc_psyMain()
499 psyData[ch] = &psyDynamic->psyData[ch]; in FDKaacEnc_psyMain()
500 tnsData[ch] = &psyDynamic->tnsData[ch]; in FDKaacEnc_psyMain()
501 pnsData[ch] = &psyDynamic->pnsData[ch]; in FDKaacEnc_psyMain()
503 psyData[ch]->mdctSpectrum = psyOutChannel[ch]->mdctSpectrum; in FDKaacEnc_psyMain()
511 for(ch = 0; ch < channels; ch++) in FDKaacEnc_psyMain()
517 &pInput[chIdx[ch]], in FDKaacEnc_psyMain()
522 FDKaacEnc_BlockSwitching (&psyStatic[ch]->blockSwitchingControl, in FDKaacEnc_psyMain()
524 psyStatic[ch]->isLFE, in FDKaacEnc_psyMain()
530 FDKmemcpy(psyStatic[ch]->psyInputBuffer+blockSwitchingOffset, in FDKaacEnc_psyMain()
549 for(ch = 0; ch < channels; ch++) in FDKaacEnc_psyMain()
552 FDKaacEnc_deinterleaveInputBuffer( psyStatic[ch]->psyInputBuffer + blockSwitchingOffset, in FDKaacEnc_psyMain()
553 &pInput[chIdx[ch]], in FDKaacEnc_psyMain()
559 for(ch = 0; ch < channels; ch++) in FDKaacEnc_psyMain()
560 isShortWindow[ch]=(psyStatic[ch]->blockSwitchingControl.lastWindowSequence == SHORT_WINDOW); in FDKaacEnc_psyMain()
563 for(ch = 0; ch < channels; ch++) in FDKaacEnc_psyMain()
565 if(isShortWindow[ch]) { in FDKaacEnc_psyMain()
566 hThisPsyConf[ch] = hPsyConfShort; in FDKaacEnc_psyMain()
567 windowLength[ch] = psyConf->granuleLength/TRANS_FAC; in FDKaacEnc_psyMain()
568 nWindows[ch] = TRANS_FAC; in FDKaacEnc_psyMain()
569 maxSfb[ch] = MAX_SFB_SHORT; in FDKaacEnc_psyMain()
571 pSfbMaxScaleSpec[ch] = psyData[ch]->sfbMaxScaleSpec.Short[0]; in FDKaacEnc_psyMain()
572 pSfbEnergy[ch] = psyData[ch]->sfbEnergy.Short[0]; in FDKaacEnc_psyMain()
573 pSfbSpreadEnergy[ch] = psyData[ch]->sfbSpreadEnergy.Short[0]; in FDKaacEnc_psyMain()
574 pSfbEnergyLdData[ch] = psyData[ch]->sfbEnergyLdData.Short[0]; in FDKaacEnc_psyMain()
575 pSfbEnergyMS[ch] = psyData[ch]->sfbEnergyMS.Short[0]; in FDKaacEnc_psyMain()
576 pSfbThreshold[ch] = psyData[ch]->sfbThreshold.Short[0]; in FDKaacEnc_psyMain()
580 hThisPsyConf[ch] = hPsyConfLong; in FDKaacEnc_psyMain()
581 windowLength[ch] = psyConf->granuleLength; in FDKaacEnc_psyMain()
582 nWindows[ch] = 1; in FDKaacEnc_psyMain()
583 maxSfb[ch] = MAX_GROUPED_SFB; in FDKaacEnc_psyMain()
585 pSfbMaxScaleSpec[ch] = psyData[ch]->sfbMaxScaleSpec.Long; in FDKaacEnc_psyMain()
586 pSfbEnergy[ch] = psyData[ch]->sfbEnergy.Long; in FDKaacEnc_psyMain()
587 pSfbSpreadEnergy[ch] = psyData[ch]->sfbSpreadEnergy.Long; in FDKaacEnc_psyMain()
588 pSfbEnergyLdData[ch] = psyData[ch]->sfbEnergyLdData.Long; in FDKaacEnc_psyMain()
589 pSfbEnergyMS[ch] = psyData[ch]->sfbEnergyMS.Long; in FDKaacEnc_psyMain()
590 pSfbThreshold[ch] = psyData[ch]->sfbThreshold.Long; in FDKaacEnc_psyMain()
595 for(ch = 0; ch < channels; ch++) in FDKaacEnc_psyMain()
598 if (psyStatic[ch]->isLFE) { in FDKaacEnc_psyMain()
599 psyData[ch]->sfbActive = hThisPsyConf[ch]->sfbActiveLFE; in FDKaacEnc_psyMain()
600 psyData[ch]->lowpassLine = hThisPsyConf[ch]->lowpassLineLFE; in FDKaacEnc_psyMain()
603 psyData[ch]->sfbActive = hThisPsyConf[ch]->sfbActive; in FDKaacEnc_psyMain()
604 psyData[ch]->lowpassLine = hThisPsyConf[ch]->lowpassLine; in FDKaacEnc_psyMain()
607 for(w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
609 wOffset = w*windowLength[ch]; in FDKaacEnc_psyMain()
611 FDKaacEnc_Transform_Real( psyStatic[ch]->psyInputBuffer + wOffset, in FDKaacEnc_psyMain()
612 psyData[ch]->mdctSpectrum+wOffset, in FDKaacEnc_psyMain()
613 psyStatic[ch]->blockSwitchingControl.lastWindowSequence, in FDKaacEnc_psyMain()
614 psyStatic[ch]->blockSwitchingControl.windowShape, in FDKaacEnc_psyMain()
615 &psyStatic[ch]->blockSwitchingControl.lastWindowShape, in FDKaacEnc_psyMain()
618 hThisPsyConf[ch]->filterbank in FDKaacEnc_psyMain()
619 ,psyStatic[ch]->overlapAddBuffer in FDKaacEnc_psyMain()
623 FDKmemclear(&psyData[ch]->mdctSpectrum[psyData[ch]->lowpassLine+wOffset], in FDKaacEnc_psyMain()
624 (windowLength[ch]-psyData[ch]->lowpassLine)*sizeof(FIXP_DBL)); in FDKaacEnc_psyMain()
626 if ( (hPsyConfLong->filterbank != FB_LC) && (psyData[ch]->lowpassLine >= FADE_OUT_LEN) ) { in FDKaacEnc_psyMain()
629 …psyData[ch]->mdctSpectrum[psyData[ch]->lowpassLine+wOffset - FADE_OUT_LEN + i] = fMult(psyData[ch]… in FDKaacEnc_psyMain()
635 for(line=0; (line<psyData[ch]->lowpassLine) && (zeroSpec==TRUE); line++) { in FDKaacEnc_psyMain()
636 if (psyData[ch]->mdctSpectrum[line+wOffset] != (FIXP_DBL)0) { in FDKaacEnc_psyMain()
644 psyData[ch]->mdctScale = mdctSpectrum_e; in FDKaacEnc_psyMain()
647 FDKmemmove(psyStatic[ch]->psyInputBuffer, in FDKaacEnc_psyMain()
648 psyStatic[ch]->psyInputBuffer+psyConf->granuleLength, in FDKaacEnc_psyMain()
653 FDKaacEnc_deinterleaveInputBuffer( psyStatic[ch]->psyInputBuffer+psyConf->granuleLength, in FDKaacEnc_psyMain()
654 … &pInput[ (2*psyConf->granuleLength-blockSwitchingOffset)*totalChannels + chIdx[ch] ], in FDKaacEnc_psyMain()
670 for(ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
671 for(w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
672 wOffset = w*windowLength[ch]; in FDKaacEnc_psyMain()
673 FDKaacEnc_CalcSfbMaxScaleSpec(psyData[ch]->mdctSpectrum+wOffset, in FDKaacEnc_psyMain()
674 hThisPsyConf[ch]->sfbOffset, in FDKaacEnc_psyMain()
675 pSfbMaxScaleSpec[ch]+w*maxSfb[ch], in FDKaacEnc_psyMain()
676 psyData[ch]->sfbActive); in FDKaacEnc_psyMain()
678 for (sfb = 0; sfb<psyData[ch]->sfbActive; sfb++) in FDKaacEnc_psyMain()
679 minSpecShift = fixMin(minSpecShift, (pSfbMaxScaleSpec[ch]+w*maxSfb[ch])[sfb]); in FDKaacEnc_psyMain()
685 for(ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
686 for(w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
687 wOffset = w*windowLength[ch]; in FDKaacEnc_psyMain()
688 currNrg = FDKaacEnc_CheckBandEnergyOptim(psyData[ch]->mdctSpectrum+wOffset, in FDKaacEnc_psyMain()
689 pSfbMaxScaleSpec[ch]+w*maxSfb[ch], in FDKaacEnc_psyMain()
690 hThisPsyConf[ch]->sfbOffset, in FDKaacEnc_psyMain()
691 psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
692 pSfbEnergy[ch]+w*maxSfb[ch], in FDKaacEnc_psyMain()
693 pSfbEnergyLdData[ch]+w*maxSfb[ch], in FDKaacEnc_psyMain()
720 for(ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
721 for(w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
722 for(sfb=0; sfb<psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
723 INT scale = fixMax(0, (pSfbMaxScaleSpec[ch]+w*maxSfb[ch])[sfb]-4); in FDKaacEnc_psyMain()
725 if (scale >= 0) (pSfbEnergy[ch]+w*maxSfb[ch])[sfb] >>= (scale); in FDKaacEnc_psyMain()
726 else (pSfbEnergy[ch]+w*maxSfb[ch])[sfb] <<= (-scale); in FDKaacEnc_psyMain()
727 … (pSfbThreshold[ch]+w*maxSfb[ch])[sfb] = fMult((pSfbEnergy[ch]+w*maxSfb[ch])[sfb], C_RATIO); in FDKaacEnc_psyMain()
728 (pSfbEnergyLdData[ch]+w*maxSfb[ch])[sfb] += ldShift; in FDKaacEnc_psyMain()
734 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
735 for(w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
736 wOffset = w*windowLength[ch]; in FDKaacEnc_psyMain()
737 for(line=0; line<psyData[ch]->lowpassLine; line++) { in FDKaacEnc_psyMain()
738 psyData[ch]->mdctSpectrum[line+wOffset] <<= finalShift; in FDKaacEnc_psyMain()
741 for (sfb = 0; sfb<psyData[ch]->sfbActive; sfb++) in FDKaacEnc_psyMain()
742 (pSfbMaxScaleSpec[ch]+w*maxSfb[ch])[sfb] -= finalShift; in FDKaacEnc_psyMain()
745 psyData[ch]->mdctScale -= finalShift; in FDKaacEnc_psyMain()
751 for (ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
752 …psyData[ch]->mdctScale = 0; /* otherwise mdctScale would be for example 7 and PCM quantization… in FDKaacEnc_psyMain()
755 for(w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
756 for (sfb = 0; sfb<psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
757 (pSfbMaxScaleSpec[ch]+w*maxSfb[ch])[sfb] = 0; in FDKaacEnc_psyMain()
758 (pSfbEnergy[ch]+w*maxSfb[ch])[sfb] = (FIXP_DBL)0; in FDKaacEnc_psyMain()
759 (pSfbEnergyLdData[ch]+w*maxSfb[ch])[sfb] = FL2FXCONST_DBL(-1.0f); in FDKaacEnc_psyMain()
760 (pSfbThreshold[ch]+w*maxSfb[ch])[sfb] = (FIXP_DBL)0; in FDKaacEnc_psyMain()
774 for(ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
775 if (!isShortWindow[ch]) { in FDKaacEnc_psyMain()
777 FDKaacEnc_CalculateFullTonality( psyData[ch]->mdctSpectrum, in FDKaacEnc_psyMain()
778 pSfbMaxScaleSpec[ch], in FDKaacEnc_psyMain()
779 pSfbEnergyLdData[ch], in FDKaacEnc_psyMain()
780 sfbTonality[ch], in FDKaacEnc_psyMain()
781 psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
782 hThisPsyConf[ch]->sfbOffset, in FDKaacEnc_psyMain()
783 hThisPsyConf[ch]->pnsConf.usePns); in FDKaacEnc_psyMain()
792 for(ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
793 for(w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
795 wOffset = w*windowLength[ch]; in FDKaacEnc_psyMain()
798 tnsData[ch], in FDKaacEnc_psyMain()
799 &hThisPsyConf[ch]->tnsConf, in FDKaacEnc_psyMain()
800 &psyOutChannel[ch]->tnsInfo, in FDKaacEnc_psyMain()
801 hThisPsyConf[ch]->sfbCnt, in FDKaacEnc_psyMain()
802 psyData[ch]->mdctSpectrum+wOffset, in FDKaacEnc_psyMain()
804 psyStatic[ch]->blockSwitchingControl.lastWindowSequence in FDKaacEnc_psyMain()
836 for(ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
837 if (tnsActive[0] && !isShortWindow[ch]) { in FDKaacEnc_psyMain()
841 for(sfb=0; sfb<hThisPsyConf[ch]->lowpassLine; sfb++) { in FDKaacEnc_psyMain()
842 psyData[ch]->mdctSpectrum[sfb] = psyData[ch]->mdctSpectrum[sfb] >> shift; in FDKaacEnc_psyMain()
846 for (sfb=0; sfb<psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
847 pSfbThreshold[ch][sfb] >>= (2*shift); in FDKaacEnc_psyMain()
850 psyData[ch]->mdctScale += shift; /* update mdctScale */ in FDKaacEnc_psyMain()
857 for(ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
858 for(w = 0; w < nWindows[ch]; w++) in FDKaacEnc_psyMain()
860 wOffset = w*windowLength[ch]; in FDKaacEnc_psyMain()
862 &psyOutChannel[ch]->tnsInfo, in FDKaacEnc_psyMain()
863 tnsData[ch], in FDKaacEnc_psyMain()
864 hThisPsyConf[ch]->sfbCnt, in FDKaacEnc_psyMain()
865 &hThisPsyConf[ch]->tnsConf, in FDKaacEnc_psyMain()
866 …hThisPsyConf[ch]->sfbOffset[psyData[ch]->sfbActive],/*hThisPsyConf[ch]->lowpassLine*/ /* filter st… in FDKaacEnc_psyMain()
867 psyData[ch]->mdctSpectrum+wOffset, in FDKaacEnc_psyMain()
869 psyStatic[ch]->blockSwitchingControl.lastWindowSequence); in FDKaacEnc_psyMain()
874 FDKaacEnc_CalcSfbMaxScaleSpec(psyData[ch]->mdctSpectrum+wOffset, in FDKaacEnc_psyMain()
875 hThisPsyConf[ch]->sfbOffset, in FDKaacEnc_psyMain()
876 pSfbMaxScaleSpec[ch]+w*maxSfb[ch], in FDKaacEnc_psyMain()
877 psyData[ch]->sfbActive); in FDKaacEnc_psyMain()
882 for(ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
883 for(w = 0; w < nWindows[ch]; w++) { in FDKaacEnc_psyMain()
887 if (isShortWindow[ch]) { in FDKaacEnc_psyMain()
888 FDKaacEnc_CalcBandEnergyOptimShort(psyData[ch]->mdctSpectrum+w*windowLength[ch], in FDKaacEnc_psyMain()
889 pSfbMaxScaleSpec[ch]+w*maxSfb[ch], in FDKaacEnc_psyMain()
890 hThisPsyConf[ch]->sfbOffset, in FDKaacEnc_psyMain()
891 psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
892 pSfbEnergy[ch]+w*maxSfb[ch]); in FDKaacEnc_psyMain()
895 … nrgScaling[ch] = /* with tns, energy calculation can overflow; -> scaling */ in FDKaacEnc_psyMain()
896 FDKaacEnc_CalcBandEnergyOptimLong(psyData[ch]->mdctSpectrum, in FDKaacEnc_psyMain()
897 pSfbMaxScaleSpec[ch], in FDKaacEnc_psyMain()
898 hThisPsyConf[ch]->sfbOffset, in FDKaacEnc_psyMain()
899 psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
900 pSfbEnergy[ch], in FDKaacEnc_psyMain()
901 pSfbEnergyLdData[ch]); in FDKaacEnc_psyMain()
902 …tnsSpecShift = fixMax(tnsSpecShift, nrgScaling[ch]); /* nrgScaling is set only if nrg would … in FDKaacEnc_psyMain()
909 for(ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
910 if ( (tnsSpecShift!=0) && !isShortWindow[ch] ) { in FDKaacEnc_psyMain()
912 for(line=0; line<hThisPsyConf[ch]->lowpassLine; line++) { in FDKaacEnc_psyMain()
913 psyData[ch]->mdctSpectrum[line] >>= tnsSpecShift; in FDKaacEnc_psyMain()
915 INT scale = (tnsSpecShift-nrgScaling[ch])<<1; in FDKaacEnc_psyMain()
916 for(sfb=0; sfb<psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
917 pSfbEnergyLdData[ch][sfb] -= scale*FL2FXCONST_DBL(1.0/LD_DATA_SCALING); in FDKaacEnc_psyMain()
918 pSfbEnergy[ch][sfb] >>= scale; in FDKaacEnc_psyMain()
919 pSfbThreshold[ch][sfb] >>= (tnsSpecShift<<1); in FDKaacEnc_psyMain()
921 …psyData[ch]->mdctScale += tnsSpecShift; /* update mdctScale; not necessary to update sfbMaxScaleS… in FDKaacEnc_psyMain()
935 for(ch = 0; ch < channels; ch++) { in FDKaacEnc_psyMain()
939 INT energyShift = psyData[ch]->mdctScale*2 ; in FDKaacEnc_psyMain()
942 if(isShortWindow[ch]) in FDKaacEnc_psyMain()
948 clipEnergy = hThisPsyConf[ch]->clipEnergy >> clipNrgShift ; in FDKaacEnc_psyMain()
950 clipEnergy = hThisPsyConf[ch]->clipEnergy << -clipNrgShift ; in FDKaacEnc_psyMain()
954 for(w = 0; w < nWindows[ch]; w++) in FDKaacEnc_psyMain()
958 for (i=0; i<psyData[ch]->sfbActive; i++) { in FDKaacEnc_psyMain()
959 … *(pSfbThreshold[ch]+w*maxSfb[ch]+i) = fixMin(*(pSfbThreshold[ch]+w*maxSfb[ch]+i), clipEnergy); in FDKaacEnc_psyMain()
963 FDKaacEnc_SpreadingMax(psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
964 hThisPsyConf[ch]->sfbMaskLowFactor, in FDKaacEnc_psyMain()
965 hThisPsyConf[ch]->sfbMaskHighFactor, in FDKaacEnc_psyMain()
966 pSfbThreshold[ch]+w*maxSfb[ch]); in FDKaacEnc_psyMain()
973 for (i=0; i<psyData[ch]->sfbActive;i++) { in FDKaacEnc_psyMain()
974 … *(pSfbThreshold[ch]+w*maxSfb[ch]+i) = fixMax(*(pSfbThreshold[ch]+w*maxSfb[ch]+i) >> THR_SHIFTBITS, in FDKaacEnc_psyMain()
975 … (hThisPsyConf[ch]->sfbPcmQuantThreshold[i] >> energyShift)); in FDKaacEnc_psyMain()
979 for (i=0; i<psyData[ch]->sfbActive;i++) { in FDKaacEnc_psyMain()
980 … *(pSfbThreshold[ch]+w*maxSfb[ch]+i) = fixMax(*(pSfbThreshold[ch]+w*maxSfb[ch]+i) >> THR_SHIFTBITS, in FDKaacEnc_psyMain()
981 … (hThisPsyConf[ch]->sfbPcmQuantThreshold[i] << energyShift)); in FDKaacEnc_psyMain()
985 if (!psyStatic[ch]->isLFE) in FDKaacEnc_psyMain()
988 if(psyStatic[ch]->blockSwitchingControl.lastWindowSequence == STOP_WINDOW) { in FDKaacEnc_psyMain()
991 for (i=0; i<psyData[ch]->sfbActive;i++) { in FDKaacEnc_psyMain()
992 psyStatic[ch]->sfbThresholdnm1[i] = (FIXP_DBL)MAXVAL_DBL; in FDKaacEnc_psyMain()
995 psyStatic[ch]->mdctScalenm1 = 0; in FDKaacEnc_psyMain()
996 psyStatic[ch]->calcPreEcho = 0; in FDKaacEnc_psyMain()
999 FDKaacEnc_PreEchoControl( psyStatic[ch]->sfbThresholdnm1, in FDKaacEnc_psyMain()
1000 psyStatic[ch]->calcPreEcho, in FDKaacEnc_psyMain()
1001 psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
1002 hThisPsyConf[ch]->maxAllowedIncreaseFactor, in FDKaacEnc_psyMain()
1003 hThisPsyConf[ch]->minRemainingThresholdFactor, in FDKaacEnc_psyMain()
1004 pSfbThreshold[ch]+w*maxSfb[ch], in FDKaacEnc_psyMain()
1005 psyData[ch]->mdctScale, in FDKaacEnc_psyMain()
1006 &psyStatic[ch]->mdctScalenm1); in FDKaacEnc_psyMain()
1008 psyStatic[ch]->calcPreEcho = 1; in FDKaacEnc_psyMain()
1010 if(psyStatic[ch]->blockSwitchingControl.lastWindowSequence == START_WINDOW) in FDKaacEnc_psyMain()
1014 for (i=0; i<psyData[ch]->sfbActive;i++) { in FDKaacEnc_psyMain()
1015 psyStatic[ch]->sfbThresholdnm1[i] = (FIXP_DBL)MAXVAL_DBL; in FDKaacEnc_psyMain()
1018 psyStatic[ch]->mdctScalenm1 = 0; in FDKaacEnc_psyMain()
1019 psyStatic[ch]->calcPreEcho = 0; in FDKaacEnc_psyMain()
1025 …FDKmemcpy(pSfbSpreadEnergy[ch]+w*maxSfb[ch], pSfbEnergy[ch]+w*maxSfb[ch], psyData[ch]->sfbActive*s… in FDKaacEnc_psyMain()
1027 FDKaacEnc_SpreadingMax(psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
1028 hThisPsyConf[ch]->sfbMaskLowFactorSprEn, in FDKaacEnc_psyMain()
1029 hThisPsyConf[ch]->sfbMaskHighFactorSprEn, in FDKaacEnc_psyMain()
1030 pSfbSpreadEnergy[ch]+w*maxSfb[ch]); in FDKaacEnc_psyMain()
1053 for(ch=0;ch<channels;ch++) in FDKaacEnc_psyMain()
1056 if(isShortWindow[ch]) in FDKaacEnc_psyMain()
1059 noSfb = psyStatic[ch]->blockSwitchingControl.noOfGroups * hPsyConfShort->sfbCnt; in FDKaacEnc_psyMain()
1061 FDKaacEnc_groupShortData( psyData[ch]->mdctSpectrum, in FDKaacEnc_psyMain()
1062 &psyData[ch]->sfbThreshold, in FDKaacEnc_psyMain()
1063 &psyData[ch]->sfbEnergy, in FDKaacEnc_psyMain()
1064 &psyData[ch]->sfbEnergyMS, in FDKaacEnc_psyMain()
1065 &psyData[ch]->sfbSpreadEnergy, in FDKaacEnc_psyMain()
1067 psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
1070 psyData[ch]->groupedSfbOffset, in FDKaacEnc_psyMain()
1071 &maxSfbPerGroup[ch], in FDKaacEnc_psyMain()
1072 psyOutChannel[ch]->sfbMinSnrLdData, in FDKaacEnc_psyMain()
1073 psyStatic[ch]->blockSwitchingControl.noOfGroups, in FDKaacEnc_psyMain()
1074 psyStatic[ch]->blockSwitchingControl.groupLen, in FDKaacEnc_psyMain()
1080 …LdDataVector(&psyData[ch]->sfbEnergy.Long[sfbGrp], &psyOutChannel[ch]->sfbEnergyLdData[sfbGrp], ps… in FDKaacEnc_psyMain()
1085 …LdDataVector(&psyData[ch]->sfbThreshold.Long[sfbGrp], &psyOutChannel[ch]->sfbThresholdLdData[sfbGr… in FDKaacEnc_psyMain()
1086 for (sfb=0;sfb<psyData[ch]->sfbActive;sfb++) { in FDKaacEnc_psyMain()
1087 psyOutChannel[ch]->sfbThresholdLdData[sfbGrp+sfb] = in FDKaacEnc_psyMain()
1088 … fixMax(psyOutChannel[ch]->sfbThresholdLdData[sfbGrp+sfb], FL2FXCONST_DBL(-0.515625f)); in FDKaacEnc_psyMain()
1094 …LdDataVector(&psyData[ch]->sfbEnergyMS.Long[sfbGrp], &psyData[ch]->sfbEnergyMSLdData[sfbGrp], psyD… in FDKaacEnc_psyMain()
1098 …FDKmemcpy(psyOutChannel[ch]->sfbOffsets, psyData[ch]->groupedSfbOffset, (MAX_GROUPED_SFB+1)*sizeof… in FDKaacEnc_psyMain()
1102 for (sfb = psyData[ch]->sfbActive-1; sfb >= 0; sfb--) { in FDKaacEnc_psyMain()
1104 if (psyData[ch]->mdctSpectrum[line] != FL2FXCONST_SGL(0.0f)) break; in FDKaacEnc_psyMain()
1108 maxSfbPerGroup[ch] = sfb + 1; in FDKaacEnc_psyMain()
1110 maxSfbPerGroup[ch] = fixMax(fixMin(5,psyData[ch]->sfbActive),maxSfbPerGroup[ch]); in FDKaacEnc_psyMain()
1113 …FDKmemcpy(psyOutChannel[ch]->sfbEnergyLdData, psyData[ch]->sfbEnergyLdData.Long, psyData[ch]->sfbA… in FDKaacEnc_psyMain()
1115 …FDKmemcpy(psyOutChannel[ch]->sfbOffsets, hPsyConfLong->sfbOffset, (MAX_GROUPED_SFB+1)*sizeof(INT)); in FDKaacEnc_psyMain()
1118 …FDKmemcpy(psyOutChannel[ch]->sfbMinSnrLdData, hPsyConfLong->sfbMinSnrLdData, psyData[ch]->sfbActiv… in FDKaacEnc_psyMain()
1123 …LdDataVector(psyData[ch]->sfbThreshold.Long, psyOutChannel[ch]->sfbThresholdLdData, psyData[ch]->s… 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], FL2FXCONST_DBL(-0.515625f)); in FDKaacEnc_psyMain()
1139 for(ch=0;ch<channels;ch++) { in FDKaacEnc_psyMain()
1140 FDKmemclear(psyOutChannel[ch]->isBook, MAX_GROUPED_SFB*sizeof(INT)); in FDKaacEnc_psyMain()
1141 FDKmemclear(psyOutChannel[ch]->isScale, MAX_GROUPED_SFB*sizeof(INT)); in FDKaacEnc_psyMain()
1144 for(ch=0;ch<channels;ch++) { in FDKaacEnc_psyMain()
1145 INT win = (isShortWindow[ch]?1:0); in FDKaacEnc_psyMain()
1146 if (!psyStatic[ch]->isLFE) in FDKaacEnc_psyMain()
1150 pnsData[ch], in FDKaacEnc_psyMain()
1151 psyStatic[ch]->blockSwitchingControl.lastWindowSequence, in FDKaacEnc_psyMain()
1152 psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
1153 maxSfbPerGroup[ch], /* count of Sfb which are not zero. */ in FDKaacEnc_psyMain()
1154 psyOutChannel[ch]->sfbThresholdLdData, in FDKaacEnc_psyMain()
1156 psyData[ch]->mdctSpectrum, in FDKaacEnc_psyMain()
1157 psyData[ch]->sfbMaxScaleSpec.Long, in FDKaacEnc_psyMain()
1158 sfbTonality[ch], in FDKaacEnc_psyMain()
1159 psyOutChannel[ch]->tnsInfo.order[0][0], in FDKaacEnc_psyMain()
1160 tnsData[ch]->dataRaw.Long.subBlockInfo.predictionGain[HIFILT], in FDKaacEnc_psyMain()
1161 tnsData[ch]->dataRaw.Long.subBlockInfo.tnsActive[HIFILT], in FDKaacEnc_psyMain()
1162 psyOutChannel[ch]->sfbEnergyLdData, in FDKaacEnc_psyMain()
1163 psyOutChannel[ch]->noiseNrg ); in FDKaacEnc_psyMain()
1274 for(ch=0;ch<channels;ch++) { in FDKaacEnc_psyMain()
1275 if (psyStatic[ch]->isLFE) { in FDKaacEnc_psyMain()
1277 for(sfb = 0; sfb < psyData[ch]->sfbActive; sfb++) { in FDKaacEnc_psyMain()
1278 psyOutChannel[ch]->noiseNrg[sfb] = NO_NOISE_PNS; in FDKaacEnc_psyMain()
1282 FDKaacEnc_CodePnsChannel(psyData[ch]->sfbActive, in FDKaacEnc_psyMain()
1283 &(psyConf[ch].pnsConf), in FDKaacEnc_psyMain()
1284 pnsData[ch]->pnsFlag, in FDKaacEnc_psyMain()
1285 psyData[ch]->sfbEnergyLdData.Long, in FDKaacEnc_psyMain()
1286 … psyOutChannel[ch]->noiseNrg, /* this is the energy that will be written to the bitstream */ in FDKaacEnc_psyMain()
1287 psyOutChannel[ch]->sfbThresholdLdData); in FDKaacEnc_psyMain()
1294 for(ch=0;ch<channels;ch++) in FDKaacEnc_psyMain()
1298 psyOutChannel[ch]->maxSfbPerGroup = maxSfbPerGroup[ch]; in FDKaacEnc_psyMain()
1299 psyOutChannel[ch]->mdctScale = psyData[ch]->mdctScale; in FDKaacEnc_psyMain()
1301 if(isShortWindow[ch]==0) { in FDKaacEnc_psyMain()
1303 psyOutChannel[ch]->sfbCnt = hPsyConfLong->sfbActive; in FDKaacEnc_psyMain()
1304 psyOutChannel[ch]->sfbPerGroup = hPsyConfLong->sfbActive; in FDKaacEnc_psyMain()
1305 … psyOutChannel[ch]->lastWindowSequence = psyStatic[ch]->blockSwitchingControl.lastWindowSequence; in FDKaacEnc_psyMain()
1306 psyOutChannel[ch]->windowShape = psyStatic[ch]->blockSwitchingControl.windowShape; in FDKaacEnc_psyMain()
1309 INT sfbCnt = psyStatic[ch]->blockSwitchingControl.noOfGroups*hPsyConfShort->sfbCnt; in FDKaacEnc_psyMain()
1311 psyOutChannel[ch]->sfbCnt = sfbCnt; in FDKaacEnc_psyMain()
1312 psyOutChannel[ch]->sfbPerGroup = hPsyConfShort->sfbCnt; in FDKaacEnc_psyMain()
1313 psyOutChannel[ch]->lastWindowSequence = SHORT_WINDOW; in FDKaacEnc_psyMain()
1314 psyOutChannel[ch]->windowShape = SINE_WINDOW; in FDKaacEnc_psyMain()
1319 for (grp = 0; grp < psyStatic[ch]->blockSwitchingControl.noOfGroups; grp++) in FDKaacEnc_psyMain()
1322 for (j=1; j<psyStatic[ch]->blockSwitchingControl.groupLen[grp]; j++) { in FDKaacEnc_psyMain()
1326 psyOutChannel[ch]->groupingMask = mask; in FDKaacEnc_psyMain()
1329 …FDKmemcpy(psyOutChannel[ch]->groupLen,psyStatic[ch]->blockSwitchingControl.groupLen,MAX_NO_OF_GROU… in FDKaacEnc_psyMain()
1330 …FDKmemcpy(psyOutChannel[ch]->sfbEnergy,(&psyData[ch]->sfbEnergy)->Long, MAX_GROUPED_SFB*sizeof(FIX… in FDKaacEnc_psyMain()
1331 …FDKmemcpy(psyOutChannel[ch]->sfbSpreadEnergy,(&psyData[ch]->sfbSpreadEnergy)->Long, MAX_GROUPED_SF… in FDKaacEnc_psyMain()