History

remove duplicate constant macro and modify the num_ref check accordingly

Sijia Chen committed 12 years ago

Commit 05684741 parent 25b723c4 files · +9 −8Browse files

Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 4 files). Show all

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+3−2
@@ -325,7 +325,7 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 324 unmodified lines
325 if (pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT) {325 if (pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT) {
326 pCfg->iNumRefFrame = ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) :326 pCfg->iNumRefFrame = ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) :
327 (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum);327 (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum);
328 pCfg->iNumRefFrame = WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM);328 pCfg->iNumRefFrame = WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA);
329 }329 }
330 }330 }
331 if (pCfg->iNumRefFrame > pCfg->iMaxNumRefFrame)331 if (pCfg->iNumRefFrame > pCfg->iMaxNumRefFrame)
@@ -519,8 +519,9 @@ void CWelsH264SVCEncoder::CheckLevelSetting (int32_t iLayer, ELevelIdc uiLevelId · 187 unmodified lines
519 }519 }
520}520}
521void CWelsH264SVCEncoder::CheckReferenceNumSetting (int32_t iNumRef) {521void CWelsH264SVCEncoder::CheckReferenceNumSetting (int32_t iNumRef) {
522 int32_t iRefUpperBound = (m_pEncContext->pSvcParam->iUsageType == CAMERA_VIDEO_REAL_TIME)?MAX_REFERENCE_PICTURE_COUNT_NUM_CAMERA:MAX_REFERENCE_PICTURE_COUNT_NUM_SCREEN;
522 m_pEncContext->pSvcParam->iNumRefFrame = iNumRef;523 m_pEncContext->pSvcParam->iNumRefFrame = iNumRef;
523 if ((iNumRef < MIN_REF_PIC_COUNT) || (iNumRef > MAX_REFERENCE_PICTURE_COUNT_NUM)) {524 if ((iNumRef < MIN_REF_PIC_COUNT) || (iNumRef > iRefUpperBound)) {
524 m_pEncContext->pSvcParam->iNumRefFrame = AUTO_REF_PIC_COUNT;525 m_pEncContext->pSvcParam->iNumRefFrame = AUTO_REF_PIC_COUNT;
525 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING,526 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_WARNING,
526 "doesn't support the number of reference frame(%d) change to auto select mode", iNumRef);527 "doesn't support the number of reference frame(%d) change to auto select mode", iNumRef);

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