History

B-frame decoding support for Main and High Profile with two test cases.

xiaotianshi2 committed 8 years ago

Commit 657d2171 parent e3e838355 files · +17936 −13825Browse files

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

Unified · Split

codec/decoder/core/src/pic_queue.cpp+30−2
@@ -108,18 +108,46 @@ PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const · 107 unmodified lines
108108 pPic->iFrameNum = -1;
109109 pPic->bAvailableFlag = true;
110110
111+ uint32_t uiMbWidth = (kiPicWidth + 15) >> 4;
112+ uint32_t uiMbHeight = (kiPicHeight + 15) >> 4;
113+ uint32_t uiMbCount = uiMbWidth * uiMbHeight;
114+ pPic->pMbType = (uint32_t*)pMa->WelsMallocz (uiMbCount * sizeof (uint32_t),
115+ "pPic->pMbType");
116+ pPic->pMv[LIST_0] = (int16_t (*)[16][2])pMa->WelsMallocz (uiMbCount * sizeof (
117+ int16_t) * MV_A * MB_BLOCK4x4_NUM, "pPic->pMv[]");
118+ pPic->pMv[LIST_1] = (int16_t (*)[16][2])pMa->WelsMallocz (uiMbCount * sizeof (
119+ int16_t) * MV_A * MB_BLOCK4x4_NUM, "pPic->pMv[]");
120+ pPic->pRefIndex[LIST_0] = (int8_t (*)[16])pMa->WelsMallocz (uiMbCount * sizeof (
121+ int8_t) * MB_BLOCK4x4_NUM, "pCtx->sMb.pRefIndex[]");
122+ pPic->pRefIndex[LIST_1] = (int8_t (*)[16])pMa->WelsMallocz (uiMbCount * sizeof (
123+ int8_t) * MB_BLOCK4x4_NUM, "pCtx->sMb.pRefIndex[]");
111124 return pPic;
112125 }
113126
114127 void FreePicture (PPicture pPic, CMemoryAlign* pMa) {
115128 if (NULL != pPic) {
116−
117129 if (pPic->pBuffer[0]) {
118130 pMa->WelsFree (pPic->pBuffer[0], "pPic->pBuffer[0]");
131+ pPic->pBuffer[0] = NULL;
119132 }
120133
121− pMa->WelsFree (pPic, "pPic");
134+ if (pPic->pMbType) {
135+ pMa->WelsFree (pPic->pMbType, "pPic->pMbType");
136+ pPic->pMbType = NULL;
137+ }
122138
139+ for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) {
140+ if (pPic->pMv[listIdx]) {
141+ pMa->WelsFree (pPic->pMv[listIdx], "pPic->pMv[]");
142+ pPic->pMv[listIdx] = NULL;
143+ }
144+
145+ if (pPic->pRefIndex[listIdx]) {
146+ pMa->WelsFree (pPic->pRefIndex[listIdx], "pPic->pRefIndex[]");
147+ pPic->pRefIndex[listIdx] = NULL;
148+ }
149+ }
150+ pMa->WelsFree (pPic, "pPic");
123151 pPic = NULL;
124152 }
125153 }

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