Lines Matching refs:blockSwitchingControl
116 BLOCK_SWITCHING_CONTROL *RESTRICT blockSwitchingControl, INT windowLen,
169 BLOCK_SWITCHING_CONTROL *blockSwitchingControl, INT isLowDelay) { in FDKaacEnc_InitBlockSwitching() argument
170 FDKmemclear(blockSwitchingControl, sizeof(BLOCK_SWITCHING_CONTROL)); in FDKaacEnc_InitBlockSwitching()
173 blockSwitchingControl->nBlockSwitchWindows = 4; in FDKaacEnc_InitBlockSwitching()
174 blockSwitchingControl->allowShortFrames = 0; in FDKaacEnc_InitBlockSwitching()
175 blockSwitchingControl->allowLookAhead = 0; in FDKaacEnc_InitBlockSwitching()
177 blockSwitchingControl->nBlockSwitchWindows = 8; in FDKaacEnc_InitBlockSwitching()
178 blockSwitchingControl->allowShortFrames = 1; in FDKaacEnc_InitBlockSwitching()
179 blockSwitchingControl->allowLookAhead = 1; in FDKaacEnc_InitBlockSwitching()
182 blockSwitchingControl->noOfGroups = MAX_NO_OF_GROUPS; in FDKaacEnc_InitBlockSwitching()
185 blockSwitchingControl->lastWindowSequence = LONG_WINDOW; in FDKaacEnc_InitBlockSwitching()
186 blockSwitchingControl->windowShape = in FDKaacEnc_InitBlockSwitching()
187 blockType2windowShape[blockSwitchingControl->allowShortFrames] in FDKaacEnc_InitBlockSwitching()
188 [blockSwitchingControl->lastWindowSequence]; in FDKaacEnc_InitBlockSwitching()
229 int FDKaacEnc_BlockSwitching(BLOCK_SWITCHING_CONTROL *blockSwitchingControl, in FDKaacEnc_BlockSwitching() argument
235 UINT nBlockSwitchWindows = blockSwitchingControl->nBlockSwitchWindows; in FDKaacEnc_BlockSwitching()
241 blockSwitchingControl->lastWindowSequence = LONG_WINDOW; in FDKaacEnc_BlockSwitching()
242 blockSwitchingControl->windowShape = SINE_WINDOW; in FDKaacEnc_BlockSwitching()
243 blockSwitchingControl->noOfGroups = 1; in FDKaacEnc_BlockSwitching()
244 blockSwitchingControl->groupLen[0] = 1; in FDKaacEnc_BlockSwitching()
250 blockSwitchingControl->lastattack = blockSwitchingControl->attack; in FDKaacEnc_BlockSwitching()
251 blockSwitchingControl->lastAttackIndex = blockSwitchingControl->attackIndex; in FDKaacEnc_BlockSwitching()
254 FDKmemcpy(blockSwitchingControl->windowNrg[0], in FDKaacEnc_BlockSwitching()
255 blockSwitchingControl->windowNrg[1], in FDKaacEnc_BlockSwitching()
256 sizeof(blockSwitchingControl->windowNrg[0])); in FDKaacEnc_BlockSwitching()
257 FDKmemcpy(blockSwitchingControl->windowNrgF[0], in FDKaacEnc_BlockSwitching()
258 blockSwitchingControl->windowNrgF[1], in FDKaacEnc_BlockSwitching()
259 sizeof(blockSwitchingControl->windowNrgF[0])); in FDKaacEnc_BlockSwitching()
261 if (blockSwitchingControl->allowShortFrames) { in FDKaacEnc_BlockSwitching()
265 FDKmemclear(blockSwitchingControl->groupLen, in FDKaacEnc_BlockSwitching()
266 sizeof(blockSwitchingControl->groupLen)); in FDKaacEnc_BlockSwitching()
269 blockSwitchingControl->noOfGroups = MAX_NO_OF_GROUPS; in FDKaacEnc_BlockSwitching()
271 FDKmemcpy(blockSwitchingControl->groupLen, in FDKaacEnc_BlockSwitching()
272 suggestedGroupingTable[blockSwitchingControl->lastAttackIndex], in FDKaacEnc_BlockSwitching()
273 sizeof(blockSwitchingControl->groupLen)); in FDKaacEnc_BlockSwitching()
275 if (blockSwitchingControl->attack == TRUE) in FDKaacEnc_BlockSwitching()
276 blockSwitchingControl->maxWindowNrg = in FDKaacEnc_BlockSwitching()
277 FDKaacEnc_GetWindowEnergy(blockSwitchingControl->windowNrg[0], in FDKaacEnc_BlockSwitching()
278 blockSwitchingControl->lastAttackIndex); in FDKaacEnc_BlockSwitching()
280 blockSwitchingControl->maxWindowNrg = FL2FXCONST_DBL(0.0); in FDKaacEnc_BlockSwitching()
286 blockSwitchingControl, in FDKaacEnc_BlockSwitching()
292 blockSwitchingControl->attack = FALSE; in FDKaacEnc_BlockSwitching()
296 enM1 = blockSwitchingControl->windowNrgF[0][nBlockSwitchWindows - 1]; in FDKaacEnc_BlockSwitching()
300 fMultDiv2(oneMinusAccWindowNrgFac, blockSwitchingControl->accWindowNrg); in FDKaacEnc_BlockSwitching()
301 blockSwitchingControl->accWindowNrg = fMultAdd(tmp, accWindowNrgFac, enM1); in FDKaacEnc_BlockSwitching()
303 if (fMult(blockSwitchingControl->windowNrgF[1][i], invAttackRatio) > in FDKaacEnc_BlockSwitching()
304 blockSwitchingControl->accWindowNrg) { in FDKaacEnc_BlockSwitching()
305 blockSwitchingControl->attack = TRUE; in FDKaacEnc_BlockSwitching()
306 blockSwitchingControl->attackIndex = i; in FDKaacEnc_BlockSwitching()
308 enM1 = blockSwitchingControl->windowNrgF[1][i]; in FDKaacEnc_BlockSwitching()
312 if (enMax < minAttackNrg) blockSwitchingControl->attack = FALSE; in FDKaacEnc_BlockSwitching()
315 if ((blockSwitchingControl->attack == FALSE) && in FDKaacEnc_BlockSwitching()
316 (blockSwitchingControl->lastattack == TRUE)) { in FDKaacEnc_BlockSwitching()
318 if (((blockSwitchingControl->windowNrgF[0][nBlockSwitchWindows - 1] >> 4) > in FDKaacEnc_BlockSwitching()
320 blockSwitchingControl->windowNrgF[1][1])) && in FDKaacEnc_BlockSwitching()
321 (blockSwitchingControl->lastAttackIndex == in FDKaacEnc_BlockSwitching()
323 blockSwitchingControl->attack = TRUE; in FDKaacEnc_BlockSwitching()
324 blockSwitchingControl->attackIndex = 0; in FDKaacEnc_BlockSwitching()
328 if (blockSwitchingControl->allowLookAhead) { in FDKaacEnc_BlockSwitching()
329 blockSwitchingControl->lastWindowSequence = in FDKaacEnc_BlockSwitching()
330 chgWndSqLkAhd[blockSwitchingControl->lastattack] in FDKaacEnc_BlockSwitching()
331 [blockSwitchingControl->attack] in FDKaacEnc_BlockSwitching()
332 [blockSwitchingControl->lastWindowSequence]; in FDKaacEnc_BlockSwitching()
335 blockSwitchingControl->lastWindowSequence = in FDKaacEnc_BlockSwitching()
336 chgWndSq[blockSwitchingControl->attack] in FDKaacEnc_BlockSwitching()
337 [blockSwitchingControl->lastWindowSequence]; in FDKaacEnc_BlockSwitching()
341 blockSwitchingControl->windowShape = in FDKaacEnc_BlockSwitching()
342 blockType2windowShape[blockSwitchingControl->allowShortFrames] in FDKaacEnc_BlockSwitching()
343 [blockSwitchingControl->lastWindowSequence]; in FDKaacEnc_BlockSwitching()
360 BLOCK_SWITCHING_CONTROL *RESTRICT blockSwitchingControl, INT windowLen, in FDKaacEnc_CalcWindowEnergy() argument
373 FIXP_DBL temp_iirState0 = blockSwitchingControl->iirStates[0]; in FDKaacEnc_CalcWindowEnergy()
374 FIXP_DBL temp_iirState1 = blockSwitchingControl->iirStates[1]; in FDKaacEnc_CalcWindowEnergy()
377 for (w = 0; w < blockSwitchingControl->nBlockSwitchWindows; w++) { in FDKaacEnc_CalcWindowEnergy()
402 blockSwitchingControl->windowNrg[1][w] = in FDKaacEnc_CalcWindowEnergy()
404 blockSwitchingControl->windowNrgF[1][w] = in FDKaacEnc_CalcWindowEnergy()
407 blockSwitchingControl->iirStates[0] = temp_iirState0; in FDKaacEnc_CalcWindowEnergy()
408 blockSwitchingControl->iirStates[1] = temp_iirState1; in FDKaacEnc_CalcWindowEnergy()