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
10931093 return ENC_RETURN_SUCCESS;
10941094 }
10951095
1096−static inline int32_t InitSliceHeadWithBase (SSlice* pSlice, SSlice* pBaseSlice, const uint8_t kuiRefCount) {
1096+void InitSliceHeadWithBase (SSlice* pSlice, SSlice* pBaseSlice) {
10971097 SSliceHeaderExt* pBaseSHExt = &pBaseSlice->sSliceHeaderExt;
10981098 SSliceHeaderExt* pSHExt = &pSlice->sSliceHeaderExt;
10991099
1100− if (NULL == pSlice || NULL == pBaseSlice)
1101− return ENC_RETURN_INVALIDINPUT;
1102−
11031100 pSlice->bSliceHeaderExtFlag = pBaseSlice->bSliceHeaderExtFlag;
11041101 pSHExt->sSliceHeader.iPpsId = pBaseSHExt->sSliceHeader.iPpsId;
11051102 pSHExt->sSliceHeader.pPps = pBaseSHExt->sSliceHeader.pPps;
11061103 pSHExt->sSliceHeader.iSpsId = pBaseSHExt->sSliceHeader.iSpsId;
11071104 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+
11081111 pSHExt->sSliceHeader.uiRefCount = kuiRefCount;
11091112 memcpy (&pSHExt->sSliceHeader.sRefMarking, &pBaseSHExt->sSliceHeader.sRefMarking, sizeof (SRefPicMarking));
11101113 memcpy (&pSHExt->sSliceHeader.sRefReordering, &pBaseSHExt->sSliceHeader.sRefReordering,
11111114 sizeof (SRefPicListReorderSyntax));
1112− return ENC_RETURN_SUCCESS;
1113−
11141115 }
1116+
11151117 static inline int32_t InitSliceRC (SSlice* pSlice, const int32_t kiGlobalQp, const int32_t kiBitsPerMb) {
11161118
11171119 if (NULL == pSlice || kiGlobalQp < 0 || kiBitsPerMb < 0)
@@ -1197,11 +1199,8 @@ int32_t ReallocateSliceList (sWelsEncCtx* pCtx, · 79 unmodified lines
11971199 return iRet;
11981200 }
11991201
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);
12051204
12061205 iRet = InitSliceRC (pSlice, pCtx->iGlobalQp, iBitsPerMb);
12071206 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