Ignore:
Timestamp:
10 Nov 2012, 19:05:41 (13 years ago)
Author:
rwth
Message:
  • added RWTH_B0036 (SDC+DLT)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-4.1-dev2-RWTH/source/Lib/TLibCommon/TComDataCU.cpp

    r161 r177  
    158158#endif
    159159#endif
     160#if RWTH_SDC_DLT_B0036
     161  m_pbSDCFlag           = NULL;
     162  m_apSegmentDCOffset[0] = NULL;
     163  m_apSegmentDCOffset[1] = NULL;
     164#endif
    160165#if OL_DEPTHLIMIT_A0044
    161166  //add a variable to store the partition information
     
    208213    memset( m_pePartSize, SIZE_NONE,uiNumPartition * sizeof( *m_pePartSize ) );
    209214    m_pePredMode         = new Char[ uiNumPartition ];
     215   
     216#if RWTH_SDC_DLT_B0036
     217    m_pbSDCFlag          = (Bool*  )xMalloc(Bool,   uiNumPartition);
     218    m_apSegmentDCOffset[0] = (Pel*)xMalloc(Pel, uiNumPartition);
     219    m_apSegmentDCOffset[1] = (Pel*)xMalloc(Pel, uiNumPartition);
     220#endif
    210221   
    211222    m_puiAlfCtrlFlag     = new Bool[ uiNumPartition ];
     
    355366#endif
    356367    if ( m_pePredMode         ) { delete[] m_pePredMode;        m_pePredMode        = NULL; }
     368#if RWTH_SDC_DLT_B0036
     369    if ( m_pbSDCFlag          ) { xFree(m_pbSDCFlag);      m_pbSDCFlag    = NULL; }
     370    if ( m_apSegmentDCOffset[0]          ) { xFree(m_apSegmentDCOffset[0]);      m_apSegmentDCOffset[0]    = NULL; }
     371    if ( m_apSegmentDCOffset[1]          ) { xFree(m_apSegmentDCOffset[1]);      m_apSegmentDCOffset[1]    = NULL; }
     372#endif
    357373    if ( m_puhCbf[0]          ) { xFree(m_puhCbf[0]);           m_puhCbf[0]         = NULL; }
    358374    if ( m_puhCbf[1]          ) { xFree(m_puhCbf[1]);           m_puhCbf[1]         = NULL; }
     
    546562    m_piTextureModeDepth[ui] = pcFrom->getTextureModeDepth(ui);
    547563#endif
     564#if RWTH_SDC_DLT_B0036
     565    m_pbSDCFlag[ui] = pcFrom->getSDCFlag(ui);
     566#endif
    548567    m_puhWidth  [ui] = pcFrom->getWidth(ui);
    549568    m_puhHeight [ui] = pcFrom->getHeight(ui);
     
    581600    memset( m_piTextureModeDepth+ firstElement,-1,                        numElements * sizeof( *m_piTextureModeDepth ) );
    582601#endif
     602#if RWTH_SDC_DLT_B0036
     603    memset( m_pbSDCFlag        + firstElement,     0,                     numElements * sizeof( *m_pbSDCFlag ) );
     604    memset( m_apSegmentDCOffset[0]        + firstElement,     0,                     numElements * sizeof( *m_apSegmentDCOffset[0] ) );
     605    memset( m_apSegmentDCOffset[1]        + firstElement,     0,                     numElements * sizeof( *m_apSegmentDCOffset[1] ) );
     606#endif
    583607    memset( m_puhTrIdx          + firstElement, 0,                        numElements * sizeof( *m_puhTrIdx ) );
    584608    memset( m_nsqtPartIdx       + firstElement, 0,                        numElements * sizeof( *m_nsqtPartIdx) );
     
    810834    m_piContourPredTexDeltaDC2[ui] = 0;
    811835#endif
     836#if RWTH_SDC_DLT_B0036
     837    m_pbSDCFlag[ui] = false;
     838    m_apSegmentDCOffset[0][ui] = 0;
     839    m_apSegmentDCOffset[1][ui] = 0;
     840#endif
    812841    }
    813842  }
     
    922951  memset( m_piContourPredTexDeltaDC1, 0, sizeof( Int  ) * m_uiNumPartition );
    923952  memset( m_piContourPredTexDeltaDC2, 0, sizeof( Int  ) * m_uiNumPartition );
    924 #endif   
     953#endif   
     954#if RWTH_SDC_DLT_B0036
     955  memset( m_pbSDCFlag,     0, sizeof(Bool) * m_uiNumPartition  );
     956  memset( m_apSegmentDCOffset[0],     0, sizeof(Pel) * m_uiNumPartition);
     957  memset( m_apSegmentDCOffset[1],     0, sizeof(Pel) * m_uiNumPartition);
     958#endif
    925959
    926960  UChar uhWidth  = g_uiMaxCUWidth  >> uiDepth;
     
    9931027      m_pbResPredFlag     [ui] = pcCU->m_pbResPredFlag     [ uiPartOffset + ui ];
    9941028#endif
     1029#if RWTH_SDC_DLT_B0036
     1030      m_pbSDCFlag         [ui] = pcCU->m_pbSDCFlag         [ uiPartOffset + ui ];
     1031      m_apSegmentDCOffset[0][ui] = pcCU->m_apSegmentDCOffset[0][ uiPartOffset + ui ];
     1032      m_apSegmentDCOffset[1][ui] = pcCU->m_apSegmentDCOffset[1][ uiPartOffset + ui ];
     1033#endif
    9951034    }
    9961035  }
     
    12021241  }
    12031242#endif
     1243#if RWTH_SDC_DLT_B0036
     1244  m_pbSDCFlag               = pcCU->getSDCFlag()            + uiPart;
     1245  m_apSegmentDCOffset[0]    = pcCU->getSDCSegmentDCOffset(0) + uiPart;
     1246  m_apSegmentDCOffset[1]    = pcCU->getSDCSegmentDCOffset(1) + uiPart;
     1247#endif
    12041248}
    12051249
     
    13841428  memcpy( m_piTextureModeDepth + uiOffset, pcCU->getTextureModeDepth(), sizeof( Int ) * uiNumPartition );
    13851429#endif
     1430#if RWTH_SDC_DLT_B0036
     1431  memcpy( m_pbSDCFlag     + uiOffset, pcCU->getSDCFlag(),      iSizeInBool  );
     1432  memcpy( m_apSegmentDCOffset[0]     + uiOffset, pcCU->getSDCSegmentDCOffset(0), sizeof( Pel ) * uiNumPartition);
     1433  memcpy( m_apSegmentDCOffset[1]     + uiOffset, pcCU->getSDCSegmentDCOffset(1), sizeof( Pel ) * uiNumPartition);
     1434#endif
    13861435}
    13871436
     
    15051554  memcpy( rpcCU->getTextureModeDepth() + m_uiAbsIdxInLCU, m_piTextureModeDepth, sizeof( Int ) * m_uiNumPartition );
    15061555#endif
     1556#if RWTH_SDC_DLT_B0036
     1557  memcpy( rpcCU->getSDCFlag() + m_uiAbsIdxInLCU, m_pbSDCFlag,      iSizeInBool  );
     1558  memcpy( rpcCU->getSDCSegmentDCOffset(0) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[0], sizeof( Pel ) * m_uiNumPartition);
     1559  memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition);
     1560#endif
    15071561}
    15081562
     
    16261680#if HHI_MPI
    16271681  memcpy( rpcCU->getTextureModeDepth() + uiPartOffset, m_piTextureModeDepth, sizeof( Int ) * uiQNumPart  );
     1682#endif
     1683#if RWTH_SDC_DLT_B0036
     1684  memcpy( rpcCU->getSDCFlag() + uiPartOffset, m_pbSDCFlag,      iSizeInBool  );
     1685  memcpy( rpcCU->getSDCSegmentDCOffset(0) + uiPartOffset, m_apSegmentDCOffset[0], sizeof( Pel ) * uiQNumPart);
     1686  memcpy( rpcCU->getSDCSegmentDCOffset(1) + uiPartOffset, m_apSegmentDCOffset[1], sizeof( Pel ) * uiQNumPart);
    16281687#endif
    16291688}
     
    29553014  setSubPart( bMergeFlag, m_pbMergeFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
    29563015}
     3016
     3017#if RWTH_SDC_DLT_B0036
     3018Void TComDataCU::setSDCFlagSubParts ( Bool bSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     3019{
     3020  setSubPart( bSDCFlag, m_pbSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
     3021}
     3022
     3023UInt TComDataCU::getCtxSDCFlag( UInt uiAbsPartIdx )
     3024{
     3025  TComDataCU* pcTempCU;
     3026  UInt        uiTempPartIdx;
     3027  UInt        uiCtx = 0;
     3028 
     3029  // left PU
     3030  pcTempCU = getPULeft( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, false );
     3031  uiCtx    = ( pcTempCU ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
     3032 
     3033  // above PU
     3034  pcTempCU = getPUAbove( uiTempPartIdx, m_uiAbsIdxInLCU + uiAbsPartIdx, true, false );
     3035  uiCtx   += ( pcTempCU ) ? pcTempCU->getSDCFlag( uiTempPartIdx ) : 0;
     3036 
     3037  return uiCtx;
     3038}
     3039
     3040Bool TComDataCU::getSDCAvailable( UInt uiAbsPartIdx )
     3041{
     3042  if( !getSlice()->getSPS()->isDepth() || getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N )
     3043    return false;
     3044 
     3045  UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx );
     3046 
     3047  if(!isIntra(uiAbsPartIdx))
     3048    return false;
     3049 
     3050  for(UInt ui=0; ui<RWTH_SDC_NUM_PRED_MODES; ui++)
     3051  {
     3052    if( g_auiSDCPredModes[ui] == uiLumaPredMode )
     3053      return true;
     3054  }
     3055  // else
     3056  return false;
     3057}
     3058#endif
    29573059
    29583060Void TComDataCU::setMergeIndexSubParts ( UInt uiMergeIndex, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
Note: See TracChangeset for help on using the changeset viewer.