History

bEnableSceneChangeDetect should be true for screen content

ruil2 committed 12 years ago

Commit b52aff71 parent f22a9e81 file · +11 −4Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+11−4
@@ -92,10 +92,17 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 91 unmodified lines
92 return ENC_RETURN_UNSUPPORTED_PARA;92 return ENC_RETURN_UNSUPPORTED_PARA;
93 }93 }
94 if (pCfg->bEnableAdaptiveQuant) {94 if (pCfg->bEnableAdaptiveQuant) {
95 WelsLog (pLogCtx, WELS_LOG_WARNING, "ParamValidation(), AdaptiveQuant(%d) is not supported yet for screen content, auto turned off\n",95 WelsLog (pLogCtx, WELS_LOG_WARNING,
96 "ParamValidation(), AdaptiveQuant(%d) is not supported yet for screen content, auto turned off\n",
96 pCfg->bEnableAdaptiveQuant);97 pCfg->bEnableAdaptiveQuant);
97 pCfg->bEnableAdaptiveQuant = false;98 pCfg->bEnableAdaptiveQuant = false;
98 }99 }
100 if (pCfg->bEnableSceneChangeDetect == false) {
101 pCfg->bEnableSceneChangeDetect = true;
102 WelsLog (pLogCtx, WELS_LOG_WARNING,
103 "ParamValidation(), screen change detection should be turned on,change bEnableSceneChangeDetect as true\n");
104 }
105
99 }106 }
100 if (pCfg->iSpatialLayerNum > 1) {107 if (pCfg->iSpatialLayerNum > 1) {
101 int32_t iFinalWidth = pCfg->sSpatialLayers[pCfg->iSpatialLayerNum - 1].iVideoWidth;108 int32_t iFinalWidth = pCfg->sSpatialLayers[pCfg->iSpatialLayerNum - 1].iVideoWidth;
@@ -2931,13 +2938,13 @@ int32_t GetSubSequenceId (sWelsEncCtx* pCtx, EVideoFrameType eFrameType) { · 2829 unmodified lines
2931}2938}
2932 2939
2933//loop each layer to check if have skip frame when RC and frame skip enable (maxbr>0)2940//loop each layer to check if have skip frame when RC and frame skip enable (maxbr>0)
2934bool CheckFrameSkipBasedMaxbr(sWelsEncCtx* pCtx, int32_t iSpatialNum) {2941bool CheckFrameSkipBasedMaxbr (sWelsEncCtx* pCtx, int32_t iSpatialNum) {
2935 SSpatialPicIndex* pSpatialIndexMap = &pCtx->sSpatialIndexMap[0];2942 SSpatialPicIndex* pSpatialIndexMap = &pCtx->sSpatialIndexMap[0];
2936 bool bSkipMustFlag = false;2943 bool bSkipMustFlag = false;
2937 2944
2938 if (RC_OFF_MODE != pCtx->pSvcParam->iRCMode && true == pCtx->pSvcParam->bEnableFrameSkip) {2945 if (RC_OFF_MODE != pCtx->pSvcParam->iRCMode && true == pCtx->pSvcParam->bEnableFrameSkip) {
2939 for (int32_t i = 0; i < iSpatialNum; i++) {2946 for (int32_t i = 0; i < iSpatialNum; i++) {
2940 if(0 == pCtx->pSvcParam->sSpatialLayers[i].iMaxSpatialBitrate) {2947 if (0 == pCtx->pSvcParam->sSpatialLayers[i].iMaxSpatialBitrate) {
2941 break;2948 break;
2942 }2949 }
2943 pCtx->uiDependencyId = (uint8_t) (pSpatialIndexMap + i)->iDid;2950 pCtx->uiDependencyId = (uint8_t) (pSpatialIndexMap + i)->iDid;
@@ -3011,7 +3018,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo* pFbi, const SSour · 67 unmodified lines
3011 }3018 }
3012 3019
3013 //loop each layer to check if have skip frame when RC and frame skip enable3020 //loop each layer to check if have skip frame when RC and frame skip enable
3014 if (CheckFrameSkipBasedMaxbr(pCtx, iSpatialNum)) {3021 if (CheckFrameSkipBasedMaxbr (pCtx, iSpatialNum)) {
3015 pFbi->eFrameType = videoFrameTypeSkip;3022 pFbi->eFrameType = videoFrameTypeSkip;
3016 return ENC_RETURN_SUCCESS;3023 return ENC_RETURN_SUCCESS;
3017 }3024 }

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