Ignore:
Timestamp:
12 Apr 2018, 11:12:21 (7 years ago)
Author:
tech
Message:
  • Update HM-16.18
  • Cleanups
  • Encoder Extension

-- Representation formats
-- Parameter set sharing
-- GOP configuration

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-16.2-dev/source/Lib/TLibCommon/TComPrediction.cpp

    r1405 r1412  
    44 * granted under this license.
    55 *
    6  * Copyright (c) 2010-2016, ITU/ISO/IEC
     6 * Copyright (c) 2010-2017, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    8282    }
    8383  }
    84 #if NH_3D_VSP
     84#if NH_3D
    8585  m_pDepthBlock = (Int*) malloc(MAX_NUM_PART_IDXS_IN_CTU_WIDTH*MAX_NUM_PART_IDXS_IN_CTU_WIDTH*sizeof(Int));
    8686  if (m_pDepthBlock == NULL)
     
    9494TComPrediction::~TComPrediction()
    9595{
    96 #if NH_3D_VSP
     96#if NH_3D
    9797  if (m_pDepthBlock != NULL)
    9898  {
     
    123123  m_cYuvPredTemp.destroy();
    124124
    125 #if NH_3D_ARP
     125#if NH_3D
    126126  m_acYuvPredBase[0].destroy();
    127127  m_acYuvPredBase[1].destroy();
     
    182182
    183183    m_cYuvPredTemp.create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC );
    184 #if NH_3D_ARP
     184#if NH_3D
    185185    m_acYuvPredBase[0] .create( MAX_CU_SIZE, MAX_CU_SIZE, chromaFormatIDC );
    186186    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  }
    194190
    195191  if (m_iLumaRecStride != (MAX_CU_SIZE>>1) + 1)
     
    201197    }
    202198  }
    203 #if NH_3D_IC
     199#if NH_3D
    204200  m_uiaShift[0] = 0;
    205201  for( Int i = 1; i < 64; i++ )
     
    508504}
    509505
    510 #if NH_3D_DMM
     506#if NH_3D
    511507Void TComPrediction::predIntraLumaDmm( TComDataCU* pcCU, UInt uiAbsPartIdx, DmmID dmmType, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight )
    512508{
    513509  assert( iWidth == iHeight  );
    514510  assert( iWidth >= DMM_MIN_SIZE && iWidth <= DMM_MAX_SIZE );
    515 #if NH_3D_SDC_INTRA
    516511  assert( !pcCU->getSDCFlag( uiAbsPartIdx ) );
    517 #endif
    518512
    519513  // get partition
     
    535529  Pel deltaDC1 = pcCU->getDmmDeltaDC( dmmType, 0, uiAbsPartIdx );
    536530  Pel deltaDC2 = pcCU->getDmmDeltaDC( dmmType, 1, uiAbsPartIdx );
    537 #if NH_3D_DLT
    538531  segDC1 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC1 ) + deltaDC1 );
    539532  segDC2 = pcCU->getSlice()->getPPS()->getDLT()->idx2DepthValue( pcCU->getSlice()->getLayerIdInVps(), pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), predDC2 ) + deltaDC2 );
    540 #else
    541   segDC1 = ClipBD( predDC1 + deltaDC1, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) );
    542   segDC2 = ClipBD( predDC2 + deltaDC2, pcCU->getSlice()->getSPS()->getBitDepth(CHANNEL_TYPE_LUMA) );
    543 #endif
    544533
    545534  // set prediction signal
     
    565554      Int layerIdL0 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, pcCU->getCUMvField(REF_PIC_LIST_0)->getRefIdx(PartAddr))->getLayerId();
    566555      Int layerIdL1 = pcCU->getSlice()->getRefPic(REF_PIC_LIST_1, pcCU->getCUMvField(REF_PIC_LIST_1)->getRefIdx(PartAddr))->getLayerId();
    567 #if NH_3D_ARP
     556#if NH_3D
    568557      if(!pcCU->getARPW(PartAddr) && RefPOCL0 == RefPOCL1 && layerIdL0 == layerIdL1 && pcCU->getCUMvField(REF_PIC_LIST_0)->getMv(PartAddr) == pcCU->getCUMvField(REF_PIC_LIST_1)->getMv(PartAddr))
    569558#else
     
    581570}
    582571
    583 #if NH_3D_SPIVMP
     572#if NH_3D
    584573Void TComPrediction::xGetSubPUAddrAndMerge(TComDataCU* pcCU, UInt uiPartAddr, Int iSPWidth, Int iSPHeight, Int iNumSPInOneLine, Int iNumSP, UInt* uiMergedSPW, UInt* uiMergedSPH, UInt* uiSPAddr )
    585574{
     
    590579    pcCU->getSPAbsPartIdx(uiPartAddr, iSPWidth, iSPHeight, i, iNumSPInOneLine, uiSPAddr[i]);
    591580  }
    592 #if NH_3D_ARP
     581
    593582  if( pcCU->getARPW( uiPartAddr ) != 0 )
    594583  {
    595584    return;
    596585  }
    597 #endif
    598586
    599587  // horizontal sub-PU merge
     
    667655  return true;
    668656}
    669 #endif
    670 
    671 #if NH_3D_DBBP
     657
    672658PartSize TComPrediction::getPartitionSizeFromDepth(Pel* pDepthPels, UInt uiDepthStride, UInt uiSize, TComDataCU*& pcCU)
    673659{
     
    11381124  {
    11391125    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
    1140 #if NH_3D_VSP
     1126#if NH_3D
    11411127    if ( pcCU->getVSPFlag(uiPartAddr) == 0)
    11421128    {
     
    11561142     else
    11571143     {
    1158 #if NH_3D_SPIVMP
     1144#if NH_3D
    11591145        if ( pcCU->getSPIVMPFlag(uiPartAddr)!=0) 
    11601146        {
     
    11961182            xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    11971183          }
    1198 #if NH_3D_SPIVMP
     1184#if NH_3D
    11991185        }
    12001186#endif
    12011187      }
    1202 #if NH_3D_VSP
     1188#if NH_3D
    12031189    }
    12041190    else
     
    12211207    pcCU->getPartIndexAndSize( iPartIdx, uiPartAddr, iWidth, iHeight );
    12221208
    1223 #if NH_3D_VSP
     1209#if NH_3D
    12241210    if ( pcCU->getVSPFlag(uiPartAddr) == 0 )
    12251211    {
     
    12391225    else
    12401226    {
    1241 #if NH_3D_SPIVMP
     1227#if NH_3D
    12421228      if (pcCU->getSPIVMPFlag(uiPartAddr)!=0) 
    12431229      {
     
    12781264          xPredInterBi  (pcCU, uiPartAddr, iWidth, iHeight, pcYuvPred );
    12791265        }
    1280 #if NH_3D_SPIVMP
    1281       }
    1282 #endif
    1283     }
    1284 #if NH_3D_VSP
     1266#if NH_3D
     1267      }
     1268#endif
     1269    }
     1270#if NH_3D
    12851271    }
    12861272    else
     
    13191305  pcCU->checkMvVertRest(cMv, eRefPicList, iRefIdx );
    13201306#endif
    1321 #if NH_3D_ARP
     1307#if NH_3D
    13221308  if(  pcCU->getARPW( uiPartAddr ) > 0 )
    13231309  {
     
    13381324    {
    13391325      const ComponentID compID=ComponentID(comp);
    1340 #if NH_3D_IC
     1326#if NH_3D
    13411327      Bool bICFlag = pcCU->getICFlag( uiPartAddr ) && ( pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getViewIndex() != pcCU->getSlice()->getViewIndex() ) && ( isLuma(compID) || (iWidth > 8) );
    13421328      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 );
    13471330#else
    13481331      xPredInterBlk  (compID,  pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, pcYuvPred, bi, pcCU->getSlice()->getSPS()->getBitDepth(toChannelType(compID)) );
    13491332#endif
    13501333    }
    1351 #if NH_3D_ARP
    1352   }
    1353 #endif
    1354 }
    1355 
    1356 #if NH_3D_VSP
     1334#if NH_3D
     1335  }
     1336#endif
     1337}
     1338
     1339#if NH_3D
    13571340Void TComPrediction::xPredInterUniVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
    13581341{
     
    13991382#endif
    14001383
    1401 #if NH_3D_ARP
     1384#if NH_3D
    14021385//temporal ARP
    14031386Void TComPrediction::xPredInterUniARP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, RefPicList eRefPicList, TComYuv*& rpcYuvPred, Bool bi )
     
    14091392  TComPic* pcPicYuvBaseRef = NULL;
    14101393
    1411 #if NH_3D_NBDV
    14121394  DisInfo cDistparity;
    14131395  cDistparity.m_acNBDV = pcCU->getDvInfo(0).m_acNBDV;
    14141396  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
    14181398  UChar dW = pcCU->getARPW ( uiPartAddr );
    14191399
     
    17771757}
    17781758
    1779 #if NH_3D_VSP
     1759#if NH_3D
    17801760Void TComPrediction::xPredInterBiVSP( TComDataCU* pcCU, UInt uiPartAddr, Int iWidth, Int iHeight, TComYuv*& rpcYuvPred )
    17811761{
     
    18211801#if NH_3D
    18221802Void 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 )
    18301804#else
    18311805Void TComPrediction::xPredInterBlk(const ComponentID compID, TComDataCU *cu, TComPicYuv *refPic, UInt partAddr, TComMv *mv, Int width, Int height, TComYuv *dstPic, Bool bi, const Int bitDepth )
     
    18491823  Int     yFrac  = mv->getVer() & ((1<<shiftVer)-1);
    18501824
    1851 #if NH_3D_INTEGER_MV_DEPTH
     1825#if NH_3D
    18521826  if( cu->getSlice()->getIsDepth() )
    18531827  {
     
    18681842#if NH_3D
    18691843    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 );
    18781845#else
    18791846    m_if.filterHor(compID, ref, refStride, dst,  dstStride, cxWidth, cxHeight, xFrac, !bi, chFmt, bitDepth );
     
    18841851#if NH_3D
    18851852  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 );
    18941854#else
    18951855    m_if.filterVer(compID, ref, refStride, dst, dstStride, cxWidth, cxHeight, yFrac, true, !bi, chFmt, bitDepth );
    1896 
    18971856#endif
    18981857  }
     
    19041863    const Int vFilterSize = isLuma(compID) ? NTAPS_LUMA : NTAPS_CHROMA;
    19051864
    1906 #if NH_3D_ARP
     1865#if NH_3D
    19071866    m_if.filterHor(compID, ref - ((vFilterSize>>1) -1)*refStride, refStride, tmp, tmpStride, cxWidth, cxHeight+vFilterSize-1, xFrac, false,      chFmt, bitDepth, filterType );
    19081867#else
     
    19121871#if NH_3D
    19131872    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 );
    19221874#else
    19231875    m_if.filterVer(compID, tmp + ((vFilterSize>>1) -1)*tmpStride, tmpStride, dst, dstStride, cxWidth, cxHeight,               yFrac, false, !bi, chFmt, bitDepth );
     
    19251877  }
    19261878
    1927 #if NH_3D_IC
     1879#if NH_3D
    19281880  if( bICFlag )
    19291881  {
     
    21042056          (uiDirMode==HOR_IDX || uiDirMode==VER_IDX);
    21052057}
    2106 #if NH_3D_IC
     2058
     2059
     2060#if MCTS_ENC_CHECK
     2061
     2062Void 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
     2187Bool 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
     2243Bool 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
    21072330/** Function for deriving the position of first non-zero binary bit of a value
    21082331 * \param x input value
     
    21302353  return iMSB;
    21312354}
    2132 
    21332355
    21342356/** Function for deriving LM illumination compensation.
     
    22522474  }   
    22532475#endif
    2254 
    2255 #if NH_3D_SDC_INTRA
     2476#if NH_3D
    22562477Void TComPrediction::predConstantSDC( Pel* ptrSrc, UInt srcStride, UInt uiSize, Pel& predDC )
    22572478{
     
    22622483  predDC = (*pLeftTop + *pRightTop + *pLeftBottom + *pRightBottom + 2)>>2;
    22632484}
    2264 #endif // NH_3D_SDC_INTRA
    2265 
    2266 #if NH_3D_DMM
     2485
    22672486Void TComPrediction::predContourFromTex( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiWidth, UInt uiHeight, Bool* segPattern )
    22682487{
Note: See TracChangeset for help on using the changeset viewer.