• Home
  • Raw
  • Download

Lines Matching refs:hTp

217 TRANSPORTDEC_ERROR transportDec_OutOfBandConfig(HANDLE_TRANSPORTDEC hTp, UCHAR *conf, const UINT le…  in transportDec_OutOfBandConfig()  argument
229 switch (hTp->transportFmt) { in transportDec_OutOfBandConfig()
237 CLatmDemux *pLatmDemux = &hTp->parser.latm; in transportDec_OutOfBandConfig()
238 … err = CLatmDemux_ReadStreamMuxConfig(hBs, pLatmDemux, &hTp->callbacks, hTp->asc, &fConfigFound); in transportDec_OutOfBandConfig()
246 err = AudioSpecificConfig_Parse(&hTp->asc[layer], hBs, 1, &hTp->callbacks); in transportDec_OutOfBandConfig()
250 errC = hTp->callbacks.cbUpdateConfig(hTp->callbacks.cbUpdateConfigData, &hTp->asc[layer]); in transportDec_OutOfBandConfig()
259 hTp->flags |= TPDEC_CONFIG_FOUND; in transportDec_OutOfBandConfig()
296 const HANDLE_TRANSPORTDEC hTp, in transportDec_FillData() argument
304 if ( (hTp == NULL) in transportDec_FillData()
315 hBs = &hTp->bitStream[layer]; in transportDec_FillData()
317 if ( TT_IS_PACKET(hTp->transportFmt) ) { in transportDec_FillData()
318 if (hTp->numberOfRawDataBlocks == 0) { in transportDec_FillData()
328 if (hTp->numberOfRawDataBlocks <= 0) { in transportDec_FillData()
336 HANDLE_FDK_BITSTREAM transportDec_GetBitstream( const HANDLE_TRANSPORTDEC hTp, const UINT layer ) in transportDec_GetBitstream() argument
338 return &hTp->bitStream[layer]; in transportDec_GetBitstream()
341 TRANSPORT_TYPE transportDec_GetFormat( const HANDLE_TRANSPORTDEC hTp ) in transportDec_GetFormat() argument
343 return hTp->transportFmt; in transportDec_GetFormat()
346 INT transportDec_GetBufferFullness( const HANDLE_TRANSPORTDEC hTp ) in transportDec_GetBufferFullness() argument
350 switch (hTp->transportFmt) { in transportDec_GetBufferFullness()
352 if (hTp->parser.adts.bs.adts_fullness != 0x7ff) { in transportDec_GetBufferFullness()
353 …bufferFullness = hTp->parser.adts.bs.frame_length*8 + hTp->parser.adts.bs.adts_fullness * 32 * get… in transportDec_GetBufferFullness()
359 if (hTp->parser.latm.m_linfo[0][0].m_bufferFullness != 0xff) { in transportDec_GetBufferFullness()
360 bufferFullness = hTp->parser.latm.m_linfo[0][0].m_bufferFullness; in transportDec_GetBufferFullness()
376 TRANSPORTDEC_ERROR transportDec_AdjustEndOfAccessUnit(HANDLE_TRANSPORTDEC hTp) in transportDec_AdjustEndOfAccessUnit() argument
378 HANDLE_FDK_BITSTREAM hBs = &hTp->bitStream[0]; in transportDec_AdjustEndOfAccessUnit()
381 switch (hTp->transportFmt) { in transportDec_AdjustEndOfAccessUnit()
385 if ( hTp->numberOfRawDataBlocks == 0 ) in transportDec_AdjustEndOfAccessUnit()
388 FDKbyteAlign(hBs, hTp->globalFramePos); in transportDec_AdjustEndOfAccessUnit()
391 if (hTp->transportFmt == TT_MP4_LOAS && hTp->parser.latm.m_audioMuxLengthBytes > 0) in transportDec_AdjustEndOfAccessUnit()
395 …loasOffset = (hTp->parser.latm.m_audioMuxLengthBytes*8 + FDKgetValidBits(hBs)) - hTp->globalFrameP… in transportDec_AdjustEndOfAccessUnit()
409 if (hTp->parser.adts.bs.protection_absent == 0) in transportDec_AdjustEndOfAccessUnit()
414 …offset = hTp->parser.adts.rawDataBlockDist[hTp->parser.adts.bs.num_raw_blocks-hTp->numberOfRawDat… in transportDec_AdjustEndOfAccessUnit()
416 … offset -= hTp->accessUnitAnchor[0] - FDKgetValidBits(hBs) + 16 + hTp->parser.adts.bs.num_pce_bits; in transportDec_AdjustEndOfAccessUnit()
419 if (hTp->parser.adts.bs.num_raw_blocks > 0 && hTp->parser.adts.bs.protection_absent == 0) { in transportDec_AdjustEndOfAccessUnit()
421 hTp->parser.adts.crcReadValue = FDKreadBits(hBs, 16); in transportDec_AdjustEndOfAccessUnit()
423 if ( hTp->numberOfRawDataBlocks == 0 ) in transportDec_AdjustEndOfAccessUnit()
426 if (hTp->parser.adts.bs.protection_absent == 0) in transportDec_AdjustEndOfAccessUnit()
430 …offset = (hTp->parser.adts.bs.frame_length*8 - ADTS_SYNCLENGTH + FDKgetValidBits(hBs)) - hTp->glob… in transportDec_AdjustEndOfAccessUnit()
456 HANDLE_TRANSPORTDEC hTp, in additionalHoldOffNeeded() argument
463 INT samplesPerFrame = hTp->asc->m_samplesPerFrame; in additionalHoldOffNeeded()
464 INT samplingFrequency = (INT)hTp->asc->m_samplingFrequency; in additionalHoldOffNeeded()
466 if ( (hTp->avgBitRate == 0) || (hTp->burstPeriod == 0) ) { in additionalHoldOffNeeded()
474 maxAU = hTp->burstPeriod * samplingFrequency + (samplesPerFrame*1000 - 1); in additionalHoldOffNeeded()
477 maxAU -= hTp->holdOffFrames; in additionalHoldOffNeeded()
479 avgBitsPerFrame = hTp->avgBitRate * samplesPerFrame + (samplingFrequency-1); in additionalHoldOffNeeded()
483 switch (hTp->transportFmt) { in additionalHoldOffNeeded()
511 HANDLE_TRANSPORTDEC hTp, in transportDec_readHeader() argument
531 switch (hTp->transportFmt) { in transportDec_readHeader()
533 if (hTp->numberOfRawDataBlocks <= 0) in transportDec_readHeader()
537 hTp->globalFramePos = FDKgetValidBits(hBs); in transportDec_readHeader()
540 err = adtsRead_DecodeHeader( &hTp->parser.adts, &hTp->asc[0], hBs, ignoreBufferFullness ); in transportDec_readHeader()
546 errC = hTp->callbacks.cbUpdateConfig(hTp->callbacks.cbUpdateConfigData, &hTp->asc[0]); in transportDec_readHeader()
556 hTp->numberOfRawDataBlocks = hTp->parser.adts.bs.num_raw_blocks+1; in transportDec_readHeader()
562 FDKcrcReset(&hTp->parser.adts.crcInfo); in transportDec_readHeader()
563 hTp->parser.adts.bs.num_pce_bits = 0; in transportDec_readHeader()
566 hTp->numberOfRawDataBlocks--; in transportDec_readHeader()
567 …taBlockLength = adtsRead_GetRawDataBlockLength(&hTp->parser.adts, (hTp->parser.adts.bs.num_raw_blo… in transportDec_readHeader()
572 …syncLayerFrameBits = (hTp->parser.adts.bs.frame_length<<3) - (startPos - FDKgetValidBits(hBs)) - s… in transportDec_readHeader()
577 hTp->numberOfRawDataBlocks = 0; in transportDec_readHeader()
581 if (hTp->numberOfRawDataBlocks <= 0) in transportDec_readHeader()
584 hTp->parser.latm.m_audioMuxLengthBytes = syncLayerFrameBits; in transportDec_readHeader()
589 if (hTp->numberOfRawDataBlocks <= 0) in transportDec_readHeader()
591 hTp->globalFramePos = FDKgetValidBits(hBs); in transportDec_readHeader()
595 &hTp->parser.latm, in transportDec_readHeader()
596 hTp->transportFmt, in transportDec_readHeader()
597 &hTp->callbacks, in transportDec_readHeader()
598 hTp->asc, in transportDec_readHeader()
607 hTp->numberOfRawDataBlocks = CLatmDemux_GetNrOfSubFrames(&hTp->parser.latm); in transportDec_readHeader()
608 if (hTp->transportFmt == TT_MP4_LOAS) { in transportDec_readHeader()
613 err = CLatmDemux_ReadPayloadLengthInfo(hBs, &hTp->parser.latm); in transportDec_readHeader()
619 rawDataBlockLength = CLatmDemux_GetFrameLengthInBits(&hTp->parser.latm); in transportDec_readHeader()
620 hTp->numberOfRawDataBlocks--; in transportDec_readHeader()
622 hTp->numberOfRawDataBlocks = 0; in transportDec_readHeader()
661 HANDLE_TRANSPORTDEC hTp, in synchronization() argument
666 HANDLE_FDK_BITSTREAM hBs = &hTp->bitStream[0]; in synchronization()
672 …INT numFramesTraversed = 0, fTraverseMoreFrames, fConfigFound = (hTp->flags & TPDEC_CONFIG_FOUND),… in synchronization()
674 …INT ignoreBufferFullness = hTp->flags & (TPDEC_LOST_FRAMES_PENDING|TPDEC_IGNORE_BUFFERFULLNESS|TPD… in synchronization()
689 …fTraverseMoreFrames = (hTp->flags & (TPDEC_MINIMIZE_DELAY|TPDEC_EARLY_CONFIG)) && ! (hTp->flags & … in synchronization()
692 switch (hTp->transportFmt) { in synchronization()
718 if (hTp->numberOfRawDataBlocks == 0) { in synchronization()
730 if ( !(hTp->flags & TPDEC_SYNCOK) ) { in synchronization()
752 numRawDataBlocksPrevious = hTp->numberOfRawDataBlocks; in synchronization()
759 hTp, in synchronization()
798 hTp->numberOfRawDataBlocks = 0; in synchronization()
812 if ( (hTp->flags & TPDEC_EARLY_CONFIG) && !(hTp->flags & TPDEC_MINIMIZE_DELAY)) in synchronization()
820 numRawDataBlocksFirstFrame = hTp->numberOfRawDataBlocks; in synchronization()
821 globalFramePosFirstFrame = hTp->globalFramePos; in synchronization()
825 FDKmemcpy(contextFirstFrame, &hTp->parser, sizeof(transportdec_parser_t)); in synchronization()
847 transportDec_AdjustEndOfAccessUnit(hTp); in synchronization()
850 …} while ( fTraverseMoreFrames || (err == TRANSPORTDEC_SYNC_ERROR && !(hTp->flags & TPDEC_SYNCOK))); in synchronization()
855 FDKmemcpy(&hTp->parser, contextFirstFrame, sizeof(transportdec_parser_t)); in synchronization()
856 hTp->numberOfRawDataBlocks = numRawDataBlocksFirstFrame; in synchronization()
857 hTp->globalFramePos = globalFramePosFirstFrame; in synchronization()
865 …if ( !(hTp->flags & (TPDEC_LOST_FRAMES_PENDING|TPDEC_IGNORE_BUFFERFULLNESS|TPDEC_SYNCOK)) && err =… in synchronization()
866 …err = additionalHoldOffNeeded(hTp, transportDec_GetBufferFullness(hTp), FDKgetValidBits(hBs) - syn… in synchronization()
868 hTp->holdOffFrames++; in synchronization()
879 hTp->holdOffFrames = 0; in synchronization()
886 hTp->numberOfRawDataBlocks = numRawDataBlocksPrevious; in synchronization()
893 hTp->auLength[0] = rawDataBlockLength; in synchronization()
897 … err) && (FDKgetValidBits(hBs) >= ((TRANSPORTDEC_INBUF_SIZE*8 - ((hTp->avgBitRate*hTp->burstPerio… in synchronization()
904 hTp->flags |= TPDEC_SYNCOK; in synchronization()
908 hTp->flags |= TPDEC_CONFIG_FOUND; in synchronization()
916 hTp->flags &= ~TPDEC_SYNCOK; in synchronization()
929 TRANSPORTDEC_ERROR transportDec_readStream ( HANDLE_TRANSPORTDEC hTp, const UINT layer ) in transportDec_readStream() argument
933 HANDLE_FDK_BITSTREAM hBs = &hTp->bitStream[layer]; in transportDec_readStream()
940 error = synchronization(hTp, &headerBits); in transportDec_readStream()
946 if (error == TRANSPORTDEC_SYNC_ERROR || (hTp->flags & TPDEC_LOST_FRAMES_PENDING)) in transportDec_readStream()
949 …if (hTp->avgBitRate > 0 && hTp->asc[0].m_samplesPerFrame > 0 && hTp->asc[0].m_samplingFrequency > … in transportDec_readStream()
955 aj = transportDec_GetBufferFullness(hTp); in transportDec_readStream()
962 hTp->flags &= ~TPDEC_LOST_FRAMES_PENDING; in transportDec_readStream()
967 bitDistance += hTp->auLength[0]; in transportDec_readStream()
969 if ( !(hTp->flags & TPDEC_LOST_FRAMES_PENDING) ) { in transportDec_readStream()
971 hTp->flags |= TPDEC_LOST_FRAMES_PENDING; in transportDec_readStream()
972 bfDelta = - (INT)hTp->lastValidBufferFullness; in transportDec_readStream()
982 num = hTp->asc[0].m_samplingFrequency * (bfDelta + bitDistance) + hTp->remainder; in transportDec_readStream()
983 denom = hTp->avgBitRate * hTp->asc[0].m_samplesPerFrame; in transportDec_readStream()
986 hTp->remainder = num % denom; in transportDec_readStream()
988 hTp->remainder = num; in transportDec_readStream()
996 if ( (denom - hTp->remainder) >= hTp->remainder ) { in transportDec_readStream()
1002 transportDec_EndAccessUnit(hTp); in transportDec_readStream()
1003 error = synchronization(hTp, &headerBits); in transportDec_readStream()
1006 … FDKprintf("ERROR: Bufferfullness accounting failed. remainder=%d, nAU=%d\n", hTp->remainder, nAU); in transportDec_readStream()
1009 hTp->remainder = 0; in transportDec_readStream()
1026 hTp->missingAccessUnits = nAU; in transportDec_readStream()
1032 TRANSPORTDEC_ERROR transportDec_ReadAccessUnit( const HANDLE_TRANSPORTDEC hTp, const UINT layer ) in transportDec_ReadAccessUnit() argument
1037 if (!hTp) { in transportDec_ReadAccessUnit()
1041 hBs = &hTp->bitStream[layer]; in transportDec_ReadAccessUnit()
1047 switch (hTp->transportFmt) { in transportDec_ReadAccessUnit()
1051 if (!(hTp->flags & TPDEC_CONFIG_FOUND)) in transportDec_ReadAccessUnit()
1055 AudioSpecificConfig_Init(&hTp->asc[0]); in transportDec_ReadAccessUnit()
1056 pce = &hTp->asc[0].m_progrConfigElement; in transportDec_ReadAccessUnit()
1057 err = adifRead_DecodeHeader(&hTp->parser.adif, pce, hBs); in transportDec_ReadAccessUnit()
1062 hTp->asc[0].m_aot = (AUDIO_OBJECT_TYPE)(pce->Profile + 1); in transportDec_ReadAccessUnit()
1063 hTp->asc[0].m_samplingFrequencyIndex = pce->SamplingFrequencyIndex; in transportDec_ReadAccessUnit()
1064 hTp->asc[0].m_samplingFrequency = SamplingRateTable[pce->SamplingFrequencyIndex]; in transportDec_ReadAccessUnit()
1065 hTp->asc[0].m_channelConfiguration = 0; in transportDec_ReadAccessUnit()
1066 hTp->asc[0].m_samplesPerFrame = 1024; in transportDec_ReadAccessUnit()
1067 hTp->avgBitRate = hTp->parser.adif.BitRate; in transportDec_ReadAccessUnit()
1073 errC = hTp->callbacks.cbUpdateConfig(hTp->callbacks.cbUpdateConfigData, &hTp->asc[0]); in transportDec_ReadAccessUnit()
1075 hTp->flags |= TPDEC_CONFIG_FOUND; in transportDec_ReadAccessUnit()
1082 hTp->auLength[layer] = -1; /* Access Unit data length is unknown. */ in transportDec_ReadAccessUnit()
1088 hTp->auLength[layer] = FDKgetValidBits(hBs); in transportDec_ReadAccessUnit()
1089 hTp->flags |= TPDEC_SYNCOK; in transportDec_ReadAccessUnit()
1095 int fConfigFound = hTp->flags & TPDEC_CONFIG_FOUND; in transportDec_ReadAccessUnit()
1096 …err = transportDec_readHeader(hTp, hBs, 0, 1, &hTp->auLength[layer], NULL, NULL, &fConfigFound, NU… in transportDec_ReadAccessUnit()
1098 hTp->flags |= TPDEC_CONFIG_FOUND; in transportDec_ReadAccessUnit()
1106 err = transportDec_readStream(hTp, layer); in transportDec_ReadAccessUnit()
1115 hTp->accessUnitAnchor[layer] = FDKgetValidBits(hBs); in transportDec_ReadAccessUnit()
1117 hTp->accessUnitAnchor[layer] = 0; in transportDec_ReadAccessUnit()
1124 INT transportDec_GetAuBitsRemaining( const HANDLE_TRANSPORTDEC hTp, const UINT layer ) in transportDec_GetAuBitsRemaining() argument
1128 if (hTp->accessUnitAnchor[layer] > 0 && hTp->auLength[layer] > 0) { in transportDec_GetAuBitsRemaining()
1129 …bits = hTp->auLength[layer] - (hTp->accessUnitAnchor[layer] - FDKgetValidBits(&hTp->bitStream[laye… in transportDec_GetAuBitsRemaining()
1131 bits = FDKgetValidBits(&hTp->bitStream[layer]); in transportDec_GetAuBitsRemaining()
1137 INT transportDec_GetAuBitsTotal( const HANDLE_TRANSPORTDEC hTp, const UINT layer ) in transportDec_GetAuBitsTotal() argument
1139 return hTp->auLength[layer]; in transportDec_GetAuBitsTotal()
1142 …ORTDEC_ERROR transportDec_GetMissingAccessUnitCount ( INT *pNAccessUnits, HANDLE_TRANSPORTDEC hTp ) in transportDec_GetMissingAccessUnitCount() argument
1144 *pNAccessUnits = hTp->missingAccessUnits; in transportDec_GetMissingAccessUnitCount()
1150 TRANSPORTDEC_ERROR transportDec_EndAccessUnit(HANDLE_TRANSPORTDEC hTp) in transportDec_EndAccessUnit() argument
1155 err = transportDec_AdjustEndOfAccessUnit(hTp); in transportDec_EndAccessUnit()
1157 switch (hTp->transportFmt) { in transportDec_EndAccessUnit()
1165 TRANSPORTDEC_ERROR transportDec_SetParam ( const HANDLE_TRANSPORTDEC hTp, in transportDec_SetParam() argument
1174 hTp->flags |= TPDEC_MINIMIZE_DELAY; in transportDec_SetParam()
1176 hTp->flags &= ~TPDEC_MINIMIZE_DELAY; in transportDec_SetParam()
1181 hTp->flags |= TPDEC_EARLY_CONFIG; in transportDec_SetParam()
1183 hTp->flags &= ~TPDEC_EARLY_CONFIG; in transportDec_SetParam()
1188 hTp->flags |= TPDEC_IGNORE_BUFFERFULLNESS; in transportDec_SetParam()
1190 hTp->flags &= ~TPDEC_IGNORE_BUFFERFULLNESS; in transportDec_SetParam()
1194 hTp->avgBitRate = value; in transportDec_SetParam()
1197 hTp->burstPeriod = value; in transportDec_SetParam()
1204 FDKresetBitbuffer(&hTp->bitStream[i]); in transportDec_SetParam()
1205 hTp->auLength[i] = 0; in transportDec_SetParam()
1206 hTp->accessUnitAnchor[i] = 0; in transportDec_SetParam()
1208 hTp->flags &= ~(TPDEC_SYNCOK|TPDEC_LOST_FRAMES_PENDING); in transportDec_SetParam()
1209 if (hTp->transportFmt != TT_MP4_ADIF) { in transportDec_SetParam()
1210 hTp->flags &= ~TPDEC_CONFIG_FOUND; in transportDec_SetParam()
1212 hTp->remainder = 0; in transportDec_SetParam()
1213 hTp->avgBitRate = 0; in transportDec_SetParam()
1214 hTp->missingAccessUnits = 0; in transportDec_SetParam()
1215 hTp->numberOfRawDataBlocks = 0; in transportDec_SetParam()
1216 hTp->globalFramePos = 0; in transportDec_SetParam()
1217 hTp->holdOffFrames = 0; in transportDec_SetParam()
1225 UINT transportDec_GetNrOfSubFrames(HANDLE_TRANSPORTDEC hTp) in transportDec_GetNrOfSubFrames() argument
1229 if (hTp == NULL) in transportDec_GetNrOfSubFrames()
1232 …if (hTp->transportFmt==TT_MP4_LATM_MCP1 || hTp->transportFmt==TT_MP4_LATM_MCP0 || hTp->transportFm… in transportDec_GetNrOfSubFrames()
1233 nSubFrames = CLatmDemux_GetNrOfSubFrames(&hTp->parser.latm); in transportDec_GetNrOfSubFrames()
1234 else if (hTp->transportFmt==TT_MP4_ADTS) in transportDec_GetNrOfSubFrames()
1235 nSubFrames = hTp->parser.adts.bs.num_raw_blocks; in transportDec_GetNrOfSubFrames()