Showing the changes to codec/decoder/core/src/pic_queue.cpp (1 of 71 files). Show all
Unified · Split
| @@ -42,8 +42,6 @@ · 41 unmodified lines | ||
| 42 | 42 | #include "codec_def.h" |
| 43 | 43 | #include "memory_align.h" |
| 44 | 44 | |
| 45 | −namespace WelsDec { | |
| 46 | − | |
| 47 | 45 | void FreePicture (PPicture pPic, CMemoryAlign* pMa); |
| 48 | 46 | |
| 49 | 47 | |
| @@ -60,14 +58,14 @@ void FreePicture (PPicture pPic, CMemoryAlign* pMa); · 10 unmodified lines | ||
| 60 | 58 | |
| 61 | 59 | |
| 62 | 60 | PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const int32_t kiPicHeight) { |
| 63 | − PPicture pPic = NULL; | |
| 64 | − int32_t iPicWidth = 0; | |
| 65 | − int32_t iPicHeight = 0; | |
| 66 | − | |
| 67 | − int32_t iPicChromaWidth = 0; | |
| 68 | − int32_t iPicChromaHeight = 0; | |
| 69 | − int32_t iLumaSize = 0; | |
| 70 | − int32_t iChromaSize = 0; | |
| 61 | + PPicture pPic; | |
| 62 | + int32_t iPicWidth; | |
| 63 | + int32_t iPicHeight; | |
| 64 | + | |
| 65 | + int32_t iPicChromaWidth; | |
| 66 | + int32_t iPicChromaHeight; | |
| 67 | + int32_t iLumaSize; | |
| 68 | + int32_t iChromaSize; | |
| 71 | 69 | CMemoryAlign* pMa = pCtx->pMemAlign; |
| 72 | 70 | |
| 73 | 71 | pPic = (PPicture) pMa->WelsMallocz (sizeof (SPicture), "PPicture"); |
| @@ -89,7 +87,7 @@ PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const · 15 unmodified lines | ||
| 89 | 87 | pPic->iLinesize[0] = iPicWidth; |
| 90 | 88 | pPic->iLinesize[1] = pPic->iLinesize[2] = iPicChromaWidth; |
| 91 | 89 | } else { |
| 92 | − pPic->pBuffer[0] = static_cast<uint8_t*> (pMa->WelsMallocz (iLumaSize /* luma */ | |
| 90 | + pPic->pBuffer[0] = (uint8_t*) (pMa->WelsMallocz (iLumaSize /* luma */ | |
| 93 | 91 | + (iChromaSize << 1) /* Cb,Cr */, "_pic->buffer[0]")); |
| 94 | 92 | WELS_VERIFY_RETURN_PROC_IF (NULL, NULL == pPic->pBuffer[0], FreePicture (pPic, pMa)); |
| 95 | 93 | |
| @@ -177,11 +175,10 @@ void FreePicture (PPicture pPic, CMemoryAlign* pMa) { · 81 unmodified lines | ||
| 177 | 175 | pPic->pReadyEvent = NULL; |
| 178 | 176 | } |
| 179 | 177 | pMa->WelsFree (pPic, "pPic"); |
| 180 | − pPic = NULL; | |
| 181 | 178 | } |
| 182 | 179 | } |
| 183 | 180 | PPicture PrefetchPic (PPicBuff pPicBuf) { |
| 184 | − int32_t iPicIdx = 0; | |
| 181 | + int32_t iPicIdx; | |
| 185 | 182 | PPicture pPic = NULL; |
| 186 | 183 | |
| 187 | 184 | if (pPicBuf->iCapacity == 0) { |
| @@ -216,7 +213,7 @@ PPicture PrefetchPic (PPicBuff pPicBuf) { · 28 unmodified lines | ||
| 216 | 213 | } |
| 217 | 214 | |
| 218 | 215 | PPicture PrefetchPicForThread (PPicBuff pPicBuf) { |
| 219 | − PPicture pPic = NULL; | |
| 216 | + PPicture pPic; | |
| 220 | 217 | |
| 221 | 218 | if (pPicBuf->iCapacity == 0) { |
| 222 | 219 | return NULL; |
| @@ -229,7 +226,7 @@ PPicture PrefetchPicForThread (PPicBuff pPicBuf) { · 6 unmodified lines | ||
| 229 | 226 | return pPic; |
| 230 | 227 | } |
| 231 | 228 | |
| 232 | −PPicture PrefetchLastPicForThread (PPicBuff pPicBuf, const int32_t& iLastPicBuffIdx) { | |
| 229 | +PPicture PrefetchLastPicForThread (PPicBuff pPicBuf, const int32_t iLastPicBuffIdx) { | |
| 233 | 230 | PPicture pPic = NULL; |
| 234 | 231 | |
| 235 | 232 | if (pPicBuf->iCapacity == 0) { |
| @@ -240,5 +237,3 @@ PPicture PrefetchLastPicForThread (PPicBuff pPicBuf, const int32_t& iLastPicBuff · 4 unmodified lines | ||
| 240 | 237 | } |
| 241 | 238 | return pPic; |
| 242 | 239 | } |
| 243 | − | |
| 244 | −} // namespace WelsDec | |