History

Merge pull request #1714 from sijchen/fix_ref4

[Encoder] enhance param checking with num-ref and related logging

ruil2 committed 11 years ago

Commit cdd072e2 parents 47dd4de ea06cbe8 files · +133 −54Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+21−6
@@ -242,7 +242,14 @@ int32_t ParamValidation (SLogContext* pLogCtx, SWelsSvcCodingParam* pCfg) { · 241 unmodified lines
242 "bEnableFrameSkip = %d,bitrate can't be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame.",242 "bEnableFrameSkip = %d,bitrate can't be controlled for RC_QUALITY_MODE,RC_BITRATE_MODE and RC_TIMESTAMP_MODE without enabling skip frame.",
243 pCfg->bEnableFrameSkip);243 pCfg->bEnableFrameSkip);
244 }244 }
245 return WelsCheckRefFrameLimitation (pLogCtx, pCfg);245 // ref-frames validation
246 if (((pCfg->iUsageType == CAMERA_VIDEO_REAL_TIME) || (pCfg->iUsageType == SCREEN_CONTENT_REAL_TIME))
247 ? WelsCheckRefFrameLimitationNumRefFirst (pLogCtx, pCfg)
248 : WelsCheckRefFrameLimitationLevelIdcFirst (pLogCtx, pCfg)) {
249 WelsLog (pLogCtx, WELS_LOG_ERROR, "WelsCheckRefFrameLimitation failed");
250 return ENC_RETURN_INVALIDINPUT;
251 }
252 return ENC_RETURN_SUCCESS;
246}253}
247 254
248 255
@@ -4012,12 +4019,20 @@ int32_t WelsEncoderApplyLTR (SLogContext* pLogCtx, sWelsEncCtx** ppCtx, SLTRConf · 3763 unmodified lines
4012 iNumRefFrame = WELS_CLIP3 (iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA);4019 iNumRefFrame = WELS_CLIP3 (iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA);
4013 4020
4014 }4021 }
4015 if (sConfig.iNumRefFrame < iNumRefFrame)4022 if (iNumRefFrame > sConfig.iMaxNumRefFrame) {
4016 sConfig.iNumRefFrame = iNumRefFrame;4023 WelsLog (pLogCtx, WELS_LOG_WARNING,
4017 if (sConfig.iNumRefFrame > sConfig.iMaxNumRefFrame)4024 " CWelsH264SVCEncoder::SetOption LTR flag = %d and number = %d: Required number of reference increased to %d and iMaxNumRefFrame is adjusted",
4018 sConfig.iMaxNumRefFrame = sConfig.iNumRefFrame;4025 sConfig.bEnableLongTermReference, sConfig.iLTRRefNum, iNumRefFrame, sConfig.iMaxNumRefFrame);
4026 sConfig.iMaxNumRefFrame = iNumRefFrame;
4027 }
4019 4028
4020 WelsLog (pLogCtx, WELS_LOG_INFO, " CWelsH264SVCEncoder::SetOption enable LTR = %d,ltrnum = %d",4029 if (sConfig.iNumRefFrame < iNumRefFrame) {
4030 WelsLog (pLogCtx, WELS_LOG_WARNING,
4031 " CWelsH264SVCEncoder::SetOption LTR flag = %d and number = %d, Required number of reference increased from Old = %d to New = %d because of LTR setting",
4032 sConfig.bEnableLongTermReference, sConfig.iLTRRefNum, sConfig.iNumRefFrame, iNumRefFrame);
4033 sConfig.iNumRefFrame = iNumRefFrame;
4034 }
4035 WelsLog (pLogCtx, WELS_LOG_INFO, "CWelsH264SVCEncoder::SetOption enable LTR = %d,ltrnum = %d",
4021 sConfig.bEnableLongTermReference, sConfig.iLTRRefNum);4036 sConfig.bEnableLongTermReference, sConfig.iLTRRefNum);
4022 iRet = WelsEncoderParamAdjust (ppCtx, &sConfig);4037 iRet = WelsEncoderParamAdjust (ppCtx, &sConfig);
4023 return iRet;4038 return iRet;

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