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