History

Multi-thread-fixed:RBC#1687:refactor for InitSliceHeadWithBase()

huade committed 9 years ago

Commit 604e4671 parent ff597655 files · +18 −21Browse files

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

Unified · Split

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

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