Changeset 878 in 3DVCSoftware for branches/HTM-10.1-dev0/source/Lib/TLibEncoder


Ignore:
Timestamp:
27 Mar 2014, 19:51:52 (11 years ago)
Author:
tech
Message:

Cleanups part 3.

Location:
branches/HTM-10.1-dev0/source/Lib/TLibEncoder
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSbac.cpp

    r877 r878  
    9292, m_cDdcFlagSCModel           ( 1,             1,               NUM_DDC_FLAG_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    9393, m_cDdcDataSCModel           ( 1,             1,               NUM_DDC_DATA_CTX              , m_contextModels + m_numContextModels, m_numContextModels)
    94 #if QC_GENERIC_SDC_G0122
    9594, m_cAngleFlagSCModel         ( 1,             1,               NUM_ANGLE_FLAG_CTX            , m_contextModels + m_numContextModels, m_numContextModels)
    96 #endif
    9795#if H_3D_DIM_DMM
    9896, m_cDmm1DataSCModel          ( 1,             1,               NUM_DMM1_DATA_CTX             , m_contextModels + m_numContextModels, m_numContextModels)
     
    170168  m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    171169  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    172 #if QC_GENERIC_SDC_G0122
    173170  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
    174 #endif
    175171#if H_3D_DIM_DMM
    176172  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
     
    258254      curCost += m_cDdcFlagSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_FLAG );
    259255      curCost += m_cDdcDataSCModel.calcCost           ( curSliceType, qp, (UChar*)INIT_DDC_DATA );
    260 #if QC_GENERIC_SDC_G0122
    261256      curCost += m_cAngleFlagSCModel.calcCost         ( curSliceType, qp, (UChar*)INIT_ANGLE_FLAG ); 
    262 #endif
    263257#if H_3D_DIM_DMM
    264258      curCost += m_cDmm1DataSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_DMM1_DATA );
     
    324318  m_cDdcFlagSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_FLAG );
    325319  m_cDdcDataSCModel.initBuffer           ( eSliceType, iQp, (UChar*)INIT_DDC_DATA );
    326 #if QC_GENERIC_SDC_G0122
    327320  m_cAngleFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_ANGLE_FLAG );
    328 #endif
    329321#if H_3D_DIM_DMM
    330322  m_cDmm1DataSCModel.initBuffer          ( eSliceType, iQp, (UChar*)INIT_DMM1_DATA );
     
    640632  this->m_cDepthIntraModeSCModel .copyFrom( &pSrc->m_cDepthIntraModeSCModel );
    641633  this->m_cDdcFlagSCModel        .copyFrom( &pSrc->m_cDdcFlagSCModel );
    642 #if QC_GENERIC_SDC_G0122
    643634  this->m_cAngleFlagSCModel      .copyFrom( &pSrc->m_cAngleFlagSCModel );
    644 #endif
    645635}
    646636#endif
     
    11211111    }
    11221112    if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    1123 #if H_3D_DIM_SDC
    1124 #if QC_GENERIC_SDC_G0122
    1125       if( 1 )
    1126 #else
    1127       if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
    1128 #endif
    1129 #endif
    1130     {
    1131 #endif
    1132     predNum[j] = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]); 
    1133     for(UInt i = 0; i < predNum[j]; i++)
    1134     {
    1135       if(dir[j] == preds[j][i])
    1136       {
    1137         predIdx[j] = i;
    1138       }
    1139     }
    1140     m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) );
     1113    {
     1114#endif
     1115      predNum[j] = pcCU->getIntraDirLumaPredictor(absPartIdx+partOffset*j, preds[j]); 
     1116      for(UInt i = 0; i < predNum[j]; i++)
     1117      {
     1118        if(dir[j] == preds[j][i])
     1119        {
     1120          predIdx[j] = i;
     1121        }
     1122      }
     1123      m_pcBinIf->encodeBin((predIdx[j] != -1)? 1 : 0, m_cCUIntraPredSCModel.get( 0, 0, 0 ) );
    11411124#if H_MV_ENC_DEC_TRAC
    1142     DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0);
     1125      DTRACE_CU("prev_intra_luma_pred_flag", (predIdx[j] != -1)? 1 : 0);
    11431126#endif
    11441127#if H_3D_DIM
     
    11511134#if H_3D_DIM
    11521135    if( pcCU->getLumaIntraDir( absPartIdx+partOffset*j ) < NUM_INTRA_MODE )
    1153 #if H_3D_DIM_SDC
    1154 #if QC_GENERIC_SDC_G0122
    1155       if( 1 )
    1156 #else
    1157       if( !pcCU->getSDCFlag( absPartIdx+partOffset*j ) )
    1158 #endif
    1159 #endif
    11601136    {
    11611137#endif
     
    12571233}
    12581234
    1259 #if QC_GENERIC_SDC_G0122
    12601235Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
    12611236{
     
    12801255  }
    12811256}
    1282 #else
    1283 Void TEncSbac::codeIntraDepthMode( TComDataCU* pcCU, UInt absPartIdx )
    1284 {
    1285   UInt codeWordTable[3][7] =    {{0, 0, 0, 1, 0, 0, 0},{0, 2, 6, 14, 15, 0, 0},{0, 1, 0, 0, 0, 0, 0}};
    1286   UInt codeWordLenTable[3][7] = {{0, 1, 0, 1, 0, 0, 0},{1, 2, 3,  4,  4, 0, 0},{1, 1, 0, 0, 0, 0, 0}};
    1287   UInt dir = pcCU->getLumaIntraDir( absPartIdx );
    1288   UInt puIdx = (pcCU->getWidth(absPartIdx) == 64) ? 2 : ( (pcCU->getPartitionSize(absPartIdx) == SIZE_NxN && pcCU->getWidth(absPartIdx) == 8) ? 0 : 1 );
    1289   UInt codeIdx = 0;
    1290 
    1291   if( dir < NUM_INTRA_MODE )
    1292   {
    1293     codeIdx = 1;
    1294   }
    1295   if( isDimMode( dir ) )
    1296   {
    1297     switch( getDimType( dir ) )
    1298     {
    1299     case DMM1_IDX: codeIdx = 3; break;
    1300     case DMM4_IDX: codeIdx = 4; break;
    1301     default:                    break;
    1302     }
    1303   }
    1304 
    1305 #if H_3D_DIM_SDC
    1306   if( pcCU->getSDCFlag( absPartIdx ) )
    1307   {
    1308     switch( dir )
    1309     {
    1310       case PLANAR_IDX:  codeIdx = 0; break;
    1311       default:          codeIdx = 2; break;
    1312     }
    1313   }
    1314 #endif
    1315   //mode coding
    1316   for( UInt i = 0; i < codeWordLenTable[puIdx][codeIdx]; i++ )
    1317   {
    1318     UInt bit = codeWordTable[puIdx][codeIdx] & ( 1<<(codeWordLenTable[puIdx][codeIdx] - i - 1) );
    1319     UInt ctxDepthMode = puIdx*3 + ( (i >= 2) ? 2 : i );
    1320     m_pcBinIf->encodeBin( bit!=0 , m_cDepthIntraModeSCModel.get(0, 0, ctxDepthMode) );
    1321   }
    1322 }
    1323 #endif
    13241257#endif
    13251258
  • branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSbac.h

    r877 r878  
    257257  ContextModel3DBuffer m_cDdcFlagSCModel;
    258258  ContextModel3DBuffer m_cDdcDataSCModel;
    259 #if QC_GENERIC_SDC_G0122
    260259  ContextModel3DBuffer m_cAngleFlagSCModel;
    261 #endif
    262260#if H_3D_DIM_DMM
    263261  ContextModel3DBuffer m_cDmm1DataSCModel;
  • branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r877 r878  
    18621862#if H_3D_DIM_SDC
    18631863Void TEncSearch::xIntraCodingSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost,
    1864 #if QC_GENERIC_SDC_G0122
    18651864  Bool bZeroResidual, Int iSDCDeltaResi
    1866 #else
    1867   Bool bResidual
    1868 #endif
    18691865  )
    18701866{
     
    18741870#if QC_PKU_SDC_SPLIT_G0123
    18751871#if HS_TSINGHUA_SDC_SPLIT_G0111
    1876 #if QC_GENERIC_SDC_G0122
    18771872  TComWedgelet* dmm4SegmentationOrg = new TComWedgelet( uiWidth, uiHeight );
    1878 #endif
    18791873#else
    1880 #if QC_GENERIC_SDC_G0122
    1881   TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
    1882 #endif
    18831874#endif
    18841875#endif
     
    19381929  AOF( pcCU->getSDCAvailable(uiAbsPartIdx) );
    19391930  AOF( pcCU->getSDCFlag(uiAbsPartIdx) );
    1940 #endif
    1941 #if !QC_GENERIC_SDC_G0122
    1942   AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) );
    1943   AOF( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || uiWidth < 64  );
    19441931#endif
    19451932 
     
    19561943#endif
    19571944#if !QC_PKU_SDC_SPLIT_G0123
    1958 #if QC_GENERIC_SDC_G0122
    19591945  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
    19601946#endif
    1961 #endif
    19621947#if HS_TSINGHUA_SDC_SPLIT_G0111
    1963 #if QC_GENERIC_SDC_G0122
    19641948  TComWedgelet* dmm4Segmentation = new TComWedgelet( uiWidth, uiHeight );
    1965 #endif
    19661949#endif
    19671950  //===== get prediction signal =====
     
    19821965#endif
    19831966    predIntraLumaDepth( pcCU, uiAbsPartIdx, uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, true
    1984 #if QC_GENERIC_SDC_G0122
    19851967      , dmm4Segmentation
    1986 #endif
    19871968      );
    19881969#if HS_TSINGHUA_SDC_SPLIT_G0111
     
    20532034    uiMaskStride = pcWedgelet->getStride();
    20542035  }
    2055 #if QC_GENERIC_SDC_G0122
    20562036  if( getDimType( uiLumaPredMode ) == DMM4_IDX )
    20572037  {
     
    20652045#endif
    20662046  }
    2067 #endif
    20682047 
    20692048  // get DC prediction for each segment
     
    20782057  {
    20792058    // remap reconstructed value to valid depth values
    2080 #if QC_GENERIC_SDC_G0122
    20812059    Pel pDCRec = ( !bZeroResidual ) ? apDCOrigValues[uiSegment] : apDCPredValues[uiSegment];
    2082 #else
    2083     Pel pDCRec = bResidual?apDCOrigValues[uiSegment]:apDCPredValues[uiSegment];
    2084 #endif
    20852060    // get residual (idx)
    20862061#if H_3D_DIM_DLT
     
    20892064    Pel pResidualIdx = pDCRec - apDCPredValues[uiSegment];
    20902065#endif
    2091 #if QC_GENERIC_SDC_G0122
    20922066    if( !bZeroResidual )
    20932067    {
     
    20992073      }
    21002074    }
    2101 #endif
    21022075    // save SDC DC offset
    21032076    pcCU->setSDCSegmentDCOffset(pResidualIdx, uiSegment, uiAbsPartIdx);
     
    22032176#endif
    22042177    dRDCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
    2205 #if QC_GENERIC_SDC_G0122
    22062178#if HS_TSINGHUA_SDC_SPLIT_G0111
    22072179  dmm4SegmentationOrg->destroy(); delete dmm4SegmentationOrg;
    22082180#else
    22092181  dmm4Segmentation->destroy(); delete dmm4Segmentation;
    2210 #endif
    22112182#endif
    22122183}
     
    30753046          case( DMM4_IDX ):
    30763047            {
    3077 #if !QC_GENERIC_SDC_G0122
    3078               if( uiWidth > 4 )
    3079 #endif
    30803048              {
    30813049                biSegmentation = new TComWedgelet( uiWidth, uiHeight );
     
    31333101      {
    31343102        pcCU->setSDCFlagSubParts( (uiSDC != 0), uiPartOffset, uiDepth + uiInitTrDepth );
    3135 #if QC_GENERIC_SDC_G0122
    31363103        for( Int iSDCDeltaResi = -2; iSDCDeltaResi <= 2; iSDCDeltaResi++ )
    31373104        {
     
    31403107            continue;
    31413108          }
    3142 #endif
    31433109#endif
    31443110     
     
    31513117      bTestZeroResi |= pcCU->getSDCFlag(uiPartOffset);
    31523118#endif
    3153 #if QC_GENERIC_SDC_G0122
    31543119      if( uiSDC != 0 && iSDCDeltaResi != 0 )
    31553120      {
    31563121        bTestZeroResi = false;
    31573122      }
    3158 #endif
    31593123#endif
    31603124     
     
    31873151
    31883152          // start encoding with SDC
    3189 #if QC_GENERIC_SDC_G0122
    31903153          xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, ( testZeroResi != 0 ), iSDCDeltaResi );
    3191 #else
    3192           xIntraCodingSDC(pcCU, uiPartOffset, pcOrgYuv, pcPredYuv, uiPUDistY, dPUCost, (testZeroResi!=0));
    3193 #endif
    31943154        }
    31953155        else
     
    32643224#if H_3D_DIM_ENC || H_3D_DIM_SDC
    32653225      }
    3266 #endif
    3267 #if QC_GENERIC_SDC_G0122
    32683226        } // SDC residual loop
    32693227#endif
  • branches/HTM-10.1-dev0/source/Lib/TLibEncoder/TEncSearch.h

    r877 r878  
    353353#endif
    354354#if H_3D_DIM_SDC
    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     );
     355  Void xIntraCodingSDC            ( TComDataCU* pcCU, UInt uiAbsPartIdx, TComYuv* pcOrgYuv, TComYuv* pcPredYuv, Dist& ruiDist, Double& dRDCost, Bool bZeroResidual, Int iSDCDeltaResi    );
    362356#endif
    363357#endif
Note: See TracChangeset for help on using the changeset viewer.