/* calculate pe for both channels */ static void calcPe(PE_DATA *peData, PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], const int nChannels) { int ch; COUNT_sub_start("calcPe"); INDIRECT(4); MOVE(3); peData->pe = peData->offset; peData->constPart = 0.0f; peData->nActiveLines = 0.0f; LOOP(1); for(ch=0; ch<nChannels; ch++) { PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch]; PE_CHANNEL_DATA *peChanData = &peData->peChannelData[ch]; INDIRECT(1); PTR_INIT(2); /* counting previous operations */ INDIRECT(6); PTR_INIT(1); FUNC(6); calcSfbPe(&peData->peChannelData[ch], psyOutChan->sfbEnergy, psyOutChan->sfbThreshold, psyOutChan->sfbCnt, psyOutChan->sfbPerGroup, psyOutChan->maxSfbPerGroup); INDIRECT(3); ADD(3); STORE(3); peData->pe += peChanData->pe; peData->constPart += peChanData->constPart; peData->nActiveLines += peChanData->nActiveLines; INDIRECT(1); MOVE(1); psyOutChannel[ch].pe = peData->pe; /* update pe for stereo preprocessing */ } COUNT_sub_end(); }
/* calculate pe for both channels */ static void calcPe(PE_DATA *peData, PSY_OUT_CHANNEL psyOutChannel[MAX_CHANNELS], const int nChannels) { int ch; peData->pe = peData->offset; peData->constPart = 0.0f; peData->nActiveLines = 0.0f; for(ch=0; ch<nChannels; ch++) { PSY_OUT_CHANNEL *psyOutChan = &psyOutChannel[ch]; PE_CHANNEL_DATA *peChanData = &peData->peChannelData[ch]; /* counting previous operations */ calcSfbPe(&peData->peChannelData[ch], psyOutChan->sfbEnergy, psyOutChan->sfbThreshold, psyOutChan->sfbCnt, psyOutChan->sfbPerGroup, psyOutChan->maxSfbPerGroup); peData->pe += peChanData->pe; peData->constPart += peChanData->constPart; peData->nActiveLines += peChanData->nActiveLines; psyOutChannel[ch].pe = peData->pe; /* update pe for stereo preprocessing */ } }