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
8989
9090 pRefPic->uiRefCount[LIST_0] = 0;
9191
92− for (i = 0; i < MAX_SHORT_REF_COUNT; i++) {
92+ for (i = 0; i < MAX_DPB_COUNT; i++) {
9393 if (pRefPic->pShortRefList[LIST_0][i] != NULL) {
9494 SetUnRef (pRefPic->pShortRefList[LIST_0][i]);
9595 pRefPic->pShortRefList[LIST_0][i] = NULL;
@@ -97,7 +97,7 @@ void WelsResetRefPic (PWelsDecoderContext pCtx) { · 1 unmodified line
9797 }
9898 pRefPic->uiShortRefCount[LIST_0] = 0;
9999
100− for (i = 0; i < MAX_LONG_REF_COUNT; i++) {
100+ for (i = 0; i < MAX_DPB_COUNT; i++) {
101101 if (pRefPic->pLongRefList[LIST_0][i] != NULL) {
102102 SetUnRef (pRefPic->pLongRefList[LIST_0][i]);
103103 pRefPic->pLongRefList[LIST_0][i] = NULL;
@@ -158,7 +158,7 @@ int32_t WelsInitRefList (PWelsDecoderContext pCtx, int32_t iPoc) { · 54 unmodified lines
158158
159159 PPicture* ppShoreRefList = pCtx->sRefPic.pShortRefList[LIST_0];
160160 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));
162162 //short
163163 for (i = 0; i < pCtx->sRefPic.uiShortRefCount[LIST_0]; ++i) {
164164 pCtx->sRefPic.pRefList[LIST_0][iCount++ ] = ppShoreRefList[i];
@@ -179,7 +179,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) { · 14 unmodified lines
179179 PSliceHeader pSliceHeader = &pCtx->pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader;
180180 PPicture pPic = NULL;
181181 PPicture* ppRefList = pCtx->sRefPic.pRefList[LIST_0];
182− int32_t iMaxRefIdx = pCtx->pSps->iNumRefFrames + 1;
182+ int32_t iMaxRefIdx = pCtx->pSps->iNumRefFrames;
183183 int32_t iRefCount = pCtx->sRefPic.uiRefCount[LIST_0];
184184 int32_t iPredFrameNum = pSliceHeader->iFrameNum;
185185 int32_t iMaxPicNum = 1 << pSliceHeader->pSps->uiLog2MaxFrameNum;
@@ -251,7 +251,7 @@ int32_t WelsReorderRefList (PWelsDecoderContext pCtx) { · 65 unmodified lines
251251 (i - iReorderingIndex)*sizeof (PPicture)); //confirmed_safe_unsafe_usage
252252 } else if (i < iReorderingIndex) {
253253 memmove (&ppRefList[1 + iReorderingIndex], &ppRefList[iReorderingIndex],
254− (iMaxRefIdx - 1 - iReorderingIndex)*sizeof (PPicture));
254+ (iMaxRefIdx - iReorderingIndex)*sizeof (PPicture));
255255 }
256256 ppRefList[iReorderingIndex] = pPic;
257257 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