History

Add MAX_DPB_COUNT equals to MAX_REF_PIC_COUNT + 1 to set the size of RefList Make the reorder search range sync with JM

Haibo Zhu committed 11 years ago

Commit 5ebb64c1 parent c0808f13 files · +9 −8Browse files

Showing the changes to codec/decoder/core/src/manage_dec_ref.cpp (1 of 3 files). Show all

Unified · Split

codec/decoder/core/src/manage_dec_ref.cpp+5−5
@@ -89,7 +89,7 @@ void WelsResetRefPic (PWelsDecoderContext pCtx) { · 88 unmodified lines
89 89
90 pRefPic->uiRefCount[LIST_0] = 0;90 pRefPic->uiRefCount[LIST_0] = 0;
91 91
92 for (i = 0; i < MAX_SHORT_REF_COUNT; i++) {92 for (i = 0; i < MAX_DPB_COUNT; i++) {
93 if (pRefPic->pShortRefList[LIST_0][i] != NULL) {93 if (pRefPic->pShortRefList[LIST_0][i] != NULL) {
94 SetUnRef (pRefPic->pShortRefList[LIST_0][i]);94 SetUnRef (pRefPic->pShortRefList[LIST_0][i]);
95 pRefPic->pShortRefList[LIST_0][i] = NULL;95 pRefPic->pShortRefList[LIST_0][i] = NULL;
@@ -97,7 +97,7 @@ void WelsResetRefPic (PWelsDecoderContext pCtx) { · 1 unmodified line
97 }97 }
98 pRefPic->uiShortRefCount[LIST_0] = 0;98 pRefPic->uiShortRefCount[LIST_0] = 0;
99 99
100 for (i = 0; i < MAX_LONG_REF_COUNT; i++) {100 for (i = 0; i < MAX_DPB_COUNT; i++) {
101 if (pRefPic->pLongRefList[LIST_0][i] != NULL) {101 if (pRefPic->pLongRefList[LIST_0][i] != NULL) {
102 SetUnRef (pRefPic->pLongRefList[LIST_0][i]);102 SetUnRef (pRefPic->pLongRefList[LIST_0][i]);
103 pRefPic->pLongRefList[LIST_0][i] = NULL;103 pRefPic->pLongRefList[LIST_0][i] = NULL;
@@ -158,7 +158,7 @@ int32_t WelsInitRefList (PWelsDecoderContext pCtx, int32_t iPoc) { · 54 unmodified lines
158 158
159 PPicture* ppShoreRefList = pCtx->sRefPic.pShortRefList[LIST_0];159 PPicture* ppShoreRefList = pCtx->sRefPic.pShortRefList[LIST_0];
160 PPicture* ppLongRefList = pCtx->sRefPic.pLongRefList[LIST_0];160 PPicture* ppLongRefList = pCtx->sRefPic.pLongRefList[LIST_0];
161 memset (pCtx->sRefPic.pRefList[LIST_0], 0, MAX_REF_PIC_COUNT * sizeof (PPicture));161 memset (pCtx->sRefPic.pRefList[LIST_0], 0, MAX_DPB_COUNT * sizeof (PPicture));
162 //short162 //short
163 for (i = 0; i < pCtx->sRefPic.uiShortRefCount[LIST_0]; ++i) {163 for (i = 0; i < pCtx->sRefPic.uiShortRefCount[LIST_0]; ++i) {
164 pCtx->sRefPic.pRefList[LIST_0][iCount++ ] = ppShoreRefList[i];164 pCtx->sRefPic.pRefList[LIST_0][iCount++ ] = ppShoreRefList[i];
@@ -179,7 +179,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) { · 14 unmodified lines
179 PSliceHeader pSliceHeader = &pCtx->pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader;179 PSliceHeader pSliceHeader = &pCtx->pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader;
180 PPicture pPic = NULL;180 PPicture pPic = NULL;
181 PPicture* ppRefList = pCtx->sRefPic.pRefList[LIST_0];181 PPicture* ppRefList = pCtx->sRefPic.pRefList[LIST_0];
182 int32_t iMaxRefIdx = pCtx->pSps->iNumRefFrames + 1;182 int32_t iMaxRefIdx = pCtx->pSps->iNumRefFrames;
183 int32_t iRefCount = pCtx->sRefPic.uiRefCount[LIST_0];183 int32_t iRefCount = pCtx->sRefPic.uiRefCount[LIST_0];
184 int32_t iPredFrameNum = pSliceHeader->iFrameNum;184 int32_t iPredFrameNum = pSliceHeader->iFrameNum;
185 int32_t iMaxPicNum = 1 << pSliceHeader->pSps->uiLog2MaxFrameNum;185 int32_t iMaxPicNum = 1 << pSliceHeader->pSps->uiLog2MaxFrameNum;
@@ -251,7 +251,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) { · 65 unmodified lines
251 (i - iReorderingIndex)*sizeof (PPicture)); //confirmed_safe_unsafe_usage251 (i - iReorderingIndex)*sizeof (PPicture)); //confirmed_safe_unsafe_usage
252 } else if (i < iReorderingIndex) {252 } else if (i < iReorderingIndex) {
253 memmove (&ppRefList[1 + iReorderingIndex], &ppRefList[iReorderingIndex],253 memmove (&ppRefList[1 + iReorderingIndex], &ppRefList[iReorderingIndex],
254 (iMaxRefIdx - 1 - iReorderingIndex)*sizeof (PPicture));254 (iMaxRefIdx - iReorderingIndex)*sizeof (PPicture));
255 }255 }
256 ppRefList[iReorderingIndex] = pPic;256 ppRefList[iReorderingIndex] = pPic;
257 iReorderingIndex++;257 iReorderingIndex++;

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