MCPcopy Create free account
hub / github.com/cisco/openh264 / FreePicture

Function FreePicture

codec/decoder/core/src/pic_queue.cpp:139–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139void FreePicture (PPicture pPic, CMemoryAlign* pMa) {
140 if (NULL != pPic) {
141 if (pPic->pBuffer[0]) {
142 pMa->WelsFree (pPic->pBuffer[0], "pPic->pBuffer[0]");
143 pPic->pBuffer[0] = NULL;
144 }
145
146 if (pPic->pMbCorrectlyDecodedFlag) {
147 pMa->WelsFree (pPic->pMbCorrectlyDecodedFlag, "pPic->pMbCorrectlyDecodedFlag");
148 pPic->pMbCorrectlyDecodedFlag = NULL;
149 }
150
151 if (pPic->pNzc) {
152 pMa->WelsFree (pPic->pNzc, "pPic->pNzc");
153 pPic->pNzc = NULL;
154 }
155
156 if (pPic->pMbType) {
157 pMa->WelsFree (pPic->pMbType, "pPic->pMbType");
158 pPic->pMbType = NULL;
159 }
160
161 for (int32_t listIdx = LIST_0; listIdx < LIST_A; ++listIdx) {
162 if (pPic->pMv[listIdx]) {
163 pMa->WelsFree (pPic->pMv[listIdx], "pPic->pMv[]");
164 pPic->pMv[listIdx] = NULL;
165 }
166
167 if (pPic->pRefIndex[listIdx]) {
168 pMa->WelsFree (pPic->pRefIndex[listIdx], "pPic->pRefIndex[]");
169 pPic->pRefIndex[listIdx] = NULL;
170 }
171 }
172 if (pPic->pReadyEvent != NULL) {
173 uint32_t uiMbHeight = (pPic->iHeightInPixel + 15) >> 4;
174 for (uint32_t i = 0; i < uiMbHeight; ++i) {
175 CLOSE_EVENT (&pPic->pReadyEvent[i]);
176 }
177 pMa->WelsFree (pPic->pReadyEvent, "pPic->pReadyEvent");
178 pPic->pReadyEvent = NULL;
179 }
180 pMa->WelsFree (pPic, "pPic");
181 pPic = NULL;
182 }
183}
184PPicture PrefetchPic (PPicBuff pPicBuf) {
185 int32_t iPicIdx = 0;
186 PPicture pPic = NULL;

Callers 5

DecreasePicBuffFunction · 0.70
DestroyPicBuffFunction · 0.70
WelsFreeDynamicMemoryFunction · 0.70
SyncPictureResolutionExtFunction · 0.70
AllocPictureFunction · 0.70

Calls 1

WelsFreeMethod · 0.80

Tested by

no test coverage detected