Lines Matching refs:hAacEncoder

852 static AACENC_ERROR FDKaacEnc_AdjustEncSettings(HANDLE_AACENCODER hAacEncoder,  in FDKaacEnc_AdjustEncSettings()  argument
857 HANDLE_AACENC_CONFIG hAacConfig = &hAacEncoder->aacConfig; in FDKaacEnc_AdjustEncSettings()
1055 int maxFrameLength = 8 * hAacEncoder->outBufferInBytes; in FDKaacEnc_AdjustEncSettings()
1170 if ((hAacConfig->nChannels > hAacEncoder->nMaxAacChannels) || in FDKaacEnc_AdjustEncSettings()
1172 ->nChannelsEff > hAacEncoder->nMaxSbrChannels) && in FDKaacEnc_AdjustEncSettings()
1185 hAacEncoder->metaDataAllowed = 1; in FDKaacEnc_AdjustEncSettings()
1195 hAacEncoder->metaDataAllowed = 0; in FDKaacEnc_AdjustEncSettings()
1210 HANDLE_AACENCODER hAacEncoder = (HANDLE_AACENCODER)self; in aacenc_SbrCallback() local
1212 sbrEncoder_GetHeader(hAacEncoder->hEnvEnc, hBs, elementIndex, 0); in aacenc_SbrCallback()
1223 HANDLE_AACENCODER hAacEncoder = (HANDLE_AACENCODER)self; in aacenc_SscCallback() local
1225 return (FDK_MpegsEnc_WriteSpatialSpecificConfig(hAacEncoder->hMpsEnc, hBs)); in aacenc_SscCallback()
1228 static AACENC_ERROR aacEncInit(HANDLE_AACENCODER hAacEncoder, ULONG InitFlags, in aacEncInit() argument
1233 HANDLE_SBR_ENCODER *hSbrEncoder = &hAacEncoder->hEnvEnc; in aacEncInit()
1234 HANDLE_AACENC_CONFIG hAacConfig = &hAacEncoder->aacConfig; in aacEncInit()
1236 hAacEncoder->nZerosAppended = 0; /* count appended zeros */ in aacEncInit()
1244 if ((err = FDKaacEnc_AdjustEncSettings(hAacEncoder, config)) != AACENC_OK) { in aacEncInit()
1257 FDKmemclear(hAacEncoder->inputBuffer, in aacEncInit()
1258 sizeof(INT_PCM) * hAacEncoder->inputBufferSize); in aacEncInit()
1265 hAacEncoder->nDelay = DELAY_AACLD(hAacConfig->framelength); in aacEncInit()
1268 hAacEncoder->nDelay = DELAY_AACELD(hAacConfig->framelength); in aacEncInit()
1271 hAacEncoder->nDelay = in aacEncInit()
1278 if ((NULL != hAacEncoder->hEnvEnc) && isSbrActive(hAacConfig) && in aacEncInit()
1309 hAacEncoder->inputBuffer, hAacEncoder->inputBufferSizePerChannel, in aacEncInit()
1312 &frameLength, hAacConfig->audioObjectType, &hAacEncoder->nDelay, in aacEncInit()
1338 if ((hAacEncoder->hMpsEnc != NULL) && (hAacConfig->syntaxFlags & AC_LD_MPS)) { in aacEncInit()
1347 FDK_MpegsEnc_Init(hAacEncoder->hMpsEnc, hAacConfig->audioObjectType, in aacEncInit()
1352 hAacEncoder->inputBufferSizePerChannel, in aacEncInit()
1357 hAacEncoder->nDelay = in aacEncInit()
1358 fMax(FDK_MpegsEnc_GetDelay(hAacEncoder->hMpsEnc), hAacEncoder->nDelay); in aacEncInit()
1367 &hAacEncoder->coderConfig, config, in aacEncInit()
1377 FDKmemclear(hAacEncoder->outBuffer, in aacEncInit()
1378 hAacEncoder->outBufferInBytes * sizeof(UCHAR)); in aacEncInit()
1381 if (transportEnc_Init(hAacEncoder->hTpEnc, hAacEncoder->outBuffer, in aacEncInit()
1382 hAacEncoder->outBufferInBytes, config->userTpType, in aacEncInit()
1383 &hAacEncoder->coderConfig, flags) != 0) { in aacEncInit()
1394 hAacEncoder->hAacEnc, hAacConfig, hAacEncoder->hTpEnc, in aacEncInit()
1404 if (hAacEncoder->hMetadataEnc && (hAacEncoder->metaDataAllowed != 0) && in aacEncInit()
1413 if (FDK_MetadataEnc_Init(hAacEncoder->hMetadataEnc, in aacEncInit()
1422 hAacEncoder->nDelay += FDK_MetadataEnc_GetDelay(hAacEncoder->hMetadataEnc); in aacEncInit()
1427 if ((hAacEncoder->hMpsEnc != NULL) && (hAacConfig->syntaxFlags & AC_LD_MPS)) { in aacEncInit()
1428 hAacEncoder->nDelayCore = in aacEncInit()
1429 hAacEncoder->nDelay - in aacEncInit()
1430 fMax(0, FDK_MpegsEnc_GetDecDelay(hAacEncoder->hMpsEnc)); in aacEncInit()
1432 hAacEncoder->nDelayCore = in aacEncInit()
1433 hAacEncoder->nDelay - in aacEncInit()
1434 fMax(0, sbrEncoder_GetSbrDecDelay(hAacEncoder->hEnvEnc)); in aacEncInit()
1436 hAacEncoder->nDelayCore = hAacEncoder->nDelay; in aacEncInit()
1443 hAacEncoder->inputBufferOffset = aacBufferOffset; in aacEncInit()
1445 hAacEncoder->nSamplesToRead = frameLength * config->nChannels; in aacEncInit()
1455 HANDLE_AACENCODER hAacEncoder = NULL; in aacEncOpen() local
1463 hAacEncoder = Get_AacEncoder(); in aacEncOpen()
1465 if (hAacEncoder == NULL) { in aacEncOpen()
1470 FDKmemclear(hAacEncoder, sizeof(AACENCODER)); in aacEncOpen()
1480 hAacEncoder->encoder_modis = ENC_MODE_FLAG_AAC; in aacEncOpen()
1482 hAacEncoder->encoder_modis |= ENC_MODE_FLAG_SBR; in aacEncOpen()
1485 hAacEncoder->encoder_modis |= ENC_MODE_FLAG_PS; in aacEncOpen()
1488 hAacEncoder->encoder_modis |= ENC_MODE_FLAG_META; in aacEncOpen()
1490 hAacEncoder->encoder_modis |= ENC_MODE_FLAG_SAC; in aacEncOpen()
1494 hAacEncoder->encoder_modis = encModules; in aacEncOpen()
1499 hAacEncoder->nMaxAacChannels = (8); in aacEncOpen()
1500 hAacEncoder->nMaxSbrChannels = (8); in aacEncOpen()
1502 hAacEncoder->nMaxAacChannels = (maxChannels & 0x00FF); in aacEncOpen()
1503 if ((hAacEncoder->encoder_modis & ENC_MODE_FLAG_SBR)) { in aacEncOpen()
1504 hAacEncoder->nMaxSbrChannels = (maxChannels & 0xFF00) in aacEncOpen()
1506 : hAacEncoder->nMaxAacChannels; in aacEncOpen()
1509 if ((hAacEncoder->nMaxAacChannels > (8)) || in aacEncOpen()
1510 (hAacEncoder->nMaxSbrChannels > (8))) { in aacEncOpen()
1517 hAacEncoder->nMaxAacElements = fixMin(((8)), hAacEncoder->nMaxAacChannels); in aacEncOpen()
1518 hAacEncoder->nMaxSbrElements = fixMin((8), hAacEncoder->nMaxSbrChannels); in aacEncOpen()
1522 if (hAacEncoder->encoder_modis & (ENC_MODE_FLAG_SBR | ENC_MODE_FLAG_PS)) in aacEncOpen()
1523 hAacEncoder->inputBufferSizePerChannel = INPUTBUFFER_SIZE; in aacEncOpen()
1525 hAacEncoder->inputBufferSizePerChannel = (1024); in aacEncOpen()
1527 hAacEncoder->inputBufferSize = in aacEncOpen()
1528 hAacEncoder->nMaxAacChannels * hAacEncoder->inputBufferSizePerChannel; in aacEncOpen()
1530 if (NULL == (hAacEncoder->inputBuffer = (INT_PCM *)FDKcalloc( in aacEncOpen()
1531 hAacEncoder->inputBufferSize, sizeof(INT_PCM)))) { in aacEncOpen()
1537 if (hAacEncoder->encoder_modis & ENC_MODE_FLAG_SBR) { in aacEncOpen()
1539 &hAacEncoder->hEnvEnc, hAacEncoder->nMaxSbrElements, in aacEncOpen()
1540 hAacEncoder->nMaxSbrChannels, in aacEncOpen()
1541 (hAacEncoder->encoder_modis & ENC_MODE_FLAG_PS) ? 1 : 0)) { in aacEncOpen()
1546 if (NULL == (hAacEncoder->pSbrPayload = (SBRENC_EXT_PAYLOAD *)FDKcalloc( in aacEncOpen()
1554 if (FDKaacEnc_Open(&hAacEncoder->hAacEnc, hAacEncoder->nMaxAacElements, in aacEncOpen()
1555 hAacEncoder->nMaxAacChannels, (1)) != AAC_ENC_OK) { in aacEncOpen()
1561 hAacEncoder->outBufferInBytes = in aacEncOpen()
1563 1, ((1) * hAacEncoder->nMaxAacChannels * 6144) >> in aacEncOpen()
1565 if (NULL == (hAacEncoder->outBuffer = (UCHAR *)FDKcalloc( in aacEncOpen()
1566 hAacEncoder->outBufferInBytes, sizeof(UCHAR)))) { in aacEncOpen()
1572 if (hAacEncoder->encoder_modis & ENC_MODE_FLAG_META) { in aacEncOpen()
1573 if (FDK_MetadataEnc_Open(&hAacEncoder->hMetadataEnc, in aacEncOpen()
1574 (UINT)hAacEncoder->nMaxAacChannels)) { in aacEncOpen()
1581 if (hAacEncoder->encoder_modis & ENC_MODE_FLAG_SAC) { in aacEncOpen()
1582 if (MPS_ENCODER_OK != FDK_MpegsEnc_Open(&hAacEncoder->hMpsEnc)) { in aacEncOpen()
1589 if (transportEnc_Open(&hAacEncoder->hTpEnc) != 0) { in aacEncOpen()
1602 hAacEncoder->CAPF_tpEnc = FDKlibInfo_getCapabilities(*pLibInfo, FDK_TPENC); in aacEncOpen()
1606 if (transportEnc_RegisterSbrCallback(hAacEncoder->hTpEnc, aacenc_SbrCallback, in aacEncOpen()
1607 hAacEncoder) != 0) { in aacEncOpen()
1611 if (transportEnc_RegisterSscCallback(hAacEncoder->hTpEnc, aacenc_SscCallback, in aacEncOpen()
1612 hAacEncoder) != 0) { in aacEncOpen()
1618 aacEncDefaultConfig(&hAacEncoder->aacConfig, &hAacEncoder->extParam); in aacEncOpen()
1621 hAacEncoder->coderConfig.headerPeriod = in aacEncOpen()
1622 hAacEncoder->extParam.userTpHeaderPeriod; in aacEncOpen()
1625 hAacEncoder->InitFlags = AACENC_INIT_ALL; in aacEncOpen()
1628 *phAacEncoder = hAacEncoder; in aacEncOpen()
1633 aacEncClose(&hAacEncoder); in aacEncOpen()
1647 HANDLE_AACENCODER hAacEncoder = *phAacEncoder; in aacEncClose() local
1649 if (hAacEncoder->inputBuffer != NULL) { in aacEncClose()
1650 FDKfree(hAacEncoder->inputBuffer); in aacEncClose()
1651 hAacEncoder->inputBuffer = NULL; in aacEncClose()
1653 if (hAacEncoder->outBuffer != NULL) { in aacEncClose()
1654 FDKfree(hAacEncoder->outBuffer); in aacEncClose()
1655 hAacEncoder->outBuffer = NULL; in aacEncClose()
1658 if (hAacEncoder->hEnvEnc) { in aacEncClose()
1659 sbrEncoder_Close(&hAacEncoder->hEnvEnc); in aacEncClose()
1661 if (hAacEncoder->pSbrPayload != NULL) { in aacEncClose()
1662 FDKfree(hAacEncoder->pSbrPayload); in aacEncClose()
1663 hAacEncoder->pSbrPayload = NULL; in aacEncClose()
1665 if (hAacEncoder->hAacEnc) { in aacEncClose()
1666 FDKaacEnc_Close(&hAacEncoder->hAacEnc); in aacEncClose()
1669 transportEnc_Close(&hAacEncoder->hTpEnc); in aacEncClose()
1671 if (hAacEncoder->hMetadataEnc) { in aacEncClose()
1672 FDK_MetadataEnc_Close(&hAacEncoder->hMetadataEnc); in aacEncClose()
1674 if (hAacEncoder->hMpsEnc) { in aacEncClose()
1675 FDK_MpegsEnc_Close(&hAacEncoder->hMpsEnc); in aacEncClose()
1685 AACENC_ERROR aacEncEncode(const HANDLE_AACENCODER hAacEncoder, in aacEncEncode() argument
1697 if (hAacEncoder == NULL) { in aacEncEncode()
1705 if (hAacEncoder->InitFlags != 0) { in aacEncEncode()
1707 aacEncInit(hAacEncoder, hAacEncoder->InitFlags, &hAacEncoder->extParam); in aacEncEncode()
1713 hAacEncoder->InitFlags = AACENC_INIT_NONE; in aacEncEncode()
1748 FDKmemclear(outBytes, hAacEncoder->aacConfig.nSubFrames * sizeof(INT)); in aacEncEncode()
1758 fixMax(0, fixMin(inargs->numInSamples, hAacEncoder->nSamplesToRead - in aacEncEncode()
1759 hAacEncoder->nSamplesRead)); in aacEncEncode()
1761 hAacEncoder->inputBuffer + in aacEncEncode()
1762 (hAacEncoder->inputBufferOffset + hAacEncoder->nSamplesRead) / in aacEncEncode()
1763 hAacEncoder->aacConfig.nChannels; in aacEncEncode()
1766 hAacEncoder->extParam in aacEncEncode()
1772 hAacEncoder->extParam.nChannels, in aacEncEncode()
1773 newSamples / hAacEncoder->extParam.nChannels, in aacEncEncode()
1774 hAacEncoder->inputBufferSizePerChannel); in aacEncEncode()
1777 hAacEncoder->extParam.nChannels, in aacEncEncode()
1778 newSamples / hAacEncoder->extParam.nChannels, in aacEncEncode()
1779 hAacEncoder->inputBufferSizePerChannel); in aacEncEncode()
1782 hAacEncoder->extParam.nChannels, in aacEncEncode()
1783 newSamples / hAacEncoder->extParam.nChannels, in aacEncEncode()
1784 hAacEncoder->inputBufferSizePerChannel); in aacEncEncode()
1786 hAacEncoder->nSamplesRead += newSamples; in aacEncEncode()
1793 if (hAacEncoder->nSamplesRead < hAacEncoder->nSamplesToRead) { in aacEncEncode()
1797 if ((hAacEncoder->nZerosAppended < hAacEncoder->nDelay)) { in aacEncEncode()
1798 int nZeros = (hAacEncoder->nSamplesToRead - hAacEncoder->nSamplesRead) / in aacEncEncode()
1799 hAacEncoder->extParam.nChannels; in aacEncEncode()
1805 for (i = 0; i < (int)hAacEncoder->extParam.nChannels; i++) { in aacEncEncode()
1806 FDKmemclear(hAacEncoder->inputBuffer + in aacEncEncode()
1807 i * hAacEncoder->inputBufferSizePerChannel + in aacEncEncode()
1808 (hAacEncoder->inputBufferOffset + in aacEncEncode()
1809 hAacEncoder->nSamplesRead) / in aacEncEncode()
1810 hAacEncoder->extParam.nChannels, in aacEncEncode()
1813 hAacEncoder->nZerosAppended += nZeros; in aacEncEncode()
1814 hAacEncoder->nSamplesRead = hAacEncoder->nSamplesToRead; in aacEncEncode()
1827 FDKmemclear(hAacEncoder->extPayload, in aacEncEncode()
1830 hAacEncoder->extPayload[i].associatedChElement = -1; in aacEncEncode()
1832 if (hAacEncoder->pSbrPayload != NULL) { in aacEncEncode()
1833 FDKmemclear(hAacEncoder->pSbrPayload, sizeof(*hAacEncoder->pSbrPayload)); in aacEncEncode()
1839 if ((hAacEncoder->hMetadataEnc != NULL) && in aacEncEncode()
1840 (hAacEncoder->metaDataAllowed != 0)) { in aacEncEncode()
1854 hAacEncoder->hMetadataEnc, in aacEncEncode()
1855 hAacEncoder->inputBuffer + hAacEncoder->inputBufferOffset / in aacEncEncode()
1856 hAacEncoder->coderConfig.noChannels, in aacEncEncode()
1857 hAacEncoder->inputBufferSizePerChannel, hAacEncoder->nSamplesRead, in aacEncEncode()
1863 hAacEncoder->extPayload[nExtensions++] = pMetaDataExtPayload[i]; in aacEncEncode()
1867 ((hAacEncoder->extParam.userChannelMode == MODE_1_2_2) || in aacEncEncode()
1868 (hAacEncoder->extParam.userChannelMode == MODE_1_2_2_1))) { in aacEncEncode()
1871 if (hAacEncoder->extParam.userPceAdditions != pceValue) { in aacEncEncode()
1872 hAacEncoder->extParam.userPceAdditions = pceValue; in aacEncEncode()
1873 hAacEncoder->InitFlags |= AACENC_INIT_TRANSPORT; in aacEncEncode()
1881 if ((hAacEncoder->hMpsEnc != NULL) && in aacEncEncode()
1882 (hAacEncoder->aacConfig.syntaxFlags & AC_LD_MPS)) { in aacEncEncode()
1888 hAacEncoder->hMpsEnc, in aacEncEncode()
1889 hAacEncoder->inputBuffer + hAacEncoder->inputBufferOffset / in aacEncEncode()
1890 hAacEncoder->coderConfig.noChannels, in aacEncEncode()
1891 hAacEncoder->nSamplesRead, &mpsExtensionPayload)) { in aacEncEncode()
1898 hAacEncoder->extPayload[nExtensions++] = mpsExtensionPayload; in aacEncEncode()
1902 if ((NULL != hAacEncoder->hEnvEnc) && (NULL != hAacEncoder->pSbrPayload) && in aacEncEncode()
1903 isSbrActive(&hAacEncoder->aacConfig)) { in aacEncEncode()
1909 if (sbrEncoder_EncodeFrame(hAacEncoder->hEnvEnc, hAacEncoder->inputBuffer, in aacEncEncode()
1910 hAacEncoder->inputBufferSizePerChannel, in aacEncEncode()
1911 hAacEncoder->pSbrPayload->dataSize[nPayload], in aacEncEncode()
1912 hAacEncoder->pSbrPayload->data[nPayload])) { in aacEncEncode()
1918 if (hAacEncoder->pSbrPayload->dataSize[nPayload][i] > 0) { in aacEncEncode()
1919 hAacEncoder->extPayload[nExtensions].pData = in aacEncEncode()
1920 hAacEncoder->pSbrPayload->data[nPayload][i]; in aacEncEncode()
1922 hAacEncoder->extPayload[nExtensions].dataSize = in aacEncEncode()
1923 hAacEncoder->pSbrPayload->dataSize[nPayload][i]; in aacEncEncode()
1924 hAacEncoder->extPayload[nExtensions].associatedChElement = i; in aacEncEncode()
1926 hAacEncoder->extPayload[nExtensions].dataType = in aacEncEncode()
1940 hAacEncoder->extPayload[nExtensions].dataSize = inargs->numAncBytes * 8; in aacEncEncode()
1941 hAacEncoder->extPayload[nExtensions].pData = (UCHAR *)inBufDesc->bufs[idx]; in aacEncEncode()
1942 hAacEncoder->extPayload[nExtensions].dataType = EXT_DATA_ELEMENT; in aacEncEncode()
1943 hAacEncoder->extPayload[nExtensions].associatedChElement = -1; in aacEncEncode()
1951 if (FDKaacEnc_EncodeFrame(hAacEncoder->hAacEnc, hAacEncoder->hTpEnc, in aacEncEncode()
1952 hAacEncoder->inputBuffer, in aacEncEncode()
1953 hAacEncoder->inputBufferSizePerChannel, outBytes, in aacEncEncode()
1954 hAacEncoder->extPayload) != AAC_ENC_OK) { in aacEncEncode()
1962 (hAacEncoder->extPayload[ancDataExtIdx].dataSize >> 3); in aacEncEncode()
1966 hAacEncoder->nSamplesRead -= hAacEncoder->nSamplesToRead; in aacEncEncode()
1971 if (isSbrActive(&hAacEncoder->aacConfig)) { in aacEncEncode()
1972 sbrEncoder_UpdateBuffers(hAacEncoder->hEnvEnc, hAacEncoder->inputBuffer, in aacEncEncode()
1973 hAacEncoder->inputBufferSizePerChannel); in aacEncEncode()
1983 for (i = 0, nBsBytes = 0; i < hAacEncoder->aacConfig.nSubFrames; i++) { in aacEncEncode()
1992 FDKmemcpy(outBufDesc->bufs[bsIdx], hAacEncoder->outBuffer, in aacEncEncode()
1996 FDKaacEnc_GetBitReservoirState(hAacEncoder->hAacEnc); in aacEncEncode()
2007 hAacEncoder->InitFlags = AACENC_INIT_ALL; in aacEncEncode()
2013 static AAC_ENCODER_ERROR aacEncGetConf(HANDLE_AACENCODER hAacEncoder, in aacEncGetConf() argument
2024 err = transportEnc_GetConf(hAacEncoder->hTpEnc, &hAacEncoder->coderConfig, in aacEncGetConf()
2078 AACENC_ERROR aacEncoder_SetParam(const HANDLE_AACENCODER hAacEncoder, in aacEncoder_SetParam() argument
2081 USER_PARAM *settings = &hAacEncoder->extParam; in aacEncoder_SetParam()
2084 if (hAacEncoder == NULL) { in aacEncoder_SetParam()
2096 if (!(hAacEncoder->encoder_modis & (ENC_MODE_FLAG_PS))) { in aacEncoder_SetParam()
2103 if (!(hAacEncoder->encoder_modis & (ENC_MODE_FLAG_SBR))) { in aacEncoder_SetParam()
2112 if (!(hAacEncoder->encoder_modis & (ENC_MODE_FLAG_AAC))) { in aacEncoder_SetParam()
2122 hAacEncoder->InitFlags |= in aacEncoder_SetParam()
2129 hAacEncoder->InitFlags |= AACENC_INIT_CONFIG | AACENC_INIT_TRANSPORT; in aacEncoder_SetParam()
2142 hAacEncoder->InitFlags |= in aacEncoder_SetParam()
2161 hAacEncoder->nSamplesRead = 0; /* reset internal inputbuffer */ in aacEncoder_SetParam()
2162 hAacEncoder->InitFlags |= in aacEncoder_SetParam()
2169 (NULL != hAacEncoder->hMpsEnc)) { in aacEncoder_SetParam()
2179 if ((pConfig->nElements > hAacEncoder->nMaxAacElements) || in aacEncoder_SetParam()
2180 (pConfig->nChannelsEff > hAacEncoder->nMaxAacChannels)) { in aacEncoder_SetParam()
2188 hAacEncoder->nSamplesRead = 0; /* reset internal inputbuffer */ in aacEncoder_SetParam()
2189 hAacEncoder->InitFlags |= AACENC_INIT_CONFIG | AACENC_INIT_TRANSPORT; in aacEncoder_SetParam()
2191 hAacEncoder->InitFlags |= AACENC_INIT_STATES; in aacEncoder_SetParam()
2198 hAacEncoder->InitFlags |= AACENC_INIT_CONFIG; in aacEncoder_SetParam()
2202 if (hAacEncoder->aacConfig.channelOrder != (CHANNEL_ORDER)value) { in aacEncoder_SetParam()
2207 hAacEncoder->aacConfig.channelOrder = (CHANNEL_ORDER)value; in aacEncoder_SetParam()
2208 hAacEncoder->nSamplesRead = 0; /* reset internal inputbuffer */ in aacEncoder_SetParam()
2209 hAacEncoder->InitFlags |= in aacEncoder_SetParam()
2220 hAacEncoder->InitFlags |= AACENC_INIT_CONFIG; in aacEncoder_SetParam()
2239 hAacEncoder->InitFlags |= in aacEncoder_SetParam()
2255 hAacEncoder->InitFlags |= in aacEncoder_SetParam()
2261 (NULL != hAacEncoder->hEnvEnc)) { in aacEncoder_SetParam()
2263 hAacEncoder->InitFlags |= in aacEncoder_SetParam()
2270 UINT flags = hAacEncoder->CAPF_tpEnc; in aacEncoder_SetParam()
2284 hAacEncoder->InitFlags |= AACENC_INIT_TRANSPORT; in aacEncoder_SetParam()
2294 hAacEncoder->InitFlags |= AACENC_INIT_TRANSPORT; in aacEncoder_SetParam()
2304 hAacEncoder->InitFlags |= AACENC_INIT_TRANSPORT; in aacEncoder_SetParam()
2314 hAacEncoder->InitFlags |= AACENC_INIT_TRANSPORT; in aacEncoder_SetParam()
2324 hAacEncoder->InitFlags |= AACENC_INIT_TRANSPORT; in aacEncoder_SetParam()
2334 hAacEncoder->InitFlags |= AACENC_INIT_TRANSPORT; in aacEncoder_SetParam()
2343 if (hAacEncoder->InitFlags != value) { in aacEncoder_SetParam()
2345 hAacEncoder->nSamplesRead = 0; in aacEncoder_SetParam()
2347 hAacEncoder->InitFlags = value; in aacEncoder_SetParam()
2357 hAacEncoder->InitFlags |= AACENC_INIT_CONFIG; in aacEncoder_SetParam()
2363 hAacEncoder->InitFlags |= AACENC_INIT_CONFIG | AACENC_INIT_TRANSPORT; in aacEncoder_SetParam()
2375 UINT aacEncoder_GetParam(const HANDLE_AACENCODER hAacEncoder, in aacEncoder_GetParam() argument
2378 USER_PARAM *settings = &hAacEncoder->extParam; in aacEncoder_GetParam()
2381 if (hAacEncoder == NULL) { in aacEncoder_GetParam()
2388 value = (UINT)hAacEncoder->aacConfig.audioObjectType; in aacEncoder_GetParam()
2391 switch (hAacEncoder->aacConfig.bitrateMode) { in aacEncoder_GetParam()
2393 value = (UINT)hAacEncoder->aacConfig.bitRate; in aacEncoder_GetParam()
2400 value = (UINT)((hAacEncoder->aacConfig.bitrateMode != AACENC_BR_MODE_FF) in aacEncoder_GetParam()
2401 ? hAacEncoder->aacConfig.bitrateMode in aacEncoder_GetParam()
2405 value = (UINT)hAacEncoder->coderConfig.extSamplingRate; in aacEncoder_GetParam()
2408 if ((MODE_1 == hAacEncoder->aacConfig.channelMode) && in aacEncoder_GetParam()
2409 (hAacEncoder->aacConfig.syntaxFlags & AC_LD_MPS)) { in aacEncoder_GetParam()
2412 value = (UINT)hAacEncoder->aacConfig.channelMode; in aacEncoder_GetParam()
2416 value = (UINT)hAacEncoder->aacConfig.bandWidth; in aacEncoder_GetParam()
2419 value = (UINT)hAacEncoder->aacConfig.channelOrder; in aacEncoder_GetParam()
2422 value = (UINT)hAacEncoder->aacConfig.useRequant; in aacEncoder_GetParam()
2425 value = (UINT)hAacEncoder->aacConfig.framelength; in aacEncoder_GetParam()
2428 value = isSbrActive(&hAacEncoder->aacConfig) in aacEncoder_GetParam()
2429 ? hAacEncoder->aacConfig.sbrRatio in aacEncoder_GetParam()
2434 (UINT)(hAacEncoder->aacConfig.syntaxFlags & AC_SBR_PRESENT) ? 1 : 0; in aacEncoder_GetParam()
2441 hAacEncoder->aacConfig.audioObjectType, settings->userTpType, in aacEncoder_GetParam()
2442 settings->userTpSignaling, hAacEncoder->aacConfig.sbrRatio); in aacEncoder_GetParam()
2448 value = (UINT)hAacEncoder->coderConfig.headerPeriod; in aacEncoder_GetParam()
2451 value = (UINT)hAacEncoder->aacConfig.audioMuxVersion; in aacEncoder_GetParam()
2457 value = (UINT)hAacEncoder->aacConfig.anc_Rate; in aacEncoder_GetParam()
2460 value = (UINT)hAacEncoder->InitFlags; in aacEncoder_GetParam()
2463 value = (hAacEncoder->metaDataAllowed == 0) in aacEncoder_GetParam()
2469 if (((INT)hAacEncoder->extParam.userPeakBitrate != -1)) { in aacEncoder_GetParam()
2471 (UINT)(fMax((INT)hAacEncoder->extParam.userPeakBitrate, in aacEncoder_GetParam()
2472 hAacEncoder->aacConfig in aacEncoder_GetParam()
2486 AACENC_ERROR aacEncInfo(const HANDLE_AACENCODER hAacEncoder, in aacEncInfo() argument
2493 pInfo->maxOutBufBytes = ((hAacEncoder->nMaxAacChannels * 6144) + 7) >> 3; in aacEncInfo()
2494 pInfo->maxAncBytes = hAacEncoder->aacConfig.maxAncBytesPerAU; in aacEncInfo()
2496 hAacEncoder->nSamplesRead / hAacEncoder->extParam.nChannels; in aacEncInfo()
2497 pInfo->inputChannels = hAacEncoder->extParam.nChannels; in aacEncInfo()
2499 hAacEncoder->nSamplesToRead / hAacEncoder->extParam.nChannels; in aacEncInfo()
2500 pInfo->nDelay = hAacEncoder->nDelay; in aacEncInfo()
2501 pInfo->nDelayCore = hAacEncoder->nDelayCore; in aacEncInfo()
2504 if (aacEncGetConf(hAacEncoder, &pInfo->confSize, &pInfo->confBuf[0]) != in aacEncInfo()