History

add debug info for RC max bitrate control test

lyao2 committed 12 years ago

Commit 3904c021 parent e4b373a3 files · +45 −27Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+10−0
@@ -167,6 +167,12 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 166 unmodified lines
167167 pSpatialLayer->iSpatialBitrate);
168168 return ENC_RETURN_INVALIDINPUT;
169169 }
170+ if (pSpatialLayer->iMaxSpatialBitrate < pSpatialLayer->iSpatialBitrate * 1.1f) {
171+ WelsLog (pLogCtx, WELS_LOG_WARNING,
172+ "MaxSpatialBitrate (%d) should set be larger than 1.1 times of SpatialBitrate (%d)",
173+ pSpatialLayer->iMaxSpatialBitrate, pSpatialLayer->iSpatialBitrate);
174+ // pSpatialLayer->iSpatialBitrate = (int32_t) (pSpatialLayer->iMaxSpatialBitrate/1.1f);
175+ }
170176 }
171177 if (iTotalBitrate > pCfg->iTargetBitrate) {
172178 WelsLog (pLogCtx, WELS_LOG_ERROR,
@@ -3032,18 +3038,21 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 2859 unmodified lines
30323038 if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate)
30333039 ++ pCtx->iCodingIndex;
30343040 pFbi->eFrameType = videoFrameTypeSkip;
3041+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,"[Rc] Frame timestamp = %8d, skip one frame",pSrcPic->uiTimeStamp);
30353042 return ENC_RETURN_SUCCESS;
30363043 }
30373044
30383045 eFrameType = DecideFrameType (pCtx, iSpatialNum);
30393046 if (eFrameType == videoFrameTypeSkip) {
30403047 pFbi->eFrameType = eFrameType;
3048+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,"[Rc] Frame timestamp = %8d, skip one frame",pSrcPic->uiTimeStamp);
30413049 return ENC_RETURN_SUCCESS;
30423050 }
30433051
30443052 //loop each layer to check if have skip frame when RC and frame skip enable
30453053 if (CheckFrameSkipBasedMaxbr (pCtx, iSpatialNum, eFrameType, (uint32_t)pSrcPic->uiTimeStamp)) {
30463054 pFbi->eFrameType = videoFrameTypeSkip;
3055+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG,"[Rc] Frame timestamp = %8d, skip one frame",pSrcPic->uiTimeStamp);
30473056 return ENC_RETURN_SUCCESS;
30483057 }
30493058
@@ -3427,6 +3436,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 377 unmodified lines
34273436 }
34283437
34293438 pCtx->pFuncList->pfRc.pfWelsRcPictureInfoUpdate (pCtx, iLayerSize);
3439+ RcTraceFrameBits (pCtx,pSrcPic->uiTimeStamp);
34303440 pCtx->pDecPic->iFrameAverageQp = pCtx->pWelsSvcRc->iAverageFrameQp;
34313441
34323442 //update scc related

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