History

Merge pull request #605 from volvet/clean_mt_macro

clean multi-threading macro

Licai Guo committed 12 years ago

Commit 9a812602 parents 535fd74 9f50e0c16 files · +12 −258Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 16 files). Show all

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+5−173
@@ -51,9 +51,7 @@ · 50 unmodified lines
5151 #include "ref_list_mgr_svc.h"
5252 #include "ls_defines.h"
5353 #include "crt_util_safe_x.h" // Safe CRT routines like utils for cross platforms
54−#if defined(MT_ENABLED)
5554 #include "slice_multi_threading.h"
56−#endif//MT_ENABLED
5755 #include "measure_time.h"
5856
5957 namespace WelsSVCEnc {
@@ -161,7 +159,6 @@ int32_t ParamValidationExt (sWelsEncCtx*pCtx,SWelsSvcCodingParam* pCodingParam) · 101 unmodified lines
161159 }
162160
163161
164−#ifdef MT_ENABLED
165162 //about iMultipleThreadIdc, bDeblockingParallelFlag, iLoopFilterDisableIdc, & uiSliceMode
166163 // (1) Single Thread
167164 // if (THREAD==1)//single thread
@@ -173,9 +170,6 @@ int32_t ParamValidationExt (sWelsEncCtx*pCtx,SWelsSvcCodingParam* pCodingParam) · 5 unmodified lines
173170 } else {
174171 pCodingParam->bDeblockingParallelFlag = true;
175172 }
176−#else
177− pCodingParam->bDeblockingParallelFlag = false;
178−#endif//MT_ENABLED
179173
180174 for (i = 0; i < pCodingParam->iSpatialLayerNum; ++ i) {
181175 SDLayerParam* fDlp = &pCodingParam->sDependencyLayers[i];
@@ -291,11 +285,9 @@ int32_t ParamValidationExt (sWelsEncCtx*pCtx,SWelsSvcCodingParam* pCodingParam) · 109 unmodified lines
291285 fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
292286 break;
293287 }
294−#ifdef MT_ENABLED
295288 if (pCodingParam->bEnableRc && fDlp->sSliceCfg.sSliceArgument.uiSliceNum > 1) {
296289 WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), WARNING: GOM based RC do not support SM_RASTER_SLICE!\n");
297290 }
298−#endif
299291 // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting
300292 if (iMbNumInFrame <= MIN_NUM_MB_PER_SLICE) {
301293 fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
@@ -501,19 +493,11 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 199 unmodified lines
501493 iCountNumLayers; // plus iCountNumLayers for reserved application
502494
503495 // to check number of layers / nals / slices dependencies, 12/8/2010
504−#if !defined(MT_ENABLED)
505496 if (iCountNumLayers > MAX_LAYER_NUM_OF_FRAME) {
506497 WelsLog (*ppCtx, WELS_LOG_ERROR, "AcquireLayersNals(), iCountNumLayers(%d) > MAX_LAYER_NUM_OF_FRAME(%d)!",
507498 iCountNumLayers, MAX_LAYER_NUM_OF_FRAME);
508499 return 1;
509500 }
510−#else//MT_ENABLED
511− if (iCountNumLayers > MAX_LAYER_NUM_OF_FRAME) {
512− WelsLog (*ppCtx, WELS_LOG_ERROR, "AcquireLayersNals(), iCountNumLayers(%d) > MAX_LAYER_NUM_OF_FRAME(%d)!",
513− iCountNumLayers, MAX_LAYER_NUM_OF_FRAME);
514− return 1;
515− }
516−#endif//!MT_ENABLED
517501
518502 if (NULL != pCountLayers)
519503 *pCountLayers = iCountNumLayers;
@@ -777,31 +761,6 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 257 unmodified lines
777761
778762 pDqLayer->iMbWidth = kiMbW;
779763 pDqLayer->iMbHeight = kiMbH;
780−#ifndef MT_ENABLED
781− if (SM_DYN_SLICE == pDlayer->sSliceCfg.uiSliceMode) { //wmalloc pSliceInLayer
782− SSlice* pSlice = NULL;
783− int32_t iSliceIdx = 0;
784− //wmalloc AVERSLICENUM_CONSTANT of pDqLayer->sLayerInfo.pSliceInLayer,
785− //wmalloc AVERSLICENUM_CONSTANT num of pSlice as initialization
786− //only set value for the first pSlice
787− pDqLayer->sLayerInfo.pSliceInLayer = (SSlice*)pMa->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "pSliceInLayer");
788−
789− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer->sLayerInfo.pSliceInLayer), FreeMemorySvc (ppCtx)) {
790− pSlice = &pDqLayer->sLayerInfo.pSliceInLayer[0];
791− pSlice->uiSliceIdx = 0;
792− pSlice->pSliceBsa = & (*ppCtx)->pOut->sBsWrite;
793− }
794−
795− while (iSliceIdx < iMaxSliceNum) {
796− pSlice = &pDqLayer->sLayerInfo.pSliceInLayer[iSliceIdx];
797− if (AllocMbCacheAligned (&pSlice->sMbCacheInfo, pMa)) {
798− FreeMemorySvc (ppCtx);
799− return 1;
800− }
801− ++ iSliceIdx;
802− }
803− } else
804−#endif//!MT_ENABLED
805764 {
806765 int32_t iSliceIdx = 0;
807766 pDqLayer->sLayerInfo.pSliceInLayer = (SSlice*)pMa->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "pSliceInLayer");
@@ -811,14 +770,10 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 3 unmodified lines
811770 while (iSliceIdx < iMaxSliceNum) {
812771 SSlice* pSlice = &pDqLayer->sLayerInfo.pSliceInLayer[iSliceIdx];
813772 pSlice->uiSliceIdx = iSliceIdx;
814−#ifdef MT_ENABLED
815773 if (pParam->iMultipleThreadIdc > 1)
816774 pSlice->pSliceBsa = & (*ppCtx)->pSliceBs[iSliceIdx].sBsWrite;
817775 else
818776 pSlice->pSliceBsa = & (*ppCtx)->pOut->sBsWrite;
819−#else
820− pSlice->pSliceBsa = & (*ppCtx)->pOut->sBsWrite;
821−#endif//MT_ENABLED
822777 if (AllocMbCacheAligned (&pSlice->sMbCacheInfo, pMa)) {
823778 FreeMemorySvc (ppCtx);
824779 return 1;
@@ -856,11 +811,9 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 31 unmodified lines
856811 pDqLayer->bDeblockingParallelFlag = false;
857812 } else {
858813 //multi-pSlice
859−#ifdef MT_ENABLED
860814 if (0 == pDqLayer->iLoopFilterDisableIdc) {
861815 pDqLayer->bDeblockingParallelFlag = false;
862816 }
863−#endif
864817 }
865818
866819 (*ppCtx)->ppDqLayerList[iDlayerIndex] = pDqLayer;
@@ -1227,9 +1180,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 360 unmodified lines
12271180 const uint32_t kuiMvdCacheAlignedSize = kuiMvdInterTableSize * sizeof (uint16_t);
12281181 int32_t iVclLayersBsSizeCount = 0;
12291182 int32_t iNonVclLayersBsSizeCount = 0;
1230−#if defined(MT_ENABLED)
12311183 int32_t iTargetSpatialBsSize = 0;
1232−#endif//MT_ENABLED
12331184
12341185 if (kiNumDependencyLayers < 1 || kiNumDependencyLayers > MAX_DEPENDENCY_LAYER) {
12351186 WelsLog (*ppCtx, WELS_LOG_WARNING, "RequestMemorySvc() failed due to invalid iNumDependencyLayers(%d)!\n",
@@ -1273,9 +1224,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 37 unmodified lines
12731224 iVclLayersBsSizeCount += iLayerBsSize;
12741225 ++ iIndex;
12751226 }
1276−#if defined(MT_ENABLED)
12771227 iTargetSpatialBsSize = iLayerBsSize;
1278−#endif//MT_ENABLED
12791228 iCountBsLen = iNonVclLayersBsSizeCount + iVclLayersBsSizeCount;
12801229
12811230 pParam->iNumRefFrame = WELS_CLIP3 (pParam->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM);
@@ -1291,14 +1240,12 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 9 unmodified lines
12911240 (*ppCtx)->pOut->iCountNals = iCountNals;
12921241 (*ppCtx)->pOut->iNalIndex = 0;
12931242
1294−#ifdef MT_ENABLED
12951243 if (pParam->iMultipleThreadIdc > 1) {
12961244 const int32_t iTotalLength = iCountBsLen + (iTargetSpatialBsSize * ((*ppCtx)->iMaxSliceCount - 1));
12971245 (*ppCtx)->pFrameBs = (uint8_t*)pMa->WelsMalloc (iTotalLength, "pFrameBs");
12981246 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pFrameBs), FreeMemorySvc (ppCtx))
12991247 (*ppCtx)->iFrameBsSize = iTotalLength;
13001248 } else
1301−#endif//MT_ENABLED
13021249 {
13031250 (*ppCtx)->pFrameBs = (uint8_t*)pMa->WelsMalloc (iCountBsLen, "pFrameBs");
13041251 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pFrameBs), FreeMemorySvc (ppCtx))
@@ -1306,14 +1253,12 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 1 unmodified line
13061253 }
13071254 (*ppCtx)->iPosBsBuffer = 0;
13081255
1309−#ifdef MT_ENABLED
13101256 // for pSlice bs buffers
13111257 if (pParam->iMultipleThreadIdc > 1 && RequestMtResource (ppCtx, pParam, iCountBsLen, iTargetSpatialBsSize)) {
13121258 WelsLog (*ppCtx, WELS_LOG_WARNING, "RequestMemorySvc(), RequestMtResource failed!");
13131259 FreeMemorySvc (ppCtx);
13141260 return 1;
13151261 }
1316−#endif
13171262
13181263 (*ppCtx)->pIntra4x4PredModeBlocks = static_cast<int8_t*>
13191264 (pMa->WelsMallocz (iCountMaxMbNum * INTRA_4x4_MODE_NUM, "pIntra4x4PredModeBlocks"));
@@ -1481,10 +1426,8 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 161 unmodified lines
14811426 pCtx->pOut = NULL;
14821427 }
14831428
1484−#ifdef MT_ENABLED
14851429 if (pParam != NULL && pParam->iMultipleThreadIdc > 1)
14861430 ReleaseMtResource (ppCtx);
1487−#endif//MT_ENABLED
14881431
14891432 // frame bitstream pBuffer
14901433 if (NULL != pCtx->pFrameBs) {
@@ -1722,9 +1665,7 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp · 231 unmodified lines
17221665 switch (pMso->uiSliceMode) {
17231666 case SM_DYN_SLICE:
17241667 iMaxSliceCount = AVERSLICENUM_CONSTRAINT;
1725−//#ifndef MT_ENABLED
1726− break; // go through for MT_ENABLED & SM_DYN_SLICE?
1727−//#endif//MT_ENABLED
1668+ break; // go through for SM_DYN_SLICE?
17281669 case SM_FIXEDSLCNUM_SLICE:
17291670 if (iSliceNum > iMaxSliceCount)
17301671 iMaxSliceCount = iSliceNum;
@@ -1788,13 +1729,8 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp · 57 unmodified lines
17881729 ++ iSpatialIdx;
17891730 } while (iSpatialIdx < iSpatialNum);
17901731
1791−#ifdef MT_ENABLED
17921732 pCodingParam->iCountThreadsNum = WELS_MIN (kiCpuCores, iMaxSliceCount);
17931733 pCodingParam->iMultipleThreadIdc = pCodingParam->iCountThreadsNum;
1794−#else
1795− pCodingParam->iMultipleThreadIdc = 1;
1796− pCodingParam->iCountThreadsNum = 1;
1797−#endif//MT_ENABLED
17981734
17991735 #ifndef WELS_TESTBED // for product release and non-SGE testing
18001736
@@ -1903,7 +1839,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 102 unmodified lines
19031839
19041840 #ifndef WELS_TESTBED
19051841
1906−#if defined(MT_ENABLED) && defined(DYNAMIC_DETECT_CPU_CORES)
1842+#if defined(DYNAMIC_DETECT_CPU_CORES)
19071843 if (pCodingParam->iMultipleThreadIdc > 0)
19081844 uiCpuCores = pCodingParam->iMultipleThreadIdc;
19091845 else {
@@ -1917,7 +1853,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 7 unmodified lines
19171853 else if (uiCpuCores < 1) // just for safe
19181854 uiCpuCores = 1;
19191855 }
1920−#endif//MT_ENABLED && DYNAMIC_DETECT_CPU_CORES
1856+#endif//DYNAMIC_DETECT_CPU_CORES
19211857
19221858 #else//WELS_TESTBED
19231859
@@ -1979,10 +1915,8 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 55 unmodified lines
19791915 return iRet;
19801916 }
19811917
1982−#ifdef MT_ENABLED
19831918 if (pCodingParam->iMultipleThreadIdc > 1)
19841919 iRet = CreateSliceThreads (pCtx);
1985−#endif
19861920
19871921 WelsRcInitModule (pCtx, pCtx->pSvcParam->bEnableRc ? WELS_RC_GOM : WELS_RC_DISABLE);
19881922
@@ -2108,7 +2042,6 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 119 unmodified lines
21082042 StatOverallEncodingExt (*ppCtx);
21092043 #endif
21102044
2111−#if defined(MT_ENABLED)
21122045 if ((*ppCtx)->pSvcParam->iMultipleThreadIdc > 1 && (*ppCtx)->pSliceThreading != NULL) {
21132046 const int32_t iThreadCount = (*ppCtx)->pSvcParam->iCountThreadsNum;
21142047 int32_t iThreadIdx = 0;
@@ -2128,7 +2061,6 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 13 unmodified lines
21282061 }
21292062 }
21302063 }
2131−#endif//MT_ENABLED
21322064
21332065 if ((*ppCtx)->pVpp) {
21342066 (*ppCtx)->pVpp->FreeSpatialPictures(*ppCtx);
@@ -2201,19 +2133,14 @@ void DynslcUpdateMbNeighbourInfoListForAllSlices (SSliceCtx* pSliceCtx, SMB* pMb · 66 unmodified lines
22012133 */
22022134 int32_t PicPartitionNumDecision (sWelsEncCtx* pCtx) {
22032135 int32_t iPartitionNum = 1;
2204−#ifdef MT_ENABLED
22052136 if (pCtx->pSvcParam->iMultipleThreadIdc > 1) {
22062137 iPartitionNum = pCtx->pSvcParam->iCountThreadsNum;
22072138 if (P_SLICE == pCtx->eSliceType)
22082139 iPartitionNum = 1;
22092140 }
22102141 return iPartitionNum;
2211−#else
2212− return iPartitionNum;
2213−#endif//MT_ENABLED
22142142 }
22152143
2216−#if defined(MT_ENABLED)
22172144 void WelsInitCurrentQBLayerMltslc (sWelsEncCtx* pCtx) {
22182145 //pData init
22192146 SDqLayer* pCurDq = pCtx->pCurDqLayer;
@@ -2304,83 +2231,6 @@ void WelsInitCurrentDlayerMltslc (sWelsEncCtx* pCtx, int32_t iPartitionNum) { · 84 unmodified lines
23042231
23052232 WelsInitCurrentQBLayerMltslc (pCtx);
23062233 }
2307−#else
2308−void WelsInitCurrentQBLayerMltslc (sWelsEncCtx* pCtx) {
2309− //pData init
2310− SDqLayer* pCurDq = pCtx->pCurDqLayer;
2311− SSliceCtx* pSliceCtx = (pCurDq->pSliceEncCtx);
2312− SSlice* pSlice = &pCurDq->sLayerInfo.pSliceInLayer[0];
2313− int32_t iTtlMbNumInFrame = pSliceCtx->iMbNumInFrame;
2314−
2315− //pSliceCtx
2316− memset (pSliceCtx->pOverallMbMap, 0, iTtlMbNumInFrame * sizeof (uint8_t));
2317− memset (pSliceCtx->pCountMbNumInSlice, 0, pSliceCtx->iSliceNumInFrame * sizeof (int32_t));
2318− memset (pSliceCtx->pFirstMbInSlice, 0, pSliceCtx->iSliceNumInFrame * sizeof (int16_t));
2319− pSliceCtx->iSliceNumInFrame = 1;//
2320− pSliceCtx->pCountMbNumInSlice[0] = iTtlMbNumInFrame;
2321−
2322− //mb_neighbor
2323− DynslcUpdateMbNeighbourInfoListForAllSlices (pSliceCtx, pCurDq->sMbDataP);
2324−
2325− //pSlice init
2326− pSlice->uiSliceIdx = 0;
2327− pSlice->pSliceBsa = &pCtx->pOut->sBsWrite;
2328− pSlice->bDynamicSlicingSliceSizeCtrlFlag = false;
2329− pSlice->uiAssumeLog2BytePerMb = (pCtx->eSliceType == P_SLICE) ? 0 : 1;
2330−}
2331−
2332−void WelsInitCurrentDlayerMltslc (sWelsEncCtx* pCtx, int32_t iPartitionNum) {
2333− SDqLayer* pCurDq = pCtx->pCurDqLayer;
2334− SSliceCtx* pSliceCtx = (pCurDq->pSliceEncCtx);
2335− int32_t iTtlMbNumInFrame = pCurDq->iMbHeight * pCurDq->iMbWidth;
2336−
2337− pSliceCtx->iMbNumInFrame
2338− = pSliceCtx->pCountMbNumInSlice[0] = iTtlMbNumInFrame;
2339−
2340− if (I_SLICE == pCtx->eSliceType) { //check if uiSliceSizeConstraint too small
2341−#define byte_complexIMBat26 (60)
2342− uint8_t iCurDid = pCtx->uiDependencyId;
2343− uint32_t uiFrmByte = 0;
2344−
2345− if (pCtx->pSvcParam->bEnableRc) {
2346− //RC case
2347− uiFrmByte = (
2348− ((uint32_t) (pCtx->pSvcParam->sDependencyLayers[iCurDid].iSpatialBitrate)
2349− / (uint32_t) (pCtx->pSvcParam->sDependencyLayers[iCurDid].fInputFrameRate)) >> 3);
2350− } else {
2351− //fixed QP case
2352− int32_t iQDeltaTo26 = (26 - pCtx->pSvcParam->sDependencyLayers[iCurDid].iDLayerQp);
2353−
2354− uiFrmByte = (iTtlMbNumInFrame * byte_complexIMBat26);
2355− if (iQDeltaTo26 > 0) {
2356− //smaller QP than 26
2357− uiFrmByte = (uint32_t) (uiFrmByte * ((float)iQDeltaTo26 / 4));
2358− } else if (iQDeltaTo26 < 0) {
2359− //larger QP than 26
2360− iQDeltaTo26 = ((-iQDeltaTo26) >> 2); //delta mod 4
2361− uiFrmByte = (uiFrmByte >> (iQDeltaTo26)); //if delta 4, byte /2
2362− }
2363− }
2364−
2365− //MINPACKETSIZE_CONSTRAINT
2366− if (pSliceCtx->uiSliceSizeConstraint
2367− <
2368− (uint32_t) (uiFrmByte//suppose 16 byte per mb at average
2369− / (pSliceCtx->iMaxSliceNumConstraint))
2370− ) {
2371−
2372− WelsLog (pCtx,
2373− WELS_LOG_WARNING,
2374− "Set-SliceConstraint(%d) too small for current resolution (MB# %d) under QP/BR!\n",
2375− pSliceCtx->uiSliceSizeConstraint,
2376− pSliceCtx->iMbNumInFrame
2377− );
2378− }
2379− }
2380−
2381− WelsInitCurrentQBLayerMltslc (pCtx);
2382−}
2383−#endif
23842234
23852235 /*!
23862236 * \brief initialize current layer
@@ -2880,9 +2730,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 493 unmodified lines
28802730 SPicture* fsnr = NULL;
28812731 #endif//ENABLE_FRAME_DUMP || ENABLE_PSNR_CALC
28822732 SPicture* pEncPic = NULL; // to be decided later
2883−#if defined(MT_ENABLED)
28842733 int32_t did_list[MAX_DEPENDENCY_LAYER] = {0};
2885−#endif//MT_ENABLED
28862734 int32_t iLayerNum = 0;
28872735 int32_t iLayerSize = 0;
28882736 int32_t iSpatialNum = 0; // available count number of spatial layers due to frame size changed in this given frame
@@ -2972,22 +2820,18 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 83 unmodified lines
29722820 iCurWidth = param_d->iFrameWidth;
29732821 iCurHeight = param_d->iFrameHeight;
29742822
2975−#if defined(MT_ENABLED)
29762823 did_list[iSpatialIdx] = iCurDid;
2977−#endif//MT_ENABLED
29782824
29792825 // Encoding this picture might mulitiple sQualityStat layers potentially be encoded as followed
29802826
29812827 switch (param_d->sSliceCfg.uiSliceMode) {
29822828 case SM_FIXEDSLCNUM_SLICE:
29832829 case SM_AUTO_SLICE:{
2984−#if defined(MT_ENABLED)
29852830 if ((iCurDid > 0) && (pSvcParam->iMultipleThreadIdc > 1) &&
29862831 (pSvcParam->sDependencyLayers[iCurDid].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE
29872832 && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[iCurDid].sSliceCfg.sSliceArgument.uiSliceNum)
29882833 )
29892834 AdjustEnhanceLayer (pCtx, iCurDid);
2990−#endif//MT_ENABLED
29912835 break;
29922836 }
29932837 case SM_DYN_SLICE: {
@@ -3100,18 +2944,13 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 106 unmodified lines
31002944 pLayerBsInfo->iNalCount = ++ iNalIdxInLayer;
31012945 }
31022946 // for dynamic slicing single threading..
3103−#ifndef MT_ENABLED
3104− else if (SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode)
3105−#else // MT_ENABLED
31062947 else if ((SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1))
3107−#endif//MT_ENABLED
31082948 {
31092949 const int32_t kiLastMbInFrame = pCtx->pCurDqLayer->pSliceEncCtx->iMbNumInFrame;
31102950 pCtx->iEncoderError = WelsCodeOnePicPartition (pCtx, pLayerBsInfo, &iNalIdxInLayer, &iLayerSize, 0, kiLastMbInFrame, 0);
31112951 WELS_VERIFY_RETURN_IFNEQ(pCtx->iEncoderError, ENC_RETURN_SUCCESS)
31122952 } else {
31132953 //other multi-slice uiSliceMode
3114−#if defined(MT_ENABLED)
31152954 int err = 0;
31162955 // THREAD_FULLY_FIRE_MODE/THREAD_PICK_UP_MODE for any mode of non-SM_DYN_SLICE
31172956 if ((SM_DYN_SLICE != param_d->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
@@ -3235,7 +3074,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 117 unmodified lines
32353074
32363075 iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, kiPartitionCnt);
32373076 } else // for non-dynamic-slicing mode single threading branch..
3238−#endif//MT_ENABLED
32393077 {
32403078 const bool bNeedPrefix = pCtx->bNeedPrefixNalFlag;
32413079 int32_t iSliceIdx = 0;
@@ -3290,9 +3128,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 48 unmodified lines
32903128
32913129 // deblocking filter
32923130 if (
3293−#if defined(MT_ENABLED)
32943131 (!pCtx->pCurDqLayer->bDeblockingParallelFlag) &&
3295−#endif//MT_ENABLED
32963132 #if !defined(ENABLE_FRAME_DUMP)
32973133 ((eNalRefIdc != NRI_PRI_LOWEST) && (param_d->iHighestTemporalId == 0 || iCurTid < param_d->iHighestTemporalId)) &&
32983134 #endif//!ENABLE_FRAME_DUMP
@@ -3432,7 +3268,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 133 unmodified lines
34323268 ++ iLayerNum;
34333269 }
34343270
3435−#if defined(MT_ENABLED)
34363271 if ((param_d->sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE||param_d->sSliceCfg.uiSliceMode == SM_AUTO_SLICE) && pSvcParam->iMultipleThreadIdc > 1 &&
34373272 pSvcParam->iMultipleThreadIdc >= param_d->sSliceCfg.sSliceArgument.uiSliceNum) {
34383273 CalcSliceComplexRatio (pCtx->pSliceThreading->pSliceComplexRatio[iCurDid], pCtx->pCurDqLayer->pSliceEncCtx,
@@ -3441,7 +3276,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 2 unmodified lines
34413276 TrackSliceComplexities (pCtx, iCurDid);
34423277 #endif//#if defined(MT_DEBUG)
34433278 }
3444−#endif//MT_ENABLED
34453279
34463280 ++ iSpatialIdx;
34473281
@@ -3468,11 +3302,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 20 unmodified lines
34683302 }
34693303 }
34703304
3471−#if defined(MT_ENABLED) && defined(MT_DEBUG)
3305+#if defined(MT_DEBUG)
34723306 TrackSliceConsumeTime (pCtx, did_list, iSpatialNum);
3473−#endif//MT_ENABLED && MT_DEBUG
3307+#endif//MT_DEBUG
34743308
3475−#if defined(MT_ENABLED)
34763309 if (pSvcParam->iMultipleThreadIdc > 1 && did_list[0] == BASE_DEPENDENCY_ID
34773310 && ((pSvcParam->sDependencyLayers[0].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE)||(pSvcParam->sDependencyLayers[0].sSliceCfg.uiSliceMode == SM_AUTO_SLICE))
34783311 && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[0].sSliceCfg.sSliceArgument.uiSliceNum
@@ -3481,7 +3314,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 2 unmodified lines
34813314 1]].sSliceCfg.sSliceArgument.uiSliceNum) {
34823315 AdjustBaseLayer (pCtx);
34833316 }
3484−#endif
34853317
34863318 #ifdef ENABLE_FRAME_DUMP
34873319 DumpRecFrame (fsnr, &pSvcParam->sDependencyLayers[pSvcParam->iSpatialLayerNum -

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t