Ignore:
Timestamp:
29 Aug 2013, 15:10:30 (12 years ago)
Author:
tech
Message:

Merged dev3: DEV-2.0-DEV3-KWU@589

Location:
branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/ContextTables.h

    r598 r601  
    112112#if H_3D_DIM_DMM
    113113#define NUM_DMM1_DATA_CTX             1       ///< number of context models for DMM1 data
     114#if !SEC_DMM2_E0146
    114115#define NUM_DMM2_DATA_CTX             1       ///< number of context models for DMM2 data
     116#endif
    115117#define NUM_DMM3_DATA_CTX             1       ///< number of context models for DMM3 data
    116118#endif
     
    388390#endif
    389391#if H_3D_DIM
     392#if ZJU_DEPTH_INTRA_MODE_E0204
     393static const UChar
     394INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
     395{
     396    {0,  0,  64, 168, 168, 124, CNU, 0},
     397    {0, 64,   0, 183, CNU, 108,   0, 0},
     398    {64, 0, CNU, CNU, 168, 109,   0, 0}
     399};
     400#else
    390401static const UChar
    391402INIT_DEPTH_INTRA_MODE[3][NUM_DEPTH_INTRA_MODE_CTX] =
     
    395406  {64, 0, CNU,   0, CNU,   0,   0, 0}
    396407};
     408#endif
    397409static const UChar
    398410INIT_DDC_FLAG[3][NUM_DDC_FLAG_CTX] =
     
    417429  { CNU },
    418430};
     431#if !SEC_DMM2_E0146
    419432static const UChar
    420433INIT_DMM2_DATA[3][NUM_DMM2_DATA_CTX] =
     
    424437  { CNU },
    425438};
     439#endif
    426440static const UChar
    427441INIT_DMM3_DATA[3][NUM_DMM3_DATA_CTX] =
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r600 r601  
    120120    m_dmmWedgeTabIdx[i] = NULL;
    121121  }
     122#if !SEC_DMM2_E0146
    122123  m_dmm2DeltaEnd    = NULL;
     124#endif
    123125  m_dmm3IntraTabIdx = NULL;
    124126#endif
     
    278280      m_dmmWedgeTabIdx[i]    = (UInt*)xMalloc(UInt, uiNumPartition);
    279281    }
     282#if !SEC_DMM2_E0146
    280283    m_dmm2DeltaEnd    = (Int* )xMalloc(Int,  uiNumPartition);
     284#endif
    281285    m_dmm3IntraTabIdx = (UInt*)xMalloc(UInt, uiNumPartition);
    282286#endif
     
    415419      if ( m_dmmWedgeTabIdx[i] ) { xFree( m_dmmWedgeTabIdx[i] ); m_dmmWedgeTabIdx[i] = NULL; }
    416420    }
     421#if !SEC_DMM2_E0146
    417422    if ( m_dmm2DeltaEnd    ) { xFree( m_dmm2DeltaEnd    ); m_dmm2DeltaEnd    = NULL; }
     423#endif
    418424    if ( m_dmm3IntraTabIdx ) { xFree( m_dmm3IntraTabIdx ); m_dmm3IntraTabIdx = NULL; }
    419425#endif
     
    640646      memset( m_dmmWedgeTabIdx[i] + firstElement, 0,                      numElements * sizeof( *m_dmmWedgeTabIdx[i] ) );
    641647    }
     648#if !SEC_DMM2_E0146
    642649    memset( m_dmm2DeltaEnd      + firstElement, 0,                        numElements * sizeof( *m_dmm2DeltaEnd    ) );
     650#endif
    643651    memset( m_dmm3IntraTabIdx   + firstElement, 0,                        numElements * sizeof( *m_dmm3IntraTabIdx ) );
    644652#endif
     
    821829        m_dmmWedgeTabIdx[i] [ui] = 0;
    822830      }
     831#if !SEC_DMM2_E0146
    823832      m_dmm2DeltaEnd    [ui] = 0;
     833#endif
    824834      m_dmm3IntraTabIdx [ui] = 0;
    825835#endif
     
    936946    memset( m_dmmWedgeTabIdx[i], 0, sizeof(UInt) * m_uiNumPartition );
    937947  }
     948#if !SEC_DMM2_E0146
    938949  memset( m_dmm2DeltaEnd   , 0, sizeof(Int ) * m_uiNumPartition );
     950#endif
    939951  memset( m_dmm3IntraTabIdx, 0, sizeof(UInt) * m_uiNumPartition );
    940952#endif
     
    10241036        m_dmmWedgeTabIdx[i] [ui] = pcCU->m_dmmWedgeTabIdx[i] [uiPartOffset+ui];
    10251037      }
     1038#if !SEC_DMM2_E0146
    10261039      m_dmm2DeltaEnd    [ui] = pcCU->m_dmm2DeltaEnd   [uiPartOffset+ui];
     1040#endif
    10271041      m_dmm3IntraTabIdx [ui] = pcCU->m_dmm3IntraTabIdx[uiPartOffset+ui];
    10281042#endif
     
    11821196    m_dmmWedgeTabIdx[i] = pcCU->getDmmWedgeTabIdx( i ) + uiPart;
    11831197  }
     1198#if !SEC_DMM2_E0146
    11841199  m_dmm2DeltaEnd    = pcCU->getDmm2DeltaEnd()    + uiPart;
     1200#endif
    11851201  m_dmm3IntraTabIdx = pcCU->getDmm3IntraTabIdx() + uiPart;
    11861202#endif
     
    13881404    memcpy( m_dmmWedgeTabIdx[i] + uiOffset, pcCU->getDmmWedgeTabIdx( i ), sizeof(UInt) * uiNumPartition );
    13891405  }
     1406#if !SEC_DMM2_E0146
    13901407  memcpy( m_dmm2DeltaEnd    + uiOffset, pcCU->getDmm2DeltaEnd()   , sizeof(Int ) * uiNumPartition );
     1408#endif
    13911409  memcpy( m_dmm3IntraTabIdx + uiOffset, pcCU->getDmm3IntraTabIdx(), sizeof(UInt) * uiNumPartition );
    13921410#endif
     
    15211539    memcpy( rpcCU->getDmmWedgeTabIdx( i ) + m_uiAbsIdxInLCU, m_dmmWedgeTabIdx[i], sizeof(UInt) * m_uiNumPartition );
    15221540  }
     1541#if !SEC_DMM2_E0146
    15231542  memcpy( rpcCU->getDmm2DeltaEnd()    + m_uiAbsIdxInLCU, m_dmm2DeltaEnd   , sizeof(Int ) * m_uiNumPartition );
     1543#endif
    15241544  memcpy( rpcCU->getDmm3IntraTabIdx() + m_uiAbsIdxInLCU, m_dmm3IntraTabIdx, sizeof(UInt) * m_uiNumPartition );
    15251545#endif
     
    16381658    memcpy( rpcCU->getDmmWedgeTabIdx( i ) + uiPartOffset, m_dmmWedgeTabIdx[i], sizeof(UInt) * uiQNumPart );
    16391659  }
     1660#if !SEC_DMM2_E0146
    16401661  memcpy( rpcCU->getDmm2DeltaEnd()    + uiPartOffset, m_dmm2DeltaEnd   , sizeof(Int ) * uiQNumPart );
     1662#endif
    16411663  memcpy( rpcCU->getDmm3IntraTabIdx() + uiPartOffset, m_dmm3IntraTabIdx, sizeof(UInt) * uiQNumPart );
    16421664#endif
     
    27132735  // check prediction mode
    27142736  UInt uiLumaPredMode = getLumaIntraDir( uiAbsPartIdx ); 
     2737#if LGE_SDC_REMOVE_DC_E0158
     2738  if( uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) )
     2739#else
    27152740  if( uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX || ( getDimType( uiLumaPredMode ) == DMM1_IDX && !isDimDeltaDC( uiLumaPredMode ) ) )
     2741#endif
    27162742    return true;
    27172743 
     
    63806406  for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; }
    63816407}
     6408#if !SEC_DMM2_E0146
    63826409Void  TComDataCU::setDmm2DeltaEndSubParts( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth )
    63836410{
     
    63856412  for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm2DeltaEnd[uiAbsPartIdx+ui] = iDelta; }
    63866413}
     6414#endif
    63876415Void  TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth )
    63886416{
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComDataCU.h

    r598 r601  
    211211#if H_3D_DIM_DMM
    212212  UInt*         m_dmmWedgeTabIdx[DMM_NUM_TYPE];
     213#if !SEC_DMM2_E0146
    213214  Int*          m_dmm2DeltaEnd;
     215#endif
    214216  UInt*         m_dmm3IntraTabIdx;
    215217#endif
     
    553555  Void  setDmmWedgeTabIdxSubParts     ( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth );
    554556
     557#if !SEC_DMM2_E0146
    555558  Int*  getDmm2DeltaEnd               ()                      { return m_dmm2DeltaEnd;        }
    556559  Int   getDmm2DeltaEnd               ( UInt uiIdx )          { return m_dmm2DeltaEnd[uiIdx]; }
    557560  Void  setDmm2DeltaEnd               ( UInt uiIdx, Int iD )  { m_dmm2DeltaEnd[uiIdx] = iD;   }
    558561  Void  setDmm2DeltaEndSubParts       ( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth );
     562#endif
    559563
    560564  UInt* getDmm3IntraTabIdx            ()                      { return m_dmm3IntraTabIdx;        }
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPrediction.cpp

    r598 r601  
    456456        dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ pcCU->getDmmWedgeTabIdx( dimType, uiAbsPartIdx ) ]);
    457457      } break;
     458#if !SEC_DMM2_E0146
    458459    case( DMM2_IDX ):
    459460      {
     
    467468        dmmSegmentation = &(g_dmmWedgeLists[ g_aucConvertToBit[iWidth] ][ uiTabIdx ]);
    468469      } break;
     470#endif
    469471    case( DMM3_IDX ):
    470472      {
     
    27822784  {
    27832785    UInt dimType =  getDimType( pcTempCU->getLumaIntraDir( uiTempPartIdx ) );
     2786#if SEC_DMM2_E0146
     2787    if( DMM1_IDX == dimType || DMM3_IDX == dimType )
     2788#else
    27842789    if( DMM1_IDX == dimType || DMM2_IDX == dimType || DMM3_IDX == dimType )
     2790#endif
    27852791    {
    27862792      // get offset between current and reference block
     
    28072813  {
    28082814    UInt dimType = getDimType( pcTempCU->getLumaIntraDir( uiTempPartIdx ) );
     2815#if SEC_DMM2_E0146
     2816    if( DMM1_IDX == dimType || DMM3_IDX == dimType )
     2817#else
    28092818    if( DMM1_IDX == dimType || DMM2_IDX == dimType || DMM3_IDX == dimType )
     2819#endif
    28102820    {
    28112821      // get offset between current and reference block
     
    28702880    iDC += piRefBlkY[k];
    28712881  }
     2882
     2883#if SCU_HS_DMM4_REMOVE_DIV_E0242
     2884  Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2;
     2885  iDC = iDC >> (cuMaxLog2Size - pcCU->getDepth(0))*2;
     2886#else
    28722887  iDC /= (uiWidth*uiHeight);
     2888#endif
    28732889  piRefBlkY = cTempYuv.getLumaAddr();
    28742890
     
    33143330#endif
    33153331#if H_3D_DIM_SDC
    3316 Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride )
     3332Void TComPrediction::analyzeSegmentsSDC( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride
     3333#if KWU_SDC_SIMPLE_DC_E0117
     3334                                         ,UInt uiIntraMode
     3335                                         ,Bool orgDC
     3336#endif
     3337                                        )
    33173338{
    33183339  Int iSumDepth[2];
     
    33213342  memset(iSumPix, 0, sizeof(Int)*2);
    33223343 
     3344#if KWU_SDC_SIMPLE_DC_E0117
     3345  if (orgDC == false)
     3346  {
     3347    if ( getDimType(uiIntraMode) == DMM1_IDX )
     3348    {
     3349      UChar ucSegmentLT = pMask[0];
     3350      UChar ucSegmentRT = pMask[uiSize-1];
     3351      UChar ucSegmentLB = pMask[uiMaskStride * (uiSize-1)];
     3352      UChar ucSegmentRB = pMask[uiMaskStride * (uiSize-1) + (uiSize-1)];
     3353
     3354      rpSegMeans[ucSegmentLT] = pOrig[0];
     3355      rpSegMeans[ucSegmentRT] = pOrig[uiSize-1];
     3356      rpSegMeans[ucSegmentLB] = pOrig[uiStride * (uiSize-1) ];
     3357      rpSegMeans[ucSegmentRB] = pOrig[uiStride * (uiSize-1) + (uiSize-1) ];
     3358    }
     3359    else if (uiIntraMode == PLANAR_IDX)
     3360    {
     3361      Pel* pLeftTop = pOrig;
     3362      Pel* pRightTop = pOrig + (uiSize-1);
     3363      Pel* pLeftBottom = (pOrig+ (uiStride*(uiSize-1)));
     3364      Pel* pRightBottom = (pOrig+ (uiStride*(uiSize-1)) + (uiSize-1));
     3365
     3366      rpSegMeans[0] = (*pLeftTop + *pRightTop + *pLeftBottom + *pRightBottom + 2)>>2;
     3367    }
     3368    return;
     3369  }
     3370#endif
     3371
    33233372  Int subSamplePix;
    33243373  if ( uiSize == 64 || uiSize == 32 )
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPrediction.h

    r598 r601  
    191191  Void predIntraLumaDepth         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiIntraMode, Pel* piPred, UInt uiStride, Int iWidth, Int iHeight, Bool bFastEnc = false );
    192192#if H_3D_DIM_SDC
    193   Void analyzeSegmentsSDC         ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride );
     193  Void analyzeSegmentsSDC         ( Pel* pOrig, UInt uiStride, UInt uiSize, Pel* rpSegMeans, UInt uiNumSegments, Bool* pMask, UInt uiMaskStride
     194#if KWU_SDC_SIMPLE_DC_E0117
     195                                    ,UInt uiIntraMode
     196                                    ,Bool orgDC=false
     197#endif
     198    );
    194199#endif
    195200#endif
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComRdCost.cpp

    r598 r601  
    483483
    484484}
     485
     486#if SCU_HS_FAST_DEPTH_INTRA_E0238
     487
     488UInt TComRdCost::calcVAR (Pel* pi0, Int stride, Int width, Int height, Int cuDepth)
     489{
     490  Int temp = 0;
     491
     492  for (Int y = 0; y < height; y++)
     493  {
     494    for (Int x = 0; x < width; x++)
     495    {
     496      temp += pi0[ y * stride + x ];
     497    }
     498  }
     499
     500  Int cuMaxLog2Size = g_aucConvertToBit[g_uiMaxCUWidth]+2;
     501 
     502  if ( width == 4 )
     503  {
     504    cuDepth = cuMaxLog2Size - 2;
     505  }
     506
     507  temp = temp >> (cuMaxLog2Size-cuDepth) * 2;
     508
     509  UInt sum = 0;
     510  for (Int y = 0; y < height; y++)
     511  {
     512    for (Int x = 0; x <  width; x++)
     513    {
     514      sum += (pi0[ y * stride + x ] - temp ) * (pi0[ y * stride + x ] - temp );
     515    }
     516  }
     517  return (sum >> (cuMaxLog2Size-cuDepth)*2);
     518
     519}
     520#endif
     521
    485522
    486523#if WEIGHTED_CHROMA_DISTORTION
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComRdCost.h

    r598 r601  
    235235  UInt    calcHAD(Int bitDepth, Pel* pi0, Int iStride0, Pel* pi1, Int iStride1, Int iWidth, Int iHeight );
    236236 
     237#if SCU_HS_FAST_DEPTH_INTRA_E0238
     238  UInt    calcVAR(Pel* pi0, Int stride, Int width, Int height, Int cuDepth);
     239#endif 
    237240  // for motion cost
    238241#if !FIX203
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComRom.cpp

    r531 r601  
    347347{ //2x2   4x4   8x8 16x16 32x32 64x64
    348348     0,    7,   10,   11,   11,   13 };
     349#if LGE_PKU_DMM3_OVERLAP_E0159
     350const UChar g_dmm3IntraTabIdxBits[6] =
     351{ //2x2   4x4   8x8 16x16 32x32 64x64
     352     0,    4,    7,    8,    8,    0 };
     353#else
    349354const UChar g_dmm3IntraTabIdxBits[6] =
    350355{ //2x2   4x4   8x8 16x16 32x32 64x64
    351356     0,    6,    9,    9,    9,    0 };
     357#endif
    352358
    353359extern std::vector< std::vector<TComWedgelet> >   g_dmmWedgeLists;
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComWedgelet.h

    r531 r601  
    5050enum DIM_IDX
    5151{
     52#if SEC_DMM2_E0146
     53  DMM1_IDX = 0,
     54  DMM3_IDX = 1,
     55  DMM4_IDX = 2,
     56  RBC_IDX  = 3
     57#else
    5258  DMM1_IDX = 0,
    5359  DMM2_IDX = 3,
     
    5561  DMM4_IDX = 2,
    5662  RBC_IDX  = 4
     63#endif
    5764};
     65#if SEC_DMM2_E0146
     66#define DMM_NUM_TYPE   3
     67#else
    5868#define DMM_NUM_TYPE   4
     69#endif
    5970#define RBC_NUM_TYPE   1
    6071#define DIM_NUM_TYPE   (DMM_NUM_TYPE+RBC_NUM_TYPE)
     
    7586#define DMM_NO_WEDGEINDEX       MAX_UINT
    7687#define DMM_NUM_WEDGE_REFINES   8
     88#if !SEC_DMM2_E0146
    7789#define DMM2_DELTAEND_MAX       4
     90#endif
    7891#define DMM3_SIMPLIFY_TR        1
    7992
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TypeDef.h

    r600 r601  
    214214#if H_3D_DIM
    215215#define H_3D_DIM_DMM                      1   // Depth Modeling Modes
     216#if H_3D_DIM
     217#define SEC_DMM2_E0146                    1   // Removal of DMM2 from DMMs
     218#define ZJU_DEPTH_INTRA_MODE_E0204        1   // Simplified Binarization for depth_intra_mode
     219#endif
    216220#define H_3D_DIM_RBC                      1   // Region Boundary Chain mode
    217221#define H_3D_DIM_SDC                      1   // Simplified Depth Coding method
     
    220224                                              // HHI_DEPTH_INTRA_SEARCH_RAU_C0160
    221225                                              // LG_ZEROINTRADEPTHRESI_A0087
     226#define KWU_SDC_SIMPLE_DC_E0117           1   // Simplified DC calculation for SDC
     227#define SCU_HS_DMM4_REMOVE_DIV_E0242      1   // DMM4 Division Removal
     228#define SCU_HS_FAST_DEPTH_INTRA_E0238     1   // Fast DMM and RBC Mode Selection
     229#if H_3D_DIM_SDC
     230#define LGE_SDC_REMOVE_DC_E0158           1   // Removal of DC mode from SDC
     231#endif
     232#if H_3D_DIM_DMM
     233#define LGE_PKU_DMM3_OVERLAP_E0159        1   // Removal of overlap between DMM3 and DMM1
     234#endif
    222235#endif
    223236
Note: See TracChangeset for help on using the changeset viewer.