Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -494,7 +494,8 @@ void WelsEncoderApplyBitRate (SLogContext* pLogCtx, SWelsSvcCodingParam* pParam, · 493 unmodified lines | ||
| 494 | 494 | pLayerParam = & (pParam->sSpatialLayers[i]); |
| 495 | 495 | fRatio = pLayerParam->iSpatialBitrate / (static_cast<float> (iOrigTotalBitrate)); |
| 496 | 496 | pLayerParam->iSpatialBitrate = static_cast<int32_t> (pParam->iTargetBitrate * fRatio); |
| 497 | − if ( UNSPECIFIED_BIT_RATE != pLayerParam->iMaxSpatialBitrate && pLayerParam->iSpatialBitrate > pLayerParam->iMaxSpatialBitrate ) { | |
| 497 | + if (UNSPECIFIED_BIT_RATE != pLayerParam->iMaxSpatialBitrate | |
| 498 | + && pLayerParam->iSpatialBitrate > pLayerParam->iMaxSpatialBitrate) { | |
| 498 | 499 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 499 | 500 | "WelsEncoderApplyBitRate(), iSpatialBitrate(%d) > iMaxSpatialBitrate(%d) at Layer %d, limiting iSpatialBitrate to iMaxSpatialBitrate!", |
| 500 | 501 | pLayerParam->iSpatialBitrate, pLayerParam->iMaxSpatialBitrate, iLayer); |
| @@ -503,7 +504,8 @@ void WelsEncoderApplyBitRate (SLogContext* pLogCtx, SWelsSvcCodingParam* pParam, · 2 unmodified lines | ||
| 503 | 504 | } |
| 504 | 505 | } else { |
| 505 | 506 | SSpatialLayerConfig* pLayerParam = & (pParam->sSpatialLayers[iLayer]); |
| 506 | − if ( UNSPECIFIED_BIT_RATE != pLayerParam->iMaxSpatialBitrate && pLayerParam->iSpatialBitrate > pLayerParam->iMaxSpatialBitrate ) { | |
| 507 | + if (UNSPECIFIED_BIT_RATE != pLayerParam->iMaxSpatialBitrate | |
| 508 | + && pLayerParam->iSpatialBitrate > pLayerParam->iMaxSpatialBitrate) { | |
| 507 | 509 | WelsLog (pLogCtx, WELS_LOG_WARNING, |
| 508 | 510 | "WelsEncoderApplyBitRate(), iSpatialBitrate(%d) > iMaxSpatialBitrate(%d) at Layer %d, limiting iSpatialBitrate to iMaxSpatialBitrate!", |
| 509 | 511 | pLayerParam->iSpatialBitrate, pLayerParam->iMaxSpatialBitrate, iLayer); |
| @@ -3087,24 +3089,24 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 2577 unmodified lines | ||
| 3087 | 3089 | if (iSpatialNum < 1) { // skip due to temporal layer settings (different frame rate) |
| 3088 | 3090 | ++ pCtx->iCodingIndex; |
| 3089 | 3091 | pFbi->eFrameType = videoFrameTypeSkip; |
| 3090 | − WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld", | |
| 3091 | − pSrcPic->uiTimeStamp); | |
| 3092 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, Frame type =%d", | |
| 3093 | + pSrcPic->uiTimeStamp, pFbi->eFrameType); | |
| 3092 | 3094 | return ENC_RETURN_SUCCESS; |
| 3093 | 3095 | } |
| 3094 | 3096 | |
| 3095 | 3097 | eFrameType = DecideFrameType (pCtx, iSpatialNum); |
| 3096 | 3098 | if (eFrameType == videoFrameTypeSkip) { |
| 3097 | 3099 | pFbi->eFrameType = eFrameType; |
| 3098 | − WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld", | |
| 3099 | − pSrcPic->uiTimeStamp); | |
| 3100 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, Frame type =%d", | |
| 3101 | + pSrcPic->uiTimeStamp, pFbi->eFrameType); | |
| 3100 | 3102 | return ENC_RETURN_SUCCESS; |
| 3101 | 3103 | } |
| 3102 | 3104 | |
| 3103 | 3105 | //loop each layer to check if have skip frame when RC and frame skip enable |
| 3104 | 3106 | if (CheckFrameSkipBasedMaxbr (pCtx, iSpatialNum, eFrameType, pSrcPic->uiTimeStamp)) { |
| 3105 | 3107 | pFbi->eFrameType = videoFrameTypeSkip; |
| 3106 | − WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld", | |
| 3107 | − pSrcPic->uiTimeStamp); | |
| 3108 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_DEBUG, "[Rc] Frame timestamp = %lld, Frame type =%d", | |
| 3109 | + pSrcPic->uiTimeStamp, pFbi->eFrameType); | |
| 3108 | 3110 | return ENC_RETURN_SUCCESS; |
| 3109 | 3111 | } |
| 3110 | 3112 | InitFrameCoding (pCtx, eFrameType); |
| @@ -3701,8 +3703,9 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 590 unmodified lines | ||
| 3701 | 3703 | pFbi->iLayerNum = iLayerNum; |
| 3702 | 3704 | pFbi->iSubSeqId = GetSubSequenceId (pCtx, eFrameType); |
| 3703 | 3705 | |
| 3704 | − WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerNum = %d,iSubSeqId = %d", iLayerNum, | |
| 3705 | − pFbi->iSubSeqId); | |
| 3706 | + WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerNum = %d,iSubSeqId = %d,iFrameSize = %d", | |
| 3707 | + iLayerNum, | |
| 3708 | + pFbi->iSubSeqId, iFrameSize); | |
| 3706 | 3709 | for (int32_t i = 0; i < iLayerNum; i++) |
| 3707 | 3710 | WelsLog (pLogCtx, WELS_LOG_DEBUG, "WelsEncoderEncodeExt() OutputInfo iLayerId = %d,iNalType = %d,iNalCount = %d", i, |
| 3708 | 3711 | pFbi->sLayerInfo[i].uiLayerType, pFbi->sLayerInfo[i].iNalCount); |