Home | History | Annotate | Download | only in src

Lines Matching refs:tC

377                                                  TNS_CONFIG *tC,
389 tC->tnsActive = (active) ? TRUE : FALSE;
390 tC->maxOrder = (blockType == SHORT_WINDOW) ? 5 : 12; /* maximum: 7, 20 */
392 tC->maxOrder -= 2;
393 tC->coefRes = (blockType == SHORT_WINDOW) ? 3 : 4;
396 tC->lpcStopBand = getTnsMaxBands(sampleRate, granuleLength, (blockType == SHORT_WINDOW) ? 1 : 0);
398 if (tC->lpcStopBand < 0) {
402 tC->lpcStopBand = FDKmin(tC->lpcStopBand, pC->sfbActive);
403 tC->lpcStopLine = pC->sfbOffset[tC->lpcStopBand];
408 tC->lpcStartBand[LOFILT] = (blockType == SHORT_WINDOW) ? 0 : ((sampleRate < 18783) ? 4 : 8);
409 tC->lpcStartLine[LOFILT] = pC->sfbOffset[tC->lpcStartBand[LOFILT]];
411 i = tC->lpcStopBand;
412 while (pC->sfbOffset[i] > (tC->lpcStartLine[LOFILT] + (tC->lpcStopLine - tC->lpcStartLine[LOFILT]) / 4)) i--;
413 tC->lpcStartBand[HIFILT] = i;
414 tC->lpcStartLine[HIFILT] = pC->sfbOffset[i];
416 tC->confTab.threshOn[HIFILT] = 1437;
417 tC->confTab.threshOn[LOFILT] = 1500;
419 tC->confTab.tnsLimitOrder[HIFILT] = tC->maxOrder;
420 tC->confTab.tnsLimitOrder[LOFILT] = tC->maxOrder - 7;
422 tC->confTab.tnsFilterDirection[HIFILT] = FILTER_DIRECTION;
423 tC->confTab.tnsFilterDirection[LOFILT] = FILTER_DIRECTION;
425 tC->confTab.acfSplit[HIFILT] = -1; /* signal Merged4to2QuartersAutoCorrelation in FDKaacEnc_MergedAutoCorrelation*/
426 tC->confTab.acfSplit[LOFILT] = -1; /* signal Merged4to2QuartersAutoCorrelation in FDKaacEnc_MergedAutoCorrelation */
428 tC->confTab.filterEnabled[HIFILT] = 1;
429 tC->confTab.filterEnabled[LOFILT] = 1;
430 tC->confTab.seperateFiltersAllowed = 1;
433 /* for (i = 0; i <= tC->maxOrder + 3; i++) {
439 FDKmemcpy(tC->acfWindow[HIFILT], acfWindowShort, FDKmin(sizeof(acfWindowShort), sizeof(tC->acfWindow[HIFILT])));
440 FDKmemcpy(tC->acfWindow[LOFILT], acfWindowShort, FDKmin(sizeof(acfWindowShort), sizeof(tC->acfWindow[HIFILT])));
443 FDKmemcpy(tC->acfWindow[HIFILT], acfWindowLong, FDKmin(sizeof(acfWindowLong), sizeof(tC->acfWindow[HIFILT])));
444 FDKmemcpy(tC->acfWindow[LOFILT], acfWindowLong, FDKmin(sizeof(acfWindowLong), sizeof(tC->acfWindow[HIFILT])));
453 tC->lpcStartBand[HIFILT] = FDKaacEnc_FreqToBandWithRounding(pCfg->filterStartFreq[HIFILT], sampleRate, pC->sfbCnt, pC->sfbOffset);
454 tC->lpcStartLine[HIFILT] = pC->sfbOffset[tC->lpcStartBand[HIFILT]];
455 tC->lpcStartBand[LOFILT] = FDKaacEnc_FreqToBandWithRounding(pCfg->filterStartFreq[LOFILT], sampleRate, pC->sfbCnt, pC->sfbOffset);
456 tC->lpcStartLine[LOFILT] = pC->sfbOffset[tC->lpcStartBand[LOFILT]];
458 tC->confTab.threshOn[HIFILT] = pCfg->threshOn[HIFILT];
459 tC->confTab.threshOn[LOFILT] = pCfg->threshOn[LOFILT];
461 tC->confTab.tnsLimitOrder[HIFILT] = pCfg->tnsLimitOrder[HIFILT];
462 tC->confTab.tnsLimitOrder[LOFILT] = pCfg->tnsLimitOrder[LOFILT];
464 tC->confTab.tnsFilterDirection[HIFILT] = pCfg->tnsFilterDirection[HIFILT];
465 tC->confTab.tnsFilterDirection[LOFILT] = pCfg->tnsFilterDirection[LOFILT];
467 tC->confTab.acfSplit[HIFILT] = pCfg->acfSplit[HIFILT];
468 tC->confTab.acfSplit[LOFILT] = pCfg->acfSplit[LOFILT];
470 tC->confTab.filterEnabled[HIFILT] = pCfg->filterEnabled[HIFILT];
471 tC->confTab.filterEnabled[LOFILT] = pCfg->filterEnabled[LOFILT];
472 tC->confTab.seperateFiltersAllowed = pCfg->seperateFiltersAllowed;
474 FDKaacEnc_CalcGaussWindow(tC->acfWindow[HIFILT], tC->maxOrder+1, sampleRate, granuleLength, pCfg->tnsTimeResolution[HIFILT], TNS_TIMERES_SCALE);
475 FDKaacEnc_CalcGaussWindow(tC->acfWindow[LOFILT], tC->maxOrder+1, sampleRate, granuleLength, pCfg->tnsTimeResolution[LOFILT], TNS_TIMERES_SCALE);
478 tC->tnsActive = FALSE; /* no configuration available, disable tns tool */
483 tC->tnsActive = FALSE; /* no configuration available, disable tns tool */
745 const TNS_CONFIG *tC,
768 tnsInfo->coefRes[subBlockNumber] = tC->coefRes;
769 for (i = 0; i < tC->maxOrder; i++) {
776 if ( (tC->tnsActive) && (tC->maxOrder>0) )
782 tC->acfWindow,
783 tC->lpcStartLine,
784 tC->lpcStopLine,
785 tC->maxOrder,
786 tC->confTab.acfSplit,
791 tsbi->predictionGain = FDKaacEnc_AutoToParcor(rxx2, parcor_tmp, tC->confTab.tnsLimitOrder[HIFILT]);
797 tC->confTab.tnsLimitOrder[HIFILT],
798 tC->coefRes);
801 for (i = tC->confTab.tnsLimitOrder[HIFILT] - 1; i >= 0; i--) {
814 tnsInfo->direction[subBlockNumber][HIFILT] = tC->confTab.tnsFilterDirection[HIFILT];
815 tnsInfo->length[subBlockNumber][HIFILT] = sfbCnt - tC->lpcStartBand[HIFILT];
818 if ((tsbi->predictionGain > tC->confTab.threshOn[HIFILT]) || (sumSqrCoef > (tC->confTab.tnsLimitOrder[HIFILT]/2 + 2)))
825 (tC->confTab.filterEnabled[LOFILT]) && (tC->confTab.seperateFiltersAllowed) )
830 INT predGain = FDKaacEnc_AutoToParcor(rxx1, parcor_tmp, tC->confTab.tnsLimitOrder[LOFILT]);
836 tC->confTab.tnsLimitOrder[LOFILT],
837 tC->coefRes);
840 for (i = tC->confTab.tnsLimitOrder[LOFILT] - 1; i >= 0; i--) {
852 tnsInfo->direction[subBlockNumber][LOFILT] = tC->confTab.tnsFilterDirection[LOFILT];
853 tnsInfo->length[subBlockNumber][LOFILT] = tC->lpcStartBand[HIFILT] - tC->lpcStartBand[LOFILT];
856 if ( ( (predGain > tC->confTab.threshOn[LOFILT]) && (predGain < (16000 * tC->confTab.tnsLimitOrder[LOFILT])) )
857 || ( (sumSqrCoef > 9) && (sumSqrCoef < 22 * tC->confTab.tnsLimitOrder[LOFILT]) ) )
861 for (i = 0; i < tC->confTab.tnsLimitOrder[LOFILT]; i++) {
868 tnsInfo->length[subBlockNumber][HIFILT] = sfbCnt - tC->lpcStartBand[LOFILT];
917 const TNS_CONFIG *tC
948 for (i = 0; i < tC->maxOrder; i++) {
973 for (i = 0; i < tC->maxOrder; i++) {
1006 const TNS_CONFIG *tC,
1021 startLine = (tnsData->filtersMerged) ? tC->lpcStartLine[LOFILT] : tC->lpcStartLine[HIFILT];
1022 stopLine = tC->lpcStopLine;
1035 tC->coefRes);
1051 startLine = tC->lpcStartLine[LOFILT];
1052 stopLine = tC->lpcStartLine[HIFILT];