Showing the changes to codec/encoder/plus/src/welsEncoderExt.cpp (1 of 5 files). Show all
Unified · Split
| @@ -352,17 +352,19 @@ int CWelsH264SVCEncoder::InitializeInternal(SWelsSvcCodingParam* pCfg) { · 351 unmodified lines | |||
| 352 | Uninitialize(); | 352 | Uninitialize(); |
| 353 | return cmInitParaError; | 353 | return cmInitParaError; |
| 354 | } | 354 | } |
| 355 | 355 | if (pCfg->iUsageType == SCREEN_CONTENT_REAL_TIME) { | |
| 356 | // Fine tune num_ref_num | 356 | if (pCfg->bEnableLongTermReference) { |
| 357 | if (pCfg->bEnableLongTermReference) { | 357 | pCfg->iLTRRefNum = LONG_TERM_REF_NUM; |
| 358 | pCfg->iLTRRefNum = LONG_TERM_REF_NUM; | 358 | pCfg->iNumRefFrame = 1 + WELS_LOG2 (pCfg->uiGopSize) + pCfg->iLTRRefNum; |
| 359 | } else { | 359 | } else { |
| 360 | pCfg->iLTRRefNum = 0; | 360 | pCfg->iLTRRefNum = 0; |
| 361 | pCfg->iNumRefFrame = 1; | ||
| 362 | } | ||
| 363 | } else { | ||
| 364 | pCfg->iLTRRefNum = pCfg->bEnableLongTermReference ? LONG_TERM_REF_NUM : 0; | ||
| 365 | pCfg->iNumRefFrame = ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) : | ||
| 366 | pCfg->iNumRefFrame = WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM); | ||
| 361 | } | 367 | } |
| 362 | pCfg->iNumRefFrame = ((pCfg->uiGopSize >> 1) > 1) ? ((pCfg->uiGopSize >> 1) + pCfg->iLTRRefNum) : | ||
| 363 | (MIN_REF_PIC_COUNT + pCfg->iLTRRefNum); | ||
| 364 | |||
| 365 | pCfg->iNumRefFrame = WELS_CLIP3 (pCfg->iNumRefFrame, MIN_REF_PIC_COUNT, MAX_REFERENCE_PICTURE_COUNT_NUM); | ||
| 366 | 368 | ||
| 367 | if (pCfg->iLtrMarkPeriod == 0) { | 369 | if (pCfg->iLtrMarkPeriod == 0) { |
| 368 | pCfg->iLtrMarkPeriod = 30; | 370 | pCfg->iLtrMarkPeriod = 30; |