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
212212 }
213213
214214 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)) {
216216 WelsLog (pLogCtx, WELS_LOG_ERROR, "ParamValidation(),Invalid iRCMode = %d", pCfg->iRCMode);
217217 return ENC_RETURN_UNSUPPORTED_PARA;
218218 }
@@ -541,7 +541,8 @@ void WelsEncoderApplyFrameRate (SWelsSvcCodingParam* pParam) { · 322 unmodified lines
541541 || (kfMaxFrameRate - pLayerParamInternal->fInputFrameRate) < -kfEpsn) {
542542 pLayerParamInternal->fInputFrameRate = kfMaxFrameRate;
543543 fTargetOutputFrameRate = kfMaxFrameRate * fRatio;
544− pLayerParamInternal->fOutputFrameRate = (fTargetOutputFrameRate >= 6) ? fTargetOutputFrameRate : (pLayerParamInternal->fInputFrameRate);
544+ pLayerParamInternal->fOutputFrameRate = (fTargetOutputFrameRate >= 6) ? fTargetOutputFrameRate :
545+ (pLayerParamInternal->fInputFrameRate);
545546 pLayerParam->fFrameRate = pLayerParamInternal->fOutputFrameRate;
546547 //TODO:{Sijia} from design, there is no sense to have temporal layer when under 6fps even with such setting?
547548 }
@@ -3824,7 +3825,9 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 3276 unmodified lines
38243825 || pOldParam->SUsedPicRect.iHeight != pNewParam->SUsedPicRect.iHeight) ||
38253826 (pOldParam->bEnableLongTermReference != pNewParam->bEnableLongTermReference) ||
38263827 (pOldParam->iLTRRefNum != pNewParam->iLTRRefNum) ||
3827− (pOldParam->iMultipleThreadIdc != pNewParam->iMultipleThreadIdc);
3828+ (pOldParam->iMultipleThreadIdc != pNewParam->iMultipleThreadIdc) ||
3829+ (pOldParam->bEnableBackgroundDetection != pNewParam->bEnableBackgroundDetection) ||
3830+ (pOldParam->bEnableAdaptiveQuant != pNewParam->bEnableAdaptiveQuant);
38283831 if (pNewParam->iMaxNumRefFrame > pOldParam->iMaxNumRefFrame) {
38293832 bNeedReset = true;
38303833 }

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