Ignore:
Timestamp:
26 Jan 2014, 15:40:44 (10 years ago)
Author:
hisilicon-htm
Message:

Integration of JCT3V-G0111/JCT3V-G0123: Intra SDC split

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.3-dev3-Hisilicon/source/Lib/TLibEncoder/TEncSearch.cpp

    r792 r799  
    18901890  UInt    uiWidth           = pcCU     ->getWidth   ( 0 );
    18911891  UInt    uiHeight          = pcCU     ->getHeight  ( 0 );
     1892#if QC_PKU_SDC_SPLIT_G0123
     1893#if QC_GENERIC_SDC_G0122
     1894  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     1895#endif
     1896#endif
     1897#if QC_PKU_SDC_SPLIT_G0123
     1898  UInt numParts = 1;
     1899  UInt i = 0;
     1900  UInt sdcDepth = 0;
     1901  UInt uiStride;         
     1902  Pel* piOrg;         
     1903  Pel* piPred;         
     1904  Pel* piReco;       
     1905
     1906  UInt uiZOrder;         
     1907  Pel* piRecIPred;       
     1908  UInt uiRecIPredStride;
     1909
     1910#if HS_TSINGHUA_SDC_SPLIT_G0111
     1911  if ( ( uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) > 1 )
     1912  {
     1913    if ( getDimType( uiLumaPredMode ) == DMM4_IDX )
     1914    {
     1915      dmm4Segmentation->destroy(); delete dmm4Segmentation;
     1916      ruiDist = MAX_INT;
     1917      return;
     1918    }
     1919    numParts = uiWidth * uiWidth >> ( 2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );
     1920    sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
     1921    uiWidth = uiHeight = ( 1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() );
     1922  }
     1923#else
     1924  if (uiWidth == 64)
     1925  {
     1926    numParts = 4;
     1927    sdcDepth = 1;
     1928    uiWidth = uiHeight = 32;
     1929  }
     1930#endif
     1931
     1932  for ( i = 0; i < numParts; i++ )
     1933  {
     1934    uiStride          = pcOrgYuv ->getStride  ();
     1935    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
     1936    piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1937    piReco            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1938
     1939    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     1940    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
     1941    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
     1942
     1943    AOF( uiWidth == uiHeight );
     1944#else
    18921945  UInt    uiStride          = pcOrgYuv ->getStride  ();
    18931946  Pel*    piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
     
    18981951  Pel*    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
    18991952  UInt    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
    1900  
     1953
    19011954  AOF( uiWidth == uiHeight );
    19021955  AOF( uiAbsPartIdx == 0 );
    19031956  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
    19041957  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
     1958#endif
    19051959#if !QC_GENERIC_SDC_G0122
    19061960  AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) );
     
    19111965  Bool  bAboveAvail = false;
    19121966  Bool  bLeftAvail  = false;
     1967#if QC_PKU_SDC_SPLIT_G0123
     1968  pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
     1969  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
     1970#else
    19131971  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
    19141972  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
     1973#endif
     1974#if !QC_PKU_SDC_SPLIT_G0123
    19151975#if QC_GENERIC_SDC_G0122
    19161976  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     1977#endif
    19171978#endif
    19181979  //===== get prediction signal =====
     
    19201981  if( isDimMode( uiLumaPredMode ) )
    19211982  {
     1983#if HS_TSINGHUA_SDC_SPLIT_G0111 
     1984    UInt dimType   = getDimType  ( uiLumaPredMode );
     1985    UInt patternID = pcCU->getDmmWedgeTabIdx(dimType, uiAbsPartIdx);
     1986    if ( patternID >= g_dmmWedgeLists[g_aucConvertToBit[uiWidth]].size() && dimType == DMM1_IDX )
     1987    {
     1988      if (g_aucConvertToBit[uiWidth] == 2)  // Encoder method. Avoid DMM1 pattern list index exceeds the maximum DMM1 pattern number when SDC split is used.
     1989        patternID = 1349;  // Split 32x32 to 16x16. 1349: Maximum DMM1 pattern number when block size is 16x16
     1990      else
     1991        patternID = patternID >> 1;  // Other cases
     1992      pcCU->setDmmWedgeTabIdx(dimType, uiAbsPartIdx, patternID);
     1993    }
     1994#endif
    19221995    predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true
    19231996#if QC_GENERIC_SDC_G0122
     
    19332006  }
    19342007#endif
    1935  
     2008#if QC_PKU_SDC_SPLIT_G0123
     2009    if ( numParts > 1 )
     2010    {
     2011      for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     2012      {
     2013        for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     2014        {
     2015          piPred        [ uiX ] = ClipY( piPred[ uiX ] );
     2016          piRecIPred    [ uiX ] = piPred[ uiX ];
     2017        }
     2018        piPred     += uiStride;
     2019        piRecIPred += uiRecIPredStride;
     2020      }
     2021    }
     2022    uiAbsPartIdx += ( ( uiWidth * uiWidth ) >> 4 );
     2023  }
     2024  uiAbsPartIdx = 0;
     2025  uiStride          = pcOrgYuv ->getStride  ();
     2026  piOrg             = pcOrgYuv ->getLumaAddr( uiAbsPartIdx );
     2027  piPred            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     2028  piReco            = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     2029
     2030  uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     2031  piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
     2032  uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
     2033
     2034  if (numParts > 1)
     2035  {
     2036    uiWidth = pcCU->getWidth( 0 );
     2037    uiHeight = pcCU->getHeight( 0 );
     2038  }
     2039#endif
    19362040  // number of segments depends on prediction mode
    19372041  UInt uiNumSegments = 1;
Note: See TracChangeset for help on using the changeset viewer.