Changeset 1222 in 3DVCSoftware for branches/HTM-14.1-update-dev4-RWTH/source/Lib/TLibCommon/TComPrediction.cpp
- Timestamp:
- 21 May 2015, 15:43:58 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev4-RWTH/source/Lib/TLibCommon/TComPrediction.cpp
r1210 r1222 747 747 #endif 748 748 749 #if H_3D_DBBP749 #if NH_3D_DBBP 750 750 PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU) 751 751 { 752 const TComSPS* sps = pcCU->getSlice()->getSPS(); 753 UInt uiMaxCUWidth = sps->getMaxCUWidth(); 754 UInt uiMaxCUHeight = sps->getMaxCUHeight(); 755 752 756 // find virtual partitioning for this CU based on depth block 753 757 // segmentation of texture block --> mask IDs … … 757 761 Int iSumDepth = 0; 758 762 Int iSubSample = 4; 759 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth( );760 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight( );763 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y); 764 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y); 761 765 TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag( ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV; 762 766 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) … … 764 768 cDv.setVer(0); 765 769 } 766 Int iBlkX = ( pcCU->get Addr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2);767 Int iBlkY = ( pcCU->get Addr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2);770 Int iBlkX = ( pcCU->getCtuRsAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getHor()+2)>>2); 771 Int iBlkY = ( pcCU->getCtuRsAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getVer()+2)>>2); 768 772 769 773 UInt t=0; … … 852 856 } 853 857 854 PartSize matchedPartSize = SIZE_NONE;858 PartSize matchedPartSize = NUMBER_OF_PART_SIZES; 855 859 856 860 Int iMaxMatchSum = 0; … … 867 871 } 868 872 869 AOF( matchedPartSize != SIZE_NONE);873 AOF( matchedPartSize != NUMBER_OF_PART_SIZES ); 870 874 871 875 return matchedPartSize; … … 874 878 Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU) 875 879 { 880 const TComSPS* sps = pcCU->getSlice()->getSPS(); 881 UInt uiMaxCUWidth = sps->getMaxCUWidth(); 882 UInt uiMaxCUHeight = sps->getMaxCUHeight(); 883 876 884 // segmentation of texture block --> mask IDs 877 885 Pel* pDepthBlockStart = pDepthPels; … … 885 893 iSumDepth = pDepthPels[ 0 ]; 886 894 887 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth( );888 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight( );895 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y); 896 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y); 889 897 TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag( ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV; 890 898 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) … … 892 900 cDv.setVer(0); 893 901 } 894 Int iBlkX = ( pcCU->get Addr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getHor()+2)>>2);895 Int iBlkY = ( pcCU->get Addr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCU() ) * g_uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCU() ] ]+ ((cDv.getVer()+2)>>2);902 Int iBlkX = ( pcCU->getCtuRsAddr() % pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUWidth + g_auiRasterToPelX[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getHor()+2)>>2); 903 Int iBlkY = ( pcCU->getCtuRsAddr() / pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getFrameWidthInCtus() ) * uiMaxCUHeight + g_auiRasterToPelY[ g_auiZscanToRaster[ pcCU->getZorderIdxInCtu() ] ]+ ((cDv.getVer()+2)>>2); 896 904 if (iBlkX>(Int)(iPictureWidth - uiWidth)) 897 905 { … … 1008 1016 } 1009 1017 1010 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize )1011 { 1012 Pel* piSrc[2] = {pInYuv[0]->get LumaAddr(uiPartAddr), pInYuv[1]->getLumaAddr(uiPartAddr)};1013 UInt uiSrcStride = pInYuv[0]->getStride( );1014 Pel* piDst = pOutYuv->get LumaAddr(uiPartAddr);1015 UInt uiDstStride = pOutYuv->getStride( );1018 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize, Int bitDepthY ) 1019 { 1020 Pel* piSrc[2] = {pInYuv[0]->getAddr(COMPONENT_Y, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Y, uiPartAddr)}; 1021 UInt uiSrcStride = pInYuv[0]->getStride(COMPONENT_Y); 1022 Pel* piDst = pOutYuv->getAddr(COMPONENT_Y, uiPartAddr); 1023 UInt uiDstStride = pOutYuv->getStride(COMPONENT_Y); 1016 1024 1017 1025 UInt uiMaskStride= MAX_CU_SIZE; … … 1052 1060 right = (x==uiWidth-1) ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1]; 1053 1061 1054 piDst[x] = (l!=r) ? Clip Y( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 )) : tmpTar[y*uiWidth+x];1062 piDst[x] = (l!=r) ? ClipBD( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x]; 1055 1063 } 1056 1064 piDst += uiDstStride; … … 1070 1078 bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x]; 1071 1079 1072 piDst[x] = (t!=b) ? Clip Y( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 )) : tmpTar[y*uiWidth+x];1080 piDst[x] = (t!=b) ? ClipBD( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x]; 1073 1081 } 1074 1082 piDst += uiDstStride; … … 1083 1091 1084 1092 // now combine chroma 1085 Pel* piSrcU[2] = { pInYuv[0]->get CbAddr(uiPartAddr), pInYuv[1]->getCbAddr(uiPartAddr) };1086 Pel* piSrcV[2] = { pInYuv[0]->get CrAddr(uiPartAddr), pInYuv[1]->getCrAddr(uiPartAddr) };1087 UInt uiSrcStrideC = pInYuv[0]->get CStride();1088 Pel* piDstU = pOutYuv->get CbAddr(uiPartAddr);1089 Pel* piDstV = pOutYuv->get CrAddr(uiPartAddr);1090 UInt uiDstStrideC = pOutYuv->get CStride();1093 Pel* piSrcU[2] = { pInYuv[0]->getAddr(COMPONENT_Cb, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cb, uiPartAddr) }; 1094 Pel* piSrcV[2] = { pInYuv[0]->getAddr(COMPONENT_Cr, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cr, uiPartAddr) }; 1095 UInt uiSrcStrideC = pInYuv[0]->getStride(COMPONENT_Cb); 1096 Pel* piDstU = pOutYuv->getAddr(COMPONENT_Cb, uiPartAddr); 1097 Pel* piDstV = pOutYuv->getAddr(COMPONENT_Cr, uiPartAddr); 1098 UInt uiDstStrideC = pOutYuv->getStride(COMPONENT_Cb); 1091 1099 UInt uiWidthC = uiWidth >> 1; 1092 1100 UInt uiHeightC = uiHeight >> 1; … … 1134 1142 if (l!=r) 1135 1143 { 1136 filSrcU = Clip C( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ));1137 filSrcV = Clip C( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ));1144 filSrcU = ClipBD( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ), bitDepthY); 1145 filSrcV = ClipBD( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ), bitDepthY); 1138 1146 } 1139 1147 else … … 1167 1175 if (t!=b) 1168 1176 { 1169 filSrcU = Clip C( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ));1170 filSrcV = Clip C( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ));1177 filSrcU = ClipBD( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ), bitDepthY); 1178 filSrcV = ClipBD( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ), bitDepthY); 1171 1179 } 1172 1180 else
Note: See TracChangeset for help on using the changeset viewer.