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
3507// writing parasets for (simulcast) svc3507// writing parasets for (simulcast) svc
3508int32_t WriteSsvcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,3508int32_t WriteSsvcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,
3509 SLayerBSInfo*& pLayerBsInfo, int32_t& iLayerNum, int32_t& iFrameSize) {3509 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;
3511 iReturn = WelsWriteParameterSets (pCtx, &pLayerBsInfo->pNalLengthInByte[0], &iCountNal, &iNonVclSize);3511 iReturn = WelsWriteParameterSets (pCtx, &pLayerBsInfo->pNalLengthInByte[0], &iCountNal, &iNonVclSize);
3512 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)3512 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
3513 3513
@@ -3532,7 +3532,7 @@ int32_t WriteSsvcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 18 unmodified lines
3532// writing parasets for simulcast avc3532// writing parasets for simulcast avc
3533int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,3533int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,
3534 SLayerBSInfo*& pLayerBsInfo, int32_t& iLayerNum, int32_t& iFrameSize) {3534 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;
3536 3536
3537 // write SPS3537 // write SPS
3538 iNonVclSize = 0;3538 iNonVclSize = 0;
@@ -3542,7 +3542,9 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 3 unmodified lines
3542 for (int32_t iIdx = 0; iIdx < pCtx->iSpsNum; iIdx++) {3542 for (int32_t iIdx = 0; iIdx < pCtx->iSpsNum; iIdx++) {
3543 //writing one NAL3543 //writing one NAL
3544 int32_t iNalSize = 0;3544 int32_t iNalSize = 0;
3545 iReturn = WelsWriteOneSPS (pCtx, iIdx, iNalSize);3545 iCountNal = 0;
3546
3547 iReturn = WelsWriteOneSPS (pCtx, iIdx, iNalSize);
3546 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)3548 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
3547 3549
3548 pLayerBsInfo->pNalLengthInByte[iCountNal] = iNalSize;3550 pLayerBsInfo->pNalLengthInByte[iCountNal] = iNalSize;
@@ -3562,7 +3564,6 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 13 unmodified lines
3562 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;3564 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
3563 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;3565 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;
3564 //update for external countings3566 //update for external countings
3565 iCountNal = 0;
3566 ++ iLayerNum;3567 ++ iLayerNum;
3567 3568
3568 }3569 }
@@ -3574,7 +3575,9 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 5 unmodified lines
3574 for (int32_t iIdx = 0; iIdx < pCtx->iPpsNum; iIdx++) {3575 for (int32_t iIdx = 0; iIdx < pCtx->iPpsNum; iIdx++) {
3575 //writing one NAL3576 //writing one NAL
3576 int32_t iNalSize = 0;3577 int32_t iNalSize = 0;
3577 iReturn = WelsWriteOnePPS (pCtx, iIdx, iNalSize);3578 iCountNal = 0;
3579
3580 iReturn = WelsWriteOnePPS (pCtx, iIdx, iNalSize);
3578 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)3581 WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS)
3579 3582
3580 pLayerBsInfo->pNalLengthInByte[iCountNal] = iNalSize;3583 pLayerBsInfo->pNalLengthInByte[iCountNal] = iNalSize;
@@ -3594,7 +3597,6 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 13 unmodified lines
3594 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;3597 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
3595 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;3598 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;
3596 //update for external countings3599 //update for external countings
3597 iCountNal = 0;
3598 ++ iLayerNum;3600 ++ iLayerNum;
3599 }3601 }
3600 3602
@@ -3612,7 +3614,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 11 unmodified lines
3612//cover the logic of simulcast avc + sps_pps_listing3614//cover the logic of simulcast avc + sps_pps_listing
3613int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,3615int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum,
3614 SLayerBSInfo*& pLayerBsInfo, int32_t& iLayerNum, int32_t& iFrameSize) {3616 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;
3616 3618
3617 // write SPS3619 // write SPS
3618 iNonVclSize = 0;3620 iNonVclSize = 0;
@@ -3643,7 +3645,6 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 24 unmodified lines
3643 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;3645 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
3644 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;3646 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;
3645 //update for external countings3647 //update for external countings
3646 iCountNal = 0;
3647 ++ iLayerNum;3648 ++ iLayerNum;
3648 }3649 }
3649 3650
@@ -3679,7 +3680,6 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 29 unmodified lines
3679 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;3680 pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer;
3680 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;3681 pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal;
3681 //update for external countings3682 //update for external countings
3682 iCountNal = 0;
3683 ++ iLayerNum;3683 ++ iLayerNum;
3684 }3684 }
3685 3685

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