Showing the changes to codec/decoder/core/src/deblocking.cpp (1 of 71 files). Show all
Unified · Split
| @@ -42,8 +42,6 @@ · 41 unmodified lines | |||
| 42 | #include "deblocking_common.h" | 42 | #include "deblocking_common.h" |
| 43 | #include "cpu_core.h" | 43 | #include "cpu_core.h" |
| 44 | 44 | ||
| 45 | namespace WelsDec { | ||
| 46 | |||
| 47 | #define NO_SUPPORTED_FILTER_IDX (-1) | 45 | #define NO_SUPPORTED_FILTER_IDX (-1) |
| 48 | #define LEFT_FLAG_BIT 0 | 46 | #define LEFT_FLAG_BIT 0 |
| 49 | #define TOP_FLAG_BIT 1 | 47 | #define TOP_FLAG_BIT 1 |
| @@ -672,8 +670,8 @@ int32_t DeblockingAvailableNoInterlayer (PDqLayer pCurDqLayer, int32_t iFilterId · 622 unmodified lines | |||
| 672 | int32_t iMbY = pCurDqLayer->iMbY; | 670 | int32_t iMbY = pCurDqLayer->iMbY; |
| 673 | int32_t iMbX = pCurDqLayer->iMbX; | 671 | int32_t iMbX = pCurDqLayer->iMbX; |
| 674 | int32_t iMbXy = pCurDqLayer->iMbXyIndex; | 672 | int32_t iMbXy = pCurDqLayer->iMbXyIndex; |
| 675 | bool bLeftFlag = false; | 673 | bool bLeftFlag; |
| 676 | bool bTopFlag = false; | 674 | bool bTopFlag; |
| 677 | 675 | ||
| 678 | if (2 == iFilterIdc) { | 676 | if (2 == iFilterIdc) { |
| 679 | bLeftFlag = (iMbX > 0) && (pCurDqLayer->pSliceIdc[iMbXy] == pCurDqLayer->pSliceIdc[iMbXy - 1]); | 677 | bLeftFlag = (iMbX > 0) && (pCurDqLayer->pSliceIdc[iMbXy] == pCurDqLayer->pSliceIdc[iMbXy - 1]); |
| @@ -720,6 +718,7 @@ void FilteringEdgeLumaV (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStr · 40 unmodified lines | |||
| 720 | 718 | ||
| 721 | 719 | ||
| 722 | void FilteringEdgeLumaIntraH (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { | 720 | void FilteringEdgeLumaIntraH (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { |
| 721 | USED(pBS); | ||
| 723 | int32_t iIndexA; | 722 | int32_t iIndexA; |
| 724 | int32_t iAlpha; | 723 | int32_t iAlpha; |
| 725 | int32_t iBeta; | 724 | int32_t iBeta; |
| @@ -734,6 +733,7 @@ void FilteringEdgeLumaIntraH (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t · 8 unmodified lines | |||
| 734 | } | 733 | } |
| 735 | 734 | ||
| 736 | void FilteringEdgeLumaIntraV (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { | 735 | void FilteringEdgeLumaIntraV (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t iStride, uint8_t* pBS) { |
| 736 | USED(pBS); | ||
| 737 | int32_t iIndexA; | 737 | int32_t iIndexA; |
| 738 | int32_t iAlpha; | 738 | int32_t iAlpha; |
| 739 | int32_t iBeta; | 739 | int32_t iBeta; |
| @@ -748,6 +748,7 @@ void FilteringEdgeLumaIntraV (SDeblockingFilter* pFilter, uint8_t* pPix, int32_t · 8 unmodified lines | |||
| 748 | } | 748 | } |
| 749 | void FilteringEdgeChromaH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, | 749 | void FilteringEdgeChromaH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, |
| 750 | uint8_t* pBS) { | 750 | uint8_t* pBS) { |
| 751 | USED(pBS); | ||
| 751 | int32_t iIndexA; | 752 | int32_t iIndexA; |
| 752 | int32_t iAlpha; | 753 | int32_t iAlpha; |
| 753 | int32_t iBeta; | 754 | int32_t iBeta; |
| @@ -821,6 +822,7 @@ void FilteringEdgeChromaV (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* · 67 unmodified lines | |||
| 821 | 822 | ||
| 822 | void FilteringEdgeChromaIntraH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, | 823 | void FilteringEdgeChromaIntraH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, |
| 823 | uint8_t* pBS) { | 824 | uint8_t* pBS) { |
| 825 | USED(pBS); | ||
| 824 | int32_t iIndexA; | 826 | int32_t iIndexA; |
| 825 | int32_t iAlpha; | 827 | int32_t iAlpha; |
| 826 | int32_t iBeta; | 828 | int32_t iBeta; |
| @@ -851,6 +853,7 @@ void FilteringEdgeChromaIntraH (SDeblockingFilter* pFilter, uint8_t* pPixCb, uin · 24 unmodified lines | |||
| 851 | 853 | ||
| 852 | void FilteringEdgeChromaIntraV (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, | 854 | void FilteringEdgeChromaIntraV (SDeblockingFilter* pFilter, uint8_t* pPixCb, uint8_t* pPixCr, int32_t iStride, |
| 853 | uint8_t* pBS) { | 855 | uint8_t* pBS) { |
| 856 | USED(pBS); | ||
| 854 | int32_t iIndexA; | 857 | int32_t iIndexA; |
| 855 | int32_t iAlpha; | 858 | int32_t iAlpha; |
| 856 | int32_t iBeta; | 859 | int32_t iBeta; |
| @@ -1221,7 +1224,7 @@ void WelsDeblockingFilterSlice (PWelsDecoderContext pCtx, PDeblockingFilterMbFun · 364 unmodified lines | |||
| 1221 | SDeblockingFilter pFilter; | 1224 | SDeblockingFilter pFilter; |
| 1222 | memset (&pFilter, 0, sizeof (pFilter)); | 1225 | memset (&pFilter, 0, sizeof (pFilter)); |
| 1223 | PFmo pFmo = pCtx->pFmo; | 1226 | PFmo pFmo = pCtx->pFmo; |
| 1224 | int32_t iNextMbXyIndex = 0; | 1227 | int32_t iNextMbXyIndex; |
| 1225 | int32_t iTotalNumMb = pCurDqLayer->sLayerInfo.sSliceInLayer.iTotalMbInCurSlice; | 1228 | int32_t iTotalNumMb = pCurDqLayer->sLayerInfo.sSliceInLayer.iTotalMbInCurSlice; |
| 1226 | int32_t iCountNumMb = 0; | 1229 | int32_t iCountNumMb = 0; |
| 1227 | int32_t iBoundryFlag; | 1230 | int32_t iBoundryFlag; |
| @@ -1285,30 +1288,30 @@ void WelsDeblockingFilterSlice (PWelsDecoderContext pCtx, PDeblockingFilterMbFun · 57 unmodified lines | |||
| 1285 | * | 1288 | * |
| 1286 | * \return NONE | 1289 | * \return NONE |
| 1287 | */ | 1290 | */ |
| 1288 | void WelsDeblockingInitFilter (PWelsDecoderContext pCtx, SDeblockingFilter& pFilter, int32_t& iFilterIdc) { | 1291 | void WelsDeblockingInitFilter (PWelsDecoderContext pCtx, SDeblockingFilter *pFilter, int32_t *iFilterIdc) { |
| 1289 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; | 1292 | PDqLayer pCurDqLayer = pCtx->pCurDqLayer; |
| 1290 | PSliceHeaderExt pSliceHeaderExt = &pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt; | 1293 | PSliceHeaderExt pSliceHeaderExt = &pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt; |
| 1291 | 1294 | ||
| 1292 | memset (&pFilter, 0, sizeof (pFilter)); | 1295 | memset (pFilter, 0, sizeof (*pFilter)); |
| 1293 | 1296 | ||
| 1294 | iFilterIdc = pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc; | 1297 | *iFilterIdc = pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.uiDisableDeblockingFilterIdc; |
| 1295 | 1298 | ||
| 1296 | /* Step1: parameters set */ | 1299 | /* Step1: parameters set */ |
| 1297 | pFilter.pCsData[0] = pCtx->pDec->pData[0]; | 1300 | pFilter->pCsData[0] = pCtx->pDec->pData[0]; |
| 1298 | pFilter.pCsData[1] = pCtx->pDec->pData[1]; | 1301 | pFilter->pCsData[1] = pCtx->pDec->pData[1]; |
| 1299 | pFilter.pCsData[2] = pCtx->pDec->pData[2]; | 1302 | pFilter->pCsData[2] = pCtx->pDec->pData[2]; |
| 1300 | 1303 | ||
| 1301 | pFilter.iCsStride[0] = pCtx->pDec->iLinesize[0]; | 1304 | pFilter->iCsStride[0] = pCtx->pDec->iLinesize[0]; |
| 1302 | pFilter.iCsStride[1] = pCtx->pDec->iLinesize[1]; | 1305 | pFilter->iCsStride[1] = pCtx->pDec->iLinesize[1]; |
| 1303 | 1306 | ||
| 1304 | pFilter.eSliceType = (EWelsSliceType)pCurDqLayer->sLayerInfo.sSliceInLayer.eSliceType; | 1307 | pFilter->eSliceType = (EWelsSliceType)pCurDqLayer->sLayerInfo.sSliceInLayer.eSliceType; |
| 1305 | 1308 | ||
| 1306 | pFilter.iSliceAlphaC0Offset = pSliceHeaderExt->sSliceHeader.iSliceAlphaC0Offset; | 1309 | pFilter->iSliceAlphaC0Offset = pSliceHeaderExt->sSliceHeader.iSliceAlphaC0Offset; |
| 1307 | pFilter.iSliceBetaOffset = pSliceHeaderExt->sSliceHeader.iSliceBetaOffset; | 1310 | pFilter->iSliceBetaOffset = pSliceHeaderExt->sSliceHeader.iSliceBetaOffset; |
| 1308 | 1311 | ||
| 1309 | pFilter.pLoopf = &pCtx->sDeblockingFunc; | 1312 | pFilter->pLoopf = &pCtx->sDeblockingFunc; |
| 1310 | pFilter.pRefPics[0] = pCtx->sRefPic.pRefList[0]; | 1313 | pFilter->pRefPics[0] = pCtx->sRefPic.pRefList[0]; |
| 1311 | pFilter.pRefPics[1] = pCtx->sRefPic.pRefList[1]; | 1314 | pFilter->pRefPics[1] = pCtx->sRefPic.pRefList[1]; |
| 1312 | } | 1315 | } |
| 1313 | 1316 | ||
| 1314 | /*! | 1317 | /*! |
| @@ -1318,12 +1321,12 @@ void WelsDeblockingInitFilter (PWelsDecoderContext pCtx, SDeblockingFilter& pFil · 3 unmodified lines | |||
| 1318 | * | 1321 | * |
| 1319 | * \return NONE | 1322 | * \return NONE |
| 1320 | */ | 1323 | */ |
| 1321 | void WelsDeblockingFilterMB (PDqLayer pCurDqLayer, SDeblockingFilter& pFilter, int32_t& iFilterIdc, | 1324 | void WelsDeblockingFilterMB (PDqLayer pCurDqLayer, SDeblockingFilter *pFilter, int32_t *iFilterIdc, |
| 1322 | PDeblockingFilterMbFunc pDeblockMb) { | 1325 | PDeblockingFilterMbFunc pDeblockMb) { |
| 1323 | /* macroblock deblocking */ | 1326 | /* macroblock deblocking */ |
| 1324 | if (0 == iFilterIdc || 2 == iFilterIdc) { | 1327 | if (0 == *iFilterIdc || 2 == *iFilterIdc) { |
| 1325 | int32_t iBoundryFlag = DeblockingAvailableNoInterlayer (pCurDqLayer, iFilterIdc); | 1328 | int32_t iBoundryFlag = DeblockingAvailableNoInterlayer (pCurDqLayer, *iFilterIdc); |
| 1326 | pDeblockMb (pCurDqLayer, &pFilter, iBoundryFlag); | 1329 | pDeblockMb (pCurDqLayer, pFilter, iBoundryFlag); |
| 1327 | } | 1330 | } |
| 1328 | } | 1331 | } |
| 1329 | /*! | 1332 | /*! |
| @@ -1336,6 +1339,8 @@ void WelsDeblockingFilterMB (PDqLayer pCurDqLayer, SDeblockingFilter& pFilter, i · 6 unmodified lines | |||
| 1336 | */ | 1339 | */ |
| 1337 | 1340 | ||
| 1338 | void DeblockingInit (SDeblockingFunc* pFunc, int32_t iCpu) { | 1341 | void DeblockingInit (SDeblockingFunc* pFunc, int32_t iCpu) { |
| 1342 | USED(iCpu); | ||
| 1343 | |||
| 1339 | pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_c; | 1344 | pFunc->pfLumaDeblockingLT4Ver = DeblockLumaLt4V_c; |
| 1340 | pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_c; | 1345 | pFunc->pfLumaDeblockingEQ4Ver = DeblockLumaEq4V_c; |
| 1341 | pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_c; | 1346 | pFunc->pfLumaDeblockingLT4Hor = DeblockLumaLt4H_c; |
| @@ -1418,5 +1423,3 @@ void DeblockingInit (SDeblockingFunc* pFunc, int32_t iCpu) { · 76 unmodified lines | |||
| 1418 | } | 1423 | } |
| 1419 | #endif//HAVE_MSA | 1424 | #endif//HAVE_MSA |
| 1420 | } | 1425 | } |
| 1421 | |||
| 1422 | } // namespace WelsDec | ||