History

fix bug when some parameters change dynamically

ruil2 committed 11 years ago

Commit ce14a0e1 parent 3244f112 files · +25 −5Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+6−3
@@ -212,7 +212,7 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 211 unmodified lines
212 }212 }
213 213
214 if ((pCfg->iRCMode != RC_OFF_MODE) && (pCfg->iRCMode != RC_QUALITY_MODE) && (pCfg->iRCMode != RC_BUFFERBASED_MODE)214 if ((pCfg->iRCMode != RC_OFF_MODE) && (pCfg->iRCMode != RC_QUALITY_MODE) && (pCfg->iRCMode != RC_BUFFERBASED_MODE)
215 && (pCfg->iRCMode != RC_BITRATE_MODE)&& (pCfg->iRCMode != RC_TIMESTAMP_MODE)) {215 && (pCfg->iRCMode != RC_BITRATE_MODE) && (pCfg->iRCMode != RC_TIMESTAMP_MODE)) {
216 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidation(),Invalid iRCMode = %d", pCfg->iRCMode);216 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidation(),Invalid iRCMode = %d", pCfg->iRCMode);
217 return ENC_RETURN_UNSUPPORTED_PARA;217 return ENC_RETURN_UNSUPPORTED_PARA;
218 }218 }
@@ -541,7 +541,8 @@ void WelsEncoderApplyFrameRate (SWelsSvcCodingParam* pParam) { · 322 unmodified lines
541 || (kfMaxFrameRate - pLayerParamInternal->fInputFrameRate) < -kfEpsn) {541 || (kfMaxFrameRate - pLayerParamInternal->fInputFrameRate) < -kfEpsn) {
542 pLayerParamInternal->fInputFrameRate = kfMaxFrameRate;542 pLayerParamInternal->fInputFrameRate = kfMaxFrameRate;
543 fTargetOutputFrameRate = kfMaxFrameRate * fRatio;543 fTargetOutputFrameRate = kfMaxFrameRate * fRatio;
544 pLayerParamInternal->fOutputFrameRate = (fTargetOutputFrameRate >= 6) ? fTargetOutputFrameRate : (pLayerParamInternal->fInputFrameRate);544 pLayerParamInternal->fOutputFrameRate = (fTargetOutputFrameRate >= 6) ? fTargetOutputFrameRate :
545 (pLayerParamInternal->fInputFrameRate);
545 pLayerParam->fFrameRate = pLayerParamInternal->fOutputFrameRate;546 pLayerParam->fFrameRate = pLayerParamInternal->fOutputFrameRate;
546 //TODO:{Sijia} from design, there is no sense to have temporal layer when under 6fps even with such setting?547 //TODO:{Sijia} from design, there is no sense to have temporal layer when under 6fps even with such setting?
547 }548 }
@@ -3824,7 +3825,9 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 3276 unmodified lines
3824 || pOldParam->SUsedPicRect.iHeight != pNewParam->SUsedPicRect.iHeight) ||3825 || pOldParam->SUsedPicRect.iHeight != pNewParam->SUsedPicRect.iHeight) ||
3825 (pOldParam->bEnableLongTermReference != pNewParam->bEnableLongTermReference) ||3826 (pOldParam->bEnableLongTermReference != pNewParam->bEnableLongTermReference) ||
3826 (pOldParam->iLTRRefNum != pNewParam->iLTRRefNum) ||3827 (pOldParam->iLTRRefNum != pNewParam->iLTRRefNum) ||
3827 (pOldParam->iMultipleThreadIdc != pNewParam->iMultipleThreadIdc);3828 (pOldParam->iMultipleThreadIdc != pNewParam->iMultipleThreadIdc) ||
3829 (pOldParam->bEnableBackgroundDetection != pNewParam->bEnableBackgroundDetection) ||
3830 (pOldParam->bEnableAdaptiveQuant != pNewParam->bEnableAdaptiveQuant);
3828 if (pNewParam->iMaxNumRefFrame > pOldParam->iMaxNumRefFrame) {3831 if (pNewParam->iMaxNumRefFrame > pOldParam->iMaxNumRefFrame) {
3829 bNeedReset = true;3832 bNeedReset = true;
3830 }3833 }

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