History

reformat cpp files for next release

Sijia Chen committed 12 years ago

Commit 97298de1 parent 452fb867 files · +849 −821Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+18−10
@@ -156,9 +156,9 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 155 unmodified lines
156156 }
157157 if (pSpatialLayer->iMaxSpatialBitrate < pSpatialLayer->iSpatialBitrate * 1.1f) {
158158 WelsLog (pLogCtx, WELS_LOG_WARNING,
159− "MaxSpatialBitrate (%d) should set be larger than 1.1 times of SpatialBitrate (%d)",
160− pSpatialLayer->iMaxSpatialBitrate, pSpatialLayer->iSpatialBitrate);
161− // pSpatialLayer->iSpatialBitrate = (int32_t) (pSpatialLayer->iMaxSpatialBitrate/1.1f);
159+ "MaxSpatialBitrate (%d) should set be larger than 1.1 times of SpatialBitrate (%d)",
160+ pSpatialLayer->iMaxSpatialBitrate, pSpatialLayer->iSpatialBitrate);
161+// pSpatialLayer->iSpatialBitrate = (int32_t) (pSpatialLayer->iMaxSpatialBitrate/1.1f);
162162 }
163163 }
164164 if (iTotalBitrate > pCfg->iTargetBitrate) {
@@ -1357,7 +1357,9 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx) { · 1192 unmodified lines
13571357 iTargetSpatialBsSize = iLayerBsSize;
13581358 iCountBsLen = iNonVclLayersBsSizeCount + iVclLayersBsSizeCount;
13591359
1360− pParam->iNumRefFrame = WELS_CLIP3 (pParam->iNumRefFrame, MIN_REF_PIC_COUNT, (pParam->iUsageType==CAMERA_VIDEO_REAL_TIME?MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA:MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN));
1360+ pParam->iNumRefFrame = WELS_CLIP3 (pParam->iNumRefFrame, MIN_REF_PIC_COUNT,
1361+ (pParam->iUsageType == CAMERA_VIDEO_REAL_TIME ? MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA :
1362+ MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN));
13611363
13621364 // Output
13631365 (*ppCtx)->pOut = (SWelsEncoderOutput*)pMa->WelsMalloc (sizeof (SWelsEncoderOutput), "SWelsEncoderOutput");
@@ -2015,7 +2017,9 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar · 651 unmodified lines
20152017 }
20162018 iRet = pCodingParam->DetermineTemporalSettings();
20172019 if (iRet != ENC_RETURN_SUCCESS) {
2018− WelsLog (pLogCtx, WELS_LOG_ERROR, "WelsInitEncoderExt(), DetermineTemporalSettings failed return %d (check in/out frame rate and temporal layer setting!)", iRet);
2020+ WelsLog (pLogCtx, WELS_LOG_ERROR,
2021+ "WelsInitEncoderExt(), DetermineTemporalSettings failed return %d (check in/out frame rate and temporal layer setting!)",
2022+ iRet);
20192023 return iRet;
20202024 }
20212025 iRet = GetMultipleThreadIdc (pLogCtx, pCodingParam, iSliceNum, iCacheLineSize, uiCpuFeatureFlags);
@@ -3029,21 +3033,24 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1007 unmodified lines
30293033 if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate)
30303034 ++ pCtx->iCodingIndex;
30313035 pFbi->eFrameType = videoFrameTypeSkip;
3032− WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,"[Rc] Frame timestamp = %8" PRId64", skip one frame", (int64_t)pSrcPic->uiTimeStamp);
3036+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %8" PRId64", skip one frame",
3037+ (int64_t)pSrcPic->uiTimeStamp);
30333038 return ENC_RETURN_SUCCESS;
30343039 }
30353040
30363041 eFrameType = DecideFrameType (pCtx, iSpatialNum);
30373042 if (eFrameType == videoFrameTypeSkip) {
30383043 pFbi->eFrameType = eFrameType;
3039− WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,"[Rc] Frame timestamp = %8" PRId64", skip one frame", (int64_t)pSrcPic->uiTimeStamp);
3044+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %8" PRId64", skip one frame",
3045+ (int64_t)pSrcPic->uiTimeStamp);
30403046 return ENC_RETURN_SUCCESS;
30413047 }
30423048
30433049 //loop each layer to check if have skip frame when RC and frame skip enable
30443050 if (CheckFrameSkipBasedMaxbr (pCtx, iSpatialNum, eFrameType, (uint32_t)pSrcPic->uiTimeStamp)) {
30453051 pFbi->eFrameType = videoFrameTypeSkip;
3046− WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,"[Rc] Frame timestamp = %8" PRId64", skip one frame", (int64_t)pSrcPic->uiTimeStamp);
3052+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %8" PRId64", skip one frame",
3053+ (int64_t)pSrcPic->uiTimeStamp);
30473054 return ENC_RETURN_SUCCESS;
30483055 }
30493056
@@ -3427,7 +3434,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 377 unmodified lines
34273434 }
34283435
34293436 pCtx->pFuncList->pfRc.pfWelsRcPictureInfoUpdate (pCtx, iLayerSize);
3430− RcTraceFrameBits (pCtx,pSrcPic->uiTimeStamp);
3437+ RcTraceFrameBits (pCtx, pSrcPic->uiTimeStamp);
34313438 pCtx->pDecPic->iFrameAverageQp = pCtx->pWelsSvcRc->iAverageFrameQp;
34323439
34333440 //update scc related
@@ -3753,7 +3760,8 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 319 unmodified lines
37533760 } else {
37543761 /* maybe adjustment introduced in bitrate or little settings adjustment and so on.. */
37553762 pNewParam->iNumRefFrame = WELS_CLIP3 (pNewParam->iNumRefFrame, MIN_REF_PIC_COUNT,
3756− (pNewParam->iUsageType==CAMERA_VIDEO_REAL_TIME?MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA:MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN));
3763+ (pNewParam->iUsageType == CAMERA_VIDEO_REAL_TIME ? MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA :
3764+ MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN));
37573765 pNewParam->iLoopFilterDisableIdc = WELS_CLIP3 (pNewParam->iLoopFilterDisableIdc, 0, 6);
37583766 pNewParam->iLoopFilterAlphaC0Offset = WELS_CLIP3 (pNewParam->iLoopFilterAlphaC0Offset, -6, 6);
37593767 pNewParam->iLoopFilterBetaOffset = WELS_CLIP3 (pNewParam->iLoopFilterBetaOffset, -6, 6);

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