Changeset 781 in 3DVCSoftware


Ignore:
Timestamp:
20 Jan 2014, 04:34:18 (11 years ago)
Author:
qualcomm
Message:

integration of JCT3V-G0122 (generalize SDC to all depth intra modes) by Qualcomm.

Location:
branches/HTM-9.3-dev3-Qualcomm
Files:
2 added
13 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/ContextTables.h

    r773 r781  
    107107
    108108#if H_3D_DIM
     109#if QC_GENERIC_SDC_G0122
     110#define NUM_DEPTH_INTRA_MODE_CTX      1       ///< number of context models for depth intra modes
     111#else
    109112#define NUM_DEPTH_INTRA_MODE_CTX      8       ///< number of context models for depth intra modes
     113#endif
    110114#define NUM_DDC_FLAG_CTX              2       ///< number of context models for deltaDC flag (DMM or RBC)
    111115#define NUM_DDC_DATA_CTX              1       ///< number of context models for deltaDC data (DMM or RBC)
    112116#if H_3D_DIM_DMM
    113117#define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
     118#endif
     119#if QC_GENERIC_SDC_G0122
     120#define NUM_ANGLE_FLAG_CTX            3
     121#define NUM_INTRASDC_FLAG_CTX         3
    114122#endif
    115123#endif
     
    383391#endif
    384392#if H_3D_DIM
     393#if QC_GENERIC_SDC_G0122
     394static const UChar
     395INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
     396{
     397  { 154, },
     398  { 154, },
     399  { 154, }
     400};
     401#else
    385402static const UChar
    386403INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
     
    390407    {64, 0, CNU, CNU, 168, 109,   0, 0}
    391408};
     409#endif
     410
     411#if QC_GENERIC_SDC_G0122
     412static const UChar
     413INIT_ANGLE_FLAG[3][NUM_ANGLE_FLAG_CTX] =
     414{
     415  { 154, 155, 156 },
     416  { 141, 185, 214 },
     417  { 155, 170, 157 },
     418};
     419static const UChar
     420INIT_INTRASDC_FLAG[3][NUM_INTRASDC_FLAG_CTX] =
     421{
     422  { 214, 229, 230 },
     423  { 215, 202, 174 },
     424  { 213, 201, 246 },
     425};
     426#endif
    392427
    393428static const UChar
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.cpp

    r773 r781  
    24012401#endif
    24022402
     2403#if QC_GENERIC_SDC_G0122
     2404UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
     2405{
     2406  TComDataCU* pcTempCU;
     2407  UInt        uiTempPartIdx;
     2408  UInt        uiCtx = 0;
     2409
     2410  // Get BCBP of left PU
     2411  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2412  uiCtx    = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
     2413
     2414  // Get BCBP of above PU
     2415  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2416  uiCtx   += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
     2417
     2418  return uiCtx;
     2419}
     2420
     2421UInt TComDataCU::getCtxAngleFlag( UInt uiAbsPartIdx )
     2422{
     2423  TComDataCU* pcTempCU;
     2424  UInt        uiTempPartIdx;
     2425  UInt        uiCtx = 0;
     2426
     2427  // Get BCBP of left PU
     2428  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2429  uiCtx    = ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? ( pcTempCU->getLumaIntraDir( uiTempPartIdx ) < NUM_INTRA_MODE ? 1 : 0 ) : 0;
     2430
     2431  // Get BCBP of above PU
     2432  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx );
     2433  uiCtx   += ( pcTempCU && pcTempCU->isIntra( uiTempPartIdx ) ) ? ( pcTempCU->getLumaIntraDir( uiTempPartIdx ) < NUM_INTRA_MODE ? 1 : 0 ) : 0;
     2434
     2435  return uiCtx;
     2436}
     2437#endif
     2438
    24032439UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx )
    24042440{
     
    26272663  if( !getSlice()->getIsDepth() || !isIntra(uiAbsPartIdx) || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N )
    26282664    return false;
    2629  
     2665#if QC_GENERIC_SDC_G0122
     2666  if( isDimMode( getLumaIntraDir( uiAbsPartIdx ) ) && !isDimDeltaDC( getLumaIntraDir( uiAbsPartIdx ) ) )
     2667  {
     2668    return true;
     2669  }
     2670
     2671  if( getLumaIntraDir( uiAbsPartIdx ) < NUM_INTRA_MODE )
     2672  {
     2673    return true;
     2674  }
     2675
     2676  return false;
     2677#endif
    26302678  // check prediction mode
    26312679  UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); 
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComDataCU.h

    r773 r781  
    571571  Pel           getSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentDCOffset[uiSeg][uiPartIdx]; }
    572572  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
     573#if QC_GENERIC_SDC_G0122
     574  UInt          getCtxSDCFlag          ( UInt   uiAbsPartIdx );
     575  UInt          getCtxAngleFlag        ( UInt   uiAbsPartIdx );
     576#endif
    573577#endif
    574578#endif
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComPrediction.cpp

    r773 r781  
    416416
    417417#if H_3D_DIM
    418 Void TComPrediction::predIntraLumaDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc )
     418Void TComPrediction::predIntraLumaDepth( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc
     419#if QC_GENERIC_SDC_G0122
     420  , TComWedgelet* dmm4Segmentation
     421#endif
     422  )
    419423{
    420424  assert( iWidth == iHeight  );
     
    442446    case( DMM4_IDX ):
    443447      {
     448#if QC_GENERIC_SDC_G0122
     449        if( dmm4Segmentation == NULL )
     450        {
     451          dmmSegmentation = new TComWedgelet( iWidth, iHeight );
     452          xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmmSegmentation );
     453        }
     454        else
     455        {
     456          xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmm4Segmentation );
     457          dmmSegmentation = dmm4Segmentation;
     458        }
     459#else
    444460        dmmSegmentation = new TComWedgelet( iWidth, iHeight );
    445461        xPredContourFromTex( pcCU, uiAbsPartIdx, iWidth, iHeight, dmmSegmentation );
     462#endif
    446463      } break;
    447464    default: assert(0);
     
    494511
    495512#if H_3D_DIM_DMM
     513#if QC_GENERIC_SDC_G0122
     514  if( dimType == DMM4_IDX && dmm4Segmentation == NULL ) { dmmSegmentation->destroy(); delete dmmSegmentation; }
     515#else
    496516  if( dimType == DMM4_IDX ) { dmmSegmentation->destroy(); delete dmmSegmentation; }
     517#endif
    497518#endif
    498519}
     
    21842205  Int iSumPix[2];
    21852206  memset(iSumPix, 0, sizeof(Int)*2);
    2186  
     2207#if QC_GENERIC_SDC_G0122
     2208  for( Int i = 0; i < uiNumSegments; i++ )
     2209  {
     2210    rpSegMeans[i] = 0;
     2211  }
     2212#endif
    21872213  if (orgDC == false)
    21882214  {
     
    21992225      rpSegMeans[ucSegmentRB] = pOrig[uiStride * (uiSize-1) + (uiSize-1) ];
    22002226    }
     2227#if QC_GENERIC_SDC_G0122
     2228    else if( getDimType( uiIntraMode ) == DMM4_IDX )
     2229    {
     2230      Pel *ptmpOrig = pOrig;
     2231      Bool *ptmpMask = pMask, bBreak = false;
     2232      UChar ucSegment = ptmpMask? (UChar) ptmpMask[0] : 0;
     2233      UChar bFirstSeg = ucSegment;
     2234
     2235      rpSegMeans[ucSegment] = ptmpOrig[0];
     2236      for ( Int y = 0; y < uiSize; y++ )
     2237      {
     2238        for ( Int x = 0; x < uiSize; x++ )
     2239        {
     2240          ucSegment = ptmpMask[x];
     2241          assert( ucSegment < uiNumSegments );
     2242
     2243          if( bFirstSeg != ucSegment )
     2244          {
     2245            rpSegMeans[ucSegment] = ptmpOrig[x];
     2246            bBreak = true;
     2247            break;
     2248          }
     2249        }
     2250
     2251        if( bBreak )
     2252        {
     2253          break;
     2254        }
     2255
     2256        ptmpOrig  += uiStride;
     2257        ptmpMask  += uiMaskStride;
     2258      }
     2259    }
     2260    else
     2261#else
    22012262    else if (uiIntraMode == PLANAR_IDX)
     2263#endif
    22022264    {
    22032265      Pel* pLeftTop = pOrig;
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TComPrediction.h

    r773 r781  
    167167#if H_3D_DIM
    168168  // Depth intra
    169   Void predIntraLumaDepth         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false );
     169  Void predIntraLumaDepth         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false
     170#if QC_GENERIC_SDC_G0122
     171    , TComWedgelet* dmm4Segmentation = NULL
     172#endif
     173    );
    170174#if H_3D_DIM_SDC
    171175  Void analyzeSegmentsSDC         ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibCommon/TypeDef.h

    r773 r781  
    235235#define H_3D_DELTA_DLT                    1
    236236#endif
     237#define QC_GENERIC_SDC_G0122              1  // Generalize SDC to all depth intra modes
    237238
    238239#define H_3D_DIM_ENC                      1   // Depth Intra encoder optimizations, includes:
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecCu.cpp

    r773 r781  
    932932  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
    933933  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_pcPrediction->getPredicBuf(), m_pcPrediction->getPredicBufWidth(), m_pcPrediction->getPredicBufHeight(), bAboveAvail, bLeftAvail );
    934  
     934#if QC_GENERIC_SDC_G0122
     935  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     936#endif
    935937  //===== get prediction signal =====
    936938#if H_3D_DIM
    937939  if( isDimMode( uiLumaPredMode ) )
    938940  {
    939     m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight );
     941    m_pcPrediction->predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight
     942#if QC_GENERIC_SDC_G0122
     943      , false, dmm4Segmentation
     944#endif
     945      );
    940946  }
    941947  else
     
    963969    uiMaskStride = pcWedgelet->getStride();
    964970  }
    965  
     971#if QC_GENERIC_SDC_G0122
     972  if( getDimType( uiLumaPredMode ) == DMM4_IDX )
     973  {
     974    uiNumSegments = 2;
     975    pbMask  = dmm4Segmentation->getPattern();
     976    uiMaskStride = dmm4Segmentation->getStride();
     977  }
     978#endif
    966979  // get DC prediction for each segment
    967980  Pel apDCPredValues[2];
     
    10251038    pRecCr += uiStrideC;
    10261039  }
     1040#if QC_GENERIC_SDC_G0122
     1041  dmm4Segmentation->destroy(); delete dmm4Segmentation;
     1042#endif
    10271043}
    10281044#endif
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.cpp

    r773 r781  
    8787, m_cDdcFlagSCModel           ( 1,             1,               NUM_DDC_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    8888, m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
     89#if QC_GENERIC_SDC_G0122
     90, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
     91, m_cIntraSdcFlagSCModel      ( 1,             1,               NUM_INTRASDC_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     92#endif
    8993#if H_3D_DIM_DMM
    9094, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     
    170174  m_cDdcFlagSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DDC_FLAG );
    171175  m_cDdcDataSCModel.initBuffer           ( sliceType, qp, (UChar*)INIT_DDC_DATA );
     176#if QC_GENERIC_SDC_G0122
     177  m_cAngleFlagSCModel.initBuffer         ( sliceType, qp, (UChar*)INIT_ANGLE_FLAG );
     178  m_cIntraSdcFlagSCModel.initBuffer      ( sliceType, qp, (UChar*)INIT_INTRASDC_FLAG );
     179#endif
    172180#if H_3D_DIM_DMM
    173181  m_cDmm1DataSCModel.initBuffer          ( sliceType, qp, (UChar*)INIT_DMM1_DATA );
     
    239247  m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    240248  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
     249#if QC_GENERIC_SDC_G0122
     250  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
     251  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
     252#endif
    241253#if H_3D_DIM_DMM
    242254  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
     
    925937    if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    926938#if H_3D_DIM_SDC
     939#if QC_GENERIC_SDC_G0122
     940      if( 1 )
     941#else
    927942      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
     943#endif
    928944#endif
    929945    {
     
    943959    if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    944960#if H_3D_DIM_SDC
     961#if QC_GENERIC_SDC_G0122
     962      if( 1 )
     963#else
    945964      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
     965#endif
    946966#endif
    947967    {
     
    10491069  {
    10501070    UInt symbol;
     1071#if QC_GENERIC_SDC_G0122
     1072    UInt uiNumSegments = isDimMode( dir ) ? 2 : 1;
     1073#else
    10511074    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
     1075#endif
    10521076
    10531077    if( pcCU->getSDCFlag( absPartIdx ) )
     
    10891113}
    10901114
     1115#if QC_GENERIC_SDC_G0122
     1116Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
     1117{
     1118  UInt uiSymbol, uiIsDimMode;
     1119
     1120  if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
     1121  {
     1122    m_pcTDecBinIf->decodeBin( uiSymbol, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
     1123  }
     1124  else
     1125  {
     1126    uiSymbol = 1;
     1127  }
     1128  uiIsDimMode = uiSymbol ? 0 : 1;
     1129  pcCU->setLumaIntraDirSubParts( 0, absPartIdx, depth );
     1130
     1131  if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case
     1132  {
     1133    m_pcTDecBinIf->decodeBin( uiSymbol, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) );
     1134  }
     1135  else
     1136  {
     1137    uiSymbol = 0;
     1138  }
     1139
     1140  pcCU->setSDCFlagSubParts( uiSymbol, absPartIdx, depth );
     1141
     1142  //decode DMM index
     1143  if( uiIsDimMode )
     1144  {
     1145    m_pcTDecBinIf->decodeBin( uiSymbol, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
     1146    if( !uiSymbol )
     1147    {
     1148      pcCU->setLumaIntraDirSubParts( ( 2 * DMM1_IDX + DIM_OFFSET ), absPartIdx, depth );
     1149    }
     1150    else
     1151    {
     1152      pcCU->setLumaIntraDirSubParts( ( 2 * DMM4_IDX + DIM_OFFSET ), absPartIdx, depth );
     1153    }
     1154  }
     1155}
     1156#else
    10911157Void TDecSbac::parseIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx, UInt depth )
    10921158{
     
    11511217#endif
    11521218}
     1219#endif
    11531220#endif
    11541221
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibDecoder/TDecSbac.h

    r773 r781  
    211211  ContextModel3DBuffer m_cDdcFlagSCModel;
    212212  ContextModel3DBuffer m_cDdcDataSCModel;
     213#if QC_GENERIC_SDC_G0122
     214  ContextModel3DBuffer m_cAngleFlagSCModel;
     215  ContextModel3DBuffer m_cIntraSdcFlagSCModel;
     216#endif
    213217#if H_3D_DIM_DMM
    214218  ContextModel3DBuffer m_cDmm1DataSCModel;
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.cpp

    r773 r781  
    9393, m_cDdcFlagSCModel           ( 1,             1,               NUM_DDC_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    9494, m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
     95#if QC_GENERIC_SDC_G0122
     96, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
     97, m_cIntraSdcFlagSCModel      ( 1,             1,               NUM_INTRASDC_FLAG_CTX         , m_contextModels + m_numContextModels, m_numContextModels)
     98#endif
    9599#if H_3D_DIM_DMM
    96100, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     
    168172  m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    169173  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
     174#if QC_GENERIC_SDC_G0122
     175  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
     176  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
     177#endif
    170178#if H_3D_DIM_DMM
    171179  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
     
    252260      curCost += m_cDdcFlagSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_FLAG );
    253261      curCost += m_cDdcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
     262#if QC_GENERIC_SDC_G0122
     263      curCost += m_cAngleFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 
     264      curCost += m_cIntraSdcFlagSCModel.calcCost      ( curSliceType, qp, (UChar*)INIT_INTRASDC_FLAG ); 
     265#endif
    254266#if H_3D_DIM_DMM
    255267      curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
     
    317329  m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    318330  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
     331#if QC_GENERIC_SDC_G0122
     332  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
     333  m_cIntraSdcFlagSCModel.initBuffer      ( eSliceType, iQp, (UChar*)INIT_INTRASDC_FLAG );
     334#endif
    319335#if H_3D_DIM_DMM
    320336  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
     
    629645  this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel );
    630646  this->m_cDdcFlagSCModel        .copyFrom( &pSrc->m_cDdcFlagSCModel );
     647#if QC_GENERIC_SDC_G0122
     648  this->m_cAngleFlagSCModel      .copyFrom( &pSrc->m_cAngleFlagSCModel );
     649  this->m_cIntraSdcFlagSCModel   .copyFrom( &pSrc->m_cIntraSdcFlagSCModel );
     650#endif
    631651}
    632652#endif
     
    10161036    if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    10171037#if H_3D_DIM_SDC
     1038#if QC_GENERIC_SDC_G0122
     1039      if( 1 )
     1040#else
    10181041      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
     1042#endif
    10191043#endif
    10201044    {
     
    10421066    if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    10431067#if H_3D_DIM_SDC
     1068#if QC_GENERIC_SDC_G0122
     1069      if( 1 )
     1070#else
    10441071      if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
     1072#endif
    10451073#endif
    10461074    {
     
    11461174    UInt dimDeltaDC;
    11471175    Pel  deltaDC;
     1176#if QC_GENERIC_SDC_G0122
     1177    UInt uiNumSegments = isDimMode( dir ) ? 2 : 1;
     1178#else
    11481179    UInt uiNumSegments = ( dir == PLANAR_IDX ) ? 1 : 2;
     1180#endif
    11491181    if( pcCU->getSDCFlag( absPartIdx ) )
    11501182    {
     
    11761208}
    11771209
     1210#if QC_GENERIC_SDC_G0122
     1211Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
     1212{
     1213  UInt dir = pcCU->getLumaIntraDir( absPartIdx );
     1214
     1215  if( ( pcCU->getSlice()->getSPS()->getMaxCUWidth() >> pcCU->getDepth( absPartIdx ) ) < 64 ) //DMM and HEVC intra modes are both allowed
     1216  {
     1217    m_pcBinIf->encodeBin( isDimMode( dir ) ? 0 : 1, m_cAngleFlagSCModel.get( 0, 0, pcCU->getCtxAngleFlag( absPartIdx ) ) );
     1218  }
     1219
     1220  if( pcCU->getPartitionSize( absPartIdx ) == SIZE_2Nx2N ) //SDC is allowed only in this case
     1221  {
     1222    m_pcBinIf->encodeBin( pcCU->getSDCFlag( absPartIdx ) ? 1 : 0, m_cIntraSdcFlagSCModel.get( 0, 0, pcCU->getCtxSDCFlag( absPartIdx ) ) );
     1223  }
     1224
     1225  if( isDimMode( dir ) )
     1226  {
     1227    UInt uiCodeIdx = 0;
     1228
     1229    switch( getDimType( dir ) )
     1230    {
     1231    case DMM1_IDX: uiCodeIdx = 0; break;
     1232    case DMM4_IDX: uiCodeIdx = 1; break;
     1233    default:                      break;
     1234    }
     1235    //mode coding
     1236    m_pcBinIf->encodeBin( uiCodeIdx == 0 ? 0 : 1, m_cDepthIntraModeSCModel.get( 0, 0, 0 ) );
     1237  }
     1238}
     1239#else
    11781240Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
    11791241{
     
    12161278  }
    12171279}
     1280#endif
    12181281#endif
    12191282
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSbac.h

    r773 r781  
    247247  ContextModel3DBuffer m_cDdcFlagSCModel;
    248248  ContextModel3DBuffer m_cDdcDataSCModel;
     249#if QC_GENERIC_SDC_G0122
     250  ContextModel3DBuffer m_cAngleFlagSCModel;
     251  ContextModel3DBuffer m_cIntraSdcFlagSCModel;
     252#endif
    249253#if H_3D_DIM_DMM
    250254  ContextModel3DBuffer m_cDmm1DataSCModel;
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSearch.cpp

    r773 r781  
    18621862
    18631863#if H_3D_DIM_SDC
    1864 Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual )
     1864Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost,
     1865#if QC_GENERIC_SDC_G0122
     1866  Bool bZeroResidual, Int iSDCDeltaResi
     1867#else
     1868  Bool bResidual
     1869#endif
     1870  )
    18651871{
    18661872  UInt    uiLumaPredMode    = pcCU     ->getLumaIntraDir( uiAbsPartIdx );
     
    18801886  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
    18811887  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
     1888#if !QC_GENERIC_SDC_G0122
    18821889  AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) );
    18831890  AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || uiWidth < 64  );
     1891#endif
    18841892 
    18851893  //===== init availability pattern =====
     
    18881896  pcCU->getPattern()->initPattern   ( pcCU, 0, uiAbsPartIdx );
    18891897  pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );
    1890  
     1898#if QC_GENERIC_SDC_G0122
     1899  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
     1900#endif
    18911901  //===== get prediction signal =====
    18921902#if H_3D_DIM
    18931903  if( isDimMode( uiLumaPredMode ) )
    18941904  {
    1895     predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true );
     1905    predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true
     1906#if QC_GENERIC_SDC_G0122
     1907      , dmm4Segmentation
     1908#endif
     1909      );
    18961910  }
    18971911  else
     
    19191933    uiMaskStride = pcWedgelet->getStride();
    19201934  }
    1921  
     1935#if QC_GENERIC_SDC_G0122
     1936  if( getDimType( uiLumaPredMode ) == DMM4_IDX )
     1937  {
     1938    uiNumSegments = 2;
     1939    pbMask  = dmm4Segmentation->getPattern();
     1940    uiMaskStride = dmm4Segmentation->getStride();
     1941  }
     1942#endif
     1943
    19221944  // get DC prediction for each segment
    19231945  Pel apDCPredValues[2];
     
    19311953  {
    19321954    // remap reconstructed value to valid depth values
     1955#if QC_GENERIC_SDC_G0122
     1956    Pel pDCRec = ( !bZeroResidual ) ? apDCOrigValues[uiSegment] : apDCPredValues[uiSegment];
     1957#else
    19331958    Pel pDCRec = bResidual?apDCOrigValues[uiSegment]:apDCPredValues[uiSegment];
    1934    
     1959#endif
    19351960    // get residual (idx)
    19361961#if H_3D_DIM_DLT
     
    19391964    Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment];
    19401965#endif
    1941    
     1966#if QC_GENERIC_SDC_G0122
     1967    if( !bZeroResidual )
     1968    {
     1969      Pel   pPredIdx    = pcCU->getSlice()->getPPS()->getDLT()->depthValue2idx( pcCU->getSlice()->getLayerIdInVps(), apDCPredValues[uiSegment] );
     1970      Int   pTestIdx    = pPredIdx + pResidualIdx + iSDCDeltaResi;
     1971      if( pTestIdx >= 0 && pTestIdx < pcCU->getSlice()->getPPS()->getDLT()->getNumDepthValues( pcCU->getSlice()->getLayerIdInVps() ) )
     1972      {
     1973        pResidualIdx += iSDCDeltaResi;
     1974      }
     1975    }
     1976#endif
    19421977    // save SDC DC offset
    19431978    pcCU->setSDCSegmentDCOffset(pResidualIdx, uiSegment, uiAbsPartIdx);
     
    20242059#endif
    20252060    dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
     2061#if QC_GENERIC_SDC_G0122
     2062  dmm4Segmentation->destroy(); delete dmm4Segmentation;
     2063#endif
    20262064}
    20272065#endif
     
    29012939          case( DMM4_IDX ):
    29022940            {
     2941#if !QC_GENERIC_SDC_G0122
    29032942              if( uiWidth > 4 )
     2943#endif
    29042944              {
    29052945                biSegmentation = new TComWedgelet( uiWidth, uiHeight );
     
    29572997      {
    29582998        pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth );
     2999#if QC_GENERIC_SDC_G0122
     3000        for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ )
     3001        {
     3002          if( ( uiSDC == 0 ) && iSDCDeltaResi != 0 )
     3003          {
     3004            continue;
     3005          }
     3006#endif
    29593007#endif
    29603008     
     
    29663014#if H_3D_DIM_SDC
    29673015      bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset);
     3016#endif
     3017#if QC_GENERIC_SDC_G0122
     3018      if( uiSDC != 0 && iSDCDeltaResi != 0 )
     3019      {
     3020        bTestZeroResi = false;
     3021      }
    29683022#endif
    29693023#endif
     
    30003054             
    30013055              // start encoding with SDC
     3056#if QC_GENERIC_SDC_G0122
     3057              xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi );
     3058#else
    30023059              xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (testZeroResi!=0));
     3060#endif
    30033061            }
    30043062            else
     
    30733131#if H_3D_DIM_ENC || H_3D_DIM_SDC
    30743132      }
     3133#endif
     3134#if QC_GENERIC_SDC_G0122
     3135        } // SDC residual loop
    30753136#endif
    30763137#if H_3D_DIM_SDC
  • branches/HTM-9.3-dev3-Qualcomm/source/Lib/TLibEncoder/TEncSearch.h

    r773 r781  
    353353#endif
    354354#if H_3D_DIM_SDC
    355   Void xIntraCodingSDC            ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bResidual );
     355  Void xIntraCodingSDC            ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost,
     356#if QC_GENERIC_SDC_G0122
     357    Bool bZeroResidual, Int iSDCDeltaResi
     358#else
     359    Bool bResidual
     360#endif
     361    );
    356362#endif
    357363#endif
Note: See TracChangeset for help on using the changeset viewer.