Changeset 799 in 3DVCSoftware for branches/HTM-9.3-dev3-Hisilicon


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

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

Location:
branches/HTM-9.3-dev3-Hisilicon
Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.3-dev3-Hisilicon/source/Lib/TLibCommon/TypeDef.h

    r792 r799  
    243243                                              // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
    244244                                              // LG_ZEROINTRADEPTHRESI_A0087
     245#endif
     246#define QC_PKU_SDC_SPLIT_G0123            1   // Intra SDC Split
     247#if QC_PKU_SDC_SPLIT_G0123
     248#define HS_TSINGHUA_SDC_SPLIT_G0111       1
    245249#endif
    246250///// ***** VIEW SYNTHESIS PREDICTION *********
  • branches/HTM-9.3-dev3-Hisilicon/source/Lib/TLibDecoder/TDecCu.cpp

    r792 r799  
    921921  UInt uiWidth        = pcCU->getWidth  ( 0 );
    922922  UInt uiHeight       = pcCU->getHeight ( 0 );
    923  
     923#if QC_PKU_SDC_SPLIT_G0123
     924#if QC_GENERIC_SDC_G0122
     925  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     926#endif
     927#endif
     928#if QC_PKU_SDC_SPLIT_G0123
     929  UInt numParts = 1;
     930  UInt i = 0;
     931  UInt sdcDepth    = 0;
     932  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
     933  TComYuv* pcPredYuv  = m_ppcYuvReco[uiDepth];
     934  TComYuv* pcResiYuv  = m_ppcYuvResi[uiDepth];
     935
     936  UInt    uiStride = 0;
     937  Pel*    piReco;
     938  Pel*    piPred;
     939  Pel*    piResi;
     940
     941  UInt    uiZOrder;       
     942  Pel*    piRecIPred;     
     943  UInt    uiRecIPredStride;
     944
     945  UInt    uiLumaPredMode = 0; 
     946
     947#if HS_TSINGHUA_SDC_SPLIT_G0111
     948  if ((uiWidth >> pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize()) > 1)
     949  {
     950    numParts = uiWidth * uiWidth >> (2 * pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize());
     951    sdcDepth = g_aucConvertToBit[uiWidth] + 2 - pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize();
     952    uiWidth = uiHeight = (1 << pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize());
     953  }
     954#else
     955  if (uiWidth == 64)
     956  {
     957    numParts = 4;
     958    sdcDepth = 1;
     959    uiWidth = uiHeight = 32;
     960  }
     961#endif
     962
     963  for ( i = 0; i < numParts; i++ )
     964  {
     965    uiStride    = pcRecoYuv->getStride  ();
     966    piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
     967    piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     968    piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
     969
     970    uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     971    piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
     972    uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
     973
     974    uiLumaPredMode    = pcCU->getLumaIntraDir     ( uiAbsPartIdx );
     975
     976    AOF( uiWidth == uiHeight );
     977#else
    924978  TComYuv* pcRecoYuv  = m_ppcYuvReco[uiDepth];
    925979  TComYuv* pcPredYuv  = m_ppcYuvReco[uiDepth];
     
    936990 
    937991  UInt    uiLumaPredMode    = pcCU->getLumaIntraDir     ( uiAbsPartIdx );
    938  
     992
    939993  AOF( uiWidth == uiHeight );
    940994  AOF( uiAbsPartIdx == 0 );
    941995  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
    942996  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
     997#endif
    943998 
    944999  //===== init availability pattern =====
    9451000  Bool  bAboveAvail = false;
    9461001  Bool  bLeftAvail  = false;
     1002#if QC_PKU_SDC_SPLIT_G0123
     1003  pcCU->getPattern()->initPattern   ( pcCU, sdcDepth, uiAbsPartIdx );
     1004  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, sdcDepth, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
     1005#else
    9471006  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
    9481007  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
     1008#endif
     1009#if !QC_PKU_SDC_SPLIT_G0123
    9491010#if QC_GENERIC_SDC_G0122
    9501011  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     1012#endif
    9511013#endif
    9521014  //===== get prediction signal =====
     
    9671029  }
    9681030#endif
    969  
     1031#if QC_PKU_SDC_SPLIT_G0123
     1032    if ( numParts > 1 )
     1033    {
     1034      for( UInt uiY = 0; uiY < uiHeight; uiY++ )
     1035      {
     1036        for( UInt uiX = 0; uiX < uiWidth; uiX++ )
     1037        {
     1038          piReco        [ uiX ] = ClipY( piPred[ uiX ] );
     1039          piRecIPred    [ uiX ] = piReco[ uiX ];
     1040        }
     1041        piPred     += uiStride;
     1042        piReco     += uiStride;
     1043        piRecIPred += uiRecIPredStride;
     1044      }
     1045    }
     1046    uiAbsPartIdx += ( (uiWidth * uiWidth) >> 4 );
     1047  }
     1048  uiAbsPartIdx = 0;
     1049
     1050  if ( numParts > 1 )
     1051  {
     1052    uiWidth = pcCU->getWidth( 0 );
     1053    uiHeight = pcCU->getHeight( 0 );
     1054  }
     1055  piReco      = pcRecoYuv->getLumaAddr( uiAbsPartIdx );
     1056  piPred      = pcPredYuv->getLumaAddr( uiAbsPartIdx );
     1057  piResi      = pcResiYuv->getLumaAddr( uiAbsPartIdx );
     1058  uiZOrder          = pcCU->getZorderIdxInCU() + uiAbsPartIdx;
     1059  piRecIPred        = pcCU->getPic()->getPicYuvRec()->getLumaAddr( pcCU->getAddr(), uiZOrder );
     1060  uiRecIPredStride  = pcCU->getPic()->getPicYuvRec()->getStride  ();
     1061#endif
    9701062  // number of segments depends on prediction mode
    9711063  UInt uiNumSegments = 1;
  • 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.