Changeset 1274 in 3DVCSoftware for branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComPrediction.cpp
- Timestamp:
- 14 Jul 2015, 12:31:09 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-14.1-update-dev2/source/Lib/TLibCommon/TComPrediction.cpp
r1226 r1274 82 82 } 83 83 } 84 #if H_3D_VSP85 m_pDepthBlock = (Int*) malloc(MAX_NUM_ SPU_W*MAX_NUM_SPU_W*sizeof(Int));84 #if NH_3D_VSP 85 m_pDepthBlock = (Int*) malloc(MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH*sizeof(Int)); 86 86 if (m_pDepthBlock == NULL) 87 87 { … … 94 94 TComPrediction::~TComPrediction() 95 95 { 96 #if H_3D_VSP96 #if NH_3D_VSP 97 97 if (m_pDepthBlock != NULL) 98 98 { … … 123 123 m_cYuvPredTemp.destroy(); 124 124 125 #if H_3D_ARP125 #if NH_3D_ARP 126 126 m_acYuvPredBase[0].destroy(); 127 127 m_acYuvPredBase[1].destroy(); … … 182 182 183 183 m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 184 #if H_3D_ARP185 m_acYuvPredBase[0] .create( g_uiMaxCUWidth, g_uiMaxCUHeight);186 m_acYuvPredBase[1] .create( g_uiMaxCUWidth, g_uiMaxCUHeight);187 #endif 188 #if H_3D_VSP189 m_cYuvDepthOnVsp.create( g_uiMaxCUWidth, g_uiMaxCUHeight);184 #if NH_3D_ARP 185 m_acYuvPredBase[0] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 186 m_acYuvPredBase[1] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 187 #endif 188 #if NH_3D_VSP 189 m_cYuvDepthOnVsp.create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 190 190 #endif 191 191 … … 648 648 Int RefPOCL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getPOC(); 649 649 Int RefPOCL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getPOC(); 650 #if H_3D_ARP650 #if NH_3D_ARP 651 651 if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr)) 652 652 #else … … 661 661 } 662 662 663 #if H_3D_SPIVMP663 #if NH_3D_SPIVMP 664 664 Void TComPrediction::xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr ) 665 665 { … … 670 670 pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]); 671 671 } 672 #if H_3D_ARP // check this! 672 673 if( pcCU->getARPW( uiPartAddr ) != 0 ) 673 674 { 674 675 return; 675 676 } 677 #endif 676 678 677 679 // horizontal sub-PU merge … … 747 749 #endif 748 750 749 #if H_3D_DBBP751 #if NH_3D_DBBP 750 752 PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU) 751 753 { 754 const TComSPS* sps = pcCU->getSlice()->getSPS(); 755 UInt uiMaxCUWidth = sps->getMaxCUWidth(); 756 UInt uiMaxCUHeight = sps->getMaxCUHeight(); 757 752 758 // find virtual partitioning for this CU based on depth block 753 759 // segmentation of texture block --> mask IDs … … 757 763 Int iSumDepth = 0; 758 764 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( );765 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y); 766 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y); 761 767 TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag( ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV; 762 768 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) … … 764 770 cDv.setVer(0); 765 771 } 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);772 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); 773 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 774 769 775 UInt t=0; … … 852 858 } 853 859 854 PartSize matchedPartSize = SIZE_NONE;860 PartSize matchedPartSize = NUMBER_OF_PART_SIZES; 855 861 856 862 Int iMaxMatchSum = 0; … … 867 873 } 868 874 869 AOF( matchedPartSize != SIZE_NONE);875 AOF( matchedPartSize != NUMBER_OF_PART_SIZES ); 870 876 871 877 return matchedPartSize; … … 874 880 Bool TComPrediction::getSegmentMaskFromDepth( Pel* pDepthPels, UInt uiDepthStride, UInt uiWidth, UInt uiHeight, Bool* pMask, TComDataCU*& pcCU) 875 881 { 882 const TComSPS* sps = pcCU->getSlice()->getSPS(); 883 UInt uiMaxCUWidth = sps->getMaxCUWidth(); 884 UInt uiMaxCUHeight = sps->getMaxCUHeight(); 885 876 886 // segmentation of texture block --> mask IDs 877 887 Pel* pDepthBlockStart = pDepthPels; … … 885 895 iSumDepth = pDepthPels[ 0 ]; 886 896 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( );897 Int iPictureWidth = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getWidth(COMPONENT_Y); 898 Int iPictureHeight = pcCU->getSlice()->getIvPic (true, pcCU->getDvInfo(0).m_aVIdxCan)->getPicYuvRec()->getHeight(COMPONENT_Y); 889 899 TComMv cDv = pcCU->getSlice()->getDepthRefinementFlag( ) ? pcCU->getDvInfo(0).m_acDoNBDV : pcCU->getDvInfo(0).m_acNBDV; 890 900 if( pcCU->getSlice()->getDepthRefinementFlag( ) ) … … 892 902 cDv.setVer(0); 893 903 } 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);904 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); 905 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 906 if (iBlkX>(Int)(iPictureWidth - uiWidth)) 897 907 { … … 1008 1018 } 1009 1019 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( );1020 Void TComPrediction::combineSegmentsWithMask( TComYuv* pInYuv[2], TComYuv* pOutYuv, Bool* pMask, UInt uiWidth, UInt uiHeight, UInt uiPartAddr, UInt partSize, Int bitDepthY ) 1021 { 1022 Pel* piSrc[2] = {pInYuv[0]->getAddr(COMPONENT_Y, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Y, uiPartAddr)}; 1023 UInt uiSrcStride = pInYuv[0]->getStride(COMPONENT_Y); 1024 Pel* piDst = pOutYuv->getAddr(COMPONENT_Y, uiPartAddr); 1025 UInt uiDstStride = pOutYuv->getStride(COMPONENT_Y); 1016 1026 1017 1027 UInt uiMaskStride= MAX_CU_SIZE; … … 1052 1062 right = (x==uiWidth-1) ? tmpTar[y*uiWidth+x] : tmpTar[y*uiWidth+x+1]; 1053 1063 1054 piDst[x] = (l!=r) ? Clip Y( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 )) : tmpTar[y*uiWidth+x];1064 piDst[x] = (l!=r) ? ClipBD( Pel(( left + (tmpTar[y*uiWidth+x] << 1) + right ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x]; 1055 1065 } 1056 1066 piDst += uiDstStride; … … 1070 1080 bottom = (y==uiHeight-1) ? tmpTar[y*uiWidth+x] : tmpTar[(y+1)*uiWidth+x]; 1071 1081 1072 piDst[x] = (t!=b) ? Clip Y( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 )) : tmpTar[y*uiWidth+x];1082 piDst[x] = (t!=b) ? ClipBD( Pel(( top + (tmpTar[y*uiWidth+x] << 1) + bottom ) >> 2 ), bitDepthY) : tmpTar[y*uiWidth+x]; 1073 1083 } 1074 1084 piDst += uiDstStride; … … 1083 1093 1084 1094 // 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();1095 Pel* piSrcU[2] = { pInYuv[0]->getAddr(COMPONENT_Cb, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cb, uiPartAddr) }; 1096 Pel* piSrcV[2] = { pInYuv[0]->getAddr(COMPONENT_Cr, uiPartAddr), pInYuv[1]->getAddr(COMPONENT_Cr, uiPartAddr) }; 1097 UInt uiSrcStrideC = pInYuv[0]->getStride(COMPONENT_Cb); 1098 Pel* piDstU = pOutYuv->getAddr(COMPONENT_Cb, uiPartAddr); 1099 Pel* piDstV = pOutYuv->getAddr(COMPONENT_Cr, uiPartAddr); 1100 UInt uiDstStrideC = pOutYuv->getStride(COMPONENT_Cb); 1091 1101 UInt uiWidthC = uiWidth >> 1; 1092 1102 UInt uiHeightC = uiHeight >> 1; … … 1134 1144 if (l!=r) 1135 1145 { 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 ));1146 filSrcU = ClipBD( Pel(( leftU + (tmpTarU[y*uiWidthC+x] << 1) + rightU ) >> 2 ), bitDepthY); 1147 filSrcV = ClipBD( Pel(( leftV + (tmpTarV[y*uiWidthC+x] << 1) + rightV ) >> 2 ), bitDepthY); 1138 1148 } 1139 1149 else … … 1167 1177 if (t!=b) 1168 1178 { 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 ));1179 filSrcU = ClipBD( Pel(( topU + (tmpTarU[y*uiWidthC+x] << 1) + bottomU ) >> 2 ), bitDepthY); 1180 filSrcV = ClipBD( Pel(( topV + (tmpTarV[y*uiWidthC+x] << 1) + bottomV ) >> 2 ), bitDepthY); 1171 1181 } 1172 1182 else … … 1205 1215 { 1206 1216 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1207 #if H_3D_VSP1217 #if NH_3D_VSP 1208 1218 if ( pcCU->getVSPFlag(uiPartAddr) == 0) 1209 1219 { 1210 1220 #endif 1211 if ( eRefPicList != REF_PIC_LIST_X ) 1212 { 1213 if( pcCU->getSlice()->getPPS()->getUseWP()) 1214 { 1215 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true ); 1221 if ( eRefPicList != REF_PIC_LIST_X ) 1222 { 1223 if( pcCU->getSlice()->getPPS()->getUseWP()) 1224 { 1225 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true ); 1226 } 1227 else 1228 { 1229 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1230 } 1231 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 1232 { 1233 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1234 } 1216 1235 } 1217 1236 else 1218 1237 { 1219 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1220 } 1221 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 1222 { 1223 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1224 } 1225 } 1226 else 1227 { 1228 #if H_3D_SPIVMP 1238 #if NH_3D_SPIVMP 1229 1239 if ( pcCU->getSPIVMPFlag(uiPartAddr)!=0) 1230 1240 { … … 1258 1268 { 1259 1269 #endif 1270 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 1271 { 1272 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 1273 } 1274 else 1275 { 1276 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1277 } 1278 #if NH_3D_SPIVMP 1279 } 1280 #endif 1281 } 1282 #if NH_3D_VSP 1283 } 1284 else 1285 { 1260 1286 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 1261 1287 { 1262 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );1288 xPredInterUniVSP( pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 1263 1289 } 1264 1290 else 1265 1291 { 1266 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1267 } 1268 #if H_3D_SPIVMP 1269 } 1270 #endif 1271 } 1272 #if H_3D_VSP 1292 xPredInterBiVSP ( pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1293 } 1294 } 1295 #endif 1296 return; 1297 } 1298 1299 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartitions(); iPartIdx++ ) 1300 { 1301 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1302 1303 #if NH_3D_VSP 1304 if ( pcCU->getVSPFlag(uiPartAddr) == 0 ) 1305 { 1306 #endif 1307 if ( eRefPicList != REF_PIC_LIST_X ) 1308 { 1309 if( pcCU->getSlice()->getPPS()->getUseWP()) 1310 { 1311 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true ); 1312 } 1313 else 1314 { 1315 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1316 } 1317 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 1318 { 1319 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1320 } 1273 1321 } 1274 1322 else 1275 1323 { 1276 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 1277 { 1278 xPredInterUniVSP( pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 1279 } 1280 else 1281 { 1282 xPredInterBiVSP ( pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1283 } 1284 } 1285 #endif 1286 return; 1287 } 1288 1289 for ( iPartIdx = 0; iPartIdx < pcCU->getNumPartitions(); iPartIdx++ ) 1290 { 1291 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1292 1293 #if H_3D_VSP 1294 if ( pcCU->getVSPFlag(uiPartAddr) == 0 ) 1295 { 1296 #endif 1297 if ( eRefPicList != REF_PIC_LIST_X ) 1298 { 1299 if( pcCU->getSlice()->getPPS()->getUseWP()) 1300 { 1301 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, true ); 1302 } 1303 else 1304 { 1305 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1306 } 1307 if ( pcCU->getSlice()->getPPS()->getUseWP() ) 1308 { 1309 xWeightedPredictionUni( pcCU, pcYuvPred, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred ); 1310 } 1311 } 1312 else 1313 { 1314 #if H_3D_SPIVMP 1315 if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 1324 #if NH_3D_SPIVMP 1325 if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 1316 1326 { 1317 1327 Int iNumSPInOneLine, iNumSP, iSPWidth, iSPHeight; … … 1343 1353 { 1344 1354 #endif 1345 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) )1346 {1347 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred );1348 }1349 else1350 {1351 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );1352 }1353 #if H_3D_SPIVMP1354 1355 #endif 1356 } 1357 #if H_3D_VSP1355 if ( xCheckIdenticalMotion( pcCU, uiPartAddr ) ) 1356 { 1357 xPredInterUni (pcCU, uiPartAddr, iWidth, iHeight, REF_PIC_LIST_0, pcYuvPred ); 1358 } 1359 else 1360 { 1361 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1362 } 1363 #if NH_3D_SPIVMP 1364 } 1365 #endif 1366 } 1367 #if NH_3D_VSP 1358 1368 } 1359 1369 else … … 1381 1391 pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx ); 1382 1392 #endif 1383 #if H_3D_ARP 1384 if(pcCU->getARPW( uiPartAddr ) > 0 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC()) 1385 { 1386 xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , rpcYuvPred , bi ); 1393 #if NH_3D_ARP 1394 if( pcCU->getARPW( uiPartAddr ) > 0 ) 1395 { 1396 if( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()== pcCU->getSlice()->getPOC() ) 1397 { 1398 xPredInterUniARPviewRef( pcCU , uiPartAddr , iWidth , iHeight , eRefPicList , pcYuvPred , bi ); 1387 1399 } 1388 1400 else 1389 1401 { 1390 if( pcCU->getARPW( uiPartAddr ) > 0 1391 && pcCU->getPartitionSize(uiPartAddr)==SIZE_2Nx2N 1392 && pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() 1393 ) 1394 { 1395 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, rpcYuvPred, bi ); 1402 xPredInterUniARP( pcCU, uiPartAddr, iWidth, iHeight, eRefPicList, pcYuvPred, bi ); 1403 } 1396 1404 } 1397 1405 else … … 1404 1412 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) ); 1405 1413 xPredInterBlk(compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) 1406 #if H_3D_ARP1414 #if NH_3D_ARP 1407 1415 , false 1408 1416 #endif … … 1412 1420 #endif 1413 1421 } 1414 #if H_3D_ARP 1415 } 1416 } 1417 #endif 1418 } 1419 1420 #if H_3D_VSP 1422 #if NH_3D_ARP 1423 } 1424 #endif 1425 } 1426 1427 #if NH_3D_VSP 1421 1428 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1422 1429 { … … 1439 1446 Void TComPrediction::xPredInterUniSubPU( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, Int widthSubPU, Int heightSubPU ) 1440 1447 { 1441 UInt numPartsInLine = pcCU->getPic()->getNumPartIn Width();1448 UInt numPartsInLine = pcCU->getPic()->getNumPartInCtuWidth(); 1442 1449 UInt horiNumPartsInSubPU = widthSubPU >> 2; 1443 1450 UInt vertNumPartsInSubPU = (heightSubPU >> 2) * numPartsInLine; … … 1455 1462 pcCU->clipMv(cMv); 1456 1463 1457 xPredInter LumaBlk ( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi);1458 xPredInter ChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi);1459 1460 } 1461 } 1462 } 1463 1464 #endif 1465 1466 #if H_3D_ARP1467 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi , TComMvField * pNewMvFiled)1468 { 1469 Int iRefIdx = p NewMvFiled ? pNewMvFiled->getRefIdx() : pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr );1470 TComMv cMv = p NewMvFiled ? pNewMvFiled->getMv() : pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr );1464 xPredInterBlk( COMPONENT_Y, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) ); 1465 xPredInterBlk( COMPONENT_Cb, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) ); 1466 xPredInterBlk( COMPONENT_Cr, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, refIdx )->getPicYuvRec(), partAddrSubPU, &cMv, widthSubPU, heightSubPU, rpcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_CHROMA) ); 1467 } 1468 } 1469 } 1470 #endif 1471 1472 #if NH_3D_ARP 1473 //temporal ARP 1474 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1475 { 1476 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); 1477 TComMv cMv = pcCU->getCUMvField( eRefPicList )->getMv( uiPartAddr ); 1471 1478 Bool bTobeScaled = false; 1472 1479 TComPic* pcPicYuvBaseCol = NULL; 1473 1480 TComPic* pcPicYuvBaseRef = NULL; 1474 1481 1475 #if H_3D_NBDV1482 #if NH_3D_NBDV 1476 1483 DisInfo cDistparity; 1477 1484 cDistparity.m_acNBDV = pcCU->getDvInfo(0).m_acNBDV; … … 1482 1489 UChar dW = pcCU->getARPW ( uiPartAddr ); 1483 1490 1484 {1485 1491 Int arpRefIdx = pcCU->getSlice()->getFirstTRefIdx(eRefPicList); 1486 if( dW > 0 && pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC()!= pcCU->getSlice()->getPOC() ) 1487 { 1488 bTobeScaled = true; 1489 } 1490 1491 pcPicYuvBaseCol = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(), cDistparity.m_aVIdxCan ); 1492 1493 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan ); 1494 1495 if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan)) 1492 if (arpRefIdx < 0 || !pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, cDistparity.m_aVIdxCan)) 1496 1493 { 1497 1494 dW = 0; … … 1500 1497 else 1501 1498 { 1502 assert( pcPicYuvBaseCol->getPOC() == pcCU->getSlice()->getPOC() && pcPicYuvBaseRef->getPOC() == pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC() ); 1499 if( arpRefIdx != iRefIdx ) 1500 { 1501 bTobeScaled = true; 1502 } 1503 pcPicYuvBaseCol = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getPOC(), cDistparity.m_aVIdxCan ); 1504 pcPicYuvBaseRef = pcCU->getSlice()->getBaseViewRefPic( pcCU->getSlice()->getRefPic( eRefPicList, arpRefIdx )->getPOC(), cDistparity.m_aVIdxCan ); 1503 1505 } 1504 1506 … … 1507 1509 Int iCurrPOC = pcCU->getSlice()->getPOC(); 1508 1510 Int iColRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, iRefIdx ); 1509 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, 0);1511 Int iCurrRefPOC = pcCU->getSlice()->getRefPOC( eRefPicList, arpRefIdx ); 1510 1512 Int iScale = pcCU-> xGetDistScaleFactor(iCurrPOC, iCurrRefPOC, iCurrPOC, iColRefPOC); 1511 1513 if ( iScale != 4096 ) … … 1513 1515 cMv = cMv.scaleMv( iScale ); 1514 1516 } 1515 iRefIdx = 0; 1516 } 1517 iRefIdx = arpRefIdx; 1517 1518 } 1518 1519 1519 1520 pcCU->clipMv(cMv); 1520 1521 TComPicYuv* pcPicYuvRef = pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(); 1521 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true ); 1522 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), true ); 1522 1523 for (UInt comp=COMPONENT_Y; comp< rpcYuvPred->getNumberValidComponents(); comp++) 1524 { 1525 const ComponentID compID=ComponentID(comp); 1526 xPredInterBlk ( compID, pcCU, pcPicYuvRef, uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 ), pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1527 } 1523 1528 1524 1529 if( dW > 0 ) … … 1536 1541 pcCU->clipMv( cNBDV ); 1537 1542 1538 pcPicYuvRef = pcPicYuvBaseCol->getPicYuvRec(); 1539 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true ); 1540 if (iWidth > 8) 1541 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, true ); 1543 TComPicYuv* pcPicYuvBaseColRec = pcPicYuvBaseCol->getPicYuvRec(); 1544 TComPicYuv* pcPicYuvBaseRefRec = pcPicYuvBaseRef->getPicYuvRec(); 1542 1545 1543 pcPicYuvRef = pcPicYuvBaseRef->getPicYuvRec(); 1544 xPredInterLumaBlk ( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true ); 1545 1546 if (iWidth > 8) 1547 xPredInterChromaBlk( pcCU, pcPicYuvRef, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, true ); 1546 UInt uiCompNum = ( iWidth > 8 ) ? 3: 1; 1547 for (UInt comp=COMPONENT_Y; comp< uiCompNum; comp++) 1548 { 1549 const ComponentID compID=ComponentID(comp); 1550 xPredInterBlk ( compID, pcCU, pcPicYuvBaseColRec, uiPartAddr, &cNBDV, iWidth, iHeight, pYuvB0, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1551 xPredInterBlk ( compID, pcCU, pcPicYuvBaseRefRec, uiPartAddr, &cMVwithDisparity, iWidth, iHeight, pYuvB1, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1552 } 1548 1553 1549 1554 pYuvB0->subtractARP( pYuvB0 , pYuvB1 , uiPartAddr , iWidth , iHeight ); … … 1553 1558 pYuvB0->multiplyARP( uiPartAddr , iWidth , iHeight , dW ); 1554 1559 } 1555 rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi );1560 rpcYuvPred->addARP( rpcYuvPred , pYuvB0 , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() ); 1556 1561 } 1557 1562 } … … 1562 1567 TComMv cDMv = pcCU->getCUMvField( eBaseRefPicList )->getMv( uiPartAddr ); 1563 1568 TComPic* pcPicYuvBaseCol = pcCU->getSlice()->getRefPic( eBaseRefPicList, iRefIdx ); 1564 TComPicYuv* pcYuvBaseCol = pcPicYuvBaseCol->getPicYuvRec();1565 Int uiLCUAddr,uiAbsPartAddr;1566 1569 Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2 + ((cDMv.getHor() + 2)>>2); 1567 1570 Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2); … … 1569 1572 irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX); 1570 1573 irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 1571 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1572 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1574 1575 Int uiLCUAddr,uiAbsPartAddr; 1576 pcPicYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1577 TComDataCU *pColCU = pcPicYuvBaseCol->getCtu( uiLCUAddr ); 1573 1578 1574 1579 TComPic* pcPicYuvBaseTRef = NULL; … … 1622 1627 } 1623 1628 1624 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi, TComMvField * pNewMvFiled ) 1629 //inter-view ARP 1630 Void TComPrediction::xPredInterUniARPviewRef( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1625 1631 { 1626 1632 Int iRefIdx = pcCU->getCUMvField( eRefPicList )->getRefIdx( uiPartAddr ); … … 1635 1641 Bool bTMVAvai = false; 1636 1642 TComMv cBaseTMV; 1637 if( pNewMvFiled ) 1638 { 1639 iRefIdx = pNewMvFiled->getRefIdx(); 1640 cDMv = pNewMvFiled->getMv(); 1641 } 1643 1642 1644 pcCU->clipMv(cTempDMv); 1643 1645 1644 assert(dW > 0);1645 if (!pcCU->getSlice()->getArpRefPicAvailable( eRefPicList, pcPicYuvBaseCol->getViewIndex()))1646 {1647 dW = 0;1648 }1649 Int uiLCUAddr,uiAbsPartAddr;1650 1646 Int irefPUX = pcCU->getCUPelX() + g_auiRasterToPelX[g_auiZscanToRaster[uiPartAddr]] + iWidth/2 + ((cDMv.getHor() + 2)>>2); 1651 1647 Int irefPUY = pcCU->getCUPelY() + g_auiRasterToPelY[g_auiZscanToRaster[uiPartAddr]] + iHeight/2 + ((cDMv.getVer() + 2)>>2); … … 1653 1649 irefPUX = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()-> getPicWidthInLumaSamples()-1, irefPUX); 1654 1650 irefPUY = (Int)Clip3<Int>(0, pcCU->getSlice()->getSPS()->getPicHeightInLumaSamples()-1, irefPUY); 1655 pcYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1656 TComDataCU *pColCU = pcPicYuvBaseCol->getCU( uiLCUAddr ); 1651 1652 Int uiLCUAddr,uiAbsPartAddr; 1653 pcPicYuvBaseCol->getCUAddrAndPartIdx( irefPUX, irefPUY, uiLCUAddr, uiAbsPartAddr); 1654 TComDataCU *pColCU = pcPicYuvBaseCol->getCtu( uiLCUAddr ); 1657 1655 if( pcCU->getSlice()->isInterB() && !pcCU->getSlice()->getIsDepth() ) 1658 1656 { … … 1725 1723 RefPicList eRefPicListCurr = RefPicList(iList); 1726 1724 Int iRef = pColCU->getCUMvField(eRefPicListCurr)->getRefIdx(uiAbsPartAddr); 1727 if( iRef != -1 )1725 if( iRef != -1 && pcCU->getSlice()->getArpRefPicAvailable( eRefPicListCurr, pcPicYuvBaseCol->getViewIndex())) 1728 1726 { 1729 1727 pcPicYuvBaseTRef = pColCU->getSlice()->getRefPic(eRefPicListCurr, iRef); … … 1759 1757 } 1760 1758 1761 xPredInterLumaBlk ( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), bTMVAvai); 1762 xPredInterChromaBlk( pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), bTMVAvai); 1763 1764 if( dW > 0 && bTMVAvai ) 1765 { 1759 for (UInt comp=COMPONENT_Y; comp< rpcYuvPred->getNumberValidComponents(); comp++) 1760 { 1761 const ComponentID compID=ComponentID(comp); 1762 xPredInterBlk ( compID, pcCU, pcYuvBaseCol, uiPartAddr, &cTempDMv, iWidth, iHeight, rpcYuvPred, bi || ( dW > 0 && bTMVAvai ), pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), bTMVAvai ); 1763 } 1764 1765 if( dW > 0 ) 1766 { 1767 assert ( bTMVAvai ); 1766 1768 TComYuv* pYuvCurrTRef = &m_acYuvPredBase[0]; 1767 1769 TComYuv* pYuvBaseTRef = &m_acYuvPredBase[1]; … … 1777 1779 pYuvCurrTRef->clear(); pYuvBaseTRef->clear(); 1778 1780 } 1779 xPredInterLumaBlk ( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, true); 1780 1781 if (iWidth > 8) 1782 xPredInterChromaBlk( pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, true); 1783 1784 xPredInterLumaBlk ( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, true); 1785 1786 if (iWidth > 8) 1787 xPredInterChromaBlk( pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, true); 1781 1782 UInt uiCompNum = ( iWidth > 8 ) ? 3: 1; 1783 for (UInt comp=COMPONENT_Y; comp< uiCompNum; comp++) 1784 { 1785 const ComponentID compID=ComponentID(comp); 1786 xPredInterBlk ( compID, pcCU, pcYuvCurrTref, uiPartAddr, &cBaseTMV, iWidth, iHeight, pYuvCurrTRef, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1787 xPredInterBlk ( compID, pcCU, pcYuvBaseTref, uiPartAddr, &cTempMv, iWidth, iHeight, pYuvBaseTRef, true, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)), true ); 1788 } 1788 1789 1789 1790 pYuvCurrTRef->subtractARP( pYuvCurrTRef , pYuvBaseTRef , uiPartAddr , iWidth , iHeight ); … … 1792 1793 pYuvCurrTRef->multiplyARP( uiPartAddr , iWidth , iHeight , dW ); 1793 1794 } 1794 rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi );1795 rpcYuvPred->addARP( rpcYuvPred , pYuvCurrTRef , uiPartAddr , iWidth , iHeight , !bi, pcCU->getSlice()->getSPS()->getBitDepths() ); 1795 1796 } 1796 1797 } … … 1847 1848 } 1848 1849 1849 #if H_3D_VSP 1850 1850 #if NH_3D_VSP 1851 1851 Void TComPrediction::xPredInterBiVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ) 1852 1852 { … … 1870 1870 } 1871 1871 1872 xWeightedAverage( &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred ); 1873 } 1874 1872 xWeightedAverage( &m_acYuvPred[0], &m_acYuvPred[1], iRefIdx[0], iRefIdx[1], uiPartAddr, iWidth, iHeight, rpcYuvPred, pcCU->getSlice()->getSPS()->getBitDepths() ); 1873 } 1875 1874 #endif 1876 1875 … … 1892 1891 1893 1892 Void TComPrediction::xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth 1894 #if H_3D_ARP1893 #if NH_3D_ARP 1895 1894 , Bool filterType 1896 1895 #endif … … 1914 1913 Int yFrac = mv->getVer() & ((1<<shiftVer)-1); 1915 1914 1916 #if NH_3D_ FULL_PEL_DEPTH_MAP_MV_ACC1915 #if NH_3D_INTEGER_MV_DEPTH 1917 1916 if( cu->getSlice()->getIsDepth() ) 1918 1917 { 1919 1918 refOffset = mv->getHor() + mv->getVer() * refStride; 1920 1919 ref = refPic->getAddr(compID, cu->getCtuRsAddr(), cu->getZorderIdxInCtu() + partAddr ) + refOffset; 1921 1922 1920 xFrac = 0; 1923 1921 yFrac = 0; … … 1937 1935 m_if.filterHor(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth 1938 1936 #endif 1939 #if H_3D_ARP1937 #if NH_3D_ARP 1940 1938 , filterType 1941 1939 #endif … … 1949 1947 m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth 1950 1948 #endif 1951 #if H_3D_ARP1949 #if NH_3D_ARP 1952 1950 , filterType 1953 1951 #endif … … 1962 1960 1963 1961 m_if.filterHor(compID, ref - ((vFilterSize>>1) -1)*refStride, refStride, tmp, tmpStride, cxWidth, cxHeight+vFilterSize-1, xFrac, false, chFmt, bitDepth 1964 #if H_3D_ARP1962 #if NH_3D_ARP 1965 1963 , filterType 1966 1964 #endif … … 1971 1969 m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight, yFrac, false, !bi, chFmt, bitDepth 1972 1970 #endif 1973 #if H_3D_ARP1971 #if NH_3D_ARP 1974 1972 , filterType 1975 1973 #endif … … 2208 2206 2209 2207 // LLS parameters estimation 2208 2210 2209 Int x = 0, y = 0, xx = 0, xy = 0; 2211 2210 Int precShift = std::max(0, bitDepth - 12); … … 2264 2263 else 2265 2264 { 2266 xy += xx >> IC_REG_COST_SHIFT; 2267 xx += xx >> IC_REG_COST_SHIFT; 2268 Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift); 2269 Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift); 2270 const Int iShift = IC_CONST_SHIFT; 2271 const Int iShiftA2 = 6; 2272 const Int iAccuracyShift = 15; 2273 Int iScaleShiftA2 = 0; 2274 Int iScaleShiftA1 = 0; 2265 xy += xx >> IC_REG_COST_SHIFT; 2266 xx += xx >> IC_REG_COST_SHIFT; 2267 Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift); 2268 Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift); 2269 const Int iShift = IC_CONST_SHIFT; 2270 const Int iShiftA2 = 6; 2271 const Int iAccuracyShift = 15; 2272 2273 Int iScaleShiftA2 = 0; 2274 Int iScaleShiftA1 = 0; 2275 2275 Int a1s; 2276 2276 Int a2s; 2277 2278 a1 = Clip3(0, 2*a2, a1); 2279 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 2280 iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF; 2281 2282 if( iScaleShiftA1 < 0 ) 2283 { 2284 iScaleShiftA1 = 0; 2285 } 2286 if( iScaleShiftA2 < 0 ) 2287 { 2288 iScaleShiftA2 = 0; 2289 } 2290 2291 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 2292 2293 a2s = a2 >> iScaleShiftA2; 2294 a1s = a1 >> iScaleShiftA1; 2295 2296 a = a1s * m_uiaShift[ a2s ]; 2297 a = a >> iScaleShiftA; 2298 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 2299 } 2300 } 2277 2278 a1 = Clip3(0, 2*a2, a1); 2279 iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 2280 iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF; 2281 2282 if( iScaleShiftA1 < 0 ) 2283 { 2284 iScaleShiftA1 = 0; 2285 } 2286 2287 if( iScaleShiftA2 < 0 ) 2288 { 2289 iScaleShiftA2 = 0; 2290 } 2291 2292 Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1; 2293 2294 2295 a2s = a2 >> iScaleShiftA2; 2296 2297 a1s = a1 >> iScaleShiftA1; 2298 2299 a = a1s * m_uiaShift[ a2s ]; 2300 a = a >> iScaleShiftA; 2301 b = ( y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift; 2302 } 2303 } 2301 2304 #endif 2302 2305
Note: See TracChangeset for help on using the changeset viewer.