Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -3507,7 +3507,7 @@ int32_t GetSubSequenceId (sWelsEncCtx* pCtx, EVideoFrameType eFrameType) { · 3506 unmodified lines | ||
| 3507 | 3507 | // writing parasets for (simulcast) svc |
| 3508 | 3508 | int32_t WriteSsvcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, |
| 3509 | 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 | 3511 | iReturn = WelsWriteParameterSets (pCtx, &pLayerBsInfo->pNalLengthInByte[0], &iCountNal, &iNonVclSize); |
| 3512 | 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 | 3532 | // writing parasets for simulcast avc |
| 3533 | 3533 | int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, |
| 3534 | 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 | 3537 | // write SPS |
| 3538 | 3538 | iNonVclSize = 0; |
| @@ -3542,7 +3542,9 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 3 unmodified lines | ||
| 3542 | 3542 | for (int32_t iIdx = 0; iIdx < pCtx->iSpsNum; iIdx++) { |
| 3543 | 3543 | //writing one NAL |
| 3544 | 3544 | int32_t iNalSize = 0; |
| 3545 | − iReturn = WelsWriteOneSPS (pCtx, iIdx, iNalSize); | |
| 3545 | + iCountNal = 0; | |
| 3546 | + | |
| 3547 | + iReturn = WelsWriteOneSPS (pCtx, iIdx, iNalSize); | |
| 3546 | 3548 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) |
| 3547 | 3549 | |
| 3548 | 3550 | pLayerBsInfo->pNalLengthInByte[iCountNal] = iNalSize; |
| @@ -3562,7 +3564,6 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 13 unmodified lines | ||
| 3562 | 3564 | pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer; |
| 3563 | 3565 | pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal; |
| 3564 | 3566 | //update for external countings |
| 3565 | − iCountNal = 0; | |
| 3566 | 3567 | ++ iLayerNum; |
| 3567 | 3568 | |
| 3568 | 3569 | } |
| @@ -3574,7 +3575,9 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 5 unmodified lines | ||
| 3574 | 3575 | for (int32_t iIdx = 0; iIdx < pCtx->iPpsNum; iIdx++) { |
| 3575 | 3576 | //writing one NAL |
| 3576 | 3577 | int32_t iNalSize = 0; |
| 3577 | − iReturn = WelsWriteOnePPS (pCtx, iIdx, iNalSize); | |
| 3578 | + iCountNal = 0; | |
| 3579 | + | |
| 3580 | + iReturn = WelsWriteOnePPS (pCtx, iIdx, iNalSize); | |
| 3578 | 3581 | WELS_VERIFY_RETURN_IFNEQ (iReturn, ENC_RETURN_SUCCESS) |
| 3579 | 3582 | |
| 3580 | 3583 | pLayerBsInfo->pNalLengthInByte[iCountNal] = iNalSize; |
| @@ -3594,7 +3597,6 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 13 unmodified lines | ||
| 3594 | 3597 | pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer; |
| 3595 | 3598 | pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal; |
| 3596 | 3599 | //update for external countings |
| 3597 | − iCountNal = 0; | |
| 3598 | 3600 | ++ iLayerNum; |
| 3599 | 3601 | } |
| 3600 | 3602 | |
| @@ -3612,7 +3614,7 @@ int32_t WriteSavcParaset (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 11 unmodified lines | ||
| 3612 | 3614 | //cover the logic of simulcast avc + sps_pps_listing |
| 3613 | 3615 | int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, |
| 3614 | 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 | 3619 | // write SPS |
| 3618 | 3620 | iNonVclSize = 0; |
| @@ -3643,7 +3645,6 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 24 unmodified lines | ||
| 3643 | 3645 | pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer; |
| 3644 | 3646 | pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal; |
| 3645 | 3647 | //update for external countings |
| 3646 | − iCountNal = 0; | |
| 3647 | 3648 | ++ iLayerNum; |
| 3648 | 3649 | } |
| 3649 | 3650 | |
| @@ -3679,7 +3680,6 @@ int32_t WriteSavcParaset_Listing (sWelsEncCtx* pCtx, const int32_t kiSpatialNum, · 29 unmodified lines | ||
| 3679 | 3680 | pLayerBsInfo->pBsBuf = pCtx->pFrameBs + pCtx->iPosBsBuffer; |
| 3680 | 3681 | pLayerBsInfo->pNalLengthInByte = (pLayerBsInfo - 1)->pNalLengthInByte + iCountNal; |
| 3681 | 3682 | //update for external countings |
| 3682 | − iCountNal = 0; | |
| 3683 | 3683 | ++ iLayerNum; |
| 3684 | 3684 | } |
| 3685 | 3685 | |