History

clean multi-threading macro

volvet committed 12 years ago

Commit 9f50e0c1 parent cad753d16 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 {
@@ -165,7 +163,6 @@ int32_t ParamValidationExt (sWelsEncCtx*pCtx,SWelsSvcCodingParam* pCodingParam) · 105 unmodified lines
165163 }
166164
167165
168−#ifdef MT_ENABLED
169166 //about iMultipleThreadIdc, bDeblockingParallelFlag, iLoopFilterDisableIdc, & uiSliceMode
170167 // (1) Single Thread
171168 // if (THREAD==1)//single thread
@@ -177,9 +174,6 @@ int32_t ParamValidationExt (sWelsEncCtx*pCtx,SWelsSvcCodingParam* pCodingParam) · 5 unmodified lines
177174 } else {
178175 pCodingParam->bDeblockingParallelFlag = true;
179176 }
180−#else
181− pCodingParam->bDeblockingParallelFlag = false;
182−#endif//MT_ENABLED
183177
184178 for (i = 0; i < pCodingParam->iSpatialLayerNum; ++ i) {
185179 SDLayerParam* fDlp = &pCodingParam->sDependencyLayers[i];
@@ -295,11 +289,9 @@ int32_t ParamValidationExt (sWelsEncCtx*pCtx,SWelsSvcCodingParam* pCodingParam) · 109 unmodified lines
295289 fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
296290 break;
297291 }
298−#ifdef MT_ENABLED
299292 if (pCodingParam->bEnableRc && fDlp->sSliceCfg.sSliceArgument.uiSliceNum > 1) {
300293 WelsLog (pCtx, WELS_LOG_ERROR, "ParamValidationExt(), WARNING: GOM based RC do not support SM_RASTER_SLICE!\n");
301294 }
302−#endif
303295 // considering the coding efficient and performance, iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting
304296 if (iMbNumInFrame <= MIN_NUM_MB_PER_SLICE) {
305297 fDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
@@ -505,19 +497,11 @@ static inline int32_t AcquireLayersNals (sWelsEncCtx** ppCtx, SWelsSvcCodingPara · 199 unmodified lines
505497 iCountNumLayers; // plus iCountNumLayers for reserved application
506498
507499 // to check number of layers / nals / slices dependencies, 12/8/2010
508−#if !defined(MT_ENABLED)
509500 if (iCountNumLayers > MAX_LAYER_NUM_OF_FRAME) {
510501 WelsLog (*ppCtx, WELS_LOG_ERROR, "AcquireLayersNals(), iCountNumLayers(%d) > MAX_LAYER_NUM_OF_FRAME(%d)!",
511502 iCountNumLayers, MAX_LAYER_NUM_OF_FRAME);
512503 return 1;
513504 }
514−#else//MT_ENABLED
515− if (iCountNumLayers > MAX_LAYER_NUM_OF_FRAME) {
516− WelsLog (*ppCtx, WELS_LOG_ERROR, "AcquireLayersNals(), iCountNumLayers(%d) > MAX_LAYER_NUM_OF_FRAME(%d)!",
517− iCountNumLayers, MAX_LAYER_NUM_OF_FRAME);
518− return 1;
519− }
520−#endif//!MT_ENABLED
521505
522506 if (NULL != pCountLayers)
523507 *pCountLayers = iCountNumLayers;
@@ -781,31 +765,6 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 257 unmodified lines
781765
782766 pDqLayer->iMbWidth = kiMbW;
783767 pDqLayer->iMbHeight = kiMbH;
784−#ifndef MT_ENABLED
785− if (SM_DYN_SLICE == pDlayer->sSliceCfg.uiSliceMode) { //wmalloc pSliceInLayer
786− SSlice* pSlice = NULL;
787− int32_t iSliceIdx = 0;
788− //wmalloc AVERSLICENUM_CONSTANT of pDqLayer->sLayerInfo.pSliceInLayer,
789− //wmalloc AVERSLICENUM_CONSTANT num of pSlice as initialization
790− //only set value for the first pSlice
791− pDqLayer->sLayerInfo.pSliceInLayer = (SSlice*)pMa->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "pSliceInLayer");
792−
793− WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pDqLayer->sLayerInfo.pSliceInLayer), FreeMemorySvc (ppCtx)) {
794− pSlice = &pDqLayer->sLayerInfo.pSliceInLayer[0];
795− pSlice->uiSliceIdx = 0;
796− pSlice->pSliceBsa = & (*ppCtx)->pOut->sBsWrite;
797− }
798−
799− while (iSliceIdx < iMaxSliceNum) {
800− pSlice = &pDqLayer->sLayerInfo.pSliceInLayer[iSliceIdx];
801− if (AllocMbCacheAligned (&pSlice->sMbCacheInfo, pMa)) {
802− FreeMemorySvc (ppCtx);
803− return 1;
804− }
805− ++ iSliceIdx;
806− }
807− } else
808−#endif//!MT_ENABLED
809768 {
810769 int32_t iSliceIdx = 0;
811770 pDqLayer->sLayerInfo.pSliceInLayer = (SSlice*)pMa->WelsMallocz (sizeof (SSlice) * iMaxSliceNum, "pSliceInLayer");
@@ -815,14 +774,10 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 3 unmodified lines
815774 while (iSliceIdx < iMaxSliceNum) {
816775 SSlice* pSlice = &pDqLayer->sLayerInfo.pSliceInLayer[iSliceIdx];
817776 pSlice->uiSliceIdx = iSliceIdx;
818−#ifdef MT_ENABLED
819777 if (pParam->iMultipleThreadIdc > 1)
820778 pSlice->pSliceBsa = & (*ppCtx)->pSliceBs[iSliceIdx].sBsWrite;
821779 else
822780 pSlice->pSliceBsa = & (*ppCtx)->pOut->sBsWrite;
823−#else
824− pSlice->pSliceBsa = & (*ppCtx)->pOut->sBsWrite;
825−#endif//MT_ENABLED
826781 if (AllocMbCacheAligned (&pSlice->sMbCacheInfo, pMa)) {
827782 FreeMemorySvc (ppCtx);
828783 return 1;
@@ -860,11 +815,9 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx) { · 31 unmodified lines
860815 pDqLayer->bDeblockingParallelFlag = false;
861816 } else {
862817 //multi-pSlice
863−#ifdef MT_ENABLED
864818 if (0 == pDqLayer->iLoopFilterDisableIdc) {
865819 pDqLayer->bDeblockingParallelFlag = false;
866820 }
867−#endif
868821 }
869822
870823 (*ppCtx)->ppDqLayerList[iDlayerIndex] = pDqLayer;
@@ -1231,9 +1184,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 360 unmodified lines
12311184 const uint32_t kuiMvdCacheAlignedSize = kuiMvdInterTableSize * sizeof (uint16_t);
12321185 int32_t iVclLayersBsSizeCount = 0;
12331186 int32_t iNonVclLayersBsSizeCount = 0;
1234−#if defined(MT_ENABLED)
12351187 int32_t iTargetSpatialBsSize = 0;
1236−#endif//MT_ENABLED
12371188
12381189 if (kiNumDependencyLayers < 1 || kiNumDependencyLayers > MAX_DEPENDENCY_LAYER) {
12391190 WelsLog (*ppCtx, WELS_LOG_WARNING, "RequestMemorySvc() failed due to invalid iNumDependencyLayers(%d)!\n",
@@ -1277,9 +1228,7 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 37 unmodified lines
12771228 iVclLayersBsSizeCount += iLayerBsSize;
12781229 ++ iIndex;
12791230 }
1280−#if defined(MT_ENABLED)
12811231 iTargetSpatialBsSize = iLayerBsSize;
1282−#endif//MT_ENABLED
12831232 iCountBsLen = iNonVclLayersBsSizeCount + iVclLayersBsSizeCount;
12841233
12851234 pParam->iNumRefFrame = WELS_CLIP3 (pParam->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM);
@@ -1295,14 +1244,12 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 9 unmodified lines
12951244 (*ppCtx)->pOut->iCountNals = iCountNals;
12961245 (*ppCtx)->pOut->iNalIndex = 0;
12971246
1298−#ifdef MT_ENABLED
12991247 if (pParam->iMultipleThreadIdc > 1) {
13001248 const int32_t iTotalLength = iCountBsLen + (iTargetSpatialBsSize * ((*ppCtx)->iMaxSliceCount - 1));
13011249 (*ppCtx)->pFrameBs = (uint8_t*)pMa->WelsMalloc (iTotalLength, "pFrameBs");
13021250 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pFrameBs), FreeMemorySvc (ppCtx))
13031251 (*ppCtx)->iFrameBsSize = iTotalLength;
13041252 } else
1305−#endif//MT_ENABLED
13061253 {
13071254 (*ppCtx)->pFrameBs = (uint8_t*)pMa->WelsMalloc (iCountBsLen, "pFrameBs");
13081255 WELS_VERIFY_RETURN_PROC_IF (1, (NULL == (*ppCtx)->pFrameBs), FreeMemorySvc (ppCtx))
@@ -1310,14 +1257,12 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 1 unmodified line
13101257 }
13111258 (*ppCtx)->iPosBsBuffer = 0;
13121259
1313−#ifdef MT_ENABLED
13141260 // for pSlice bs buffers
13151261 if (pParam->iMultipleThreadIdc > 1 && RequestMtResource (ppCtx, pParam, iCountBsLen, iTargetSpatialBsSize)) {
13161262 WelsLog (*ppCtx, WELS_LOG_WARNING, "RequestMemorySvc(), RequestMtResource failed!");
13171263 FreeMemorySvc (ppCtx);
13181264 return 1;
13191265 }
1320−#endif
13211266
13221267 (*ppCtx)->pIntra4x4PredModeBlocks = static_cast<int8_t*>
13231268 (pMa->WelsMallocz (iCountMaxMbNum * INTRA_4x4_MODE_NUM, "pIntra4x4PredModeBlocks"));
@@ -1485,10 +1430,8 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 161 unmodified lines
14851430 pCtx->pOut = NULL;
14861431 }
14871432
1488−#ifdef MT_ENABLED
14891433 if (pParam != NULL && pParam->iMultipleThreadIdc > 1)
14901434 ReleaseMtResource (ppCtx);
1491−#endif//MT_ENABLED
14921435
14931436 // frame bitstream pBuffer
14941437 if (NULL != pCtx->pFrameBs) {
@@ -1726,9 +1669,7 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp · 231 unmodified lines
17261669 switch (pMso->uiSliceMode) {
17271670 case SM_DYN_SLICE:
17281671 iMaxSliceCount = AVERSLICENUM_CONSTRAINT;
1729−//#ifndef MT_ENABLED
1730− break; // go through for MT_ENABLED & SM_DYN_SLICE?
1731−//#endif//MT_ENABLED
1672+ break; // go through for SM_DYN_SLICE?
17321673 case SM_FIXEDSLCNUM_SLICE:
17331674 if (iSliceNum > iMaxSliceCount)
17341675 iMaxSliceCount = iSliceNum;
@@ -1792,13 +1733,8 @@ int32_t InitSliceSettings (SWelsSvcCodingParam* pCodingParam, const int32_t kiCp · 57 unmodified lines
17921733 ++ iSpatialIdx;
17931734 } while (iSpatialIdx < iSpatialNum);
17941735
1795−#ifdef MT_ENABLED
17961736 pCodingParam->iCountThreadsNum = WELS_MIN (kiCpuCores, iMaxSliceCount);
17971737 pCodingParam->iMultipleThreadIdc = pCodingParam->iCountThreadsNum;
1798−#else
1799− pCodingParam->iMultipleThreadIdc = 1;
1800− pCodingParam->iCountThreadsNum = 1;
1801−#endif//MT_ENABLED
18021738
18031739 #ifndef WELS_TESTBED // for product release and non-SGE testing
18041740
@@ -1907,7 +1843,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 102 unmodified lines
19071843
19081844 #ifndef WELS_TESTBED
19091845
1910−#if defined(MT_ENABLED) && defined(DYNAMIC_DETECT_CPU_CORES)
1846+#if defined(DYNAMIC_DETECT_CPU_CORES)
19111847 if (pCodingParam->iMultipleThreadIdc > 0)
19121848 uiCpuCores = pCodingParam->iMultipleThreadIdc;
19131849 else {
@@ -1921,7 +1857,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 7 unmodified lines
19211857 else if (uiCpuCores < 1) // just for safe
19221858 uiCpuCores = 1;
19231859 }
1924−#endif//MT_ENABLED && DYNAMIC_DETECT_CPU_CORES
1860+#endif//DYNAMIC_DETECT_CPU_CORES
19251861
19261862 #else//WELS_TESTBED
19271863
@@ -1983,10 +1919,8 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 55 unmodified lines
19831919 return iRet;
19841920 }
19851921
1986−#ifdef MT_ENABLED
19871922 if (pCodingParam->iMultipleThreadIdc > 1)
19881923 iRet = CreateSliceThreads (pCtx);
1989−#endif
19901924
19911925 WelsRcInitModule (pCtx, pCtx->pSvcParam->bEnableRc ? WELS_RC_GOM : WELS_RC_DISABLE);
19921926
@@ -2112,7 +2046,6 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 119 unmodified lines
21122046 StatOverallEncodingExt (*ppCtx);
21132047 #endif
21142048
2115−#if defined(MT_ENABLED)
21162049 if ((*ppCtx)->pSvcParam->iMultipleThreadIdc > 1 && (*ppCtx)->pSliceThreading != NULL) {
21172050 const int32_t iThreadCount = (*ppCtx)->pSvcParam->iCountThreadsNum;
21182051 int32_t iThreadIdx = 0;
@@ -2132,7 +2065,6 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 13 unmodified lines
21322065 }
21332066 }
21342067 }
2135−#endif//MT_ENABLED
21362068
21372069 if ((*ppCtx)->pVpp) {
21382070 (*ppCtx)->pVpp->FreeSpatialPictures(*ppCtx);
@@ -2205,19 +2137,14 @@ void DynslcUpdateMbNeighbourInfoListForAllSlices (SSliceCtx* pSliceCtx, SMB* pMb · 66 unmodified lines
22052137 */
22062138 int32_t PicPartitionNumDecision (sWelsEncCtx* pCtx) {
22072139 int32_t iPartitionNum = 1;
2208−#ifdef MT_ENABLED
22092140 if (pCtx->pSvcParam->iMultipleThreadIdc > 1) {
22102141 iPartitionNum = pCtx->pSvcParam->iCountThreadsNum;
22112142 if (P_SLICE == pCtx->eSliceType)
22122143 iPartitionNum = 1;
22132144 }
22142145 return iPartitionNum;
2215−#else
2216− return iPartitionNum;
2217−#endif//MT_ENABLED
22182146 }
22192147
2220−#if defined(MT_ENABLED)
22212148 void WelsInitCurrentQBLayerMltslc (sWelsEncCtx* pCtx) {
22222149 //pData init
22232150 SDqLayer* pCurDq = pCtx->pCurDqLayer;
@@ -2308,83 +2235,6 @@ void WelsInitCurrentDlayerMltslc (sWelsEncCtx* pCtx, int32_t iPartitionNum) { · 84 unmodified lines
23082235
23092236 WelsInitCurrentQBLayerMltslc (pCtx);
23102237 }
2311−#else
2312−void WelsInitCurrentQBLayerMltslc (sWelsEncCtx* pCtx) {
2313− //pData init
2314− SDqLayer* pCurDq = pCtx->pCurDqLayer;
2315− SSliceCtx* pSliceCtx = (pCurDq->pSliceEncCtx);
2316− SSlice* pSlice = &pCurDq->sLayerInfo.pSliceInLayer[0];
2317− int32_t iTtlMbNumInFrame = pSliceCtx->iMbNumInFrame;
2318−
2319− //pSliceCtx
2320− memset (pSliceCtx->pOverallMbMap, 0, iTtlMbNumInFrame * sizeof (uint8_t));
2321− memset (pSliceCtx->pCountMbNumInSlice, 0, pSliceCtx->iSliceNumInFrame * sizeof (int32_t));
2322− memset (pSliceCtx->pFirstMbInSlice, 0, pSliceCtx->iSliceNumInFrame * sizeof (int16_t));
2323− pSliceCtx->iSliceNumInFrame = 1;//
2324− pSliceCtx->pCountMbNumInSlice[0] = iTtlMbNumInFrame;
2325−
2326− //mb_neighbor
2327− DynslcUpdateMbNeighbourInfoListForAllSlices (pSliceCtx, pCurDq->sMbDataP);
2328−
2329− //pSlice init
2330− pSlice->uiSliceIdx = 0;
2331− pSlice->pSliceBsa = &pCtx->pOut->sBsWrite;
2332− pSlice->bDynamicSlicingSliceSizeCtrlFlag = false;
2333− pSlice->uiAssumeLog2BytePerMb = (pCtx->eSliceType == P_SLICE) ? 0 : 1;
2334−}
2335−
2336−void WelsInitCurrentDlayerMltslc (sWelsEncCtx* pCtx, int32_t iPartitionNum) {
2337− SDqLayer* pCurDq = pCtx->pCurDqLayer;
2338− SSliceCtx* pSliceCtx = (pCurDq->pSliceEncCtx);
2339− int32_t iTtlMbNumInFrame = pCurDq->iMbHeight * pCurDq->iMbWidth;
2340−
2341− pSliceCtx->iMbNumInFrame
2342− = pSliceCtx->pCountMbNumInSlice[0] = iTtlMbNumInFrame;
2343−
2344− if (I_SLICE == pCtx->eSliceType) { //check if uiSliceSizeConstraint too small
2345−#define byte_complexIMBat26 (60)
2346− uint8_t iCurDid = pCtx->uiDependencyId;
2347− uint32_t uiFrmByte = 0;
2348−
2349− if (pCtx->pSvcParam->bEnableRc) {
2350− //RC case
2351− uiFrmByte = (
2352− ((uint32_t) (pCtx->pSvcParam->sDependencyLayers[iCurDid].iSpatialBitrate)
2353− / (uint32_t) (pCtx->pSvcParam->sDependencyLayers[iCurDid].fInputFrameRate)) >> 3);
2354− } else {
2355− //fixed QP case
2356− int32_t iQDeltaTo26 = (26 - pCtx->pSvcParam->sDependencyLayers[iCurDid].iDLayerQp);
2357−
2358− uiFrmByte = (iTtlMbNumInFrame * byte_complexIMBat26);
2359− if (iQDeltaTo26 > 0) {
2360− //smaller QP than 26
2361− uiFrmByte = (uint32_t) (uiFrmByte * ((float)iQDeltaTo26 / 4));
2362− } else if (iQDeltaTo26 < 0) {
2363− //larger QP than 26
2364− iQDeltaTo26 = ((-iQDeltaTo26) >> 2); //delta mod 4
2365− uiFrmByte = (uiFrmByte >> (iQDeltaTo26)); //if delta 4, byte /2
2366− }
2367− }
2368−
2369− //MINPACKETSIZE_CONSTRAINT
2370− if (pSliceCtx->uiSliceSizeConstraint
2371− <
2372− (uint32_t) (uiFrmByte//suppose 16 byte per mb at average
2373− / (pSliceCtx->iMaxSliceNumConstraint))
2374− ) {
2375−
2376− WelsLog (pCtx,
2377− WELS_LOG_WARNING,
2378− "Set-SliceConstraint(%d) too small for current resolution (MB# %d) under QP/BR!\n",
2379− pSliceCtx->uiSliceSizeConstraint,
2380− pSliceCtx->iMbNumInFrame
2381− );
2382− }
2383− }
2384−
2385− WelsInitCurrentQBLayerMltslc (pCtx);
2386−}
2387−#endif
23882238
23892239 /*!
23902240 * \brief initialize current layer
@@ -2884,9 +2734,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 493 unmodified lines
28842734 SPicture* fsnr = NULL;
28852735 #endif//ENABLE_FRAME_DUMP || ENABLE_PSNR_CALC
28862736 SPicture* pEncPic = NULL; // to be decided later
2887−#if defined(MT_ENABLED)
28882737 int32_t did_list[MAX_DEPENDENCY_LAYER] = {0};
2889−#endif//MT_ENABLED
28902738 int32_t iLayerNum = 0;
28912739 int32_t iLayerSize = 0;
28922740 int32_t iSpatialNum = 0; // available count number of spatial layers due to frame size changed in this given frame
@@ -2976,22 +2824,18 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 83 unmodified lines
29762824 iCurWidth = param_d->iFrameWidth;
29772825 iCurHeight = param_d->iFrameHeight;
29782826
2979−#if defined(MT_ENABLED)
29802827 did_list[iSpatialIdx] = iCurDid;
2981−#endif//MT_ENABLED
29822828
29832829 // Encoding this picture might mulitiple sQualityStat layers potentially be encoded as followed
29842830
29852831 switch (param_d->sSliceCfg.uiSliceMode) {
29862832 case SM_FIXEDSLCNUM_SLICE:
29872833 case SM_AUTO_SLICE:{
2988−#if defined(MT_ENABLED)
29892834 if ((iCurDid > 0) && (pSvcParam->iMultipleThreadIdc > 1) &&
29902835 (pSvcParam->sDependencyLayers[iCurDid].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE
29912836 && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[iCurDid].sSliceCfg.sSliceArgument.uiSliceNum)
29922837 )
29932838 AdjustEnhanceLayer (pCtx, iCurDid);
2994−#endif//MT_ENABLED
29952839 break;
29962840 }
29972841 case SM_DYN_SLICE: {
@@ -3104,18 +2948,13 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 106 unmodified lines
31042948 pLayerBsInfo->iNalCount = ++ iNalIdxInLayer;
31052949 }
31062950 // for dynamic slicing single threading..
3107−#ifndef MT_ENABLED
3108− else if (SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode)
3109−#else // MT_ENABLED
31102951 else if ((SM_DYN_SLICE == param_d->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc <= 1))
3111−#endif//MT_ENABLED
31122952 {
31132953 const int32_t kiLastMbInFrame = pCtx->pCurDqLayer->pSliceEncCtx->iMbNumInFrame;
31142954 pCtx->iEncoderError = WelsCodeOnePicPartition (pCtx, pLayerBsInfo, &iNalIdxInLayer, &iLayerSize, 0, kiLastMbInFrame, 0);
31152955 WELS_VERIFY_RETURN_IFNEQ(pCtx->iEncoderError, ENC_RETURN_SUCCESS)
31162956 } else {
31172957 //other multi-slice uiSliceMode
3118−#if defined(MT_ENABLED)
31192958 int err = 0;
31202959 // THREAD_FULLY_FIRE_MODE/THREAD_PICK_UP_MODE for any mode of non-SM_DYN_SLICE
31212960 if ((SM_DYN_SLICE != param_d->sSliceCfg.uiSliceMode) && (pSvcParam->iMultipleThreadIdc > 1)) {
@@ -3239,7 +3078,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 117 unmodified lines
32393078
32403079 iLayerSize = AppendSliceToFrameBs (pCtx, pLayerBsInfo, kiPartitionCnt);
32413080 } else // for non-dynamic-slicing mode single threading branch..
3242−#endif//MT_ENABLED
32433081 {
32443082 const bool bNeedPrefix = pCtx->bNeedPrefixNalFlag;
32453083 int32_t iSliceIdx = 0;
@@ -3294,9 +3132,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 48 unmodified lines
32943132
32953133 // deblocking filter
32963134 if (
3297−#if defined(MT_ENABLED)
32983135 (!pCtx->pCurDqLayer->bDeblockingParallelFlag) &&
3299−#endif//MT_ENABLED
33003136 #if !defined(ENABLE_FRAME_DUMP)
33013137 ((eNalRefIdc != NRI_PRI_LOWEST) && (param_d->iHighestTemporalId == 0 || iCurTid < param_d->iHighestTemporalId)) &&
33023138 #endif//!ENABLE_FRAME_DUMP
@@ -3436,7 +3272,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 133 unmodified lines
34363272 ++ iLayerNum;
34373273 }
34383274
3439−#if defined(MT_ENABLED)
34403275 if ((param_d->sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE||param_d->sSliceCfg.uiSliceMode == SM_AUTO_SLICE) && pSvcParam->iMultipleThreadIdc > 1 &&
34413276 pSvcParam->iMultipleThreadIdc >= param_d->sSliceCfg.sSliceArgument.uiSliceNum) {
34423277 CalcSliceComplexRatio (pCtx->pSliceThreading->pSliceComplexRatio[iCurDid], pCtx->pCurDqLayer->pSliceEncCtx,
@@ -3445,7 +3280,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 2 unmodified lines
34453280 TrackSliceComplexities (pCtx, iCurDid);
34463281 #endif//#if defined(MT_DEBUG)
34473282 }
3448−#endif//MT_ENABLED
34493283
34503284 ++ iSpatialIdx;
34513285
@@ -3472,11 +3306,10 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 20 unmodified lines
34723306 }
34733307 }
34743308
3475−#if defined(MT_ENABLED) && defined(MT_DEBUG)
3309+#if defined(MT_DEBUG)
34763310 TrackSliceConsumeTime (pCtx, did_list, iSpatialNum);
3477−#endif//MT_ENABLED && MT_DEBUG
3311+#endif//MT_DEBUG
34783312
3479−#if defined(MT_ENABLED)
34803313 if (pSvcParam->iMultipleThreadIdc > 1 && did_list[0] == BASE_DEPENDENCY_ID
34813314 && ((pSvcParam->sDependencyLayers[0].sSliceCfg.uiSliceMode == SM_FIXEDSLCNUM_SLICE)||(pSvcParam->sDependencyLayers[0].sSliceCfg.uiSliceMode == SM_AUTO_SLICE))
34823315 && pSvcParam->iMultipleThreadIdc >= pSvcParam->sDependencyLayers[0].sSliceCfg.sSliceArgument.uiSliceNum
@@ -3485,7 +3318,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 2 unmodified lines
34853318 1]].sSliceCfg.sSliceArgument.uiSliceNum) {
34863319 AdjustBaseLayer (pCtx);
34873320 }
3488−#endif
34893321
34903322 #ifdef ENABLE_FRAME_DUMP
34913323 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