| 137 | } |
| 138 | |
| 139 | void 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 | } |
| 184 | PPicture PrefetchPic (PPicBuff pPicBuf) { |
| 185 | int32_t iPicIdx = 0; |
| 186 | PPicture pPic = NULL; |
no test coverage detected