• Home
  • Raw
  • Download

Lines Matching refs:pReverbData

81     S_REVERB_OBJECT *pReverbData;  in ReverbInit()  local
86 pReverbData = EAS_CMEnumFXData(EAS_MODULE_REVERB); in ReverbInit()
90 pReverbData = EAS_HWMalloc(pEASData->hwInstData, sizeof(S_REVERB_OBJECT)); in ReverbInit()
92 if (pReverbData == NULL) in ReverbInit()
99 EAS_HWMemSet(pReverbData, 0, sizeof(S_REVERB_OBJECT)); in ReverbInit()
101 ReverbReadInPresets(pReverbData); in ReverbInit()
103 pReverbData->m_nMinSamplesToAdd = REVERB_UPDATE_PERIOD_IN_SAMPLES; in ReverbInit()
105 pReverbData->m_nRevOutFbkR = 0; in ReverbInit()
106 pReverbData->m_nRevOutFbkL = 0; in ReverbInit()
108 pReverbData->m_sAp0.m_zApIn = AP0_IN; in ReverbInit()
109 pReverbData->m_sAp0.m_zApOut = AP0_IN + DEFAULT_AP0_LENGTH; in ReverbInit()
110 pReverbData->m_sAp0.m_nApGain = DEFAULT_AP0_GAIN; in ReverbInit()
112 pReverbData->m_zD0In = DELAY0_IN; in ReverbInit()
114 pReverbData->m_sAp1.m_zApIn = AP1_IN; in ReverbInit()
115 pReverbData->m_sAp1.m_zApOut = AP1_IN + DEFAULT_AP1_LENGTH; in ReverbInit()
116 pReverbData->m_sAp1.m_nApGain = DEFAULT_AP1_GAIN; in ReverbInit()
118 pReverbData->m_zD1In = DELAY1_IN; in ReverbInit()
120 pReverbData->m_zLpf0 = 0; in ReverbInit()
121 pReverbData->m_zLpf1 = 0; in ReverbInit()
122 pReverbData->m_nLpfFwd = 8837; in ReverbInit()
123 pReverbData->m_nLpfFbk = 6494; in ReverbInit()
125 pReverbData->m_nSin = 0; in ReverbInit()
126 pReverbData->m_nCos = 0; in ReverbInit()
127 pReverbData->m_nSinIncrement = 0; in ReverbInit()
128 pReverbData->m_nCosIncrement = 0; in ReverbInit()
131 pReverbData->m_nXfadeInterval = (EAS_U16)REVERB_XFADE_PERIOD_IN_SAMPLES; in ReverbInit()
132pReverbData->m_nXfadeCounter = pReverbData->m_nXfadeInterval + 1; // force update on first itera… in ReverbInit()
133 pReverbData->m_nPhase = -32768; in ReverbInit()
134 pReverbData->m_nPhaseIncrement = REVERB_XFADE_PHASE_INCREMENT; in ReverbInit()
136 pReverbData->m_nNoise = (EAS_I16)0xABCD; in ReverbInit()
138 pReverbData->m_nMaxExcursion = 0x007F; in ReverbInit()
141 nOffset = ReverbCalculateNoise( pReverbData->m_nMaxExcursion, in ReverbInit()
142 &pReverbData->m_nNoise ); in ReverbInit()
144 pReverbData->m_zD1Cross = in ReverbInit()
145 DELAY1_OUT - pReverbData->m_nMaxExcursion + nOffset; in ReverbInit()
147 nOffset = ReverbCalculateNoise( pReverbData->m_nMaxExcursion, in ReverbInit()
148 &pReverbData->m_nNoise ); in ReverbInit()
150 pReverbData->m_zD0Cross = in ReverbInit()
151 DELAY1_OUT - pReverbData->m_nMaxExcursion - nOffset; in ReverbInit()
153 nOffset = ReverbCalculateNoise( pReverbData->m_nMaxExcursion, in ReverbInit()
154 &pReverbData->m_nNoise ); in ReverbInit()
156 pReverbData->m_zD0Self = in ReverbInit()
157 DELAY0_OUT - pReverbData->m_nMaxExcursion - nOffset; in ReverbInit()
159 nOffset = ReverbCalculateNoise( pReverbData->m_nMaxExcursion, in ReverbInit()
160 &pReverbData->m_nNoise ); in ReverbInit()
162 pReverbData->m_zD1Self = in ReverbInit()
163 DELAY1_OUT - pReverbData->m_nMaxExcursion + nOffset; in ReverbInit()
166 pReverbData->m_bUseNoise = EAS_FALSE; in ReverbInit()
169 pReverbData->m_bBypass = EAS_TRUE; //EAS_FALSE; in ReverbInit()
171 pReverbData->m_nNextRoom = 1; in ReverbInit()
173 pReverbData->m_nCurrentRoom = pReverbData->m_nNextRoom + 1; // force update on first iteration in ReverbInit()
175 pReverbData->m_nWet = REVERB_DEFAULT_WET; in ReverbInit()
177 pReverbData->m_nDry = REVERB_DEFAULT_DRY; in ReverbInit()
180 pReverbData->m_nBaseIndex = 0; in ReverbInit()
183 pReverbData->m_sEarlyL.m_nLpfFbk = 4915; in ReverbInit()
184 pReverbData->m_sEarlyL.m_nLpfFwd = 27852; in ReverbInit()
185 pReverbData->m_sEarlyL.m_zLpf = 0; in ReverbInit()
189 pReverbData->m_sEarlyL.m_nGain[i] = 0; in ReverbInit()
190 pReverbData->m_sEarlyL.m_zDelay[i] = 0; in ReverbInit()
194 pReverbData->m_sEarlyR.m_nLpfFbk = 4915; in ReverbInit()
195 pReverbData->m_sEarlyR.m_nLpfFwd = 27852; in ReverbInit()
196 pReverbData->m_sEarlyR.m_zLpf = 0; in ReverbInit()
200 pReverbData->m_sEarlyR.m_nGain[i] = 0; in ReverbInit()
201 pReverbData->m_sEarlyR.m_zDelay[i] = 0; in ReverbInit()
207 pReverbData->m_nDelayLine[i] = 0; in ReverbInit()
213 pPreset = &pReverbData->m_sPreset.m_sPreset[pReverbData->m_nNextRoom]; in ReverbInit()
215 pReverbData->m_nLpfFbk = pPreset->m_nLpfFbk; in ReverbInit()
216 pReverbData->m_nLpfFwd = pPreset->m_nLpfFwd; in ReverbInit()
218 pReverbData->m_nEarly = pPreset->m_nEarly; in ReverbInit()
219 pReverbData->m_nWet = pPreset->m_nWet; in ReverbInit()
220 pReverbData->m_nDry = pPreset->m_nDry; in ReverbInit()
222 pReverbData->m_nMaxExcursion = pPreset->m_nMaxExcursion; in ReverbInit()
227 pReverbData->m_nXfadeInterval = (EAS_U16) temp; in ReverbInit()
230 pReverbData->m_sAp0.m_nApGain = pPreset->m_nAp0_ApGain; in ReverbInit()
235 pReverbData->m_sAp0.m_zApOut = (EAS_U16) (pReverbData->m_sAp0.m_zApIn + temp); in ReverbInit()
238 pReverbData->m_sAp1.m_nApGain = pPreset->m_nAp1_ApGain; in ReverbInit()
243 pReverbData->m_sAp1.m_zApOut = (EAS_U16) (pReverbData->m_sAp1.m_zApIn + temp); in ReverbInit()
248 *pInstData = pReverbData; in ReverbInit()
277 S_REVERB_OBJECT *pReverbData; in ReverbProcess() local
279 pReverbData = (S_REVERB_OBJECT*) pInstData; in ReverbProcess()
282 if (pReverbData->m_bBypass || in ReverbProcess()
283 (pReverbData->m_nWet == 0 && pReverbData->m_nDry == 32767)) in ReverbProcess()
290 if (pReverbData->m_nNextRoom != pReverbData->m_nCurrentRoom) in ReverbProcess()
292 ReverbUpdateRoom(pReverbData); in ReverbProcess()
295 ReverbUpdateXfade(pReverbData, numSamples); in ReverbProcess()
297 Reverb(pReverbData, numSamples, pDst, pSrc); in ReverbProcess()
300 if (pReverbData->m_nUpdateCounter >= REVERB_MODULO_UPDATE_PERIOD_IN_SAMPLES) in ReverbProcess()
303 pReverbData->m_nUpdateCounter = 0; in ReverbProcess()
307 pReverbData->m_nUpdateCounter += (EAS_I16)numSamples; in ReverbProcess()
328 static EAS_RESULT ReverbUpdateXfade(S_REVERB_OBJECT *pReverbData, EAS_INT nNumSamplesToAdd) in ReverbUpdateXfade() argument
334 if (pReverbData->m_nXfadeCounter >= pReverbData->m_nXfadeInterval) in ReverbUpdateXfade()
337 pReverbData->m_nXfadeCounter = 0; in ReverbUpdateXfade()
341 if (pReverbData->m_nPhaseIncrement > 0) in ReverbUpdateXfade()
344 pReverbData->m_nSin = 32767; in ReverbUpdateXfade()
345 pReverbData->m_nCos = 0; in ReverbUpdateXfade()
348 pReverbData->m_nPhase = 32767; in ReverbUpdateXfade()
351 nOffset = ReverbCalculateNoise( pReverbData->m_nMaxExcursion, &pReverbData->m_nNoise ); in ReverbUpdateXfade()
353 pReverbData->m_zD1Cross = in ReverbUpdateXfade()
354 DELAY1_OUT - pReverbData->m_nMaxExcursion + nOffset; in ReverbUpdateXfade()
356 nOffset = ReverbCalculateNoise( pReverbData->m_nMaxExcursion, &pReverbData->m_nNoise ); in ReverbUpdateXfade()
358 pReverbData->m_zD0Cross = in ReverbUpdateXfade()
359 DELAY0_OUT - pReverbData->m_nMaxExcursion - nOffset; in ReverbUpdateXfade()
364 pReverbData->m_nSin = 0; in ReverbUpdateXfade()
365 pReverbData->m_nCos = 32767; in ReverbUpdateXfade()
368 pReverbData->m_nPhase = -32768; in ReverbUpdateXfade()
371 nOffset = ReverbCalculateNoise( pReverbData->m_nMaxExcursion, &pReverbData->m_nNoise ); in ReverbUpdateXfade()
373 pReverbData->m_zD0Self = in ReverbUpdateXfade()
374 DELAY0_OUT - pReverbData->m_nMaxExcursion - nOffset; in ReverbUpdateXfade()
376 nOffset = ReverbCalculateNoise( pReverbData->m_nMaxExcursion, &pReverbData->m_nNoise ); in ReverbUpdateXfade()
378 pReverbData->m_zD1Self = in ReverbUpdateXfade()
379 DELAY1_OUT - pReverbData->m_nMaxExcursion + nOffset; in ReverbUpdateXfade()
386 pReverbData->m_nPhaseIncrement = -pReverbData->m_nPhaseIncrement; in ReverbUpdateXfade()
391 pReverbData->m_nPhase += pReverbData->m_nPhaseIncrement; in ReverbUpdateXfade()
394 ReverbCalculateSinCos(pReverbData->m_nPhase, &tempSin, &tempCos); in ReverbUpdateXfade()
398 pReverbData->m_nSinIncrement = in ReverbUpdateXfade()
399 (tempSin - pReverbData->m_nSin) >> REVERB_UPDATE_PERIOD_IN_BITS; in ReverbUpdateXfade()
402 pReverbData->m_nCosIncrement = in ReverbUpdateXfade()
403 (tempCos - pReverbData->m_nCos) >> REVERB_UPDATE_PERIOD_IN_BITS; in ReverbUpdateXfade()
407 pReverbData->m_nXfadeCounter += (EAS_U16) nNumSamplesToAdd; in ReverbUpdateXfade()
525 static EAS_RESULT Reverb(S_REVERB_OBJECT *pReverbData, EAS_INT nNumSamplesToAdd, EAS_PCM *pOutputBu… in Reverb() argument
544 nBase = pReverbData->m_nBaseIndex; in Reverb()
551 nApIn = ((*pInputBuffer++)>>2) + pReverbData->m_nRevOutFbkR; in Reverb()
556 nAddr = CIRCULAR(nBase, pReverbData->m_sAp0.m_zApOut, REVERB_BUFFER_MASK); in Reverb()
557 nDelayOut = pReverbData->m_nDelayLine[nAddr]; in Reverb()
560 nTemp1 = MULT_EG1_EG1(nApIn, pReverbData->m_sAp0.m_nApGain); in Reverb()
564 nTemp1 = MULT_EG1_EG1(nApOut, pReverbData->m_sAp0.m_nApGain); in Reverb()
568 nAddr = CIRCULAR(nBase, pReverbData->m_sAp0.m_zApIn, REVERB_BUFFER_MASK); in Reverb()
569 pReverbData->m_nDelayLine[nAddr] = (EAS_PCM) nTemp1; in Reverb()
572 nAddr = CIRCULAR(nBase, pReverbData->m_zD0In, REVERB_BUFFER_MASK); in Reverb()
573 pReverbData->m_nDelayLine[nAddr] = (EAS_PCM) nApOut; in Reverb()
580 nApIn = ((*pInputBuffer++)>>2) + pReverbData->m_nRevOutFbkL; in Reverb()
584 nAddr = CIRCULAR(nBase, pReverbData->m_sAp1.m_zApOut, REVERB_BUFFER_MASK); in Reverb()
585 nDelayOut = pReverbData->m_nDelayLine[nAddr]; in Reverb()
588 nTemp1 = MULT_EG1_EG1(nApIn, pReverbData->m_sAp1.m_nApGain); in Reverb()
592 nTemp1 = MULT_EG1_EG1(nApOut, pReverbData->m_sAp1.m_nApGain); in Reverb()
596 nAddr = CIRCULAR(nBase, pReverbData->m_sAp1.m_zApIn, REVERB_BUFFER_MASK); in Reverb()
597 pReverbData->m_nDelayLine[nAddr] = (EAS_PCM) nTemp1; in Reverb()
600 nAddr = CIRCULAR(nBase, pReverbData->m_zD1In, REVERB_BUFFER_MASK); in Reverb()
601 pReverbData->m_nDelayLine[nAddr] = (EAS_PCM) nApOut; in Reverb()
607 nAddr = CIRCULAR(nBase, pReverbData->m_zD0Self, REVERB_BUFFER_MASK); in Reverb()
608 nDelayOut = pReverbData->m_nDelayLine[nAddr]; in Reverb()
611 nTemp1 = MULT_EG1_EG1(nDelayOut, pReverbData->m_nSin); in Reverb()
614 nAddr = CIRCULAR(nBase, pReverbData->m_zD1Cross, REVERB_BUFFER_MASK); in Reverb()
615 nDelayOut = pReverbData->m_nDelayLine[nAddr]; in Reverb()
618 nTemp2 = MULT_EG1_EG1(nDelayOut, pReverbData->m_nCos); in Reverb()
624 nTemp1 = MULT_EG1_EG1(nDelayOut, pReverbData->m_nLpfFwd); in Reverb()
626 nTemp2 = MULT_EG1_EG1(pReverbData->m_zLpf0, pReverbData->m_nLpfFbk); in Reverb()
630 pReverbData->m_zLpf0 = (EAS_PCM) SATURATE(nTemp1 + nTemp2); in Reverb()
636 nAddr = CIRCULAR(nBase, pReverbData->m_zD1Self, REVERB_BUFFER_MASK); in Reverb()
637 nDelayOut = pReverbData->m_nDelayLine[nAddr]; in Reverb()
640 nTemp1 = MULT_EG1_EG1(nDelayOut, pReverbData->m_nSin); in Reverb()
643 nAddr = CIRCULAR(nBase, pReverbData->m_zD0Cross, REVERB_BUFFER_MASK); in Reverb()
644 nDelayOut = pReverbData->m_nDelayLine[nAddr]; in Reverb()
647 nTemp2 = MULT_EG1_EG1(nDelayOut, pReverbData->m_nCos); in Reverb()
653 nTemp1 = MULT_EG1_EG1(nDelayOut, pReverbData->m_nLpfFwd); in Reverb()
655 nTemp2 = MULT_EG1_EG1(pReverbData->m_zLpf1, pReverbData->m_nLpfFbk); in Reverb()
659 pReverbData->m_zLpf1 = (EAS_PCM)SATURATE(nTemp1 + nTemp2); in Reverb()
665 pReverbData->m_nRevOutFbkL = in Reverb()
666 (EAS_PCM)SATURATE((EAS_I32)pReverbData->m_zLpf1 + (EAS_I32)pReverbData->m_zLpf0); in Reverb()
670 pReverbData->m_nRevOutFbkR = in Reverb()
671 (EAS_PCM)SATURATE((EAS_I32)pReverbData->m_zLpf1 - (EAS_I32)pReverbData->m_zLpf0); in Reverb()
684 nAddr = CIRCULAR(nBase, pReverbData->m_sEarlyL.m_zDelay[j], REVERB_BUFFER_MASK); in Reverb()
686 nDelayOut = pReverbData->m_nDelayLine[nAddr]; in Reverb()
690 nTemp1 = MULT_EG1_EG1(nDelayOut, pReverbData->m_sEarlyL.m_nGain[j]); in Reverb()
698 nTemp1 = MULT_EG1_EG1(nEarlyOut, pReverbData->m_sEarlyL.m_nLpfFwd); in Reverb()
701 nTemp2 = MULT_EG1_EG1(pReverbData->m_sEarlyL.m_zLpf, pReverbData->m_sEarlyL.m_nLpfFbk); in Reverb()
707 pReverbData->m_sEarlyL.m_zLpf = (EAS_PCM) SATURATE(nTemp1 + nTemp2); in Reverb()
712 …tempValue = SATURATE((EAS_I32)pReverbData->m_sEarlyL.m_zLpf + (EAS_I32)pReverbData->m_nRevOutFbkL); in Reverb()
715 tempValue = MULT_EG1_EG1(tempValue, (pReverbData->m_nWet<<1)); in Reverb()
730 nAddr = CIRCULAR(nBase, pReverbData->m_sEarlyR.m_zDelay[j], REVERB_BUFFER_MASK); in Reverb()
731 nDelayOut = pReverbData->m_nDelayLine[nAddr]; in Reverb()
734 nTemp1 = MULT_EG1_EG1(nDelayOut, pReverbData->m_sEarlyR.m_nGain[j]); in Reverb()
741 nTemp1 = MULT_EG1_EG1(nEarlyOut, pReverbData->m_sEarlyR.m_nLpfFwd); in Reverb()
743 nTemp2 = MULT_EG1_EG1(pReverbData->m_sEarlyR.m_zLpf, pReverbData->m_sEarlyR.m_nLpfFbk); in Reverb()
747 pReverbData->m_sEarlyR.m_zLpf = (EAS_PCM)SATURATE(nTemp1 + nTemp2); in Reverb()
751 …tempValue = SATURATE((EAS_I32)pReverbData->m_sEarlyR.m_zLpf + (EAS_I32)pReverbData->m_nRevOutFbkR); in Reverb()
754 tempValue = MULT_EG1_EG1(tempValue, (pReverbData->m_nWet << 1)); in Reverb()
764 pReverbData->m_nSin += pReverbData->m_nSinIncrement; in Reverb()
765 pReverbData->m_nCos += pReverbData->m_nCosIncrement; in Reverb()
770 pReverbData->m_nBaseIndex = nBase; in Reverb()
914 static EAS_RESULT ReverbUpdateRoom(S_REVERB_OBJECT *pReverbData) in ReverbUpdateRoom() argument
918 S_REVERB_PRESET *pPreset = &pReverbData->m_sPreset.m_sPreset[pReverbData->m_nNextRoom]; in ReverbUpdateRoom()
920 pReverbData->m_nLpfFwd = pPreset->m_nLpfFwd; in ReverbUpdateRoom()
921 pReverbData->m_nLpfFbk = pPreset->m_nLpfFbk; in ReverbUpdateRoom()
923 pReverbData->m_nEarly = pPreset->m_nEarly; in ReverbUpdateRoom()
924 pReverbData->m_nWet = pPreset->m_nWet; in ReverbUpdateRoom()
925 pReverbData->m_nDry = pPreset->m_nDry; in ReverbUpdateRoom()
928 pReverbData->m_nMaxExcursion = pPreset->m_nMaxExcursion; in ReverbUpdateRoom()
933 pReverbData->m_nXfadeInterval = (EAS_U16) temp; in ReverbUpdateRoom()
935 pReverbData->m_sAp0.m_nApGain = pPreset->m_nAp0_ApGain; in ReverbUpdateRoom()
940 pReverbData->m_sAp0.m_zApOut = (EAS_U16) (pReverbData->m_sAp0.m_zApIn + temp); in ReverbUpdateRoom()
942 pReverbData->m_sAp1.m_nApGain = pPreset->m_nAp1_ApGain; in ReverbUpdateRoom()
947 pReverbData->m_sAp1.m_zApOut = (EAS_U16) (pReverbData->m_sAp1.m_zApIn + temp); in ReverbUpdateRoom()
950 pReverbData->m_nCurrentRoom = pReverbData->m_nNextRoom; in ReverbUpdateRoom()
968 static EAS_RESULT ReverbReadInPresets(S_REVERB_OBJECT *pReverbData) in ReverbReadInPresets() argument
977 S_REVERB_PRESET *pPreset = &pReverbData->m_sPreset.m_sPreset[defaultPreset]; in ReverbReadInPresets()