Lines Matching refs:hTp
348 HANDLE_FDK_BITSTREAM transportEnc_GetBitstream(HANDLE_TRANSPORTENC hTp) { in transportEnc_GetBitstream() argument
349 return &hTp->bitStream; in transportEnc_GetBitstream()
381 TRANSPORTENC_ERROR transportEnc_WriteAccessUnit(HANDLE_TRANSPORTENC hTp, in transportEnc_WriteAccessUnit() argument
386 if (!hTp) { in transportEnc_WriteAccessUnit()
389 HANDLE_FDK_BITSTREAM hBs = &hTp->bitStream; in transportEnc_WriteAccessUnit()
392 if (hTp->pceFrameCounter >= hTp->config.headerPeriod) { in transportEnc_WriteAccessUnit()
394 hTp->config.channelMode, hTp->config.matrixMixdownA, in transportEnc_WriteAccessUnit()
398 switch (hTp->transportFmt) { in transportEnc_WriteAccessUnit()
400 FDKinitBitStream(&hTp->bitStream, hTp->bsBuffer, hTp->bsBufferSize, 0, in transportEnc_WriteAccessUnit()
402 if (0 != adifWrite_EncodeHeader(&hTp->writer.adif, hBs, bufferFullness)) { in transportEnc_WriteAccessUnit()
410 adtsWrite_EncodeHeader(&hTp->writer.adts, &hTp->bitStream, bufferFullness, in transportEnc_WriteAccessUnit()
419 transportEnc_LatmWrite(&hTp->writer.latm, hBs, frameUsedBits, in transportEnc_WriteAccessUnit()
420 bufferFullness, &hTp->callbacks); in transportEnc_WriteAccessUnit()
423 if (hTp->writer.raw.curSubFrame >= hTp->writer.raw.nSubFrames) { in transportEnc_WriteAccessUnit()
424 hTp->writer.raw.curSubFrame = 0; in transportEnc_WriteAccessUnit()
425 FDKinitBitStream(&hTp->bitStream, hTp->bsBuffer, hTp->bsBufferSize, 0, in transportEnc_WriteAccessUnit()
428 hTp->writer.raw.prevBits = FDKgetValidBits(hBs); in transportEnc_WriteAccessUnit()
436 if (hTp->pceFrameCounter >= hTp->config.headerPeriod) { in transportEnc_WriteAccessUnit()
439 UINT alignAnchor = FDKgetValidBits(&hTp->bitStream); in transportEnc_WriteAccessUnit()
442 FDKwriteBits(&hTp->bitStream, ID_PCE, 3); in transportEnc_WriteAccessUnit()
444 if ((hTp->transportFmt == TT_MP4_ADTS) && in transportEnc_WriteAccessUnit()
445 !hTp->writer.adts.protection_absent) { in transportEnc_WriteAccessUnit()
446 crcIndex = adtsWrite_CrcStartReg(&hTp->writer.adts, &hTp->bitStream, 0); in transportEnc_WriteAccessUnit()
451 &hTp->bitStream, hTp->config.channelMode, hTp->config.samplingRate, 0, in transportEnc_WriteAccessUnit()
452 1, hTp->config.matrixMixdownA, in transportEnc_WriteAccessUnit()
453 (hTp->config.flags & CC_PSEUDO_SURROUND) ? 1 : 0, alignAnchor); in transportEnc_WriteAccessUnit()
455 if ((hTp->transportFmt == TT_MP4_ADTS) && in transportEnc_WriteAccessUnit()
456 !hTp->writer.adts.protection_absent) { in transportEnc_WriteAccessUnit()
457 adtsWrite_CrcEndReg(&hTp->writer.adts, &hTp->bitStream, crcIndex); in transportEnc_WriteAccessUnit()
459 hTp->pceFrameCounter = 0; /* reset pce frame counter */ in transportEnc_WriteAccessUnit()
462 if (hTp->pceFrameCounter != -1) { in transportEnc_WriteAccessUnit()
463 hTp->pceFrameCounter++; /* Update pceFrameCounter only if PCE writing is in transportEnc_WriteAccessUnit()
470 TRANSPORTENC_ERROR transportEnc_EndAccessUnit(HANDLE_TRANSPORTENC hTp, in transportEnc_EndAccessUnit() argument
472 switch (hTp->transportFmt) { in transportEnc_EndAccessUnit()
476 transportEnc_LatmAdjustSubframeBits(&hTp->writer.latm, bits); in transportEnc_EndAccessUnit()
479 adtsWrite_EndRawDataBlock(&hTp->writer.adts, &hTp->bitStream, bits); in transportEnc_EndAccessUnit()
483 *bits -= adifWrite_GetHeaderBits(&hTp->writer.adif); in transportEnc_EndAccessUnit()
484 hTp->writer.adif.headerWritten = 1; in transportEnc_EndAccessUnit()
487 *bits -= hTp->writer.raw.prevBits; in transportEnc_EndAccessUnit()
533 INT transportEnc_GetStaticBits(HANDLE_TRANSPORTENC hTp, int auBits) { in transportEnc_GetStaticBits() argument
537 if (hTp->pceFrameCounter >= hTp->config.headerPeriod) { in transportEnc_GetStaticBits()
539 hTp->config.channelMode, hTp->config.matrixMixdownA, in transportEnc_GetStaticBits()
546 switch (hTp->transportFmt) { in transportEnc_GetStaticBits()
552 nbits = adtsWrite_GetHeaderBits(&hTp->writer.adts); in transportEnc_GetStaticBits()
558 transportEnc_LatmCountTotalBitDemandHeader(&hTp->writer.latm, auBits); in transportEnc_GetStaticBits()