History

Merge pull request #1439 from sijchen/for_format

[Reformat] format cpp files for next release

sijchen committed 12 years ago

Commit 43c62d02 parents 5d6b201 4e89e7114 files · +984 −939Browse files

Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 14 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);
@@ -3031,21 +3035,24 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 1009 unmodified lines
30313035 if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate)
30323036 ++ pCtx->iCodingIndex;
30333037 pFbi->eFrameType = videoFrameTypeSkip;
3034− WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,"[Rc] Frame timestamp = %8" PRId64", skip one frame", (int64_t)pSrcPic->uiTimeStamp);
3038+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %8" PRId64", skip one frame",
3039+ (int64_t)pSrcPic->uiTimeStamp);
30353040 return ENC_RETURN_SUCCESS;
30363041 }
30373042
30383043 eFrameType = DecideFrameType (pCtx, iSpatialNum);
30393044 if (eFrameType == videoFrameTypeSkip) {
30403045 pFbi->eFrameType = eFrameType;
3041− WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,"[Rc] Frame timestamp = %8" PRId64", skip one frame", (int64_t)pSrcPic->uiTimeStamp);
3046+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %8" PRId64", skip one frame",
3047+ (int64_t)pSrcPic->uiTimeStamp);
30423048 return ENC_RETURN_SUCCESS;
30433049 }
30443050
30453051 //loop each layer to check if have skip frame when RC and frame skip enable
30463052 if (CheckFrameSkipBasedMaxbr (pCtx, iSpatialNum, eFrameType, (uint32_t)pSrcPic->uiTimeStamp)) {
30473053 pFbi->eFrameType = videoFrameTypeSkip;
3048− WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,"[Rc] Frame timestamp = %8" PRId64", skip one frame", (int64_t)pSrcPic->uiTimeStamp);
3054+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %8" PRId64", skip one frame",
3055+ (int64_t)pSrcPic->uiTimeStamp);
30493056 return ENC_RETURN_SUCCESS;
30503057 }
30513058
@@ -3429,7 +3436,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 377 unmodified lines
34293436 }
34303437
34313438 pCtx->pFuncList->pfRc.pfWelsRcPictureInfoUpdate (pCtx, iLayerSize);
3432− RcTraceFrameBits (pCtx,pSrcPic->uiTimeStamp);
3439+ RcTraceFrameBits (pCtx, pSrcPic->uiTimeStamp);
34333440 pCtx->pDecPic->iFrameAverageQp = pCtx->pWelsSvcRc->iAverageFrameQp;
34343441
34353442 //update scc related
@@ -3760,7 +3767,8 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 324 unmodified lines
37603767 } else {
37613768 /* maybe adjustment introduced in bitrate or little settings adjustment and so on.. */
37623769 pNewParam->iNumRefFrame = WELS_CLIP3 (pNewParam->iNumRefFrame, MIN_REF_PIC_COUNT,
3763− (pNewParam->iUsageType==CAMERA_VIDEO_REAL_TIME?MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA:MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN));
3770+ (pNewParam->iUsageType == CAMERA_VIDEO_REAL_TIME ? MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA :
3771+ MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN));
37643772 pNewParam->iLoopFilterDisableIdc = WELS_CLIP3 (pNewParam->iLoopFilterDisableIdc, 0, 6);
37653773 pNewParam->iLoopFilterAlphaC0Offset = WELS_CLIP3 (pNewParam->iLoopFilterAlphaC0Offset, -6, 6);
37663774 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