History

Convert tabs to spaces before comments

Martin Storsjö committed 11 years ago

Commit 78e0ec61 parent 3052b7a57 files · +278 −278Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+36−36
@@ -51,7 +51,7 @@ · 50 unmodified lines
51#include "deblocking.h"51#include "deblocking.h"
52#include "ref_list_mgr_svc.h"52#include "ref_list_mgr_svc.h"
53#include "ls_defines.h"53#include "ls_defines.h"
54#include "crt_util_safe_x.h" // Safe CRT routines like utils for cross platforms54#include "crt_util_safe_x.h" // Safe CRT routines like utils for cross platforms
55#include "slice_multi_threading.h"55#include "slice_multi_threading.h"
56#include "measure_time.h"56#include "measure_time.h"
57#include "svc_set_mb_syn.h"57#include "svc_set_mb_syn.h"
@@ -64,8 +64,8 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 6 unmodified lines
64 SLayerBSInfo* pLayerBsInfo,64 SLayerBSInfo* pLayerBsInfo,
65 int32_t* pNalIdxInLayer,65 int32_t* pNalIdxInLayer,
66 int32_t* pLayerSize,66 int32_t* pLayerSize,
67 int32_t iFirstMbInPartition, // first mb inclusive in partition67 int32_t iFirstMbInPartition, // first mb inclusive in partition
68 int32_t iEndMbInPartition, // end mb exclusive in partition68 int32_t iEndMbInPartition, // end mb exclusive in partition
69 int32_t iStartSliceIdx69 int32_t iStartSliceIdx
70 );70 );
71 71
@@ -453,7 +453,7 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 381 unmodified lines
453 pSpatialLayer->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;453 pSpatialLayer->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
454 break;454 break;
455 }455 }
456 if (pCodingParam->iRCMode != RC_OFF_MODE) { // multiple slices verify with gom456 if (pCodingParam->iRCMode != RC_OFF_MODE) { // multiple slices verify with gom
457 //check uiSliceNum and set uiSliceMbNum with current uiSliceNum457 //check uiSliceNum and set uiSliceMbNum with current uiSliceNum
458 if (!GomValidCheckSliceNum (iMbWidth, iMbHeight, &pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum)) {458 if (!GomValidCheckSliceNum (iMbWidth, iMbHeight, &pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum)) {
459 WelsLog (pLogCtx, WELS_LOG_WARNING,459 WelsLog (pLogCtx, WELS_LOG_WARNING,
@@ -469,7 +469,7 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 9 unmodified lines
469 }469 }
470 assert (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > 1);470 assert (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > 1);
471 } else if (!CheckFixedSliceNumMultiSliceSetting (iMbNumInFrame,471 } else if (!CheckFixedSliceNumMultiSliceSetting (iMbNumInFrame,
472 &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings472 &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings
473 //check uiSliceMbNum with current uiSliceNum473 //check uiSliceMbNum with current uiSliceNum
474 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!",474 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!",
475 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);475 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
@@ -501,13 +501,13 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 25 unmodified lines
501 }501 }
502 502
503 if (!CheckRasterMultiSliceSetting (iMbNumInFrame,503 if (!CheckRasterMultiSliceSetting (iMbNumInFrame,
504 &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings504 &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings
505 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!",505 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!",
506 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);506 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
507 return ENC_RETURN_UNSUPPORTED_PARA;507 return ENC_RETURN_UNSUPPORTED_PARA;
508 }508 }
509 if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum <= 0509 if (pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum <= 0
510 || pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > iMaxSliceNum) { // verify interleave mode settings510 || pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum > iMaxSliceNum) { // verify interleave mode settings
511 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) in SM_RASTER_SLICE settings!",511 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceNum (%d) in SM_RASTER_SLICE settings!",
512 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum);512 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceNum);
513 return ENC_RETURN_UNSUPPORTED_PARA;513 return ENC_RETURN_UNSUPPORTED_PARA;
@@ -548,7 +548,7 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 34 unmodified lines
548 return ENC_RETURN_UNSUPPORTED_PARA;548 return ENC_RETURN_UNSUPPORTED_PARA;
549 }549 }
550 if (!CheckRowMbMultiSliceSetting (iMbWidth,550 if (!CheckRowMbMultiSliceSetting (iMbWidth,
551 &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings551 &pSpatialLayer->sSliceCfg.sSliceArgument)) { // verify interleave mode settings
552 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!",552 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidationExt(), invalid uiSliceMbNum (%d) settings!",
553 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);553 pSpatialLayer->sSliceCfg.sSliceArgument.uiSliceMbNum[0]);
554 return ENC_RETURN_UNSUPPORTED_PARA;554 return ENC_RETURN_UNSUPPORTED_PARA;
@@ -1178,7 +1178,7 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p · 623 unmodified lines
1178 }1178 }
1179 }1179 }
1180 // fix issue in case single pSlice coding might be inclusive exist in variant spatial layer setting, also introducing multi-pSlice modes1180 // fix issue in case single pSlice coding might be inclusive exist in variant spatial layer setting, also introducing multi-pSlice modes
1181 else { // only one pSlice1181 else { // only one pSlice
1182 SSlice* pSlice = &pDqLayer->sLayerInfo.pSliceInLayer[0];1182 SSlice* pSlice = &pDqLayer->sLayerInfo.pSliceInLayer[0];
1183 pSlice->uiSliceIdx = 0;1183 pSlice->uiSliceIdx = 0;
1184 pSlice->pSliceBsa = & (*ppCtx)->pOut->sBsWrite;1184 pSlice->pSliceBsa = & (*ppCtx)->pOut->sBsWrite;
@@ -1410,8 +1410,8 @@ int32_t AllocStrideTables (sWelsEncCtx** ppCtx, const int32_t kiNumSpatialLayers · 225 unmodified lines
1410 uint8_t* pBaseDec = NULL, *pBaseEnc = NULL, *pBaseMbX = NULL, *pBaseMbY = NULL;1410 uint8_t* pBaseDec = NULL, *pBaseEnc = NULL, *pBaseMbX = NULL, *pBaseMbY = NULL;
1411 struct {1411 struct {
1412 int32_t iMbWidth;1412 int32_t iMbWidth;
1413 int32_t iCountMbNum; // count number of SMB in each spatial1413 int32_t iCountMbNum; // count number of SMB in each spatial
1414 int32_t iSizeAllMbAlignCache; // cache line size aligned in each spatial1414 int32_t iSizeAllMbAlignCache; // cache line size aligned in each spatial
1415 } sMbSizeMap[MAX_DEPENDENCY_LAYER] = {{ 0 }};1415 } sMbSizeMap[MAX_DEPENDENCY_LAYER] = {{ 0 }};
1416 int32_t iLineSizeY[MAX_DEPENDENCY_LAYER][2] = {{ 0 }};1416 int32_t iLineSizeY[MAX_DEPENDENCY_LAYER][2] = {{ 0 }};
1417 int32_t iLineSizeUV[MAX_DEPENDENCY_LAYER][2] = {{ 0 }};1417 int32_t iLineSizeUV[MAX_DEPENDENCY_LAYER][2] = {{ 0 }};
@@ -1607,7 +1607,7 @@ int32_t AllocStrideTables (sWelsEncCtx** ppCtx, const int32_t kiNumSpatialLayers · 189 unmodified lines
1607 1607
1608 i = 0;1608 i = 0;
1609 while (i < kiMbHeight) {1609 while (i < kiMbHeight) {
1610 memcpy (pMbIndexX, pRowX, kiLineSize); // confirmed_safe_unsafe_usage1610 memcpy (pMbIndexX, pRowX, kiLineSize); // confirmed_safe_unsafe_usage
1611 1611
1612 pMbIndexX += kiMbWidth;1612 pMbIndexX += kiMbWidth;
1613 ++ i;1613 ++ i;
@@ -1630,7 +1630,7 @@ int32_t AllocStrideTables (sWelsEncCtx** ppCtx, const int32_t kiNumSpatialLayers · 16 unmodified lines
1630 int16_t* pMbIndexY = pPtr->pMbIndexY[iSpatialIdx] + i * kiMbWidth;1630 int16_t* pMbIndexY = pPtr->pMbIndexY[iSpatialIdx] + i * kiMbWidth;
1631 1631
1632 if (i < kiMbHeight) {1632 if (i < kiMbHeight) {
1633 memcpy (pMbIndexY, pRowY, kiLineSize); // confirmed_safe_unsafe_usage1633 memcpy (pMbIndexY, pRowY, kiLineSize); // confirmed_safe_unsafe_usage
1634 }1634 }
1635 }1635 }
1636 ++ i;1636 ++ i;
@@ -2205,7 +2205,7 @@ void FreeMemorySvc (sWelsEncCtx** ppCtx) { · 568 unmodified lines
2205 }2205 }
2206 2206
2207#if defined(MEMORY_MONITOR)2207#if defined(MEMORY_MONITOR)
2208 assert (pMa->WelsGetMemoryUsage() == 0); // ensure all memory free well2208 assert (pMa->WelsGetMemoryUsage() == 0); // ensure all memory free well
2209#endif//MEMORY_MONITOR2209#endif//MEMORY_MONITOR
2210 2210
2211 if ((*ppCtx)->pMemAlign != NULL) {2211 if ((*ppCtx)->pMemAlign != NULL) {
@@ -2277,7 +2277,7 @@ int32_t InitSliceSettings (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPar · 65 unmodified lines
2277 pDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;2277 pDlp->sSliceCfg.uiSliceMode = SM_SINGLE_SLICE;
2278 break;2278 break;
2279 }2279 }
2280 if (pCodingParam->iRCMode != RC_OFF_MODE) { // multiple slices verify with gom2280 if (pCodingParam->iRCMode != RC_OFF_MODE) { // multiple slices verify with gom
2281 //check uiSliceNum and set uiSliceMbNum with current uiSliceNum2281 //check uiSliceNum and set uiSliceMbNum with current uiSliceNum
2282 if (!GomValidCheckSliceNum (kiMbWidth, kiMbHeight, &pDlp->sSliceCfg.sSliceArgument.uiSliceNum)) {2282 if (!GomValidCheckSliceNum (kiMbWidth, kiMbHeight, &pDlp->sSliceCfg.sSliceArgument.uiSliceNum)) {
2283 WelsLog (pLogCtx, WELS_LOG_WARNING,2283 WelsLog (pLogCtx, WELS_LOG_WARNING,
@@ -2292,7 +2292,7 @@ int32_t InitSliceSettings (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPar · 8 unmodified lines
2292 return ENC_RETURN_INVALIDINPUT;2292 return ENC_RETURN_INVALIDINPUT;
2293 }2293 }
2294 } else if (!CheckFixedSliceNumMultiSliceSetting (kiMbNumInFrame,2294 } else if (!CheckFixedSliceNumMultiSliceSetting (kiMbNumInFrame,
2295 &pDlp->sSliceCfg.sSliceArgument)) { // verify interleave mode settings2295 &pDlp->sSliceCfg.sSliceArgument)) { // verify interleave mode settings
2296 //check uiSliceMbNum with current uiSliceNum2296 //check uiSliceMbNum with current uiSliceNum
2297 WelsLog (pLogCtx, WELS_LOG_ERROR,2297 WelsLog (pLogCtx, WELS_LOG_ERROR,
2298 "InitSliceSettings(), invalid uiSliceMbNum (%d) settings!,now turn to SM_SINGLE_SLICE type",2298 "InitSliceSettings(), invalid uiSliceMbNum (%d) settings!,now turn to SM_SINGLE_SLICE type",
@@ -2400,7 +2400,7 @@ int32_t GetMultipleThreadIdc (SLogContext* pLogCtx, SWelsSvcCodingParam* pCoding · 101 unmodified lines
2400 uiCpuCores = pCodingParam->iMultipleThreadIdc;2400 uiCpuCores = pCodingParam->iMultipleThreadIdc;
2401 else {2401 else {
2402 if (uiCpuCores ==2402 if (uiCpuCores ==
2403 0) // cpuid not supported or doesn't expose the number of cores, use high level system API as followed to detect number of pysical/logic processor2403 0) // cpuid not supported or doesn't expose the number of cores, use high level system API as followed to detect number of pysical/logic processor
2404 uiCpuCores = DynamicDetectCpuCores();2404 uiCpuCores = DynamicDetectCpuCores();
2405 // So far so many cpu cores up to MAX_THREADS_NUM mean for server platforms,2405 // So far so many cpu cores up to MAX_THREADS_NUM mean for server platforms,
2406 // for client application here it is constrained by maximal to MAX_THREADS_NUM2406 // for client application here it is constrained by maximal to MAX_THREADS_NUM
@@ -2475,7 +2475,7 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 68 unmodified lines
2475 FreeMemorySvc (&pCtx);2475 FreeMemorySvc (&pCtx);
2476 return iRet;2476 return iRet;
2477 }2477 }
2478 memcpy (pCtx->pSvcParam, pCodingParam, sizeof (SWelsSvcCodingParam)); // confirmed_safe_unsafe_usage2478 memcpy (pCtx->pSvcParam, pCodingParam, sizeof (SWelsSvcCodingParam)); // confirmed_safe_unsafe_usage
2479 2479
2480 pCtx->pFuncList = (SWelsFuncPtrList*)pCtx->pMemAlign->WelsMalloc (sizeof (SWelsFuncPtrList), "SWelsFuncPtrList");2480 pCtx->pFuncList = (SWelsFuncPtrList*)pCtx->pMemAlign->WelsMalloc (sizeof (SWelsFuncPtrList), "SWelsFuncPtrList");
2481 if (NULL == pCtx->pFuncList) {2481 if (NULL == pCtx->pFuncList) {
@@ -2639,7 +2639,7 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 157 unmodified lines
2639 if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]) {2639 if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]) {
2640 WelsEventSignal (& (*ppCtx)->pSliceThreading->pExitEncodeEvent[iThreadIdx]);2640 WelsEventSignal (& (*ppCtx)->pSliceThreading->pExitEncodeEvent[iThreadIdx]);
2641 WelsEventSignal (& (*ppCtx)->pSliceThreading->pThreadMasterEvent[iThreadIdx]);2641 WelsEventSignal (& (*ppCtx)->pSliceThreading->pThreadMasterEvent[iThreadIdx]);
2642 res = WelsThreadJoin ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]); // waiting thread exit2642 res = WelsThreadJoin ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]); // waiting thread exit
2643 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pthread_join(pThreadHandles%d) return %d..",2643 WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pthread_join(pThreadHandles%d) return %d..",
2644 iThreadIdx,2644 iThreadIdx,
2645 res);2645 res);
@@ -2844,7 +2844,7 @@ void WelsInitCurrentLayer (sWelsEncCtx* pCtx, · 198 unmodified lines
2844 2844
2845 pCurDq->pDecPic = pDecPic;2845 pCurDq->pDecPic = pDecPic;
2846 2846
2847 if (fDlp->sSliceCfg.uiSliceMode == SM_DYN_SLICE) // need get extra slices for update2847 if (fDlp->sSliceCfg.uiSliceMode == SM_DYN_SLICE) // need get extra slices for update
2848 iSliceCount = GetInitialSliceNum (pCurDq->iMbWidth, pCurDq->iMbHeight, &fDlp->sSliceCfg);2848 iSliceCount = GetInitialSliceNum (pCurDq->iMbWidth, pCurDq->iMbHeight, &fDlp->sSliceCfg);
2849 else2849 else
2850 iSliceCount = GetCurrentSliceNum (pCurDq->pSliceEncCtx);2850 iSliceCount = GetCurrentSliceNum (pCurDq->pSliceEncCtx);
@@ -3146,7 +3146,7 @@ void ParasetIdAdditionIdAdjust (SParaSetOffsetVariable* sParaSetOffsetVariable, · 295 unmodified lines
3146 sParaSetOffsetVariable->iParaSetIdDelta[kiEncId] = uiNextIdInBs -3146 sParaSetOffsetVariable->iParaSetIdDelta[kiEncId] = uiNextIdInBs -
3147 kiEncId; //for current parameter set, change its id_delta3147 kiEncId; //for current parameter set, change its id_delta
3148 //write pso pData for next update:3148 //write pso pData for next update:
3149 sParaSetOffsetVariable->bUsedParaSetIdInBs[uiNextIdInBs] = true; // update current used_id3149 sParaSetOffsetVariable->bUsedParaSetIdInBs[uiNextIdInBs] = true; // update current used_id
3150 3150
3151 //prepare for next update:3151 //prepare for next update:
3152 // find the next avaibable iId3152 // find the next avaibable iId
@@ -3716,7 +3716,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 563 unmodified lines
3716 pCtx->pFuncList->pfRc.pfWelsUpdateMaxBrWindowStatus (pCtx, iSpatialNum, pSrcPic->uiTimeStamp);3716 pCtx->pFuncList->pfRc.pfWelsUpdateMaxBrWindowStatus (pCtx, iSpatialNum, pSrcPic->uiTimeStamp);
3717 }3717 }
3718 3718
3719 if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate)3719 if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate)
3720 ++ pCtx->iCodingIndex;3720 ++ pCtx->iCodingIndex;
3721 pFbi->eFrameType = videoFrameTypeSkip;3721 pFbi->eFrameType = videoFrameTypeSkip;
3722 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,3722 WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,
@@ -3879,16 +3879,16 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 156 unmodified lines
3879 && (pCtx->iNumRef0 > 0)) ? pCtx->pRefList0[0] : NULL,3879 && (pCtx->iNumRef0 > 0)) ? pCtx->pRefList0[0] : NULL,
3880 iCurDid, (pCtx->eSliceType == P_SLICE) && pSvcParam->bEnableBackgroundDetection);3880 iCurDid, (pCtx->eSliceType == P_SLICE) && pSvcParam->bEnableBackgroundDetection);
3881 WelsUpdateRefSyntax (pCtx, pCtx->iPOC,3881 WelsUpdateRefSyntax (pCtx, pCtx->iPOC,
3882 eFrameType); //get reordering syntax used for writing slice header and transmit to encoder.3882 eFrameType); //get reordering syntax used for writing slice header and transmit to encoder.
3883 PrefetchReferencePicture (pCtx, eFrameType); // update reference picture for current pDq layer3883 PrefetchReferencePicture (pCtx, eFrameType); // update reference picture for current pDq layer
3884 3884
3885 pCtx->pFuncList->pfRc.pfWelsRcPictureInit (pCtx, pSrcPic->uiTimeStamp);3885 pCtx->pFuncList->pfRc.pfWelsRcPictureInit (pCtx, pSrcPic->uiTimeStamp);
3886 PreprocessSliceCoding (pCtx); // MUST be called after pfWelsRcPictureInit() and WelsInitCurrentLayer()3886 PreprocessSliceCoding (pCtx); // MUST be called after pfWelsRcPictureInit() and WelsInitCurrentLayer()
3887 3887
3888 //TODO Complexity Calculation here for screen content3888 //TODO Complexity Calculation here for screen content
3889 iLayerSize = 0;3889 iLayerSize = 0;
3890 3890
3891 if (SM_SINGLE_SLICE == pParam->sSliceCfg.uiSliceMode) { // only one slice within a sQualityStat layer3891 if (SM_SINGLE_SLICE == pParam->sSliceCfg.uiSliceMode) { // only one slice within a sQualityStat layer
3892 int32_t iSliceSize = 0;3892 int32_t iSliceSize = 0;
3893 int32_t iPayloadSize = 0;3893 int32_t iPayloadSize = 0;
3894 3894
@@ -3948,7 +3948,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 53 unmodified lines
3948 return ENC_RETURN_UNEXPECTED;3948 return ENC_RETURN_UNEXPECTED;
3949 }3949 }
3950 3950
3951 if (pSvcParam->iCountThreadsNum >= iSliceCount) { //THREAD_FULLY_FIRE_MODE3951 if (pSvcParam->iCountThreadsNum >= iSliceCount) { //THREAD_FULLY_FIRE_MODE
3952#if defined(MT_DEBUG)3952#if defined(MT_DEBUG)
3953 int64_t t_bs_append = 0;3953 int64_t t_bs_append = 0;
3954#endif3954#endif
@@ -3986,7 +3986,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 31 unmodified lines
3986 t_bs_append, pCtx->iCodingIndex, iCurDid, 0);3986 t_bs_append, pCtx->iCodingIndex, iCurDid, 0);
3987 }3987 }
3988#endif//MT_DEBUG3988#endif//MT_DEBUG
3989 } else { //THREAD_PICK_UP_MODE3989 } else { //THREAD_PICK_UP_MODE
3990 int32_t iNumThreadsRunning = 0;3990 int32_t iNumThreadsRunning = 0;
3991 int32_t iNumThreadsScheduled = 0;3991 int32_t iNumThreadsScheduled = 0;
3992 int32_t iIndexOfSliceToBeCoded = 0;3992 int32_t iIndexOfSliceToBeCoded = 0;
@@ -4026,7 +4026,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 33 unmodified lines
4026 WelsEventSignal (&pCtx->pSliceThreading->pThreadMasterEvent[iEventId]);4026 WelsEventSignal (&pCtx->pSliceThreading->pThreadMasterEvent[iEventId]);
4027 4027
4028 ++ iIndexOfSliceToBeCoded;4028 ++ iIndexOfSliceToBeCoded;
4029 } else { // no other slices left for coding4029 } else { // no other slices left for coding
4030 -- iNumThreadsRunning;4030 -- iNumThreadsRunning;
4031 }4031 }
4032 }4032 }
@@ -4320,7 +4320,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 287 unmodified lines
4320 4320
4321#ifdef ENABLE_FRAME_DUMP4321#ifdef ENABLE_FRAME_DUMP
4322 DumpRecFrame (fsnr, &pSvcParam->sDependencyLayers[pSvcParam->iSpatialLayerNum - 1].sRecFileName[0],4322 DumpRecFrame (fsnr, &pSvcParam->sDependencyLayers[pSvcParam->iSpatialLayerNum - 1].sRecFileName[0],
4323 pSvcParam->iSpatialLayerNum - 1, pCtx->bRecFlag, pCtx->pCurDqLayer); // pDecPic: final reconstruction output4323 pSvcParam->iSpatialLayerNum - 1, pCtx->bRecFlag, pCtx->pCurDqLayer); // pDecPic: final reconstruction output
4324 pCtx->bRecFlag = true;4324 pCtx->bRecFlag = true;
4325 4325
4326#endif//ENABLE_FRAME_DUMP4326#endif//ENABLE_FRAME_DUMP
@@ -4431,7 +4431,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 104 unmodified lines
4431 bNeedReset = true;4431 bNeedReset = true;
4432 }4432 }
4433 4433
4434 if (!bNeedReset) { // Check its picture resolutions/quality settings respectively in each dependency layer4434 if (!bNeedReset) { // Check its picture resolutions/quality settings respectively in each dependency layer
4435 iIndexD = 0;4435 iIndexD = 0;
4436 assert (pOldParam->iSpatialLayerNum == pNewParam->iSpatialLayerNum);4436 assert (pOldParam->iSpatialLayerNum == pNewParam->iSpatialLayerNum);
4437 do {4437 do {
@@ -4628,7 +4628,7 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 190 unmodified lines
4628 pOldDlpInternal->iDecompositionStages = pNewDlpInternal->iDecompositionStages;4628 pOldDlpInternal->iDecompositionStages = pNewDlpInternal->iDecompositionStages;
4629 4629
4630 memcpy (pOldDlpInternal->uiCodingIdx2TemporalId, pNewDlpInternal->uiCodingIdx2TemporalId,4630 memcpy (pOldDlpInternal->uiCodingIdx2TemporalId, pNewDlpInternal->uiCodingIdx2TemporalId,
4631 sizeof (pOldDlpInternal->uiCodingIdx2TemporalId)); // confirmed_safe_unsafe_usage4631 sizeof (pOldDlpInternal->uiCodingIdx2TemporalId)); // confirmed_safe_unsafe_usage
4632 4632
4633 ++ iIndexD;4633 ++ iIndexD;
4634 } while (iIndexD < pOldParam->iSpatialLayerNum);4634 } while (iIndexD < pOldParam->iSpatialLayerNum);
@@ -4829,8 +4829,8 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 194 unmodified lines
4829 SLayerBSInfo* pLayerBsInfo,4829 SLayerBSInfo* pLayerBsInfo,
4830 int32_t* pNalIdxInLayer,4830 int32_t* pNalIdxInLayer,
4831 int32_t* pLayerSize,4831 int32_t* pLayerSize,
4832 int32_t iFirstMbInPartition, // first mb inclusive in partition4832 int32_t iFirstMbInPartition, // first mb inclusive in partition
4833 int32_t iEndMbInPartition, // end mb exclusive in partition4833 int32_t iEndMbInPartition, // end mb exclusive in partition
4834 int32_t iStartSliceIdx4834 int32_t iStartSliceIdx
4835 ) {4835 ) {
4836 4836
@@ -4860,7 +4860,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 23 unmodified lines
4860 int32_t iSliceSize = 0;4860 int32_t iSliceSize = 0;
4861 int32_t iPayloadSize = 0;4861 int32_t iPayloadSize = 0;
4862 4862
4863 if (iSliceIdx >= (pSliceCtx->iMaxSliceNumConstraint - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[]4863 if (iSliceIdx >= (pSliceCtx->iMaxSliceNumConstraint - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[]
4864 if (pCtx->iActiveThreadsNum == 1) {4864 if (pCtx->iActiveThreadsNum == 1) {
4865 //only single thread support re-alloc now4865 //only single thread support re-alloc now
4866 if (DynSliceRealloc (pCtx, pFrameBSInfo, pLayerBsInfo)) {4866 if (DynSliceRealloc (pCtx, pFrameBSInfo, pLayerBsInfo)) {
@@ -4909,7 +4909,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 42 unmodified lines
4909#endif//SLICE_INFO_OUTPUT4909#endif//SLICE_INFO_OUTPUT
4910 4910
4911 ++ iNalIdxInLayer;4911 ++ iNalIdxInLayer;
4912 iSliceIdx += kiSliceStep; //if uiSliceIdx is not continuous4912 iSliceIdx += kiSliceStep; //if uiSliceIdx is not continuous
4913 iAnyMbLeftInPartition = iEndMbInPartition - (1 + pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId]);4913 iAnyMbLeftInPartition = iEndMbInPartition - (1 + pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId]);
4914 }4914 }
4915 4915

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