Lines Matching refs:hAacConfig

326 static inline INT isSbrActive(const HANDLE_AACENC_CONFIG hAacConfig)  in isSbrActive()  argument
330 if ( (hAacConfig->audioObjectType==AOT_SBR) || (hAacConfig->audioObjectType==AOT_PS) ) in isSbrActive()
334 if (hAacConfig->audioObjectType == AOT_ER_AAC_ELD && (hAacConfig->syntaxFlags & AC_SBR_PRESENT)) in isSbrActive()
419 const HANDLE_AACENC_CONFIG hAacConfig in H_ALLOC_MEM()
427 transport_AOT = hAacConfig->audioObjectType; in H_ALLOC_MEM()
429 if (hAacConfig->audioObjectType == AOT_ER_AAC_ELD) { in H_ALLOC_MEM()
430 cc->flags |= (hAacConfig->syntaxFlags & AC_SBR_PRESENT) ? CC_SBR : 0; in H_ALLOC_MEM()
463 cc->bitRate = hAacConfig->bitRate; in H_ALLOC_MEM()
464 cc->noChannels = hAacConfig->nChannels; in H_ALLOC_MEM()
466 cc->channelMode = hAacConfig->channelMode; in H_ALLOC_MEM()
468 cc->nSubFrames = (hAacConfig->nSubFrames > 1 && extCfg->userTpNsubFrames == 1) in H_ALLOC_MEM()
469 ? hAacConfig->nSubFrames in H_ALLOC_MEM()
489 cc->samplesPerFrame = hAacConfig->framelength; in H_ALLOC_MEM()
490 cc->samplingRate = hAacConfig->sampleRate; in H_ALLOC_MEM()
496 cc->flags |= (hAacConfig->syntaxFlags & AC_ER_VCB11) ? CC_VCB11 : 0; in H_ALLOC_MEM()
497 cc->flags |= (hAacConfig->syntaxFlags & AC_ER_HCR) ? CC_HCR : 0; in H_ALLOC_MEM()
498 cc->flags |= (hAacConfig->syntaxFlags & AC_ER_RVLC) ? CC_RVLC : 0; in H_ALLOC_MEM()
501 if ( (extCfg->userPceAdditions&0x1) && (hAacConfig->epConfig==-1) in H_ALLOC_MEM()
542 AAC_ENCODER_ERROR aacEncDefaultConfig(HANDLE_AACENC_CONFIG hAacConfig, in aacEncDefaultConfig() argument
546 FDKaacEnc_AacInitDefaultConfig (hAacConfig); in aacEncDefaultConfig()
552 config->nChannels = hAacConfig->nChannels; in aacEncDefaultConfig()
553 config->userAOT = hAacConfig->audioObjectType = AOT_AAC_LC; in aacEncDefaultConfig()
554 config->userSamplerate = hAacConfig->sampleRate; in aacEncDefaultConfig()
555 config->userChannelMode = hAacConfig->channelMode; in aacEncDefaultConfig()
556 config->userBitrate = hAacConfig->bitRate; in aacEncDefaultConfig()
557 config->userBitrateMode = hAacConfig->bitrateMode; in aacEncDefaultConfig()
559 config->userBandwidth = hAacConfig->bandWidth; in aacEncDefaultConfig()
560 config->userTns = hAacConfig->useTns; in aacEncDefaultConfig()
561 config->userPns = hAacConfig->usePns; in aacEncDefaultConfig()
562 config->userIntensity = hAacConfig->useIS; in aacEncDefaultConfig()
563 config->userAfterburner = hAacConfig->useRequant; in aacEncDefaultConfig()
566 if (hAacConfig->syntaxFlags & AC_ER_VCB11) { in aacEncDefaultConfig()
569 if (hAacConfig->syntaxFlags & AC_ER_HCR) { in aacEncDefaultConfig()
746 HANDLE_AACENC_CONFIG hAacConfig = &hAacEncoder->aacConfig; in FDKaacEnc_AdjustEncSettings() local
748 hAacConfig->nChannels = config->nChannels; in FDKaacEnc_AdjustEncSettings()
751 hAacConfig->sampleRate = config->userSamplerate; in FDKaacEnc_AdjustEncSettings()
752 hAacConfig->useTns = config->userTns; in FDKaacEnc_AdjustEncSettings()
753 hAacConfig->usePns = config->userPns; in FDKaacEnc_AdjustEncSettings()
754 hAacConfig->useIS = config->userIntensity; in FDKaacEnc_AdjustEncSettings()
755 hAacConfig->bitRate = config->userBitrate; in FDKaacEnc_AdjustEncSettings()
756 hAacConfig->channelMode = config->userChannelMode; in FDKaacEnc_AdjustEncSettings()
757 hAacConfig->bitrateMode = config->userBitrateMode; in FDKaacEnc_AdjustEncSettings()
758 hAacConfig->bandWidth = config->userBandwidth; in FDKaacEnc_AdjustEncSettings()
759 hAacConfig->useRequant = config->userAfterburner; in FDKaacEnc_AdjustEncSettings()
761 hAacConfig->audioObjectType = config->userAOT; in FDKaacEnc_AdjustEncSettings()
762 hAacConfig->anc_Rate = config->userAncDataRate; in FDKaacEnc_AdjustEncSettings()
763 hAacConfig->syntaxFlags = 0; in FDKaacEnc_AdjustEncSettings()
764 hAacConfig->epConfig = -1; in FDKaacEnc_AdjustEncSettings()
767 hAacConfig->audioMuxVersion = config->userTpAmxv; in FDKaacEnc_AdjustEncSettings()
770 hAacConfig->audioMuxVersion = -1; in FDKaacEnc_AdjustEncSettings()
774 switch ( hAacConfig->audioObjectType ) { in FDKaacEnc_AdjustEncSettings()
779hAacConfig->framelength = (config->userFramelength!=(UINT)-1) ? config->userFramelength : 1024; in FDKaacEnc_AdjustEncSettings()
780 if (hAacConfig->framelength != 1024) { in FDKaacEnc_AdjustEncSettings()
785 hAacConfig->epConfig = 0; in FDKaacEnc_AdjustEncSettings()
786 hAacConfig->syntaxFlags |= AC_ER|AC_LD; in FDKaacEnc_AdjustEncSettings()
787 hAacConfig->syntaxFlags |= ((config->userErTools & 0x1) ? AC_ER_VCB11 : 0); in FDKaacEnc_AdjustEncSettings()
788 hAacConfig->syntaxFlags |= ((config->userErTools & 0x2) ? AC_ER_HCR : 0); in FDKaacEnc_AdjustEncSettings()
789 hAacConfig->syntaxFlags |= ((config->userErTools & 0x4) ? AC_ER_RVLC : 0); in FDKaacEnc_AdjustEncSettings()
791hAacConfig->framelength = (config->userFramelength!=(UINT)-1) ? config->userFramelength : 512; in FDKaacEnc_AdjustEncSettings()
792 if (hAacConfig->framelength != 512 && hAacConfig->framelength != 480) { in FDKaacEnc_AdjustEncSettings()
797 hAacConfig->epConfig = 0; in FDKaacEnc_AdjustEncSettings()
798 hAacConfig->syntaxFlags |= AC_ER|AC_ELD; in FDKaacEnc_AdjustEncSettings()
799 hAacConfig->syntaxFlags |= ((config->userErTools & 0x1) ? AC_ER_VCB11 : 0); in FDKaacEnc_AdjustEncSettings()
800 hAacConfig->syntaxFlags |= ((config->userErTools & 0x2) ? AC_ER_HCR : 0); in FDKaacEnc_AdjustEncSettings()
801 hAacConfig->syntaxFlags |= ((config->userErTools & 0x4) ? AC_ER_RVLC : 0); in FDKaacEnc_AdjustEncSettings()
802 hAacConfig->syntaxFlags |= ((config->userSbrEnabled==1) ? AC_SBR_PRESENT : 0); in FDKaacEnc_AdjustEncSettings()
804hAacConfig->framelength = (config->userFramelength!=(UINT)-1) ? config->userFramelength : 512; in FDKaacEnc_AdjustEncSettings()
805 if (hAacConfig->framelength != 512 && hAacConfig->framelength != 480) { in FDKaacEnc_AdjustEncSettings()
813 switch ( hAacConfig->audioObjectType ) { in FDKaacEnc_AdjustEncSettings()
818 if ( isLowDelay(hAacConfig->audioObjectType) ) { in FDKaacEnc_AdjustEncSettings()
820 INT brPerChannel = hAacConfig->bitRate/hAacConfig->nChannels; in FDKaacEnc_AdjustEncSettings()
824 hAacConfig->bitreservoir = bitreservoir & ~7; /* align to bytes */ in FDKaacEnc_AdjustEncSettings()
827 if (hAacConfig->bitrateMode!=0) { in FDKaacEnc_AdjustEncSettings()
835 hAacConfig->bitRate = config->userBitrate; in FDKaacEnc_AdjustEncSettings()
838 if ( (hAacConfig->bitrateMode>=1) && (hAacConfig->bitrateMode<=5) ) { in FDKaacEnc_AdjustEncSettings()
840hAacConfig->bitRate = FDKaacEnc_GetVBRBitrate(hAacConfig->bitrateMode, hAacConfig->channelMode); in FDKaacEnc_AdjustEncSettings()
846 if ( (hAacConfig->bitrateMode==0) && (config->userBitrate==(UINT)-1) ) { in FDKaacEnc_AdjustEncSettings()
847 …NT bitrate = FDKaacEnc_GetChannelModeConfiguration(hAacConfig->channelMode)->nChannelsEff * hAacCo… in FDKaacEnc_AdjustEncSettings()
849 if ( isPsActive(hAacConfig->audioObjectType) ) { in FDKaacEnc_AdjustEncSettings()
850 hAacConfig->bitRate = (bitrate>>1); /* 0.5 bit per sample */ in FDKaacEnc_AdjustEncSettings()
852 else if ( isSbrActive(hAacConfig) ) in FDKaacEnc_AdjustEncSettings()
854 …if ( (config->userSbrRatio==2) || ((config->userSbrRatio==0)&&(hAacConfig->audioObjectType!=AOT_ER… in FDKaacEnc_AdjustEncSettings()
855 hAacConfig->bitRate = (bitrate + (bitrate>>2))>>1; /* 0.625 bits per sample */ in FDKaacEnc_AdjustEncSettings()
857 …if ( (config->userSbrRatio==1) || ((config->userSbrRatio==0)&&(hAacConfig->audioObjectType==AOT_ER… in FDKaacEnc_AdjustEncSettings()
858 hAacConfig->bitRate = (bitrate + (bitrate>>3)); /* 1.125 bits per sample */ in FDKaacEnc_AdjustEncSettings()
862 hAacConfig->bitRate = bitrate + (bitrate>>1); /* 1.5 bits per sample */ in FDKaacEnc_AdjustEncSettings()
866 if ((hAacConfig->bitrateMode >= 0) && (hAacConfig->bitrateMode <= 5)) { in FDKaacEnc_AdjustEncSettings()
868hAacConfig->maxBitsPerFrame = (FDKaacEnc_CalcBitsPerFrame(fMax(hAacConfig->bitRate, (INT)config->u… in FDKaacEnc_AdjustEncSettings()
871 hAacConfig->maxBitsPerFrame = -1; in FDKaacEnc_AdjustEncSettings()
873 if (hAacConfig->audioMuxVersion==2) { in FDKaacEnc_AdjustEncSettings()
874hAacConfig->minBitsPerFrame = fMin(32*8, FDKaacEnc_CalcBitsPerFrame(hAacConfig->bitRate, hAacConfi… in FDKaacEnc_AdjustEncSettings()
879 if ( (hAacConfig->audioObjectType==AOT_ER_AAC_ELD) in FDKaacEnc_AdjustEncSettings()
886 hAacConfig->sampleRate, in FDKaacEnc_AdjustEncSettings()
887 hAacConfig->channelMode, in FDKaacEnc_AdjustEncSettings()
888 hAacConfig->bitRate, in FDKaacEnc_AdjustEncSettings()
895 hAacConfig->syntaxFlags |= ((eldSbr) ? AC_SBR_PRESENT : 0); in FDKaacEnc_AdjustEncSettings()
896 hAacConfig->sbrRatio = eldSbrRatio; in FDKaacEnc_AdjustEncSettings()
899 if ( (config->userSbrRatio==0) && (isSbrActive(hAacConfig)) ) { in FDKaacEnc_AdjustEncSettings()
904 hAacConfig->sbrRatio = (hAacConfig->audioObjectType==AOT_ER_AAC_ELD) ? 1 : 2; in FDKaacEnc_AdjustEncSettings()
908 hAacConfig->sbrRatio = isSbrActive(hAacConfig) ? config->userSbrRatio : 0; in FDKaacEnc_AdjustEncSettings()
912 …R tpSignaling=getSbrSignalingMode(hAacConfig->audioObjectType, config->userTpType, config->userTpS… in FDKaacEnc_AdjustEncSettings()
914 …if ( (hAacConfig->audioObjectType==AOT_AAC_LC || hAacConfig->audioObjectType==AOT_SBR || hAacConfi… in FDKaacEnc_AdjustEncSettings()
921 …if ( (hAacConfig->audioObjectType==AOT_AAC_LC || hAacConfig->audioObjectType==AOT_SBR || hAacConfi… in FDKaacEnc_AdjustEncSettings()
922 (tpSignaling==0) && (hAacConfig->sbrRatio==1)) { in FDKaacEnc_AdjustEncSettings()
931 hAacConfig->bitRate = aacEncoder_LimitBitrate( in FDKaacEnc_AdjustEncSettings()
933 hAacConfig->sampleRate, in FDKaacEnc_AdjustEncSettings()
934 hAacConfig->framelength, in FDKaacEnc_AdjustEncSettings()
935 hAacConfig->nChannels, in FDKaacEnc_AdjustEncSettings()
936 hAacConfig->channelMode, in FDKaacEnc_AdjustEncSettings()
937 hAacConfig->bitRate, in FDKaacEnc_AdjustEncSettings()
938 hAacConfig->nSubFrames, in FDKaacEnc_AdjustEncSettings()
939 isSbrActive(hAacConfig), in FDKaacEnc_AdjustEncSettings()
940 hAacConfig->sbrRatio, in FDKaacEnc_AdjustEncSettings()
941 hAacConfig->audioObjectType in FDKaacEnc_AdjustEncSettings()
945 if ( ((hAacConfig->bitrateMode>=1) && (hAacConfig->bitrateMode<=5)) /* VBR without PNS. */ in FDKaacEnc_AdjustEncSettings()
946 || (hAacConfig->useTns == 0) ) /* TNS required. */ in FDKaacEnc_AdjustEncSettings()
948 hAacConfig->usePns = 0; in FDKaacEnc_AdjustEncSettings()
951 if (hAacConfig->epConfig >= 0) { in FDKaacEnc_AdjustEncSettings()
952 hAacConfig->syntaxFlags |= AC_ER; in FDKaacEnc_AdjustEncSettings()
953 if (((INT)hAacConfig->channelMode < 1) || ((INT)hAacConfig->channelMode > 7)) { in FDKaacEnc_AdjustEncSettings()
958 …if ( FDKaacEnc_DetermineEncoderMode(&hAacConfig->channelMode, hAacConfig->nChannels) != AAC_ENC_OK… in FDKaacEnc_AdjustEncSettings()
962 if ( (hAacConfig->nChannels > hAacEncoder->nMaxAacChannels) in FDKaacEnc_AdjustEncSettings()
963 …|| ( (FDKaacEnc_GetChannelModeConfiguration(hAacConfig->channelMode)->nChannelsEff > hAacEncoder->… in FDKaacEnc_AdjustEncSettings()
964 isSbrActive(hAacConfig) ) in FDKaacEnc_AdjustEncSettings()
971 switch (hAacConfig->audioObjectType) in FDKaacEnc_AdjustEncSettings()
978 if (((INT)hAacConfig->channelMode < 1) || ((INT)hAacConfig->channelMode > 7)) { in FDKaacEnc_AdjustEncSettings()
1017 HANDLE_AACENC_CONFIG hAacConfig = &hAacEncoder->aacConfig; in aacEncInit() local
1021 INT frameLength = hAacConfig->framelength; in aacEncInit()
1025 CHANNEL_MODE prevChMode = hAacConfig->channelMode; in aacEncInit()
1031 frameLength = hAacConfig->framelength; /* adapt temporal framelength */ in aacEncInit()
1034 if ( (prevChMode!=hAacConfig->channelMode) && isSbrActive(hAacConfig) ) { in aacEncInit()
1047 if (hAacConfig->audioObjectType == AOT_ER_AAC_ELD) { in aacEncInit()
1048 hAacEncoder->nDelay = DELAY_AACELD(hAacConfig->framelength); in aacEncInit()
1051 hAacEncoder->nDelay = DELAY_AAC(hAacConfig->framelength); /* AAC encoder delay */ in aacEncInit()
1053 hAacConfig->ancDataBitRate = 0; in aacEncInit()
1056 if ( isSbrActive(hAacConfig) && in aacEncInit()
1063 if ( FDKaacEnc_InitChannelMapping(hAacConfig->channelMode, in aacEncInit()
1064 hAacConfig->channelOrder, in aacEncInit()
1075 aacEncDistributeSbrBits(&channelMapping, sbrElInfo, hAacConfig->bitRate); in aacEncInit()
1086 &hAacConfig->bandWidth, in aacEncInit()
1088 &hAacConfig->nChannels, in aacEncInit()
1089 &hAacConfig->sampleRate, in aacEncInit()
1090 &hAacConfig->sbrRatio, in aacEncInit()
1092 hAacConfig->audioObjectType, in aacEncInit()
1094 (hAacConfig->audioObjectType == AOT_ER_AAC_ELD) ? 1 : TRANS_FAC, in aacEncInit()
1104 if (hAacConfig->nChannels == 1) { in aacEncInit()
1105 hAacConfig->channelMode = MODE_1; in aacEncInit()
1109 if ( hAacConfig->usePns ) { in aacEncInit()
1110 hAacConfig->usePns = 0; in aacEncInit()
1114 hAacConfig->ancDataBitRate = sbrEncoder_GetEstimateBitrate(*hSbrEncoder) ; in aacEncInit()
1129 …getSbrSignalingMode(hAacConfig->audioObjectType, config->userTpType, config->userTpSignaling, hAac… in aacEncInit()
1130 hAacConfig); in aacEncInit()
1154 hAacConfig, in aacEncInit()
1170 INT inputDataDelay = DELAY_AAC(hAacConfig->framelength); in aacEncInit()
1172 if ( isSbrActive(hAacConfig) && hSbrEncoder!=NULL) { in aacEncInit()
1173 … inputDataDelay = hAacConfig->sbrRatio*inputDataDelay + sbrEncoder_GetInputDataDelay(*hSbrEncoder); in aacEncInit()
1184 hAacConfig->channelOrder) != 0) in aacEncInit()