Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -347,16 +347,20 @@ int CWelsH264SVCEncoder::InitializeInternal (SWelsSvcCodingParam* pCfg) { · 346 unmodified lines | |||
| 347 | if (pCfg->iUsageType == SCREEN_CONTENT_REAL_TIME) { | 347 | if (pCfg->iUsageType == SCREEN_CONTENT_REAL_TIME) { |
| 348 | if (pCfg->bEnableLongTermReference) { | 348 | if (pCfg->bEnableLongTermReference) { |
| 349 | pCfg->iLTRRefNum = WELS_CLIP3 (pCfg->iLTRRefNum, 1, LONG_TERM_REF_NUM_SCREEN); | 349 | pCfg->iLTRRefNum = WELS_CLIP3 (pCfg->iLTRRefNum, 1, LONG_TERM_REF_NUM_SCREEN); |
| 350 | pCfg->iNumRefFrame = WELS_MAX (1, WELS_LOG2 (pCfg->uiGopSize)) + pCfg->iLTRRefNum; | 350 | if(pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT) |
| 351 | pCfg->iNumRefFrame = WELS_MAX (1, WELS_LOG2 (pCfg->uiGopSize)) + pCfg->iLTRRefNum; | ||
| 351 | } else { | 352 | } else { |
| 352 | pCfg->iLTRRefNum = 0; | 353 | pCfg->iLTRRefNum = 0; |
| 353 | pCfg->iNumRefFrame = WELS_MAX (1, pCfg->uiGopSize >> 1); | 354 | if(pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT) |
| 355 | pCfg->iNumRefFrame = WELS_MAX (1, pCfg->uiGopSize >> 1); | ||
| 354 | } | 356 | } |
| 355 | } else { | 357 | } else { |
| 356 | pCfg->iLTRRefNum = pCfg->bEnableLongTermReference ? WELS_CLIP3 (pCfg->iLTRRefNum, 1, LONG_TERM_REF_NUM) : 0; | 358 | pCfg->iLTRRefNum = pCfg->bEnableLongTermReference ? WELS_CLIP3 (pCfg->iLTRRefNum, 1, LONG_TERM_REF_NUM) : 0; |
| 357 | pCfg->iNumRefFrame = ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) : | 359 | if(pCfg->iNumRefFrame == AUTO_REF_PIC_COUNT){ |
| 358 | (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum); | 360 | pCfg->iNumRefFrame = ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) : |
| 359 | pCfg->iNumRefFrame = WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM); | 361 | (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum); |
| 362 | pCfg->iNumRefFrame = WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM); | ||
| 363 | } | ||
| 360 | } | 364 | } |
| 361 | 365 | ||
| 362 | if (pCfg->iLtrMarkPeriod == 0) { | 366 | if (pCfg->iLtrMarkPeriod == 0) { |