Changeset 1412 in 3DVCSoftware for branches/HTM-16.2-dev/source/Lib/TLibCommon/TComPrediction.cpp
- Timestamp:
- 12 Apr 2018, 11:12:21 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-16.2-dev/source/Lib/TLibCommon/TComPrediction.cpp
r1405 r1412 4 4 * granted under this license. 5 5 * 6 * Copyright (c) 2010-201 6, ITU/ISO/IEC6 * Copyright (c) 2010-2017, ITU/ISO/IEC 7 7 * All rights reserved. 8 8 * … … 82 82 } 83 83 } 84 #if NH_3D _VSP84 #if NH_3D 85 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) … … 94 94 TComPrediction::~TComPrediction() 95 95 { 96 #if NH_3D _VSP96 #if NH_3D 97 97 if (m_pDepthBlock != NULL) 98 98 { … … 123 123 m_cYuvPredTemp.destroy(); 124 124 125 #if NH_3D _ARP125 #if NH_3D 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 NH_3D _ARP184 #if NH_3D 185 185 m_acYuvPredBase[0] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 186 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 #endif 191 192 } 193 187 m_cYuvDepthOnVsp .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC ); 188 #endif 189 } 194 190 195 191 if (m_iLumaRecStride != (MAX_CU_SIZE>>1) + 1) … … 201 197 } 202 198 } 203 #if NH_3D _IC199 #if NH_3D 204 200 m_uiaShift[0] = 0; 205 201 for( Int i = 1; i < 64; i++ ) … … 508 504 } 509 505 510 #if NH_3D _DMM506 #if NH_3D 511 507 Void TComPrediction::predIntraLumaDmm( TComDataCU* pcCU, UInt uiAbsPartIdx, DmmID dmmType, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight ) 512 508 { 513 509 assert( iWidth == iHeight ); 514 510 assert( iWidth >= DMM_MIN_SIZE && iWidth <= DMM_MAX_SIZE ); 515 #if NH_3D_SDC_INTRA516 511 assert( !pcCU->getSDCFlag( uiAbsPartIdx ) ); 517 #endif518 512 519 513 // get partition … … 535 529 Pel deltaDC1 = pcCU->getDmmDeltaDC( dmmType, 0, uiAbsPartIdx ); 536 530 Pel deltaDC2 = pcCU->getDmmDeltaDC( dmmType, 1, uiAbsPartIdx ); 537 #if NH_3D_DLT538 531 segDC1 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 ); 539 532 segDC2 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 ); 540 #else541 segDC1 = ClipBD( predDC1 + deltaDC1, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) );542 segDC2 = ClipBD( predDC2 + deltaDC2, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) );543 #endif544 533 545 534 // set prediction signal … … 565 554 Int layerIdL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getLayerId(); 566 555 Int layerIdL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getLayerId(); 567 #if NH_3D _ARP556 #if NH_3D 568 557 if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && layerIdL0 == layerIdL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr)) 569 558 #else … … 581 570 } 582 571 583 #if NH_3D _SPIVMP572 #if NH_3D 584 573 Void TComPrediction::xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr ) 585 574 { … … 590 579 pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]); 591 580 } 592 #if NH_3D_ARP 581 593 582 if( pcCU->getARPW( uiPartAddr ) != 0 ) 594 583 { 595 584 return; 596 585 } 597 #endif598 586 599 587 // horizontal sub-PU merge … … 667 655 return true; 668 656 } 669 #endif 670 671 #if NH_3D_DBBP 657 672 658 PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU) 673 659 { … … 1138 1124 { 1139 1125 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1140 #if NH_3D _VSP1126 #if NH_3D 1141 1127 if ( pcCU->getVSPFlag(uiPartAddr) == 0) 1142 1128 { … … 1156 1142 else 1157 1143 { 1158 #if NH_3D _SPIVMP1144 #if NH_3D 1159 1145 if ( pcCU->getSPIVMPFlag(uiPartAddr)!=0) 1160 1146 { … … 1196 1182 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1197 1183 } 1198 #if NH_3D _SPIVMP1184 #if NH_3D 1199 1185 } 1200 1186 #endif 1201 1187 } 1202 #if NH_3D _VSP1188 #if NH_3D 1203 1189 } 1204 1190 else … … 1221 1207 pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight ); 1222 1208 1223 #if NH_3D _VSP1209 #if NH_3D 1224 1210 if ( pcCU->getVSPFlag(uiPartAddr) == 0 ) 1225 1211 { … … 1239 1225 else 1240 1226 { 1241 #if NH_3D _SPIVMP1227 #if NH_3D 1242 1228 if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 1243 1229 { … … 1278 1264 xPredInterBi (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred ); 1279 1265 } 1280 #if NH_3D _SPIVMP1281 } 1282 #endif 1283 } 1284 #if NH_3D _VSP1266 #if NH_3D 1267 } 1268 #endif 1269 } 1270 #if NH_3D 1285 1271 } 1286 1272 else … … 1319 1305 pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx ); 1320 1306 #endif 1321 #if NH_3D _ARP1307 #if NH_3D 1322 1308 if( pcCU->getARPW( uiPartAddr ) > 0 ) 1323 1309 { … … 1338 1324 { 1339 1325 const ComponentID compID=ComponentID(comp); 1340 #if NH_3D _IC1326 #if NH_3D 1341 1327 Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) ); 1342 1328 xPredInterBlk(compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) 1343 #if NH_3D_ARP 1344 , false 1345 #endif 1346 , bICFlag ); 1329 , false, bICFlag ); 1347 1330 #else 1348 1331 xPredInterBlk (compID, pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) ); 1349 1332 #endif 1350 1333 } 1351 #if NH_3D _ARP1352 } 1353 #endif 1354 } 1355 1356 #if NH_3D _VSP1334 #if NH_3D 1335 } 1336 #endif 1337 } 1338 1339 #if NH_3D 1357 1340 Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) 1358 1341 { … … 1399 1382 #endif 1400 1383 1401 #if NH_3D _ARP1384 #if NH_3D 1402 1385 //temporal ARP 1403 1386 Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi ) … … 1409 1392 TComPic* pcPicYuvBaseRef = NULL; 1410 1393 1411 #if NH_3D_NBDV1412 1394 DisInfo cDistparity; 1413 1395 cDistparity.m_acNBDV = pcCU->getDvInfo(0).m_acNBDV; 1414 1396 cDistparity.m_aVIdxCan = pcCU->getDvInfo(uiPartAddr).m_aVIdxCan; 1415 #else 1416 assert(0); // ARP can be applied only when a DV is available 1417 #endif 1397 1418 1398 UChar dW = pcCU->getARPW ( uiPartAddr ); 1419 1399 … … 1777 1757 } 1778 1758 1779 #if NH_3D _VSP1759 #if NH_3D 1780 1760 Void TComPrediction::xPredInterBiVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred ) 1781 1761 { … … 1821 1801 #if NH_3D 1822 1802 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 1823 #if NH_3D_ARP 1824 , Bool filterType 1825 #endif 1826 #if NH_3D_IC 1827 , Bool bICFlag 1828 #endif 1829 ) 1803 , Bool filterType , Bool bICFlag ) 1830 1804 #else 1831 1805 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 ) … … 1849 1823 Int yFrac = mv->getVer() & ((1<<shiftVer)-1); 1850 1824 1851 #if NH_3D _INTEGER_MV_DEPTH1825 #if NH_3D 1852 1826 if( cu->getSlice()->getIsDepth() ) 1853 1827 { … … 1868 1842 #if NH_3D 1869 1843 m_if.filterHor(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, xFrac, !bi 1870 #if NH_3D_IC 1871 || bICFlag 1872 #endif 1873 , chFmt, bitDepth 1874 #if NH_3D_ARP 1875 , filterType 1876 #endif 1877 ); 1844 || bICFlag, chFmt, bitDepth, filterType ); 1878 1845 #else 1879 1846 m_if.filterHor(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth ); … … 1884 1851 #if NH_3D 1885 1852 m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi 1886 #if NH_3D_IC 1887 || bICFlag 1888 #endif 1889 , chFmt, bitDepth 1890 #if NH_3D_ARP 1891 , filterType 1892 #endif 1893 ); 1853 || bICFlag , chFmt, bitDepth , filterType ); 1894 1854 #else 1895 1855 m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth ); 1896 1897 1856 #endif 1898 1857 } … … 1904 1863 const Int vFilterSize = isLuma(compID) ? NTAPS_LUMA : NTAPS_CHROMA; 1905 1864 1906 #if NH_3D _ARP1865 #if NH_3D 1907 1866 m_if.filterHor(compID, ref - ((vFilterSize>>1) -1)*refStride, refStride, tmp, tmpStride, cxWidth, cxHeight+vFilterSize-1, xFrac, false, chFmt, bitDepth, filterType ); 1908 1867 #else … … 1912 1871 #if NH_3D 1913 1872 m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight, yFrac, false, !bi 1914 #if NH_3D_IC 1915 || bICFlag 1916 #endif 1917 , chFmt, bitDepth 1918 #if NH_3D_ARP 1919 , filterType 1920 #endif 1921 ); 1873 || bICFlag , chFmt, bitDepth , filterType ); 1922 1874 #else 1923 1875 m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight, yFrac, false, !bi, chFmt, bitDepth ); … … 1925 1877 } 1926 1878 1927 #if NH_3D _IC1879 #if NH_3D 1928 1880 if( bICFlag ) 1929 1881 { … … 2104 2056 (uiDirMode==HOR_IDX || uiDirMode==VER_IDX); 2105 2057 } 2106 #if NH_3D_IC 2058 2059 2060 #if MCTS_ENC_CHECK 2061 2062 Void getRefPUPartPos(TComDataCU* pcCU, TComMv& cMv, Int uiPartIdx, Int& ruiPredXLeft, Int& ruiPredYTop, Int& ruiPredXRight, Int& ruiPredYBottom, Int iWidth, Int iHeight) 2063 { 2064 ruiPredXLeft = pcCU->getCUPelX(); 2065 ruiPredYTop = pcCU->getCUPelY(); 2066 2067 switch (pcCU->getPartitionSize(0)) 2068 { 2069 case SIZE_2NxN: 2070 if (uiPartIdx == 0) 2071 { 2072 ruiPredXRight = ruiPredXLeft + iWidth; 2073 ruiPredYBottom = ruiPredYTop + iHeight; 2074 } 2075 else 2076 { 2077 ruiPredXRight = ruiPredXLeft + iWidth; 2078 ruiPredYBottom = ruiPredYTop + (iHeight << 1); 2079 ruiPredYTop += iHeight; 2080 } 2081 break; 2082 case SIZE_Nx2N: 2083 if (uiPartIdx == 0) 2084 { 2085 ruiPredXRight = ruiPredXLeft + iWidth; 2086 ruiPredYBottom = ruiPredYTop + iHeight; 2087 } 2088 else 2089 { 2090 ruiPredXRight = ruiPredXLeft + (iWidth << 1); 2091 ruiPredYBottom = ruiPredYTop + iHeight; 2092 ruiPredXLeft += iWidth; 2093 } 2094 break; 2095 case SIZE_NxN: 2096 if (uiPartIdx == 0) 2097 { 2098 ruiPredXRight = ruiPredXLeft + iWidth; 2099 ruiPredYBottom = ruiPredYTop + iHeight; 2100 } 2101 else if (uiPartIdx == 1) 2102 { 2103 ruiPredXRight = ruiPredXLeft + (iWidth << 1); 2104 ruiPredYBottom = ruiPredYTop + iHeight; 2105 ruiPredXLeft += iWidth; 2106 } 2107 else if (uiPartIdx == 2) 2108 { 2109 ruiPredXRight = ruiPredXLeft + iWidth; 2110 ruiPredYBottom = ruiPredYTop + (iHeight << 1); 2111 ruiPredYTop += iHeight; 2112 } 2113 else if (uiPartIdx == 3) 2114 { 2115 ruiPredXRight = ruiPredXLeft + (iWidth << 1); 2116 ruiPredYBottom = ruiPredYTop + (iHeight << 1); 2117 ruiPredXLeft += iWidth; 2118 ruiPredYTop += iHeight; 2119 } 2120 break; 2121 case SIZE_2NxnU: 2122 if (uiPartIdx == 0) 2123 { 2124 ruiPredXRight = ruiPredXLeft + iWidth; 2125 ruiPredYBottom = ruiPredYTop + iHeight; 2126 } 2127 else 2128 { 2129 ruiPredXRight = ruiPredXLeft + iWidth; 2130 ruiPredYBottom = ruiPredYTop + pcCU->getHeight(0); 2131 ruiPredYTop += (iHeight / 3); 2132 } 2133 break; 2134 case SIZE_2NxnD: 2135 if (uiPartIdx == 0) 2136 { 2137 ruiPredXRight = ruiPredXLeft + iWidth; 2138 ruiPredYBottom = ruiPredYTop + iHeight; 2139 } 2140 else 2141 { 2142 Int oriHeight = iHeight << 2; 2143 ruiPredXRight = ruiPredXLeft + iWidth; 2144 ruiPredYBottom = ruiPredYTop + oriHeight; 2145 ruiPredYTop += (oriHeight >> 2) + (oriHeight >> 1); 2146 } 2147 break; 2148 case SIZE_nLx2N: 2149 if (uiPartIdx == 0) 2150 { 2151 ruiPredXRight = ruiPredXLeft + iWidth; 2152 ruiPredYBottom = ruiPredYTop + iHeight; 2153 } 2154 else 2155 { 2156 ruiPredXRight = ruiPredXLeft + pcCU->getWidth(0); 2157 ruiPredYBottom = ruiPredYTop + iHeight; 2158 ruiPredXLeft += (iWidth / 3); 2159 } 2160 break; 2161 case SIZE_nRx2N: 2162 if (uiPartIdx == 0) 2163 { 2164 ruiPredXRight = ruiPredXLeft + iWidth; 2165 ruiPredYBottom = ruiPredYTop + iHeight; 2166 } 2167 else 2168 { 2169 Int oriWidth = (iWidth << 2); 2170 ruiPredXRight = ruiPredXLeft + oriWidth; 2171 ruiPredYBottom = ruiPredYTop + iHeight; 2172 ruiPredXLeft += (oriWidth >> 2) + (oriWidth >> 1); 2173 } 2174 break; 2175 default: 2176 ruiPredXRight = ruiPredXLeft + iWidth; 2177 ruiPredYBottom = ruiPredYTop + iHeight; 2178 break; 2179 } 2180 2181 ruiPredXLeft += (cMv.getHor() >> 2); 2182 ruiPredYTop += (cMv.getVer() >> 2); 2183 ruiPredXRight += (cMv.getHor() >> 2) - 1; 2184 ruiPredYBottom += (cMv.getVer() >> 2) - 1; 2185 } 2186 2187 Bool checkMVPRange(TComMv& cMv, UInt ctuLength, UInt tileXPosInCtus, UInt tileYPosInCtus, UInt tileWidthtInCtus, UInt tileHeightInCtus, Int PredXLeft, Int PredXRight, Int PredYTop, Int PredYBottom, ChromaFormat chromaFormat) 2188 { 2189 // filter length of sub-sample generation filter to be considered 2190 const UInt LumaLTSampleOffset = 3; 2191 const UInt LumaRBSampleOffset = 4; 2192 const UInt CromaLTSampleoffset = 1; 2193 const UInt CromaRBSampleoffset = 2; 2194 2195 // tile position in full pels 2196 const Int leftTopPelPosX = ctuLength * tileXPosInCtus; 2197 const Int leftTopPelPosY = ctuLength * tileYPosInCtus; 2198 const Int rightBottomPelPosX = ((tileWidthtInCtus + tileXPosInCtus) * ctuLength) - 1; 2199 const Int rightBottomPelPosY = ((tileHeightInCtus + tileYPosInCtus) * ctuLength) - 1; 2200 2201 // Luma MV range check 2202 const Bool isFullPelHorLuma = (cMv.getHor() % 4 == 0); 2203 const Bool isFullPelVerLuma = (cMv.getVer() % 4 == 0); 2204 2205 const Int lRangeXLeft = leftTopPelPosX + (isFullPelHorLuma ? 0 : LumaLTSampleOffset); 2206 const Int lRangeYTop = leftTopPelPosY + (isFullPelVerLuma ? 0 : LumaLTSampleOffset); 2207 const Int lRangeXRight = rightBottomPelPosX - (isFullPelHorLuma ? 0 : LumaRBSampleOffset); 2208 const Int lRangeYBottom = rightBottomPelPosY - (isFullPelVerLuma ? 0 : LumaRBSampleOffset); 2209 2210 if (!(PredXLeft >= lRangeXLeft && PredXLeft <= lRangeXRight) || !(PredXRight >= lRangeXLeft && PredXRight <= lRangeXRight)) 2211 { 2212 return false; 2213 } 2214 else if (!(PredYTop >= lRangeYTop && PredYTop <= lRangeYBottom) || !(PredYBottom >= lRangeYTop && PredYBottom <= lRangeYBottom)) 2215 { 2216 return false; 2217 } 2218 2219 if ((chromaFormat != CHROMA_444) && (chromaFormat != CHROMA_400)) 2220 { 2221 // Chroma MV range check 2222 const Bool isFullPelHorChroma = (cMv.getHor() % 8 == 0); 2223 const Bool isFullPelVerChroma = (cMv.getVer() % 8 == 0); 2224 2225 const Int cRangeXLeft = leftTopPelPosX + (isFullPelHorChroma ? 0 : CromaLTSampleoffset); 2226 const Int cRangeYTop = leftTopPelPosY + (isFullPelVerChroma ? 0 : CromaLTSampleoffset); 2227 const Int cRangeXRight = rightBottomPelPosX - (isFullPelHorChroma ? 0 : CromaRBSampleoffset); 2228 const Int cRangeYBottom = rightBottomPelPosY - (isFullPelVerChroma ? 0 : CromaRBSampleoffset); 2229 2230 if (!(PredXLeft >= cRangeXLeft && PredXLeft <= cRangeXRight) || !(PredXRight >= cRangeXLeft && PredXRight <= cRangeXRight)) 2231 { 2232 return false; 2233 } 2234 else if ((!(PredYTop >= cRangeYTop && PredYTop <= cRangeYBottom) || !(PredYBottom >= cRangeYTop && PredYBottom <= cRangeYBottom)) && (chromaFormat != CHROMA_422)) 2235 { 2236 return false; 2237 } 2238 } 2239 2240 return true; 2241 } 2242 2243 Bool TComPrediction::checkTMctsMvp(TComDataCU* pcCU, Int partIdx) 2244 { 2245 Int partWidth = 0; 2246 Int partHeight = 0; 2247 UInt partAddr = 0; 2248 2249 UInt tileXPosInCtus = 0; 2250 UInt tileYPosInCtus = 0; 2251 UInt tileWidthtInCtus = 0; 2252 UInt tileHeightInCtus = 0; 2253 2254 getTilePosition(pcCU, tileXPosInCtus, tileYPosInCtus, tileWidthtInCtus, tileHeightInCtus); 2255 2256 const UInt ctuLength = pcCU->getPic()->getPicSym()->getSPS().getMaxCUWidth(); 2257 const ChromaFormat chromaFormat = pcCU->getPic()->getPicSym()->getSPS().getChromaFormatIdc(); 2258 2259 Int predXLeft; 2260 Int predYTop; 2261 Int predXRight; 2262 Int predYBottom; 2263 2264 if (partIdx >= 0) 2265 { 2266 pcCU->getPartIndexAndSize(partIdx, partAddr, partWidth, partHeight); 2267 2268 if (xCheckIdenticalMotion(pcCU, partAddr)) 2269 { 2270 RefPicList eRefPicList = REF_PIC_LIST_0; 2271 TComMv cMv = pcCU->getCUMvField(eRefPicList)->getMv(partAddr); 2272 getRefPUPartPos(pcCU, cMv, partIdx, predXLeft, predYTop, predXRight, predYBottom, partWidth, partHeight); 2273 if (!checkMVPRange(cMv, ctuLength, tileXPosInCtus, tileYPosInCtus, tileWidthtInCtus, tileHeightInCtus, predXLeft, predXRight, predYTop, predYBottom, chromaFormat)) 2274 { 2275 return false; 2276 } 2277 } 2278 else 2279 { 2280 for (UInt refList = 0; refList < NUM_REF_PIC_LIST_01; refList++) 2281 { 2282 RefPicList eRefPicList = (refList ? REF_PIC_LIST_1 : REF_PIC_LIST_0); 2283 2284 TComMv cMv = pcCU->getCUMvField(eRefPicList)->getMv(partAddr); 2285 getRefPUPartPos(pcCU, cMv, partIdx, predXLeft, predYTop, predXRight, predYBottom, partWidth, partHeight); 2286 if (!checkMVPRange(cMv, ctuLength, tileXPosInCtus, tileYPosInCtus, tileWidthtInCtus, tileHeightInCtus, predXLeft, predXRight, predYTop, predYBottom, chromaFormat)) 2287 { 2288 return false; 2289 } 2290 } 2291 } 2292 return true; 2293 } 2294 2295 for (partIdx = 0; partIdx < pcCU->getNumPartitions(); partIdx++) 2296 { 2297 pcCU->getPartIndexAndSize(partIdx, partAddr, partWidth, partHeight); 2298 2299 if (xCheckIdenticalMotion(pcCU, partAddr)) 2300 { 2301 RefPicList eRefPicList = REF_PIC_LIST_0; 2302 TComMv cMv = pcCU->getCUMvField(eRefPicList)->getMv(partAddr); 2303 getRefPUPartPos(pcCU, cMv, partIdx, predXLeft, predYTop, predXRight, predYBottom, partWidth, partHeight); 2304 if (!checkMVPRange(cMv, ctuLength, tileXPosInCtus, tileYPosInCtus, tileWidthtInCtus, tileHeightInCtus, predXLeft, predXRight, predYTop, predYBottom, chromaFormat)) 2305 { 2306 return false; 2307 } 2308 } 2309 else 2310 { 2311 for (UInt refList = 0; refList < NUM_REF_PIC_LIST_01; refList++) 2312 { 2313 RefPicList eRefPicList = (refList ? REF_PIC_LIST_1 : REF_PIC_LIST_0); 2314 2315 TComMv cMv = pcCU->getCUMvField(eRefPicList)->getMv(partAddr); 2316 getRefPUPartPos(pcCU, cMv, partIdx, predXLeft, predYTop, predXRight, predYBottom, partWidth, partHeight); 2317 if (!checkMVPRange(cMv, ctuLength, tileXPosInCtus, tileYPosInCtus, tileWidthtInCtus, tileHeightInCtus, predXLeft, predXRight, predYTop, predYBottom, chromaFormat)) 2318 { 2319 return false; 2320 } 2321 } 2322 } 2323 } 2324 return true; 2325 } 2326 2327 2328 #endif 2329 #if NH_3D 2107 2330 /** Function for deriving the position of first non-zero binary bit of a value 2108 2331 * \param x input value … … 2130 2353 return iMSB; 2131 2354 } 2132 2133 2355 2134 2356 /** Function for deriving LM illumination compensation. … … 2252 2474 } 2253 2475 #endif 2254 2255 #if NH_3D_SDC_INTRA 2476 #if NH_3D 2256 2477 Void TComPrediction::predConstantSDC( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& predDC ) 2257 2478 { … … 2262 2483 predDC = (*pLeftTop + *pRightTop + *pLeftBottom + *pRightBottom + 2)>>2; 2263 2484 } 2264 #endif // NH_3D_SDC_INTRA 2265 2266 #if NH_3D_DMM 2485 2267 2486 Void TComPrediction::predContourFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool* segPattern ) 2268 2487 {
Note: See TracChangeset for help on using the changeset viewer.