Lines Matching refs:hQC
327 QC_STATE* hQC = GetRam_aacEnc_QCstate(); in FDKaacEnc_QCNew() local
328 *phQC = hQC; in FDKaacEnc_QCNew()
329 if (hQC == NULL) { in FDKaacEnc_QCNew()
334 if (FDKaacEnc_AdjThrNew(&hQC->hAdjThr, nElements)) { in FDKaacEnc_QCNew()
339 if (FDKaacEnc_BCNew(&(hQC->hBitCounter), dynamic_RAM)) { in FDKaacEnc_QCNew()
345 hQC->elementBits[i] = GetRam_aacEnc_ElementBits(i); in FDKaacEnc_QCNew()
346 if (hQC->elementBits[i] == NULL) { in FDKaacEnc_QCNew()
366 AAC_ENCODER_ERROR FDKaacEnc_QCInit(QC_STATE *hQC, in FDKaacEnc_QCInit() argument
370 hQC->maxBitsPerFrame = init->maxBits; in FDKaacEnc_QCInit()
371 hQC->minBitsPerFrame = init->minBits; in FDKaacEnc_QCInit()
372 hQC->nElements = init->channelMapping->nElements; in FDKaacEnc_QCInit()
373 hQC->bitResTotMax = init->bitRes; in FDKaacEnc_QCInit()
374 hQC->bitResTot = init->bitRes; in FDKaacEnc_QCInit()
375 hQC->maxBitFac = init->maxBitFac; in FDKaacEnc_QCInit()
376 hQC->bitrateMode = init->bitrateMode; in FDKaacEnc_QCInit()
377 hQC->invQuant = init->invQuant; in FDKaacEnc_QCInit()
378 hQC->maxIterations = init->maxIterations; in FDKaacEnc_QCInit()
380 if ( isConstantBitrateMode(hQC->bitrateMode) ) { in FDKaacEnc_QCInit()
381 INT bitresPerChannel = (hQC->bitResTotMax / init->channelMapping->nChannelsEff); in FDKaacEnc_QCInit()
383 hQC->bitDistributionMode = (bitresPerChannel>BITRES_MIN_LD) ? 0 : (bitresPerChannel>0) ? 1 : 2; in FDKaacEnc_QCInit()
386 hQC->bitDistributionMode = 0; /* full bitreservoir */ in FDKaacEnc_QCInit()
390 hQC->padding.paddingRest = init->padding.paddingRest; in FDKaacEnc_QCInit()
392 hQC->globHdrBits = init->staticBits; /* Bit overhead due to transport */ in FDKaacEnc_QCInit()
394 FDKaacEnc_InitElementBits(hQC, in FDKaacEnc_QCInit()
397 (init->averageBits/init->nSubFrames) - hQC->globHdrBits, in FDKaacEnc_QCInit()
398 hQC->maxBitsPerFrame/init->channelMapping->nChannelsEff); in FDKaacEnc_QCInit()
400 hQC->vbrQualFactor = FL2FXCONST_DBL(0.f); in FDKaacEnc_QCInit()
402 if (hQC->bitrateMode==tableVbrQualFactor[i].bitrateMode) { in FDKaacEnc_QCInit()
403 hQC->vbrQualFactor = (FIXP_DBL)tableVbrQualFactor[i].vbrQualFactor; in FDKaacEnc_QCInit()
413 hQC->dZoneQuantEnable = 1; in FDKaacEnc_QCInit()
415 hQC->dZoneQuantEnable = 0; in FDKaacEnc_QCInit()
419 hQC->hAdjThr, in FDKaacEnc_QCInit()
421 hQC->elementBits, /* or channelBitrates, was: channelBitrate */ in FDKaacEnc_QCInit()
422 hQC->invQuant, in FDKaacEnc_QCInit()
427 hQC->vbrQualFactor, in FDKaacEnc_QCInit()
428 hQC->dZoneQuantEnable in FDKaacEnc_QCInit()
483 AAC_ENCODER_ERROR FDKaacEnc_AdjustBitrate(QC_STATE *RESTRICT hQC, in FDKaacEnc_AdjustBitrate() argument
497 &hQC->padding.paddingRest); in FDKaacEnc_AdjustBitrate()
509 static AAC_ENCODER_ERROR FDKaacEnc_distributeElementDynBits(QC_STATE* hQC, in FDKaacEnc_distributeElementDynBits() argument
522 …qcElement[i]->grantedDynBits = (INT)fMult(hQC->elementBits[i]->relativeBitsEl, (FIXP_DBL)codeBits… in FDKaacEnc_distributeElementDynBits()
605 static AAC_ENCODER_ERROR FDKaacEnc_prepareBitDistribution(QC_STATE* hQC, in FDKaacEnc_prepareBitDistribution() argument
616 … qcOut[0]->grantedDynBits = (fixMin(hQC->maxBitsPerFrame, avgTotalBits) - hQC->globHdrBits)&~7; in FDKaacEnc_prepareBitDistribution()
618 …qcOut[0]->maxDynBits = ((hQC->maxBitsPerFrame)&~7) - (qcOut[0]->globalExtBits + qcOut[0]->staticBi… in FDKaacEnc_prepareBitDistribution()
620 if ((qcOut[0]->grantedDynBits+hQC->bitResTot) < 0) { in FDKaacEnc_prepareBitDistribution()
622 …if ( (qcOut[0]->grantedDynBits+hQC->bitResTot) < (FDKaacEnc_getMinimalStaticBitdemand(cm, psyOut)-… in FDKaacEnc_prepareBitDistribution()
627 FDKaacEnc_distributeElementDynBits(hQC, in FDKaacEnc_prepareBitDistribution()
648 FDKaacEnc_DistributeBits(hQC->hAdjThr, in FDKaacEnc_prepareBitDistribution()
649 hQC->hAdjThr->adjThrStateElem[i], in FDKaacEnc_prepareBitDistribution()
657 hQC->elementBits[i]->bitResLevelEl, in FDKaacEnc_prepareBitDistribution()
658 hQC->elementBits[i]->maxBitResBitsEl, in FDKaacEnc_prepareBitDistribution()
659 hQC->maxBitFac, in FDKaacEnc_prepareBitDistribution()
660 hQC->bitDistributionMode); in FDKaacEnc_prepareBitDistribution()
662 *totalAvailableBits += hQC->elementBits[i]->bitResLevelEl; in FDKaacEnc_prepareBitDistribution()
669 *totalAvailableBits = FDKmin(hQC->maxBitsPerFrame, (*totalAvailableBits)); in FDKaacEnc_prepareBitDistribution()
747 QC_STATE *const hQC, in FDKaacEnc_BitResRedistribution() argument
753 if (hQC->bitResTot < 0) { in FDKaacEnc_BitResRedistribution()
756 else if (hQC->bitResTot > hQC->bitResTotMax) { in FDKaacEnc_BitResRedistribution()
763 int totalBitreservoir = FDKmin(hQC->bitResTot, (hQC->maxBitsPerFrame-avgTotalBits)); in FDKaacEnc_BitResRedistribution()
764 int totalBitreservoirMax = FDKmin(hQC->bitResTotMax, (hQC->maxBitsPerFrame-avgTotalBits)); in FDKaacEnc_BitResRedistribution()
773 …hQC->elementBits[i]->bitResLevelEl = (INT)fMult(hQC->elementBits[i]->relativeBitsEl, (FIXP_DBL)(to… in FDKaacEnc_BitResRedistribution()
774 totalBits += hQC->elementBits[i]->bitResLevelEl; in FDKaacEnc_BitResRedistribution()
776 …hQC->elementBits[i]->maxBitResBitsEl = (INT)fMult(hQC->elementBits[i]->relativeBitsEl, (FIXP_DBL)(… in FDKaacEnc_BitResRedistribution()
777 totalBits_max += hQC->elementBits[i]->maxBitResBitsEl; in FDKaacEnc_BitResRedistribution()
782 hQC->elementBits[firstEl]->bitResLevelEl += totalBitreservoir - totalBits; in FDKaacEnc_BitResRedistribution()
783 hQC->elementBits[firstEl]->maxBitResBitsEl += totalBitreservoirMax - totalBits_max; in FDKaacEnc_BitResRedistribution()
790 AAC_ENCODER_ERROR FDKaacEnc_QCMain(QC_STATE* RESTRICT hQC, in FDKaacEnc_QCMain() argument
808 ErrorStatus = FDKaacEnc_BitResRedistribution(hQC, cm, avgTotalBits); in FDKaacEnc_QCMain()
841 if ( isConstantBitrateMode(hQC->bitrateMode) ) in FDKaacEnc_QCMain()
846 hQC, in FDKaacEnc_QCMain()
860 qcOut[0]->grantedDynBits = ((hQC->maxBitsPerFrame - (hQC->globHdrBits))&~7) in FDKaacEnc_QCMain()
864 totalAvailableBits = hQC->maxBitsPerFrame; in FDKaacEnc_QCMain()
886 FDKaacEnc_AdjustThresholds(hQC->hAdjThr->adjThrStateElem, in FDKaacEnc_QCMain()
890 isConstantBitrateMode(hQC->bitrateMode), in FDKaacEnc_QCMain()
891 hQC->hAdjThr->maxIter2ndGuess, in FDKaacEnc_QCMain()
918 hQC->invQuant, in FDKaacEnc_QCMain()
919 hQC->dZoneQuantEnable, in FDKaacEnc_QCMain()
972 hQC->maxIterations, in FDKaacEnc_QCMain()
980 hQC->elementBits[i], in FDKaacEnc_QCMain()
1015 hQC->dZoneQuantEnable); in FDKaacEnc_QCMain()
1056 INT chDynBits = FDKaacEnc_dynBitCount(hQC->hBitCounter, in FDKaacEnc_QCMain()
1076 if(hQC->hAdjThr->adjThrStateElem[i]->dynBitsLast==-1) { in FDKaacEnc_QCMain()
1077 … hQC->hAdjThr->adjThrStateElem[i]->dynBitsLast = qcElement[c][i]->dynBitsUsed; in FDKaacEnc_QCMain()
1097 …int sumBitsConsumedTotal = FDKaacEnc_getTotalConsumedBits(qcOut, qcElement, cm, hQC->globHdrBits, … in FDKaacEnc_QCMain()
1100 …ynBits==0) && (decreaseBitConsumption==1) && checkMinFrameBitsDemand(qcOut,hQC->minBitsPerFrame,nS… in FDKaacEnc_QCMain()
1129 emergencyIterations &= ((iterations[c][i] < hQC->maxIterations) ? 0 : 1); in FDKaacEnc_QCMain()
1139 …umBitsConsumedTotal = FDKaacEnc_getTotalConsumedBits(qcOut, qcElement, cm, hQC->globHdrBits, nSubF… in FDKaacEnc_QCMain()
1147 …mBitsConsumedTotal > totalAvailableBits) || !checkMinFrameBitsDemand(qcOut,hQC->minBitsPerFrame,nS… in FDKaacEnc_QCMain()
1150 …umBitsConsumedTotal < totalAvailableBits) && checkMinFrameBitsDemand(qcOut,hQC->minBitsPerFrame,nS… in FDKaacEnc_QCMain()
1608 QC_OUT *hQC = phQC[n]; in FDKaacEnc_QCClose() local
1613 if (hQC->qcElement[i]) in FDKaacEnc_QCClose()
1614 FreeRam_aacEnc_QCelement(&hQC->qcElement[i]); in FDKaacEnc_QCClose()