History

add memory allocation for screen content

ruil2 committed 12 years ago

Commit c8eaea21 parent 37201e25 files · +247 −187Browse files

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

Unified · Split

codec/encoder/plus/src/welsEncoderExt.cpp+12−10
@@ -352,17 +352,19 @@ int CWelsH264SVCEncoder::InitializeInternal(SWelsSvcCodingParam* pCfg) { · 351 unmodified lines
352352 Uninitialize();
353353 return cmInitParaError;
354354 }
355−
356− // Fine tune num_ref_num
357− if (pCfg->bEnableLongTermReference) {
358− pCfg->iLTRRefNum = LONG_TERM_REF_NUM;
359− } else {
360− pCfg->iLTRRefNum = 0;
355+ if (pCfg->iUsageType == SCREEN_CONTENT_REAL_TIME) {
356+ if (pCfg->bEnableLongTermReference) {
357+ pCfg->iLTRRefNum = LONG_TERM_REF_NUM;
358+ pCfg->iNumRefFrame = 1 + WELS_LOG2 (pCfg->uiGopSize) + pCfg->iLTRRefNum;
359+ } else {
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);
361367 }
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);
366368
367369 if (pCfg->iLtrMarkPeriod == 0) {
368370 pCfg->iLtrMarkPeriod = 30;

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