History

initial for iReturn and refact PPS Sps bs write function

huade committed 10 years ago

Commit 436da211 parent 4a4ade11 file · +9 −9Browse 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+9−9
@@ -3507,7 +3507,7 @@ int32_t GetSubSequenceId (sWelsEncCtx* pCtx, EVideoFrameType eFrameType) { · 3506 unmodified lines
35073507 // writing parasets for (simulcast) svc
35083508 int32_t WriteSsvcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,
35093509 SLayerBSInfo*& pLayerBsInfo, int32_t& iLayerNum, int32_t& iFrameSize) {
3510− int32_t iNonVclSize = 0, iCountNal = 0, iReturn = 0;
3510+ int32_t iNonVclSize = 0, iCountNal = 0, iReturn = ENC_RETURN_SUCCESS;
35113511 iReturn = WelsWriteParameterSets (pCtx, &pLayerBsInfo->pNalLengthInByte[0], &iCountNal, &iNonVclSize);
35123512 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
35133513
@@ -3532,7 +3532,7 @@ int32_t WriteSsvcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 18 unmodified lines
35323532 // writing parasets for simulcast avc
35333533 int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,
35343534 SLayerBSInfo*& pLayerBsInfo, int32_t& iLayerNum, int32_t& iFrameSize) {
3535− int32_t iNonVclSize = 0, iCountNal = 0, iReturn;
3535+ int32_t iNonVclSize = 0, iCountNal = 0, iReturn = ENC_RETURN_SUCCESS;
35363536
35373537 // write SPS
35383538 iNonVclSize = 0;
@@ -3542,7 +3542,9 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 3 unmodified lines
35423542 for (int32_t iIdx = 0; iIdx < pCtx->iSpsNum; iIdx++) {
35433543 //writing one NAL
35443544 int32_t iNalSize = 0;
3545− iReturn = WelsWriteOneSPS (pCtx, iIdx, iNalSize);
3545+ iCountNal = 0;
3546+
3547+ iReturn = WelsWriteOneSPS (pCtx, iIdx, iNalSize);
35463548 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
35473549
35483550 pLayerBsInfo->pNalLengthInByte[iCountNal] = iNalSize;
@@ -3562,7 +3564,6 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 13 unmodified lines
35623564 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
35633565 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;
35643566 //update for external countings
3565− iCountNal = 0;
35663567 ++ iLayerNum;
35673568
35683569 }
@@ -3574,7 +3575,9 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 5 unmodified lines
35743575 for (int32_t iIdx = 0; iIdx < pCtx->iPpsNum; iIdx++) {
35753576 //writing one NAL
35763577 int32_t iNalSize = 0;
3577− iReturn = WelsWriteOnePPS (pCtx, iIdx, iNalSize);
3578+ iCountNal = 0;
3579+
3580+ iReturn = WelsWriteOnePPS (pCtx, iIdx, iNalSize);
35783581 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
35793582
35803583 pLayerBsInfo->pNalLengthInByte[iCountNal] = iNalSize;
@@ -3594,7 +3597,6 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 13 unmodified lines
35943597 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
35953598 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;
35963599 //update for external countings
3597− iCountNal = 0;
35983600 ++ iLayerNum;
35993601 }
36003602
@@ -3612,7 +3614,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 11 unmodified lines
36123614 //cover the logic of simulcast avc + sps_pps_listing
36133615 int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,
36143616 SLayerBSInfo*& pLayerBsInfo, int32_t& iLayerNum, int32_t& iFrameSize) {
3615− int32_t iNonVclSize = 0, iCountNal = 0, iReturn;
3617+ int32_t iNonVclSize = 0, iCountNal = 0, iReturn = ENC_RETURN_SUCCESS;
36163618
36173619 // write SPS
36183620 iNonVclSize = 0;
@@ -3643,7 +3645,6 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 24 unmodified lines
36433645 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
36443646 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;
36453647 //update for external countings
3646− iCountNal = 0;
36473648 ++ iLayerNum;
36483649 }
36493650
@@ -3679,7 +3680,6 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 29 unmodified lines
36793680 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
36803681 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;
36813682 //update for external countings
3682− iCountNal = 0;
36833683 ++ iLayerNum;
36843684 }
36853685

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