History

add input checking and fix a bs length under new strategy

Sijia Chen committed 11 years ago

Commit 45e34241 parent de68ec61 file · +10 −3Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+10−3
@@ -336,9 +336,15 @@ int32_t ParamValidationExt (SLogContext* pLogCtx, SWelsSvcCodingParam* pCodingPa · 335 unmodified lines
336336 pCodingParam->bDeblockingParallelFlag = true;
337337 }
338338
339+ // eSpsPpsIdStrategy checkings
339340 if (pCodingParam->iSpatialLayerNum > 1 && (SPS_LISTING & pCodingParam->eSpsPpsIdStrategy)) {
340341 WelsLog (pLogCtx, WELS_LOG_INFO,
341− "ParamValidationExt(), eSpsPpsIdStrategy adjusted to CONSTANT_ID");
342+ "ParamValidationExt(), eSpsPpsIdStrategy setting (%d) with multiple SpatialLayers (%d) not supported! eSpsPpsIdStrategy adjusted to CONSTANT_ID", pCodingParam->eSpsPpsIdStrategy, pCodingParam->iSpatialLayerNum);
343+ pCodingParam->eSpsPpsIdStrategy = CONSTANT_ID;
344+ }
345+ if (pCodingParam->iUsageType == SCREEN_CONTENT_REAL_TIME && (SPS_LISTING & pCodingParam->eSpsPpsIdStrategy)) {
346+ WelsLog (pLogCtx, WELS_LOG_INFO,
347+ "ParamValidationExt(), eSpsPpsIdStrategy setting (%d) with iUsageType (%d) not supported! eSpsPpsIdStrategy adjusted to CONSTANT_ID", pCodingParam->eSpsPpsIdStrategy, pCodingParam->iUsageType);
342348 pCodingParam->eSpsPpsIdStrategy = CONSTANT_ID;
343349 }
344350
@@ -1710,8 +1716,9 @@ int32_t RequestMemorySvc (sWelsEncCtx** ppCtx, SExistingParasetList* pExistingPa · 1365 unmodified lines
17101716 return 1;
17111717 }
17121718
1713− iNonVclLayersBsSizeCount = SSEI_BUFFER_SIZE + pParam->iSpatialLayerNum * SPS_BUFFER_SIZE +
1714− (1 + pParam->iSpatialLayerNum) * PPS_BUFFER_SIZE;
1719+ const int32_t kiSpsSize = (pParam->eSpsPpsIdStrategy & SPS_LISTING) ? (MAX_SPS_COUNT * SPS_BUFFER_SIZE): (pParam->iSpatialLayerNum * SPS_BUFFER_SIZE);
1720+ const int32_t kiPpsSize = (pParam->eSpsPpsIdStrategy & SPS_PPS_LISTING) ? (MAX_PPS_COUNT * SPS_BUFFER_SIZE) : ((1 + pParam->iSpatialLayerNum) * PPS_BUFFER_SIZE);
1721+ iNonVclLayersBsSizeCount = SSEI_BUFFER_SIZE + kiSpsSize + kiPpsSize;
17151722
17161723 int32_t iLayerBsSize = 0;
17171724 iIndex = 0;

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