Showing the changes to codec/encoder/core/src/svc_encode_slice.cpp (1 of 5 files). Show all
Unified · Split
| @@ -1093,25 +1093,27 @@ int32_t InitSliceInLayer (sWelsEncCtx* pCtx, · 1092 unmodified lines | ||
| 1093 | 1093 | return ENC_RETURN_SUCCESS; |
| 1094 | 1094 | } |
| 1095 | 1095 | |
| 1096 | −static inline int32_t InitSliceHeadWithBase (SSlice* pSlice, SSlice* pBaseSlice, const uint8_t kuiRefCount) { | |
| 1096 | +void InitSliceHeadWithBase (SSlice* pSlice, SSlice* pBaseSlice) { | |
| 1097 | 1097 | SSliceHeaderExt* pBaseSHExt = &pBaseSlice->sSliceHeaderExt; |
| 1098 | 1098 | SSliceHeaderExt* pSHExt = &pSlice->sSliceHeaderExt; |
| 1099 | 1099 | |
| 1100 | − if (NULL == pSlice || NULL == pBaseSlice) | |
| 1101 | − return ENC_RETURN_INVALIDINPUT; | |
| 1102 | − | |
| 1103 | 1100 | pSlice->bSliceHeaderExtFlag = pBaseSlice->bSliceHeaderExtFlag; |
| 1104 | 1101 | pSHExt->sSliceHeader.iPpsId = pBaseSHExt->sSliceHeader.iPpsId; |
| 1105 | 1102 | pSHExt->sSliceHeader.pPps = pBaseSHExt->sSliceHeader.pPps; |
| 1106 | 1103 | pSHExt->sSliceHeader.iSpsId = pBaseSHExt->sSliceHeader.iSpsId; |
| 1107 | 1104 | pSHExt->sSliceHeader.pSps = pBaseSHExt->sSliceHeader.pSps; |
| 1105 | +} | |
| 1106 | + | |
| 1107 | +void InitSliceRefInfoWithBase (SSlice* pSlice, SSlice* pBaseSlice, const uint8_t kuiRefCount) { | |
| 1108 | + SSliceHeaderExt* pBaseSHExt = &pBaseSlice->sSliceHeaderExt; | |
| 1109 | + SSliceHeaderExt* pSHExt = &pSlice->sSliceHeaderExt; | |
| 1110 | + | |
| 1108 | 1111 | pSHExt->sSliceHeader.uiRefCount = kuiRefCount; |
| 1109 | 1112 | memcpy (&pSHExt->sSliceHeader.sRefMarking, &pBaseSHExt->sSliceHeader.sRefMarking, sizeof (SRefPicMarking)); |
| 1110 | 1113 | memcpy (&pSHExt->sSliceHeader.sRefReordering, &pBaseSHExt->sSliceHeader.sRefReordering, |
| 1111 | 1114 | sizeof (SRefPicListReorderSyntax)); |
| 1112 | − return ENC_RETURN_SUCCESS; | |
| 1113 | − | |
| 1114 | 1115 | } |
| 1116 | + | |
| 1115 | 1117 | static inline int32_t InitSliceRC (SSlice* pSlice, const int32_t kiGlobalQp, const int32_t kiBitsPerMb) { |
| 1116 | 1118 | |
| 1117 | 1119 | if (NULL == pSlice || kiGlobalQp < 0 || kiBitsPerMb < 0) |
| @@ -1197,11 +1199,8 @@ int32_t ReallocateSliceList (sWelsEncCtx* pCtx, · 79 unmodified lines | ||
| 1197 | 1199 | return iRet; |
| 1198 | 1200 | } |
| 1199 | 1201 | |
| 1200 | − iRet = InitSliceHeadWithBase (pSlice, pBaseSlice, pCtx->iNumRef0); | |
| 1201 | − if (ENC_RETURN_SUCCESS != iRet) { | |
| 1202 | − FreeSliceBuffer(pNewSliceList, kiMaxSliceNumNew, pMA, "ReallocateSliceList()::InitSliceBsBuffer()"); | |
| 1203 | − return iRet; | |
| 1204 | − } | |
| 1202 | + InitSliceHeadWithBase (pSlice, pBaseSlice); | |
| 1203 | + InitSliceRefInfoWithBase (pSlice, pBaseSlice, pCtx->iNumRef0); | |
| 1205 | 1204 | |
| 1206 | 1205 | iRet = InitSliceRC (pSlice, pCtx->iGlobalQp, iBitsPerMb); |
| 1207 | 1206 | if (ENC_RETURN_SUCCESS != iRet) { |