Lines Matching refs:hSbrElement
631 HANDLE_SBR_ELEMENT hSbrElement = *phSbrElement; in sbrEncoder_ElementClose() local
633 if (hSbrElement!=NULL) { in sbrEncoder_ElementClose()
634 if (hSbrElement->sbrConfigData.v_k_master) in sbrEncoder_ElementClose()
635 FreeRam_Sbr_v_k_master(&hSbrElement->sbrConfigData.v_k_master); in sbrEncoder_ElementClose()
636 if (hSbrElement->sbrConfigData.freqBandTable[LO]) in sbrEncoder_ElementClose()
637 FreeRam_Sbr_freqBandTableLO(&hSbrElement->sbrConfigData.freqBandTable[LO]); in sbrEncoder_ElementClose()
638 if (hSbrElement->sbrConfigData.freqBandTable[HI]) in sbrEncoder_ElementClose()
639 FreeRam_Sbr_freqBandTableHI(&hSbrElement->sbrConfigData.freqBandTable[HI]); in sbrEncoder_ElementClose()
857 HANDLE_SBR_ELEMENT hSbrElement = hEnvEncoder->sbrElement[iElement]; in FDKsbrEnc_EnvEncodeFrame() local
868 hSbrElement = hEnvEncoder->sbrElement[iElement]; in FDKsbrEnc_EnvEncodeFrame()
870 if (hSbrElement == NULL) in FDKsbrEnc_EnvEncodeFrame()
875 HANDLE_SBR_BITSTREAM_DATA sbrBitstreamData = &hSbrElement->sbrBitstreamData; in FDKsbrEnc_EnvEncodeFrame()
903 if (hSbrElement->CmonData.dynBwEnabled ) { in FDKsbrEnc_EnvEncodeFrame()
906 hSbrElement->dynXOverFreqDelay[i] = hSbrElement->dynXOverFreqDelay[i-1]; in FDKsbrEnc_EnvEncodeFrame()
908 hSbrElement->dynXOverFreqDelay[0] = hSbrElement->CmonData.dynXOverFreqEnc; in FDKsbrEnc_EnvEncodeFrame()
909 if (hSbrElement->dynXOverFreqDelay[1] > hSbrElement->dynXOverFreqDelay[2]) in FDKsbrEnc_EnvEncodeFrame()
910 newXOver = hSbrElement->dynXOverFreqDelay[2]; in FDKsbrEnc_EnvEncodeFrame()
912 newXOver = hSbrElement->dynXOverFreqDelay[1]; in FDKsbrEnc_EnvEncodeFrame()
915 if ( hSbrElement->sbrConfigData.dynXOverFreq != newXOver ) { in FDKsbrEnc_EnvEncodeFrame()
918 cutoffSb = ((4* newXOver * hSbrElement->sbrConfigData.noQmfBands in FDKsbrEnc_EnvEncodeFrame()
919 / hSbrElement->sbrConfigData.sampleFreq)+1)>>1; in FDKsbrEnc_EnvEncodeFrame()
921 for ( band = 0; band < hSbrElement->sbrConfigData.num_Master; band++ ) { in FDKsbrEnc_EnvEncodeFrame()
922 if ( cutoffSb == hSbrElement->sbrConfigData.v_k_master[band] ) in FDKsbrEnc_EnvEncodeFrame()
925 FDK_ASSERT( band < hSbrElement->sbrConfigData.num_Master ); in FDKsbrEnc_EnvEncodeFrame()
927 hSbrElement->sbrConfigData.dynXOverFreq = newXOver; in FDKsbrEnc_EnvEncodeFrame()
928 hSbrElement->sbrHeaderData.sbr_xover_band = band; in FDKsbrEnc_EnvEncodeFrame()
929 hSbrElement->sbrBitstreamData.HeaderActive=1; in FDKsbrEnc_EnvEncodeFrame()
935 if(updateFreqBandTable(&hSbrElement->sbrConfigData, in FDKsbrEnc_EnvEncodeFrame()
936 &hSbrElement->sbrHeaderData, in FDKsbrEnc_EnvEncodeFrame()
943 INT nEnvCh = hSbrElement->sbrConfigData.nChannels; in FDKsbrEnc_EnvEncodeFrame()
945 if(resetEnvChannel (&hSbrElement->sbrConfigData, in FDKsbrEnc_EnvEncodeFrame()
946 &hSbrElement->sbrHeaderData, in FDKsbrEnc_EnvEncodeFrame()
947 &hSbrElement->sbrChannel[ch]->hEnvChannel)) in FDKsbrEnc_EnvEncodeFrame()
957 crcReg = FDKsbrEnc_InitSbrBitstream(&hSbrElement->CmonData, in FDKsbrEnc_EnvEncodeFrame()
958 hSbrElement->payloadDelayLine[hEnvEncoder->nBitstrDelay], in FDKsbrEnc_EnvEncodeFrame()
961 hSbrElement->sbrConfigData.sbrSyntaxFlags); in FDKsbrEnc_EnvEncodeFrame()
986 for(ch = 0; ch < hSbrElement->sbrConfigData.nChannels; ch++) in FDKsbrEnc_EnvEncodeFrame()
988 HANDLE_ENV_CHANNEL h_envChan = &hSbrElement->sbrChannel[ch]->hEnvChannel; in FDKsbrEnc_EnvEncodeFrame()
991 if(hSbrElement->elInfo.fParametricStereo == 0) in FDKsbrEnc_EnvEncodeFrame()
1002 qmfAnalysisFiltering( hSbrElement->hQmfAnalysis[ch], in FDKsbrEnc_EnvEncodeFrame()
1006 samples + hSbrElement->elInfo.ChannelIndex[ch], in FDKsbrEnc_EnvEncodeFrame()
1021 if (hSbrElement->elInfo.fParametricStereo) in FDKsbrEnc_EnvEncodeFrame()
1043 …INT_PCM* pSamples[2] = {samples + hSbrElement->elInfo.ChannelIndex[0],samples + hSbrElement->elInf… in FDKsbrEnc_EnvEncodeFrame()
1047 hSbrElement->hQmfAnalysis, in FDKsbrEnc_EnvEncodeFrame()
1050 … samples + hSbrElement->elInfo.ChannelIndex[ch], in FDKsbrEnc_EnvEncodeFrame()
1070 &hSbrElement->sbrConfigData, in FDKsbrEnc_EnvEncodeFrame()
1071 &hSbrElement->sbrHeaderData, in FDKsbrEnc_EnvEncodeFrame()
1072 &hSbrElement->sbrBitstreamData, in FDKsbrEnc_EnvEncodeFrame()
1074 &hSbrElement->CmonData, in FDKsbrEnc_EnvEncodeFrame()
1086 &hSbrElement->sbrConfigData, in FDKsbrEnc_EnvEncodeFrame()
1087 &hSbrElement->sbrHeaderData, in FDKsbrEnc_EnvEncodeFrame()
1088 … (hSbrElement->elInfo.fParametricStereo) ? hEnvEncoder->hParametricStereo : NULL, in FDKsbrEnc_EnvEncodeFrame()
1089 &hSbrElement->sbrBitstreamData, in FDKsbrEnc_EnvEncodeFrame()
1090 &hSbrElement->sbrChannel[0]->hEnvChannel, in FDKsbrEnc_EnvEncodeFrame()
1091 &hSbrElement->sbrChannel[1]->hEnvChannel, in FDKsbrEnc_EnvEncodeFrame()
1092 &hSbrElement->CmonData, in FDKsbrEnc_EnvEncodeFrame()
1101 …FDKsbrEnc_AssembleSbrBitstream(&hSbrElement->CmonData, &crcInfo, crcReg, hSbrElement->sbrConfigDat… in FDKsbrEnc_EnvEncodeFrame()
1106 …hSbrElement->payloadDelayLineSize[hEnvEncoder->nBitstrDelay] = FDKgetValidBits(&hSbrElement->CmonD… in FDKsbrEnc_EnvEncodeFrame()
1108 if(hSbrElement->payloadDelayLineSize[hEnvEncoder->nBitstrDelay] > (MAX_PAYLOAD_SIZE<<3)) in FDKsbrEnc_EnvEncodeFrame()
1109 hSbrElement->payloadDelayLineSize[hEnvEncoder->nBitstrDelay]=0; in FDKsbrEnc_EnvEncodeFrame()
1113 *sbrDataBits = hSbrElement->payloadDelayLineSize[0]; in FDKsbrEnc_EnvEncodeFrame()
1114 … FDKmemcpy(sbrData, hSbrElement->payloadDelayLine[0], (hSbrElement->payloadDelayLineSize[0]+7)>>3); in FDKsbrEnc_EnvEncodeFrame()
1125 int nChannels = hSbrElement->sbrConfigData.nChannels; in FDKsbrEnc_EnvEncodeFrame()
1131 FDKaacEnc_Downsample(&hSbrElement->sbrChannel[ch]->downSampler, in FDKsbrEnc_EnvEncodeFrame()
1132 … samples + hSbrElement->elInfo.ChannelIndex[ch] + hEnvEncoder->bufferOffset, in FDKsbrEnc_EnvEncodeFrame()
1133 hSbrElement->sbrConfigData.frameSize, in FDKsbrEnc_EnvEncodeFrame()
1135 samples + hSbrElement->elInfo.ChannelIndex[ch], in FDKsbrEnc_EnvEncodeFrame()
1494 HANDLE_SBR_ELEMENT hSbrElement = hSbrEncoder->sbrElement[el]; in FDKsbrEnc_Reallocate() local
1498 hSbrElement->sbrChannel[ch] = hSbrEncoder->pSbrChannel[totalCh]; in FDKsbrEnc_Reallocate()
1503 hSbrElement->elInfo.ChannelIndex[ch] = pelInfo->ChannelIndex[ch]; in FDKsbrEnc_Reallocate()
1504 hSbrElement->hQmfAnalysis[ch] = &hSbrEncoder->QmfAnalysis[totalQmf++]; in FDKsbrEnc_Reallocate()
1508 hSbrElement->elInfo.elType = pelInfo->elType; in FDKsbrEnc_Reallocate()
1509 hSbrElement->elInfo.instanceTag = pelInfo->instanceTag; in FDKsbrEnc_Reallocate()
1510 hSbrElement->elInfo.nChannelsInEl = pelInfo->nChannelsInEl; in FDKsbrEnc_Reallocate()
1511 hSbrElement->elInfo.fParametricStereo = pelInfo->fParametricStereo; in FDKsbrEnc_Reallocate()
1530 HANDLE_SBR_ELEMENT hSbrElement, in FDKsbrEnc_EnvInit() argument
1550 bitstreamBuffer = hSbrElement->payloadDelayLine[nBitstrDelay]; in FDKsbrEnc_EnvInit()
1553 hSbrElement->sbrConfigData.sbrSyntaxFlags = 0; in FDKsbrEnc_EnvInit()
1558 hSbrElement->sbrConfigData.sbrSyntaxFlags |= SBR_SYNTAX_SCALABLE; in FDKsbrEnc_EnvInit()
1559 hSbrElement->sbrConfigData.sbrSyntaxFlags |= SBR_SYNTAX_DRM_CRC; in FDKsbrEnc_EnvInit()
1560 hSbrElement->sbrConfigData.sbrSyntaxFlags |= SBR_SYNTAX_CRC; in FDKsbrEnc_EnvInit()
1563 hSbrElement->sbrConfigData.sbrSyntaxFlags |= SBR_SYNTAX_LOW_DELAY; in FDKsbrEnc_EnvInit()
1569 hSbrElement->sbrConfigData.sbrSyntaxFlags |= SBR_SYNTAX_CRC; in FDKsbrEnc_EnvInit()
1572 hSbrElement->sbrConfigData.noQmfBands = QMF_CHANNELS>>(2-params->downSampleFactor); in FDKsbrEnc_EnvInit()
1573 switch (hSbrElement->sbrConfigData.noQmfBands) in FDKsbrEnc_EnvInit()
1575 case 64: hSbrElement->sbrConfigData.noQmfSlots = params->sbrFrameSize>>6; in FDKsbrEnc_EnvInit()
1577 case 32: hSbrElement->sbrConfigData.noQmfSlots = params->sbrFrameSize>>5; in FDKsbrEnc_EnvInit()
1579 default: hSbrElement->sbrConfigData.noQmfSlots = params->sbrFrameSize>>6; in FDKsbrEnc_EnvInit()
1583 …FDKinitBitStream(&hSbrElement->CmonData.sbrBitbuf, bitstreamBuffer, MAX_PAYLOAD_SIZE*sizeof(UCHAR)… in FDKsbrEnc_EnvInit()
1588 hSbrElement->sbrConfigData.nChannels = params->codecSettings.nChannels; in FDKsbrEnc_EnvInit()
1591 hSbrElement->sbrConfigData.stereoMode = params->stereoMode; in FDKsbrEnc_EnvInit()
1593 hSbrElement->sbrConfigData.stereoMode = SBR_MONO; in FDKsbrEnc_EnvInit()
1595 hSbrElement->sbrConfigData.frameSize = params->sbrFrameSize; in FDKsbrEnc_EnvInit()
1597 …hSbrElement->sbrConfigData.sampleFreq = params->downSampleFactor * params->codecSettings.sampleFre… in FDKsbrEnc_EnvInit()
1599 hSbrElement->sbrBitstreamData.CountSendHeaderData = 0; in FDKsbrEnc_EnvInit()
1604 …hSbrElement->sbrBitstreamData.NrSendHeaderData = (INT)(params->SendHeaderDataTime * hSbrElement->s… in FDKsbrEnc_EnvInit()
1605 / (1000 * hSbrElement->sbrConfigData.frameSize)); in FDKsbrEnc_EnvInit()
1606 …hSbrElement->sbrBitstreamData.NrSendHeaderData = fixMax(hSbrElement->sbrBitstreamData.NrSendHeader… in FDKsbrEnc_EnvInit()
1610 …hSbrElement->sbrBitstreamData.NrSendHeaderData = fixMin(fixMax(headerPeriod,1),(hSbrElement->sbrCo… in FDKsbrEnc_EnvInit()
1614 hSbrElement->sbrBitstreamData.NrSendHeaderData = 0; in FDKsbrEnc_EnvInit()
1617 hSbrElement->sbrHeaderData.sbr_data_extra = params->sbr_data_extra; in FDKsbrEnc_EnvInit()
1618 hSbrElement->sbrBitstreamData.HeaderActive = 0; in FDKsbrEnc_EnvInit()
1619 hSbrElement->sbrHeaderData.sbr_start_frequency = params->startFreq; in FDKsbrEnc_EnvInit()
1620 hSbrElement->sbrHeaderData.sbr_stop_frequency = params->stopFreq; in FDKsbrEnc_EnvInit()
1621 hSbrElement->sbrHeaderData.sbr_xover_band = 0; in FDKsbrEnc_EnvInit()
1622 hSbrElement->sbrHeaderData.sbr_lc_stereo_mode = 0; in FDKsbrEnc_EnvInit()
1626 hSbrElement->sbrHeaderData.sbr_data_extra = 1; in FDKsbrEnc_EnvInit()
1628 hSbrElement->sbrHeaderData.sbr_amp_res = (AMP_RES)params->amp_res; in FDKsbrEnc_EnvInit()
1631 hSbrElement->sbrHeaderData.freqScale = params->freqScale; in FDKsbrEnc_EnvInit()
1632 hSbrElement->sbrHeaderData.alterScale = params->alterScale; in FDKsbrEnc_EnvInit()
1633 hSbrElement->sbrHeaderData.sbr_noise_bands = params->sbr_noise_bands; in FDKsbrEnc_EnvInit()
1634 hSbrElement->sbrHeaderData.header_extra_1 = 0; in FDKsbrEnc_EnvInit()
1640 hSbrElement->sbrHeaderData.header_extra_1 = 1; in FDKsbrEnc_EnvInit()
1644 hSbrElement->sbrHeaderData.sbr_limiter_bands = params->sbr_limiter_bands; in FDKsbrEnc_EnvInit()
1645 hSbrElement->sbrHeaderData.sbr_limiter_gains = params->sbr_limiter_gains; in FDKsbrEnc_EnvInit()
1647 if ((hSbrElement->sbrConfigData.sampleFreq > 48000) && in FDKsbrEnc_EnvInit()
1648 (hSbrElement->sbrHeaderData.sbr_start_frequency >= 9)) in FDKsbrEnc_EnvInit()
1650 hSbrElement->sbrHeaderData.sbr_limiter_gains = SBR_LIMITER_GAINS_INFINITE; in FDKsbrEnc_EnvInit()
1653 hSbrElement->sbrHeaderData.sbr_interpol_freq = params->sbr_interpol_freq; in FDKsbrEnc_EnvInit()
1654 hSbrElement->sbrHeaderData.sbr_smoothing_length = params->sbr_smoothing_length; in FDKsbrEnc_EnvInit()
1655 hSbrElement->sbrHeaderData.header_extra_2 = 0; in FDKsbrEnc_EnvInit()
1662 hSbrElement->sbrHeaderData.header_extra_2 = 1; in FDKsbrEnc_EnvInit()
1666 hSbrElement->sbrConfigData.useWaveCoding = params->useWaveCoding; in FDKsbrEnc_EnvInit()
1667 hSbrElement->sbrConfigData.useParametricCoding = params->parametricCoding; in FDKsbrEnc_EnvInit()
1670 if(updateFreqBandTable(&hSbrElement->sbrConfigData, in FDKsbrEnc_EnvInit()
1671 &hSbrElement->sbrHeaderData, in FDKsbrEnc_EnvInit()
1679 for ( ch = 0; ch < hSbrElement->sbrConfigData.nChannels; ch++ ) { in FDKsbrEnc_EnvInit()
1681 if ( initEnvChannel(&hSbrElement->sbrConfigData, in FDKsbrEnc_EnvInit()
1682 &hSbrElement->sbrHeaderData, in FDKsbrEnc_EnvInit()
1683 &hSbrElement->sbrChannel[ch]->hEnvChannel, in FDKsbrEnc_EnvInit()
1697 …for ( ch = 0; ch < ((hSbrElement->elInfo.fParametricStereo)?2:hSbrElement->sbrConfigData.nChannels… in FDKsbrEnc_EnvInit()
1700 …UINT qmfFlags = (hSbrElement->sbrConfigData.sbrSyntaxFlags & SBR_SYNTAX_LOW_DELAY) ? QMF_FLAG_CLDF… in FDKsbrEnc_EnvInit()
1706 err = qmfInitAnalysisFilterBank( hSbrElement->hQmfAnalysis[ch], in FDKsbrEnc_EnvInit()
1707 (FIXP_QAS*)hSbrElement->hQmfAnalysis[ch]->FilterStates, in FDKsbrEnc_EnvInit()
1708 hSbrElement->sbrConfigData.noQmfSlots, in FDKsbrEnc_EnvInit()
1709 hSbrElement->sbrConfigData.noQmfBands, in FDKsbrEnc_EnvInit()
1710 hSbrElement->sbrConfigData.noQmfBands, in FDKsbrEnc_EnvInit()
1711 hSbrElement->sbrConfigData.noQmfBands, in FDKsbrEnc_EnvInit()
1719 hSbrElement->CmonData.xOverFreq = hSbrElement->sbrConfigData.xOverFreq; in FDKsbrEnc_EnvInit()
1720 hSbrElement->CmonData.dynBwEnabled = (params->dynBwSupported && params->dynBwEnabled); in FDKsbrEnc_EnvInit()
1721 …hSbrElement->CmonData.dynXOverFreqEnc = FDKsbrEnc_SbrGetXOverFreq( hSbrElement, hSbrElement->CmonD… in FDKsbrEnc_EnvInit()
1723 hSbrElement->dynXOverFreqDelay[i] = hSbrElement->CmonData.dynXOverFreqEnc; in FDKsbrEnc_EnvInit()
1724 hSbrElement->CmonData.sbrNumChannels = hSbrElement->sbrConfigData.nChannels; in FDKsbrEnc_EnvInit()
1725 hSbrElement->sbrConfigData.dynXOverFreq = hSbrElement->CmonData.xOverFreq; in FDKsbrEnc_EnvInit()
1728 *coreBandWith = hSbrElement->CmonData.xOverFreq; in FDKsbrEnc_EnvInit()