History

Multi-thread-fixed:RBC#1720:iMaxSliceNumConstraint replaced by iMaxSliceNum

huade committed 9 years ago

Commit c2e37d51 parent c917d315 files · +31 −36Browse files

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

Unified · Split

codec/encoder/core/src/encoder_ext.cpp+9−12
@@ -2478,6 +2478,7 @@ void UpdateSlicepEncCtxWithPartition (SDqLayer* pCurDq, int32_t iPartitionNum) { · 2477 unmodified lines
24782478 void WelsInitCurrentDlayerMltslc (sWelsEncCtx* pCtx, int32_t iPartitionNum) {
24792479 SDqLayer* pCurDq = pCtx->pCurDqLayer;
24802480 SSliceCtx* pSliceCtx = &pCurDq->sSliceEncCtx;
2481+ uint32_t uiMiniPacketSize = 0;
24812482
24822483 UpdateSlicepEncCtxWithPartition (pCurDq, iPartitionNum);
24832484
@@ -2508,12 +2509,9 @@ void WelsInitCurrentDlayerMltslc (sWelsEncCtx* pCtx, int32_t iPartitionNum) { · 24 unmodified lines
25082509 }
25092510
25102511 //MINPACKETSIZE_CONSTRAINT
2511− if (pSliceCtx->uiSliceSizeConstraint
2512− <
2513− (uint32_t) (uiFrmByte//suppose 16 byte per mb at average
2514− / (pSliceCtx->iMaxSliceNumConstraint))
2515− ) {
2516−
2512+ //suppose 16 byte per mb at average
2513+ uiMiniPacketSize = (uint32_t) (uiFrmByte / pSliceCtx->iMaxSliceNumConstraint);
2514+ if (pSliceCtx->uiSliceSizeConstraint < uiMiniPacketSize ) {
25172515 WelsLog (& (pCtx->sLogCtx),
25182516 WELS_LOG_WARNING,
25192517 "Set-SliceConstraint(%d) too small for current resolution (MB# %d) under QP/BR!",
@@ -4445,7 +4443,7 @@ int32_t FrameBsRealloc (sWelsEncCtx* pCtx, · 1925 unmodified lines
44454443 SDqLayer* pCurLayer = pCtx->pCurDqLayer;
44464444
44474445 int32_t iCountNals = pCtx->pOut->iCountNals;
4448− int32_t iMaxSliceNumOld = pCurLayer->sSliceEncCtx.iMaxSliceNumConstraint;
4446+ int32_t iMaxSliceNumOld = pCurLayer->iMaxSliceNum;
44494447 int32_t iMaxSliceNum = iMaxSliceNumOld;
44504448 iCountNals += iMaxSliceNum * (pCtx->pSvcParam->iSpatialLayerNum + pCtx->bNeedPrefixNalFlag);
44514449 iMaxSliceNum *= SLICE_NUM_EXPAND_COEF;
@@ -4512,7 +4510,6 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 60 unmodified lines
45124510 ) {
45134511
45144512 SDqLayer* pCurLayer = pCtx->pCurDqLayer;
4515− SSliceCtx* pSliceCtx = &pCurLayer->sSliceEncCtx;
45164513 SSlice* pStartSlice = pCurLayer->ppSliceInLayer[iStartSliceIdx];
45174514 int32_t iNalIdxInLayer = *pNalIdxInLayer;
45184515 int32_t iSliceIdx = iStartSliceIdx;
@@ -4538,7 +4535,7 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 19 unmodified lines
45384535 int32_t iPayloadSize = 0;
45394536 SSlice* pCurSlice = NULL;
45404537
4541− if (iSliceIdx >= (pSliceCtx->iMaxSliceNumConstraint - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[]
4538+ if (iSliceIdx >= (pCurLayer->iMaxSliceNum - kiSliceIdxStep)) { // insufficient memory in pSliceInLayer[]
45424539 if (pCtx->iActiveThreadsNum == 1) {
45434540 //only single thread support re-alloc now
45444541 if (DynSliceRealloc (pCtx, pFrameBSInfo, pLayerBsInfo)) {
@@ -4546,10 +4543,10 @@ int32_t WelsCodeOnePicPartition (sWelsEncCtx* pCtx, · 1 unmodified line
45464543 "CWelsH264SVCEncoder::WelsCodeOnePicPartition: DynSliceRealloc not successful");
45474544 return ENC_RETURN_MEMALLOCERR;
45484545 }
4549− } else if (iSliceIdx >= pSliceCtx->iMaxSliceNumConstraint) {
4546+ } else if (iSliceIdx >= pCurLayer->iMaxSliceNum) {
45504547 WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
4551− "CWelsH264SVCEncoder::WelsCodeOnePicPartition: iSliceIdx(%d) over iMaxSliceNumConstraint(%d)", iSliceIdx,
4552− pSliceCtx->iMaxSliceNumConstraint);
4548+ "CWelsH264SVCEncoder::WelsCodeOnePicPartition: iSliceIdx(%d) over iMaxSliceNum(%d)", iSliceIdx,
4549+ pCurLayer->iMaxSliceNum);
45534550 return ENC_RETURN_MEMALLOCERR;
45544551 }
45554552 }

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