Ticket #234: tilesBelowLeftNeighbourBugfix.patch

File tilesBelowLeftNeighbourBugfix.patch, 4.0 KB (added by shilin.xu, 13 years ago)

patch for this bug

  • source/Lib/TLibCommon/TComDataCU.cpp

     
    20242024    return m_pcCULeft;
    20252025  }
    20262026 
     2027#if TILES
     2028  TComDataCU*   m_pcCUBelowLeft;
     2029  if ( m_pcCULeft && ( (getAddr()/m_pcPic->getPicSym()->getFrameWidthInCU()) < (m_pcPic->getPicSym()->getFrameHeightInCU()-1) ) )
     2030  {
     2031    m_pcCUBelowLeft = m_pcPic->getCU( getAddr() + m_pcPic->getPicSym()->getFrameWidthInCU() - 1 );
     2032  }
     2033  else
     2034  {
     2035    m_pcCUBelowLeft = NULL;
     2036  }
     2037
     2038  uiBLPartUnitIdx = g_auiRasterToZscan[uiNumPartInCUWidth-1];
     2039  if (
     2040       !RasterAddress::isZeroCol( uiAbsPartIdxLB, uiNumPartInCUWidth ) ||
     2041       (bEnforceSliceRestriction && (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() ||
     2042       (m_pcCUBelowLeft==NULL || m_pcCUBelowLeft->getSlice()==NULL ||
     2043       (m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUBelowLeft->getAddr() ) > m_pcPic->getPicSym()->getInverseCUOrderMap(getAddr())) ||
     2044       (m_pcCUBelowLeft->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx))
     2045       )))||
     2046       (bEnforceEntropySliceRestriction && (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() ||
     2047       (m_pcCUBelowLeft==NULL || m_pcCUBelowLeft->getSlice()==NULL ||
     2048       (m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUBelowLeft->getAddr() ) > m_pcPic->getPicSym()->getInverseCUOrderMap(getAddr())) ||
     2049       (m_pcCUBelowLeft ->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx))
     2050       )))
     2051     )
     2052  {
     2053    uiBLPartUnitIdx = MAX_UINT;
     2054    return NULL;
     2055  }
     2056  else
     2057  {
     2058    return m_pcCUBelowLeft;
     2059  }
     2060#else
    20272061  uiBLPartUnitIdx = MAX_UINT;
    20282062  return NULL;
     2063#endif
    20292064}
    20302065
    20312066TComDataCU* TComDataCU::getPUBelowLeftAdi(UInt& uiBLPartUnitIdx, UInt uiPuHeight,  UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset, Bool bEnforceSliceRestriction, Bool bEnforceEntropySliceRestriction )
     
    21152150    return m_pcCULeft;
    21162151  }
    21172152 
     2153#if TILES
     2154  TComDataCU*   m_pcCUBelowLeft;
     2155  if ( m_pcCULeft && ( (getAddr()/m_pcPic->getPicSym()->getFrameWidthInCU()) < (m_pcPic->getPicSym()->getFrameHeightInCU()-1) ) )
     2156  {
     2157    m_pcCUBelowLeft = m_pcPic->getCU( getAddr() + m_pcPic->getPicSym()->getFrameWidthInCU() - 1 );
     2158  }
     2159  else
     2160  {
     2161    m_pcCUBelowLeft = NULL;
     2162  }
     2163  uiBLPartUnitIdx = uiBLPartUnitIdx = g_auiRasterToZscan[uiAbsPartIdxLB + uiPartUnitOffset * uiNumPartInCUWidth - 1 - m_pcPic->getNumPartInHeight()*m_pcPic->getNumPartInWidth()
     2164      + uiNumPartInCUWidth];//g_auiRasterToZscan[uiNumPartInCUWidth-1];
     2165  if (
     2166       !RasterAddress::isZeroCol( uiAbsPartIdxLB, uiNumPartInCUWidth ) ||
     2167       (bEnforceSliceRestriction && (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() ||
     2168       (m_pcCUBelowLeft==NULL || m_pcCUBelowLeft->getSlice()==NULL ||
     2169       (m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUBelowLeft->getAddr() ) > m_pcPic->getPicSym()->getInverseCUOrderMap(getAddr())) ||
     2170       (m_pcCUBelowLeft->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getSliceStartCU(uiCurrPartUnitIdx))
     2171       )))||
     2172       (bEnforceEntropySliceRestriction && (m_pcPic->getPicSym()->getTileBoundaryIndependenceIdr() ||
     2173       (m_pcCUBelowLeft==NULL || m_pcCUBelowLeft->getSlice()==NULL ||
     2174       (m_pcPic->getPicSym()->getInverseCUOrderMap( m_pcCUBelowLeft->getAddr() ) > m_pcPic->getPicSym()->getInverseCUOrderMap(getAddr())) ||
     2175       (m_pcCUBelowLeft ->getSCUAddr()+uiBLPartUnitIdx < m_pcPic->getCU( getAddr() )->getEntropySliceStartCU(uiCurrPartUnitIdx))
     2176       )))
     2177     )
     2178  {
     2179    uiBLPartUnitIdx = MAX_UINT;
     2180    return NULL;
     2181  }
     2182  else
     2183  {
     2184    return m_pcCUBelowLeft;
     2185  }
     2186#else
    21182187  uiBLPartUnitIdx = MAX_UINT;
    21192188  return NULL;
     2189#endif
    21202190}
    21212191
    21222192TComDataCU* TComDataCU::getPUAboveRightAdi(UInt&  uiARPartUnitIdx, UInt uiPuWidth, UInt uiCurrPartUnitIdx, UInt uiPartUnitOffset, Bool bEnforceSliceRestriction, Bool bEnforceEntropySliceRestriction )