update format
This commit is contained in:
parent
cd75541c8f
commit
57c87f1845
@ -189,7 +189,8 @@ int32_t SliceArgumentValidationFixedSliceMode(SLogContext* pLogCtx,
|
||||
}
|
||||
|
||||
if (pSliceArgument->uiSliceNum <= 1) {
|
||||
WelsLog (pLogCtx, WELS_LOG_INFO, "SliceArgumentValidationFixedSliceMode(), uiSliceNum(%d) you set for SM_FIXEDSLCNUM_SLICE, now turn to SM_SINGLE_SLICE type!",
|
||||
WelsLog (pLogCtx, WELS_LOG_INFO,
|
||||
"SliceArgumentValidationFixedSliceMode(), uiSliceNum(%d) you set for SM_FIXEDSLCNUM_SLICE, now turn to SM_SINGLE_SLICE type!",
|
||||
pSliceArgument->uiSliceNum);
|
||||
bSingleMode = true;
|
||||
}
|
||||
@ -197,7 +198,8 @@ int32_t SliceArgumentValidationFixedSliceMode(SLogContext* pLogCtx,
|
||||
// considering the coding efficient and performance,
|
||||
// iCountMbNum constraint by MIN_NUM_MB_PER_SLICE condition of multi-pSlice mode settting
|
||||
if (iMbNumInFrame <= MIN_NUM_MB_PER_SLICE) {
|
||||
WelsLog (pLogCtx, WELS_LOG_INFO, "SliceArgumentValidationFixedSliceMode(), uiSliceNum(%d) you set for SM_FIXEDSLCNUM_SLICE, now turn to SM_SINGLE_SLICE type as CountMbNum less than MIN_NUM_MB_PER_SLICE!",
|
||||
WelsLog (pLogCtx, WELS_LOG_INFO,
|
||||
"SliceArgumentValidationFixedSliceMode(), uiSliceNum(%d) you set for SM_FIXEDSLCNUM_SLICE, now turn to SM_SINGLE_SLICE type as CountMbNum less than MIN_NUM_MB_PER_SLICE!",
|
||||
pSliceArgument->uiSliceNum);
|
||||
bSingleMode = true;
|
||||
}
|
||||
@ -213,14 +215,16 @@ int32_t SliceArgumentValidationFixedSliceMode(SLogContext* pLogCtx,
|
||||
|
||||
if (pSliceArgument->uiSliceNum > MAX_SLICES_NUM) {
|
||||
pSliceArgument->uiSliceNum = MAX_SLICES_NUM;
|
||||
WelsLog (pLogCtx, WELS_LOG_WARNING, "SliceArgumentValidationFixedSliceMode(), uiSliceNum exceed MAX_SLICES_NUM! So setting slice num eqaul to MAX_SLICES_NUM(%d)!",
|
||||
WelsLog (pLogCtx, WELS_LOG_WARNING,
|
||||
"SliceArgumentValidationFixedSliceMode(), uiSliceNum exceed MAX_SLICES_NUM! So setting slice num eqaul to MAX_SLICES_NUM(%d)!",
|
||||
pSliceArgument->uiSliceNum);
|
||||
}
|
||||
|
||||
if (kiRCMode != RC_OFF_MODE) { // multiple slices verify with gom
|
||||
//check uiSliceNum and set uiSliceMbNum with current uiSliceNum
|
||||
if (!GomValidCheckSliceNum (iMbWidth, iMbHeight, &pSliceArgument->uiSliceNum)) {
|
||||
WelsLog (pLogCtx, WELS_LOG_WARNING, "SliceArgumentValidationFixedSliceMode(), unsupported setting with Resolution and uiSliceNum combination under RC on! So uiSliceNum is changed to %d!",
|
||||
WelsLog (pLogCtx, WELS_LOG_WARNING,
|
||||
"SliceArgumentValidationFixedSliceMode(), unsupported setting with Resolution and uiSliceNum combination under RC on! So uiSliceNum is changed to %d!",
|
||||
pSliceArgument->uiSliceNum);
|
||||
}
|
||||
|
||||
@ -500,7 +504,8 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa
|
||||
return ENC_RETURN_UNSUPPORTED_PARA;
|
||||
}
|
||||
if ((pCodingParam->uiMaxNalSize != 0) && (pSpatialLayer->sSliceArgument.uiSliceMode != SM_SIZELIMITED_SLICE)) {
|
||||
WelsLog (pLogCtx, WELS_LOG_WARNING, "ParamValidationExt(), current layer %d uiSliceMode (%d) settings may not fulfill MaxNalSize = %d", i,
|
||||
WelsLog (pLogCtx, WELS_LOG_WARNING,
|
||||
"ParamValidationExt(), current layer %d uiSliceMode (%d) settings may not fulfill MaxNalSize = %d", i,
|
||||
pSpatialLayer->sSliceArgument.uiSliceMode, pCodingParam->uiMaxNalSize);
|
||||
}
|
||||
CheckProfileSetting (pLogCtx, pCodingParam, i, pSpatialLayer->uiProfileIdc);
|
||||
@ -1176,7 +1181,8 @@ static inline int32_t InitDqLayers (sWelsEncCtx** ppCtx, SExistingParasetList* p
|
||||
int32_t iPicWidth = WELS_ALIGN (kiWidth, MB_WIDTH_LUMA) + (PADDING_LENGTH << 1); // with iWidth of horizon
|
||||
int32_t iPicChromaWidth = iPicWidth >> 1;
|
||||
|
||||
iPicWidth = WELS_ALIGN (iPicWidth, 32); // 32(or 16 for chroma below) to match original imp. here instead of iCacheLineSize
|
||||
iPicWidth = WELS_ALIGN (iPicWidth,
|
||||
32); // 32(or 16 for chroma below) to match original imp. here instead of iCacheLineSize
|
||||
iPicChromaWidth = WELS_ALIGN (iPicChromaWidth, 16);
|
||||
|
||||
WelsGetEncBlockStrideOffset ((*ppCtx)->pStrideTab->pStrideEncBlockOffset[iDlayerIndex], iPicWidth, iPicChromaWidth);
|
||||
@ -1826,7 +1832,8 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa
|
||||
uiMaxSliceNumEstimation = WELS_MIN (AVERSLICENUM_CONSTRAINT,
|
||||
(iLayerBsSize / pSliceArgument->uiSliceSizeConstraint) + 1);
|
||||
(*ppCtx)->iMaxSliceCount = WELS_MAX ((*ppCtx)->iMaxSliceCount, (int) uiMaxSliceNumEstimation);
|
||||
iSliceBufferSize = (WELS_MAX(pSliceArgument->uiSliceSizeConstraint, iLayerBsSize/uiMaxSliceNumEstimation)<<1) + MAX_MACROBLOCK_SIZE_IN_BYTE_x2;
|
||||
iSliceBufferSize = (WELS_MAX (pSliceArgument->uiSliceSizeConstraint,
|
||||
iLayerBsSize / uiMaxSliceNumEstimation) << 1) + MAX_MACROBLOCK_SIZE_IN_BYTE_x2;
|
||||
} else {
|
||||
(*ppCtx)->iMaxSliceCount = WELS_MAX ((*ppCtx)->iMaxSliceCount, (int) pSliceArgument->uiSliceNum);
|
||||
iSliceBufferSize = ((iLayerBsSize / pSliceArgument->uiSliceNum) << 1) + MAX_MACROBLOCK_SIZE_IN_BYTE_x2;
|
||||
@ -1866,7 +1873,8 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa
|
||||
(*ppCtx)->iPosBsBuffer = 0;
|
||||
|
||||
// for pSlice bs buffers
|
||||
if (pParam->iMultipleThreadIdc > 1 && RequestMtResource (ppCtx, pParam, iCountBsLen, iMaxSliceBufferSize, bDynamicSlice)) {
|
||||
if (pParam->iMultipleThreadIdc > 1
|
||||
&& RequestMtResource (ppCtx, pParam, iCountBsLen, iMaxSliceBufferSize, bDynamicSlice)) {
|
||||
WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_WARNING, "RequestMemorySvc(), RequestMtResource failed!");
|
||||
FreeMemorySvc (ppCtx);
|
||||
return 1;
|
||||
@ -2380,7 +2388,8 @@ void OutputCpuFeaturesLog (SLogContext* pLogCtx, uint32_t uiCpuFeatureFlags, uin
|
||||
int32_t GetMultipleThreadIdc (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingParam, int16_t& iSliceNum,
|
||||
int32_t& iCacheLineSize, uint32_t& uiCpuFeatureFlags) {
|
||||
// for cpu features detection, Only detect once??
|
||||
int32_t uiCpuCores = 0; // number of logic processors on physical processor package, zero logic processors means HTT not supported
|
||||
int32_t uiCpuCores =
|
||||
0; // number of logic processors on physical processor package, zero logic processors means HTT not supported
|
||||
uiCpuFeatureFlags = WelsCPUFeatureDetect (&uiCpuCores); // detect cpu capacity features
|
||||
|
||||
#ifdef X86_ASM
|
||||
@ -3709,7 +3718,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
int32_t iDidList[MAX_DEPENDENCY_LAYER] = {0};
|
||||
int32_t iLayerNum = 0;
|
||||
int32_t iLayerSize = 0;
|
||||
int32_t iSpatialNum = 0; // available count number of spatial layers due to frame size changed in this given frame
|
||||
int32_t iSpatialNum =
|
||||
0; // available count number of spatial layers due to frame size changed in this given frame
|
||||
int32_t iSpatialIdx = 0; // iIndex of spatial layers due to frame size changed in this given frame
|
||||
int32_t iFrameSize = 0;
|
||||
int32_t iNalIdxInLayer = 0;
|
||||
@ -4009,7 +4019,8 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour
|
||||
#else
|
||||
int32_t iEndMbIdx = pCtx->pCurDqLayer->sSliceEncCtx.iMbNumInFrame;
|
||||
for (int32_t iIdx = kiPartitionCnt - 1; iIdx >= 0; --iIdx) {
|
||||
const int32_t iFirstMbIdx = pCtx->pCurDqLayer->sLayerInfo.pSliceInLayer[iIdx].sSliceHeaderExt.sSliceHeader.iFirstMbInSlice;
|
||||
const int32_t iFirstMbIdx =
|
||||
pCtx->pCurDqLayer->sLayerInfo.pSliceInLayer[iIdx].sSliceHeaderExt.sSliceHeader.iFirstMbInSlice;
|
||||
pCtx->pSliceThreading->pThreadPEncCtx[iIdx].iStartMbIndex = iFirstMbIdx;
|
||||
pCtx->pSliceThreading->pThreadPEncCtx[iIdx].iEndMbIndex = iEndMbIdx;
|
||||
iEndMbIdx = iFirstMbIdx;
|
||||
@ -4466,7 +4477,8 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa
|
||||
break;
|
||||
}
|
||||
|
||||
if (pOldParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceMode != pNewParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceMode
|
||||
if (pOldParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceMode !=
|
||||
pNewParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceMode
|
||||
||
|
||||
pOldParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceNum !=
|
||||
pNewParam->sSpatialLayers[iIndexD].sSliceArgument.uiSliceNum) {
|
||||
@ -4612,13 +4624,16 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa
|
||||
/* Motion search */
|
||||
|
||||
/* Deblocking loop filter */
|
||||
pOldParam->iLoopFilterDisableIdc = pNewParam->iLoopFilterDisableIdc; // 0: on, 1: off, 2: on except for slice boundaries
|
||||
pOldParam->iLoopFilterDisableIdc =
|
||||
pNewParam->iLoopFilterDisableIdc; // 0: on, 1: off, 2: on except for slice boundaries
|
||||
pOldParam->iLoopFilterAlphaC0Offset = pNewParam->iLoopFilterAlphaC0Offset;// AlphaOffset: valid range [-6, 6], default 0
|
||||
pOldParam->iLoopFilterBetaOffset = pNewParam->iLoopFilterBetaOffset; // BetaOffset: valid range [-6, 6], default 0
|
||||
pOldParam->iLoopFilterBetaOffset =
|
||||
pNewParam->iLoopFilterBetaOffset; // BetaOffset: valid range [-6, 6], default 0
|
||||
|
||||
/* Rate Control */
|
||||
pOldParam->iRCMode = pNewParam->iRCMode;
|
||||
pOldParam->iTargetBitrate = pNewParam->iTargetBitrate; // overall target bitrate introduced in RC module
|
||||
pOldParam->iTargetBitrate =
|
||||
pNewParam->iTargetBitrate; // overall target bitrate introduced in RC module
|
||||
pOldParam->iPaddingFlag = pNewParam->iPaddingFlag;
|
||||
|
||||
/* Layer definition */
|
||||
@ -4637,7 +4652,8 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa
|
||||
pOldDlpInternal->fOutputFrameRate = pNewDlpInternal->fOutputFrameRate; // output frame rate
|
||||
pOldDlp->iSpatialBitrate = pNewDlp->iSpatialBitrate;
|
||||
|
||||
pOldDlp->uiProfileIdc = pNewDlp->uiProfileIdc; // value of profile IDC (0 for auto-detection)
|
||||
pOldDlp->uiProfileIdc =
|
||||
pNewDlp->uiProfileIdc; // value of profile IDC (0 for auto-detection)
|
||||
pOldDlp->iDLayerQp = pNewDlp->iDLayerQp;
|
||||
|
||||
/* Derived variants below */
|
||||
@ -4800,7 +4816,8 @@ int32_t DynSliceRealloc (sWelsEncCtx* pCtx,
|
||||
pSORC->iCalculatedQpSlice = pCtx->iGlobalQp;
|
||||
pSORC->iTotalQpSlice = 0;
|
||||
pSORC->iTotalMbSlice = 0;
|
||||
pSORC->iTargetBitsSlice = WELS_DIV_ROUND (kiBitsPerMb * pCurLayer->sLayerInfo.pSliceInLayer[uiSliceIdx].iCountMbNumInSlice,
|
||||
pSORC->iTargetBitsSlice = WELS_DIV_ROUND (kiBitsPerMb *
|
||||
pCurLayer->sLayerInfo.pSliceInLayer[uiSliceIdx].iCountMbNumInSlice,
|
||||
INT_MULTIPLY);
|
||||
pSORC->iFrameBitsSlice = 0;
|
||||
pSORC->iGomBitsSlice = 0;
|
||||
@ -4845,7 +4862,8 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx,
|
||||
//init
|
||||
{
|
||||
pStartSlice->sSliceHeaderExt.sSliceHeader.iFirstMbInSlice = iFirstMbInPartition;
|
||||
pCurLayer->pNumSliceCodedOfPartition[kiPartitionId] = 1; // one slice per partition intialized, dynamic slicing inside
|
||||
pCurLayer->pNumSliceCodedOfPartition[kiPartitionId] =
|
||||
1; // one slice per partition intialized, dynamic slicing inside
|
||||
pCurLayer->pLastMbIdxOfPartition[kiPartitionId] = iEndMbInPartition - 1;
|
||||
}
|
||||
pCurLayer->pLastCodedMbIdxOfPartition[kiPartitionId] = 0;
|
||||
|
@ -402,7 +402,8 @@ int CWelsH264SVCEncoder ::EncodeFrameInternal (const SSourcePicture* pSrcPic, S
|
||||
const int32_t kiEncoderReturn = WelsEncoderEncodeExt (m_pEncContext, pBsInfo, pSrcPic);
|
||||
const int64_t kiCurrentFrameMs = (WelsTime() - kiBeforeFrameUs) / 1000;
|
||||
|
||||
if ((kiEncoderReturn == ENC_RETURN_MEMALLOCERR) || (kiEncoderReturn == ENC_RETURN_MEMOVERFLOWFOUND) || (kiEncoderReturn == ENC_RETURN_VLCOVERFLOWFOUND)) {
|
||||
if ((kiEncoderReturn == ENC_RETURN_MEMALLOCERR) || (kiEncoderReturn == ENC_RETURN_MEMOVERFLOWFOUND)
|
||||
|| (kiEncoderReturn == ENC_RETURN_VLCOVERFLOWFOUND)) {
|
||||
WelsUninitEncoderExt (&m_pEncContext);
|
||||
return cmMallocMemeError;
|
||||
} else if ((kiEncoderReturn != ENC_RETURN_SUCCESS) && (kiEncoderReturn == ENC_RETURN_CORRECTED)) {
|
||||
@ -615,8 +616,10 @@ void CWelsH264SVCEncoder::UpdateStatistics (const int64_t kiCurrentFrameTs, EVid
|
||||
|
||||
if (WELS_ABS (pStatistics->fLatestFrameRate - m_pEncContext->pSvcParam->fMaxFrameRate) > 30) {
|
||||
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING,
|
||||
"Actual input fLatestFrameRate = %f is quite different from framerate in setting %f, please check setting or timestamp unit (ms), cur_Ts = %" PRId64 " start_Ts = %" PRId64,
|
||||
pStatistics->fLatestFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate, kiCurrentFrameTs, static_cast<int64_t> (pStatistics->iStatisticsTs) );
|
||||
"Actual input fLatestFrameRate = %f is quite different from framerate in setting %f, please check setting or timestamp unit (ms), cur_Ts = %"
|
||||
PRId64 " start_Ts = %" PRId64,
|
||||
pStatistics->fLatestFrameRate, m_pEncContext->pSvcParam->fMaxFrameRate, kiCurrentFrameTs,
|
||||
static_cast<int64_t> (pStatistics->iStatisticsTs));
|
||||
}
|
||||
|
||||
if (m_pEncContext->pSvcParam->iRCMode == RC_QUALITY_MODE || m_pEncContext->pSvcParam->iRCMode == RC_BITRATE_MODE) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user