Showing the changes to codec/decoder/core/src/decode_slice.cpp (1 of 1 file). Show all
Unified · Split
| @@ -52,6 +52,8 @@ · 51 unmodified lines | |||
| 52 | 52 | ||
| 53 | namespace WelsDec { | 53 | namespace WelsDec { |
| 54 | 54 | ||
| 55 | extern void FreePicture (PPicture pPic, CMemoryAlign* pMa); | ||
| 56 | |||
| 55 | static inline int32_t iAbs (int32_t x) { | 57 | static inline int32_t iAbs (int32_t x) { |
| 56 | static const int32_t INT_BITS = (sizeof (int) * CHAR_BIT) - 1; | 58 | static const int32_t INT_BITS = (sizeof (int) * CHAR_BIT) - 1; |
| 57 | int32_t y = x >> INT_BITS; | 59 | int32_t y = x >> INT_BITS; |
| @@ -208,6 +210,12 @@ int32_t WelsMbInterConstruction (PWelsDecoderContext pCtx, PDqLayer pCurLayer) { · 150 unmodified lines | |||
| 208 | } else { | 210 | } else { |
| 209 | if (pCtx->pTempDec == NULL) | 211 | if (pCtx->pTempDec == NULL) |
| 210 | pCtx->pTempDec = AllocPicture (pCtx, pCtx->pSps->iMbWidth << 4, pCtx->pSps->iMbHeight << 4); | 212 | pCtx->pTempDec = AllocPicture (pCtx, pCtx->pSps->iMbWidth << 4, pCtx->pSps->iMbHeight << 4); |
| 213 | else { | ||
| 214 | if (pCtx->pTempDec->iLinesize[0] != pCtx->pDec->iLinesize[0]) { | ||
| 215 | FreePicture (pCtx->pTempDec, pCtx->pMemAlign); | ||
| 216 | pCtx->pTempDec = AllocPicture (pCtx, pCtx->pSps->iMbWidth << 4, pCtx->pSps->iMbHeight << 4); | ||
| 217 | } | ||
| 218 | } | ||
| 211 | uint8_t* pTempDstYCbCr[3]; | 219 | uint8_t* pTempDstYCbCr[3]; |
| 212 | uint8_t* pDstYCbCr[3]; | 220 | uint8_t* pDstYCbCr[3]; |
| 213 | pTempDstYCbCr[0] = pCtx->pTempDec->pData[0] + ((iMbY * iLumaStride + iMbX) << 4); | 221 | pTempDstYCbCr[0] = pCtx->pTempDec->pData[0] + ((iMbY * iLumaStride + iMbX) << 4); |