Lines Matching refs:hMp4SpaceEnc
299 HANDLE_MP4SPACE_ENCODER hMp4SpaceEnc, const INT coreCoderDelay);
302 HANDLE_MP4SPACE_ENCODER hMp4SpaceEnc);
969 FDK_SACENC_ERROR FDK_sacenc_encode(const HANDLE_MP4SPACE_ENCODER hMp4SpaceEnc, in FDK_sacenc_encode() argument
989 if ((hMp4SpaceEnc == NULL) || (pInputSamples == NULL)) { in FDK_sacenc_encode()
998 const int nChIn = hMp4SpaceEnc->nInputChannels; in FDK_sacenc_encode()
1000 const int nChOut = hMp4SpaceEnc->nOutputChannels; in FDK_sacenc_encode()
1003 const int nFrameTimeSlots = hMp4SpaceEnc->nFrameTimeSlots; in FDK_sacenc_encode()
1008 if (hMp4SpaceEnc->encMode == SACENC_212) { in FDK_sacenc_encode()
1009 nFrameTimeSlotsReduction = hMp4SpaceEnc->nFrameTimeSlots >> 1; in FDK_sacenc_encode()
1013 encoderInputChScale[i] = hMp4SpaceEnc->pEncoderInputChScale[i]; in FDK_sacenc_encode()
1029 hMp4SpaceEnc->hBitstreamFormatter, WRITE_SPATIALFRAME))) { in FDK_sacenc_encode()
1035 if (hMp4SpaceEnc->nDiscardOutFrames > in FDK_sacenc_encode()
1037 hMp4SpaceEnc->independencyCount = in FDK_sacenc_encode()
1039 hMp4SpaceEnc->independencyFlag = 1; in FDK_sacenc_encode()
1041 hMp4SpaceEnc->independencyFlag = in FDK_sacenc_encode()
1042 (hMp4SpaceEnc->independencyCount == 0) ? 1 : 0; in FDK_sacenc_encode()
1043 if (hMp4SpaceEnc->independencyFactor > 0) { in FDK_sacenc_encode()
1044 hMp4SpaceEnc->independencyCount++; in FDK_sacenc_encode()
1045 hMp4SpaceEnc->independencyCount = in FDK_sacenc_encode()
1046 hMp4SpaceEnc->independencyCount % in FDK_sacenc_encode()
1047 ((int)hMp4SpaceEnc->independencyFactor); in FDK_sacenc_encode()
1049 hMp4SpaceEnc->independencyCount = -1; in FDK_sacenc_encode()
1063 hMp4SpaceEnc, pInputSamples, pOutputSamples, inargs->nInputSamples, in FDK_sacenc_encode()
1069 if (hMp4SpaceEnc->nSamplesNext != hMp4SpaceEnc->nSamplesValid) { in FDK_sacenc_encode()
1074 if (hMp4SpaceEnc->encMode == SACENC_212 && in FDK_sacenc_encode()
1075 hMp4SpaceEnc->bEncMode_212_only) { in FDK_sacenc_encode()
1079 hMp4SpaceEnc->pppHybridIn__FDK in FDK_sacenc_encode()
1080 [ch][hMp4SpaceEnc->nUpdateHybridPositionTimeSlots + in FDK_sacenc_encode()
1082 (FIXP_DBL)0, hMp4SpaceEnc->nHybridBands); in FDK_sacenc_encode()
1096 fdk_sacenc_getPreGainPtrFDK(hMp4SpaceEnc->hStaticGain); in FDK_sacenc_encode()
1103 &hMp4SpaceEnc->ppTimeSigIn__FDK[ch][(ts * hMp4SpaceEnc->nQmfBands)]; in FDK_sacenc_encode()
1108 hMp4SpaceEnc->phDCFilterSigIn[ch], pTimeIn, in FDK_sacenc_encode()
1109 pTimeIn, hMp4SpaceEnc->nQmfBands))) { in FDK_sacenc_encode()
1117 qmfAnalysisFilteringSlot(hMp4SpaceEnc->phQmfFiltIn__FDK[ch], pQmfInReal, in FDK_sacenc_encode()
1127 for (i = 0; i < hMp4SpaceEnc->nHybridBands; i++) { in FDK_sacenc_encode()
1128 hMp4SpaceEnc in FDK_sacenc_encode()
1130 [hMp4SpaceEnc->nAnalysisLookaheadTimeSlots + in FDK_sacenc_encode()
1133 hMp4SpaceEnc in FDK_sacenc_encode()
1135 [hMp4SpaceEnc->nAnalysisLookaheadTimeSlots + in FDK_sacenc_encode()
1140 for (i = 0; i < hMp4SpaceEnc->nHybridBands; i++) { in FDK_sacenc_encode()
1141 hMp4SpaceEnc in FDK_sacenc_encode()
1143 [hMp4SpaceEnc->nAnalysisLookaheadTimeSlots + in FDK_sacenc_encode()
1146 hMp4SpaceEnc in FDK_sacenc_encode()
1148 [hMp4SpaceEnc->nAnalysisLookaheadTimeSlots + in FDK_sacenc_encode()
1162 if (hMp4SpaceEnc->encMode == SACENC_212 && in FDK_sacenc_encode()
1163 hMp4SpaceEnc->bEncMode_212_only) { in FDK_sacenc_encode()
1166 slot < (int)(hMp4SpaceEnc->nUpdateHybridPositionTimeSlots + in FDK_sacenc_encode()
1169 copyCplxVec(hMp4SpaceEnc->pppHybridIn__FDK[ch][slot], in FDK_sacenc_encode()
1170 hMp4SpaceEnc->pppHybridInStatic__FDK[ch][slot], in FDK_sacenc_encode()
1171 hMp4SpaceEnc->nHybridBands); in FDK_sacenc_encode()
1176 slot < (int)(hMp4SpaceEnc->nUpdateHybridPositionTimeSlots + in FDK_sacenc_encode()
1180 hMp4SpaceEnc->pppHybridInStatic__FDK[ch][slot], in FDK_sacenc_encode()
1181 hMp4SpaceEnc->pppHybridIn__FDK[ch][nFrameTimeSlots + slot], in FDK_sacenc_encode()
1182 hMp4SpaceEnc->nHybridBands); in FDK_sacenc_encode()
1196 hMp4SpaceEnc->phOnset[ch], nFrameTimeSlots, in FDK_sacenc_encode()
1197 hMp4SpaceEnc->nHybridBands, in FDK_sacenc_encode()
1198 &hMp4SpaceEnc->pppHybridIn__FDK in FDK_sacenc_encode()
1199 [ch][hMp4SpaceEnc->nAnalysisLookaheadTimeSlots], in FDK_sacenc_encode()
1201 hMp4SpaceEnc->trPrevPos[1], /* contains previous Transient */ in FDK_sacenc_encode()
1202 hMp4SpaceEnc->ppTrCurrPos[ch]))) { in FDK_sacenc_encode()
1206 if ((1) && (hMp4SpaceEnc->useFrameKeep == 0)) { in FDK_sacenc_encode()
1207 hMp4SpaceEnc->ppTrCurrPos[ch][0] = -1; in FDK_sacenc_encode()
1211 if ((hMp4SpaceEnc->ppTrCurrPos[ch][0] >= 0) && in FDK_sacenc_encode()
1213 (hMp4SpaceEnc->ppTrCurrPos[ch][0] < currTransPos))) { in FDK_sacenc_encode()
1214 currTransPos = hMp4SpaceEnc->ppTrCurrPos[ch][0]; in FDK_sacenc_encode()
1219 if (hMp4SpaceEnc->useFrameKeep == 1) { in FDK_sacenc_encode()
1220 if ((currTransPos != -1) || (hMp4SpaceEnc->independencyFlag == 1)) { in FDK_sacenc_encode()
1221 hMp4SpaceEnc->avoid_keep = NUM_KEEP_WINDOWS; in FDK_sacenc_encode()
1227 hMp4SpaceEnc->trPrevPos[0] = in FDK_sacenc_encode()
1228 FDKmax(-1, hMp4SpaceEnc->trPrevPos[1] - (INT)nFrameTimeSlots); in FDK_sacenc_encode()
1229 hMp4SpaceEnc->trPrevPos[1] = currTransPos; in FDK_sacenc_encode()
1234 hMp4SpaceEnc->phOnset[ch], nFrameTimeSlots))) { in FDK_sacenc_encode()
1242 hMp4SpaceEnc->hFrameWindow, hMp4SpaceEnc->trPrevPos, in FDK_sacenc_encode()
1244 hMp4SpaceEnc->pFrameWindowAna__FDK, &hMp4SpaceEnc->frameWinList, in FDK_sacenc_encode()
1245 hMp4SpaceEnc->avoid_keep))) { in FDK_sacenc_encode()
1252 for (ps = 0, winCnt = 0; ps < hMp4SpaceEnc->frameWinList.n; ++ps) { in FDK_sacenc_encode()
1254 if (hMp4SpaceEnc->frameWinList.dat[ps].hold == FW_HOLD) { in FDK_sacenc_encode()
1258 &hMp4SpaceEnc->saveFrame, 0, pFrameData, ps))) { in FDK_sacenc_encode()
1269 hMp4SpaceEnc->pFrameWindowAna__FDK[winCnt], in FDK_sacenc_encode()
1270 hMp4SpaceEnc->nAnalysisLengthTimeSlots); in FDK_sacenc_encode()
1273 getAnalysisStartTimeSlot(hMp4SpaceEnc->pFrameWindowAna__FDK[winCnt], in FDK_sacenc_encode()
1274 hMp4SpaceEnc->nAnalysisLengthTimeSlots); in FDK_sacenc_encode()
1279 hMp4SpaceEnc->pFrameWindowAna__FDK[winCnt]; in FDK_sacenc_encode()
1280 FIXP_DPK ***pppHybridIn__FDK = hMp4SpaceEnc->pppHybridIn__FDK; in FDK_sacenc_encode()
1281 FIXP_DPK ***pppProcDataIn__FDK = hMp4SpaceEnc->pppProcDataIn__FDK; in FDK_sacenc_encode()
1283 if (hMp4SpaceEnc->encMode == SACENC_212 && in FDK_sacenc_encode()
1284 hMp4SpaceEnc->bEncMode_212_only) { in FDK_sacenc_encode()
1290 hMp4SpaceEnc->hSpaceTree, ps, nChIn, nAnalysisLengthTimeSlots, in FDK_sacenc_encode()
1291 analysisStartTimeSlot, hMp4SpaceEnc->nHybridBands, in FDK_sacenc_encode()
1294 pFrameData, hMp4SpaceEnc->avoid_keep, encoderInputChScale))) { in FDK_sacenc_encode()
1300 pFrameData, ps, &hMp4SpaceEnc->saveFrame, 0))) { in FDK_sacenc_encode()
1306 if (hMp4SpaceEnc->avoid_keep > 0) { in FDK_sacenc_encode()
1307 hMp4SpaceEnc->avoid_keep--; in FDK_sacenc_encode()
1317 if (!(hMp4SpaceEnc->encMode == SACENC_212 && in FDK_sacenc_encode()
1318 hMp4SpaceEnc->bEncMode_212_only)) { in FDK_sacenc_encode()
1321 slot < (int)(hMp4SpaceEnc->nUpdateHybridPositionTimeSlots + in FDK_sacenc_encode()
1325 hMp4SpaceEnc->pppHybridIn__FDK[ch][slot], in FDK_sacenc_encode()
1326 hMp4SpaceEnc->pppHybridIn__FDK[ch][nFrameTimeSlots + slot], in FDK_sacenc_encode()
1327 hMp4SpaceEnc->nHybridBands); in FDK_sacenc_encode()
1331 hMp4SpaceEnc->pppHybridIn__FDK in FDK_sacenc_encode()
1332 [ch][hMp4SpaceEnc->nUpdateHybridPositionTimeSlots + in FDK_sacenc_encode()
1334 (FIXP_DBL)0, hMp4SpaceEnc->nHybridBands); in FDK_sacenc_encode()
1354 if (hMp4SpaceEnc->encMode == SACENC_212) { in FDK_sacenc_encode()
1361 hMp4SpaceEnc in FDK_sacenc_encode()
1362 ->ppBitstreamDelayBuffer[hMp4SpaceEnc->nBitstreamBufferWrite]; in FDK_sacenc_encode()
1369 pFrameData->bsIndependencyFlag = hMp4SpaceEnc->independencyFlag; in FDK_sacenc_encode()
1374 &hMp4SpaceEnc->pnOutputBits[hMp4SpaceEnc->nBitstreamBufferWrite], in FDK_sacenc_encode()
1375 hMp4SpaceEnc->hBitstreamFormatter))) { in FDK_sacenc_encode()
1380 if ((hMp4SpaceEnc->nDiscardOutFrames == 0) && in FDK_sacenc_encode()
1386 hMp4SpaceEnc->pnOutputBits[hMp4SpaceEnc->nBitstreamBufferRead]; in FDK_sacenc_encode()
1397 if (hMp4SpaceEnc->encMode != SACENC_212) { in FDK_sacenc_encode()
1400 hMp4SpaceEnc in FDK_sacenc_encode()
1401 ->ppBitstreamDelayBuffer[hMp4SpaceEnc->nBitstreamBufferRead], in FDK_sacenc_encode()
1413 hMp4SpaceEnc->nBitstreamBufferRead = in FDK_sacenc_encode()
1414 (hMp4SpaceEnc->nBitstreamBufferRead + 1) % in FDK_sacenc_encode()
1415 hMp4SpaceEnc->nBitstreamDelayBuffer; in FDK_sacenc_encode()
1416 hMp4SpaceEnc->nBitstreamBufferWrite = in FDK_sacenc_encode()
1417 (hMp4SpaceEnc->nBitstreamBufferWrite + 1) % in FDK_sacenc_encode()
1418 hMp4SpaceEnc->nBitstreamDelayBuffer; in FDK_sacenc_encode()
1422 (hMp4SpaceEnc->nDiscardOutFrames == 0) in FDK_sacenc_encode()
1433 if (hMp4SpaceEnc->encMode != SACENC_212) { in FDK_sacenc_encode()
1441 &hMp4SpaceEnc->pOutputDelayBuffer__FDK in FDK_sacenc_encode()
1442 [ch + (hMp4SpaceEnc->nOutputBufferDelay) * nChOut], in FDK_sacenc_encode()
1443 nChOut, hMp4SpaceEnc->ppTimeSigOut__FDK[ch], 1, in FDK_sacenc_encode()
1449 FDKmemcpy(pOutputSamples, hMp4SpaceEnc->pOutputDelayBuffer__FDK, in FDK_sacenc_encode()
1454 hMp4SpaceEnc->pOutputDelayBuffer__FDK, in FDK_sacenc_encode()
1455 &hMp4SpaceEnc->pOutputDelayBuffer__FDK[nOutputSamplesMax], in FDK_sacenc_encode()
1456 nChOut * (hMp4SpaceEnc->nOutputBufferDelay) * sizeof(INT_PCM)); in FDK_sacenc_encode()
1459 if (hMp4SpaceEnc->useTimeDomDownmix <= 0) { in FDK_sacenc_encode()
1461 hMp4SpaceEnc->hStaticGain, pOutputSamples, in FDK_sacenc_encode()
1469 if (hMp4SpaceEnc->nDiscardOutFrames > 0) { in FDK_sacenc_encode()
1470 hMp4SpaceEnc->nDiscardOutFrames--; in FDK_sacenc_encode()
1474 hMp4SpaceEnc->nSamplesValid = 0; in FDK_sacenc_encode()
1599 HANDLE_MP4SPACE_ENCODER hMp4SpaceEnc, const INT coreCoderDelay) { in mp4SpaceEnc_InitDelayCompensation() argument
1603 if (hMp4SpaceEnc == NULL) { in mp4SpaceEnc_InitDelayCompensation()
1606 hMp4SpaceEnc->coreCoderDelay = coreCoderDelay; in mp4SpaceEnc_InitDelayCompensation()
1609 hMp4SpaceEnc->hDelay, hMp4SpaceEnc->nQmfBands, in mp4SpaceEnc_InitDelayCompensation()
1610 hMp4SpaceEnc->nFrameLength, coreCoderDelay, in mp4SpaceEnc_InitDelayCompensation()
1611 hMp4SpaceEnc->timeAlignment))) { in mp4SpaceEnc_InitDelayCompensation()
1615 fdk_sacenc_delay_SetDmxAlign(hMp4SpaceEnc->hDelay, 0); in mp4SpaceEnc_InitDelayCompensation()
1617 hMp4SpaceEnc->hDelay, (hMp4SpaceEnc->useTimeDomDownmix >= 1) ? 1 : 0); in mp4SpaceEnc_InitDelayCompensation()
1618 fdk_sacenc_delay_SetMinimizeDelay(hMp4SpaceEnc->hDelay, 1); in mp4SpaceEnc_InitDelayCompensation()
1621 hMp4SpaceEnc->hDelay))) { in mp4SpaceEnc_InitDelayCompensation()
1626 hMp4SpaceEnc->nBitstreamDelayBuffer = in mp4SpaceEnc_InitDelayCompensation()
1627 fdk_sacenc_delay_GetBitstreamFrameBufferSize(hMp4SpaceEnc->hDelay); in mp4SpaceEnc_InitDelayCompensation()
1628 hMp4SpaceEnc->nOutputBufferDelay = in mp4SpaceEnc_InitDelayCompensation()
1629 fdk_sacenc_delay_GetOutputAudioBufferDelay(hMp4SpaceEnc->hDelay); in mp4SpaceEnc_InitDelayCompensation()
1630 hMp4SpaceEnc->nSurroundAnalysisBufferDelay = in mp4SpaceEnc_InitDelayCompensation()
1631 fdk_sacenc_delay_GetSurroundAnalysisBufferDelay(hMp4SpaceEnc->hDelay); in mp4SpaceEnc_InitDelayCompensation()
1632 hMp4SpaceEnc->nBitstreamBufferRead = 0; in mp4SpaceEnc_InitDelayCompensation()
1633 hMp4SpaceEnc->nBitstreamBufferWrite = in mp4SpaceEnc_InitDelayCompensation()
1634 hMp4SpaceEnc->nBitstreamDelayBuffer - 1; in mp4SpaceEnc_InitDelayCompensation()
1636 if (hMp4SpaceEnc->encMode == SACENC_212) { in mp4SpaceEnc_InitDelayCompensation()
1638 if (hMp4SpaceEnc->nBitstreamBufferWrite != in mp4SpaceEnc_InitDelayCompensation()
1639 hMp4SpaceEnc->nBitstreamBufferRead) { in mp4SpaceEnc_InitDelayCompensation()
1645 if (hMp4SpaceEnc->nOutputBufferDelay != 0) { in mp4SpaceEnc_InitDelayCompensation()
1654 hMp4SpaceEnc->nDiscardOutFrames = in mp4SpaceEnc_InitDelayCompensation()
1655 fdk_sacenc_delay_GetDiscardOutFrames(hMp4SpaceEnc->hDelay); in mp4SpaceEnc_InitDelayCompensation()
1656 hMp4SpaceEnc->nInputDelay = in mp4SpaceEnc_InitDelayCompensation()
1657 fdk_sacenc_delay_GetDmxAlignBufferDelay(hMp4SpaceEnc->hDelay); in mp4SpaceEnc_InitDelayCompensation()
1660 hMp4SpaceEnc->independencyCount = 0; in mp4SpaceEnc_InitDelayCompensation()
1661 hMp4SpaceEnc->independencyFlag = 1; in mp4SpaceEnc_InitDelayCompensation()
1666 for (i = 0; i < hMp4SpaceEnc->nBitstreamDelayBuffer - 1; i++) { in mp4SpaceEnc_InitDelayCompensation()
1670 hMp4SpaceEnc->hBitstreamFormatter, READ_SPATIALFRAME))) { in mp4SpaceEnc_InitDelayCompensation()
1680 hMp4SpaceEnc->ppBitstreamDelayBuffer[i], MAX_MPEGS_BYTES, in mp4SpaceEnc_InitDelayCompensation()
1681 &hMp4SpaceEnc->pnOutputBits[i], hMp4SpaceEnc->hBitstreamFormatter); in mp4SpaceEnc_InitDelayCompensation()
1684 if ((hMp4SpaceEnc->nInputDelay > MAX_DELAY_INPUT) || in mp4SpaceEnc_InitDelayCompensation()
1685 (hMp4SpaceEnc->nOutputBufferDelay > MAX_DELAY_OUTPUT) || in mp4SpaceEnc_InitDelayCompensation()
1686 (hMp4SpaceEnc->nSurroundAnalysisBufferDelay > in mp4SpaceEnc_InitDelayCompensation()
1688 (hMp4SpaceEnc->nBitstreamDelayBuffer > MAX_BITSTREAM_DELAY)) { in mp4SpaceEnc_InitDelayCompensation()
1828 FDK_SACENC_ERROR FDK_sacenc_getInfo(const HANDLE_MP4SPACE_ENCODER hMp4SpaceEnc, in FDK_sacenc_getInfo() argument
1832 if ((NULL == hMp4SpaceEnc) || (NULL == pInfo)) { in FDK_sacenc_getInfo()
1835 pInfo->nSampleRate = hMp4SpaceEnc->nSampleRate; in FDK_sacenc_getInfo()
1836 pInfo->nSamplesFrame = hMp4SpaceEnc->nFrameLength; in FDK_sacenc_getInfo()
1837 pInfo->nTotalInputChannels = hMp4SpaceEnc->nInputChannels; in FDK_sacenc_getInfo()
1838 pInfo->nDmxDelay = fdk_sacenc_delay_GetInfoDmxDelay(hMp4SpaceEnc->hDelay); in FDK_sacenc_getInfo()
1840 fdk_sacenc_delay_GetInfoCodecDelay(hMp4SpaceEnc->hDelay); in FDK_sacenc_getInfo()
1842 fdk_sacenc_delay_GetInfoDecoderDelay(hMp4SpaceEnc->hDelay); in FDK_sacenc_getInfo()
1844 fdk_sacenc_delay_GetBitstreamFrameBufferSize(hMp4SpaceEnc->hDelay) - 1; in FDK_sacenc_getInfo()
1845 pInfo->nDiscardOutFrames = hMp4SpaceEnc->nDiscardOutFrames; in FDK_sacenc_getInfo()
1847 pInfo->pSscBuf = &hMp4SpaceEnc->sscBuf; in FDK_sacenc_getInfo()
1852 FDK_SACENC_ERROR FDK_sacenc_setParam(HANDLE_MP4SPACE_ENCODER hMp4SpaceEnc, in FDK_sacenc_setParam() argument
1858 if (hMp4SpaceEnc == NULL) { in FDK_sacenc_setParam()
1870 hMp4SpaceEnc->user.bLdMode = value; in FDK_sacenc_setParam()
1876 hMp4SpaceEnc->user.encMode = (MP4SPACEENC_MODE)value; in FDK_sacenc_setParam()
1885 ((int)value > hMp4SpaceEnc->setup.maxSamplingrate)) { in FDK_sacenc_setParam()
1889 hMp4SpaceEnc->user.sampleRate = value; in FDK_sacenc_setParam()
1894 ((int)value > hMp4SpaceEnc->setup.maxFrameTimeSlots)) { in FDK_sacenc_setParam()
1898 hMp4SpaceEnc->user.frameTimeSlots = value; in FDK_sacenc_setParam()
1910 hMp4SpaceEnc->user.nParamBands = (MP4SPACEENC_BANDS_CONFIG)value; in FDK_sacenc_setParam()
1922 hMp4SpaceEnc->user.bTimeDomainDmx = value; in FDK_sacenc_setParam()
1931 error = fdk_sacenc_staticGain_SetDmxGain(hMp4SpaceEnc->hStaticGainConfig, in FDK_sacenc_setParam()
1940 hMp4SpaceEnc->user.bUseCoarseQuant = value; in FDK_sacenc_setParam()
1948 hMp4SpaceEnc->user.quantMode = (MP4SPACEENC_QUANTMODE)value; in FDK_sacenc_setParam()
1960 hMp4SpaceEnc->user.timeAlignment = value; in FDK_sacenc_setParam()
1964 hMp4SpaceEnc->independencyCount = value; in FDK_sacenc_setParam()
1968 hMp4SpaceEnc->user.independencyFactor = value; in FDK_sacenc_setParam()