MCPcopy Create free account
hub / github.com/cisco/openh264 / AdjustEnhanceLayer

Function AdjustEnhanceLayer

codec/encoder/core/src/slice_multi_threading.cpp:530–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528}
529
530int32_t AdjustEnhanceLayer (sWelsEncCtx* pCtx, int32_t iCurDid) {
531#ifdef MT_DEBUG
532 int64_t iT1 = WelsTime();
533#endif//MT_DEBUG
534 int32_t iNeedAdj = 1;
535 // uiSliceMode of referencing spatial should be SM_FIXEDSLCNUM_SLICE
536 // if using spatial base layer for complexity estimation
537
538 const bool kbModelingFromSpatial = (pCtx->pCurDqLayer->pRefLayer != NULL && iCurDid > 0)
539 && (pCtx->pSvcParam->sSpatialLayers[iCurDid - 1].sSliceArgument.uiSliceMode == SM_FIXEDSLCNUM_SLICE
540 && pCtx->pSvcParam->iMultipleThreadIdc >= pCtx->pSvcParam->sSpatialLayers[iCurDid -
541 1].sSliceArgument.uiSliceNum);
542
543 if (kbModelingFromSpatial) { // using spatial base layer for complexity estimation
544 // do not need adjust due to not different at both slices of consumed time
545 iNeedAdj = NeedDynamicAdjust (pCtx->ppDqLayerList[iCurDid - 1]->ppSliceInLayer,
546 pCtx->pCurDqLayer->sSliceEncCtx.iSliceNumInFrame);
547 if (iNeedAdj)
548 DynamicAdjustSlicing (pCtx,
549 pCtx->pCurDqLayer,
550 iCurDid
551 );
552 } else { // use temporal layer for complexity estimation
553 // do not need adjust due to not different at both slices of consumed time
554 iNeedAdj = NeedDynamicAdjust (pCtx->ppDqLayerList[iCurDid]->ppSliceInLayer,
555 pCtx->pCurDqLayer->sSliceEncCtx.iSliceNumInFrame);
556 if (iNeedAdj)
557 DynamicAdjustSlicing (pCtx,
558 pCtx->pCurDqLayer,
559 iCurDid
560 );
561 }
562
563#ifdef MT_DEBUG
564 iT1 = WelsTime() - iT1;
565 if (pCtx->pSliceThreading->pFSliceDiff) {
566 fprintf (pCtx->pSliceThreading->pFSliceDiff,
567 "%6" PRId64" us adjust time at spatial layer %d, iNeedAdj %d, DynamicAdjustSlicing()\n",
568 iT1, iCurDid, iNeedAdj);
569 }
570#endif//MT_DEBUG
571
572 return iNeedAdj;
573}
574
575
576

Callers 1

WelsEncoderEncodeExtFunction · 0.85

Calls 3

WelsTimeFunction · 0.85
NeedDynamicAdjustFunction · 0.85
DynamicAdjustSlicingFunction · 0.85

Tested by

no test coverage detected