Ignore:
Timestamp:
14 Aug 2013, 10:39:58 (12 years ago)
Author:
lg
Message:
  • integration of JCT3V-E0156
Location:
branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon
Files:
9 edited

Legend:

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

    r531 r571  
    124124#define SDC_NUM_RESIDUAL_CTX             1
    125125#endif
     126
     127#if LGE_INTER_SDC_E0156
     128#define NUM_INTER_SDC_FLAG_CTX        1      ///< number of context models for inter SDC flag
     129#define NUM_INTER_SDC_SIGN_FLAG_CTX   1      ///< number of context models for sign of inter SDC residual
     130#define NUM_INTER_SDC_RESIDUAL_CTX    1      ///< number of context models for abs of inter SDC residual
     131#endif
    126132// ====================================================================================================================
    127133// Tables
     
    453459#endif
    454460
     461#if LGE_INTER_SDC_E0156
     462static const UChar
     463INIT_INTER_SDC_FLAG[3][NUM_INTER_SDC_FLAG_CTX] =
     464{
     465  { CNU }, 
     466  { 154 },
     467  { 154 },
     468};
     469
     470static const UChar
     471INIT_INTER_SDC_SIGN_FLAG[3][NUM_INTER_SDC_SIGN_FLAG_CTX] =
     472{
     473  { CNU }, 
     474  { 154 },
     475  { 154 },
     476};
     477
     478static const UChar
     479INIT_INTER_SDC_RESIDUAL[3][NUM_INTER_SDC_RESIDUAL_CTX] =
     480{
     481  { CNU }, 
     482  { 154 },
     483  { 154 },
     484};
     485#endif
    455486//! \}
    456487
  • branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComDataCU.cpp

    r564 r571  
    151151  m_pbICFlag             = NULL;
    152152#endif
     153#if LGE_INTER_SDC_E0156
     154  m_pbInterSDCFlag       = NULL;
     155  for( Int i = 0; i < 4; i++ )
     156  {
     157    m_apSegmentInterDCOffset[i] = NULL;
     158  }
     159  m_pucInterSDCMask       = NULL;
     160#endif
    153161}
    154162
     
    280288#endif
    281289#endif
     290#if LGE_INTER_SDC_E0156
     291    m_pbInterSDCFlag     = (Bool*  )xMalloc(Bool,   uiNumPartition);
     292    for( Int i = 0; i < 4; i++ )
     293      m_apSegmentInterDCOffset[i] = (Int*)xMalloc(Int, uiNumPartition);
     294#endif
    282295  }
    283296  else
     
    286299    m_acCUMvField[1].setNumPartition(uiNumPartition );
    287300  }
    288  
     301#if LGE_INTER_SDC_E0156
     302  m_pucInterSDCMask     = (UChar*  )xMalloc(UChar,    g_uiMaxCUHeight*g_uiMaxCUWidth);
     303#endif
    289304  m_sliceStartCU        = (UInt*  )xMalloc(UInt, uiNumPartition);
    290305  m_sliceSegmentStartCU = (UInt*  )xMalloc(UInt, uiNumPartition);
     
    405420#endif
    406421#endif   
    407   }
    408  
     422#if LGE_INTER_SDC_E0156
     423    if ( m_pbInterSDCFlag     ) { xFree(m_pbInterSDCFlag);      m_pbInterSDCFlag    = NULL; }
     424    for(Int i = 0; i < 4; i++ )
     425    {
     426      if ( m_apSegmentInterDCOffset[i] ) { xFree( m_apSegmentInterDCOffset[i] ); m_apSegmentInterDCOffset[i] = NULL; }
     427    }
     428#endif
     429  }
     430#if LGE_INTER_SDC_E0156
     431  if ( m_pucInterSDCMask     ) { xFree(m_pucInterSDCMask);      m_pucInterSDCMask    = NULL; }
     432#endif
    409433  m_pcCUAboveLeft       = NULL;
    410434  m_pcCUAboveRight      = NULL;
     
    542566#if H_3D_DIM_SDC
    543567    m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui];
     568#endif
     569#if LGE_INTER_SDC_E0156
     570    m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui];
    544571#endif
    545572  }
     
    611638    memset( m_apSegmentDCOffset[1]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[1] ) );
    612639#endif
     640#endif
     641#if LGE_INTER_SDC_E0156
     642    memset( m_pbInterSDCFlag   + firstElement,     0,                    numElements * sizeof( *m_pbInterSDCFlag ) );
     643    for( Int i = 0; i < 4; i++ )
     644    {
     645      memset( m_apSegmentInterDCOffset[i] + firstElement,     0,         numElements * sizeof( *m_apSegmentInterDCOffset[i] ) );
     646    }
    613647#endif
    614648  }
     
    776810#endif
    777811#endif
     812#if LGE_INTER_SDC_E0156
     813      m_pbInterSDCFlag[ui] = false;
     814      for( Int i = 0; i < 4; i++ )
     815      {
     816        m_apSegmentInterDCOffset[i][ui] = 0;
     817      }
     818#endif
    778819    }
    779820  }
     
    887928  memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition   );
    888929#endif
     930#endif
     931#if LGE_INTER_SDC_E0156
     932  memset( m_pbInterSDCFlag,           0, sizeof( Bool ) * m_uiNumPartition );
     933  for( Int i = 0; i < 4; i++ )
     934  {
     935    memset( m_apSegmentInterDCOffset[i], 0, sizeof( Int ) * m_uiNumPartition );
     936  }
    889937#endif
    890938
     
    9561004#endif
    9571005#endif
     1006#if LGE_INTER_SDC_E0156
     1007      m_pbInterSDCFlag      [ui] = pcCU->m_pbInterSDCFlag    [ uiPartOffset + ui ];
     1008      for( Int i = 0; i < 4; i++ )
     1009      {
     1010        m_apSegmentInterDCOffset[i][ui] = pcCU->m_apSegmentInterDCOffset[i][ uiPartOffset + ui ];
     1011      }
     1012#endif
    9581013    }
    9591014  }
     
    11111166#endif
    11121167#endif 
     1168#if LGE_INTER_SDC_E0156
     1169  m_pbInterSDCFlag          = pcCU->getInterSDCFlag()       + uiPart;
     1170  for( Int i = 0; i < 4; i++ )
     1171  {
     1172    m_apSegmentInterDCOffset[i] = pcCU->getInterSDCSegmentDCOffset( i ) + uiPart;
     1173  }
     1174#endif
    11131175  m_puhDepth=pcCU->getDepth()                     + uiPart;
    11141176  m_puhWidth=pcCU->getWidth()                     + uiPart;
     
    12981360#endif
    12991361#endif
     1362#if LGE_INTER_SDC_E0156
     1363  memcpy( m_pbInterSDCFlag  + uiOffset, pcCU->getInterSDCFlag(),      iSizeInBool  );
     1364  for( Int i = 0; i < 4; i++ )
     1365  {
     1366    memcpy( m_apSegmentInterDCOffset[i] + uiOffset, pcCU->getInterSDCSegmentDCOffset( i ), sizeof( Int ) * uiNumPartition);
     1367  }
     1368#endif
    13001369
    13011370  memcpy( m_puhDepth  + uiOffset, pcCU->getDepth(),  iSizeInUchar );
     
    14171486  memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition);
    14181487#endif
     1488#endif
     1489#if LGE_INTER_SDC_E0156
     1490  memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag,      iSizeInBool  );
     1491  for( Int i = 0;i < 4; i++ )
     1492  {
     1493    memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + m_uiAbsIdxInLCU, m_apSegmentInterDCOffset[i], sizeof( Int ) * m_uiNumPartition);
     1494  }
    14191495#endif
    14201496  memcpy( rpcCU->getDepth()  + m_uiAbsIdxInLCU, m_puhDepth,  iSizeInUchar );
     
    15251601#endif
    15261602#endif
     1603#if LGE_INTER_SDC_E0156
     1604  memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag,      iSizeInBool  );
     1605  for( Int i = 0; i < 4; i++ )
     1606  {
     1607    memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + uiPartOffset, m_apSegmentInterDCOffset[i], sizeof( Int ) * uiQNumPart);
     1608  }
     1609#endif
    15271610  memcpy( rpcCU->getDepth()  + uiPartOffset, m_puhDepth,  iSizeInUchar );
    15281611  memcpy( rpcCU->getWidth()  + uiPartOffset, m_puhWidth,  iSizeInUchar );
     
    22382321}
    22392322#endif
     2323
     2324#if LGE_INTER_SDC_E0156
     2325Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     2326{
     2327  setSubPart( bInterSDCFlag, m_pbInterSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
     2328}
     2329
     2330UInt TComDataCU::getCtxInterSDCFlag( UInt uiAbsPartIdx )
     2331{
     2332  return 0;
     2333}
     2334
     2335Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask )
     2336{
     2337  UInt  uiWidth      = pcCU->getWidth ( 0 );
     2338  UInt  uiHeight     = pcCU->getHeight( 0 );
     2339  UInt  uiPartitionSize = pcCU->getPartitionSize( 0 );
     2340  UInt  uiXOffset = 0, uiYOffset = 0;
     2341
     2342  switch( uiPartitionSize )
     2343  {
     2344  case SIZE_2NxN:
     2345    uiXOffset = uiWidth;      uiYOffset = uiHeight >> 1;   break;
     2346  case SIZE_2NxnU:
     2347    uiXOffset = uiWidth;      uiYOffset = uiHeight >> 2;   break;
     2348  case SIZE_2NxnD:
     2349    uiXOffset = uiWidth;      uiYOffset = ( uiHeight >> 1 ) + ( uiHeight >> 2 );   break;
     2350  case SIZE_Nx2N:
     2351    uiXOffset = uiWidth >> 1; uiYOffset = uiHeight; break;
     2352  case SIZE_nLx2N:
     2353    uiXOffset = uiWidth >> 2; uiYOffset = uiHeight; break;
     2354  case SIZE_nRx2N:
     2355    uiXOffset = ( uiWidth >> 1 ) + ( uiWidth >> 2 ); uiYOffset = uiHeight; break;
     2356  case SIZE_NxN:
     2357    uiXOffset = uiWidth >> 1; uiYOffset = uiHeight >> 1;  break;
     2358  default:
     2359    assert( uiPartitionSize == SIZE_2Nx2N );
     2360    uiXOffset = uiWidth;     uiYOffset = uiHeight;    break;
     2361  }
     2362
     2363  UInt uiPelX, uiPelY;
     2364
     2365  memset( pMask, 0, uiWidth*uiHeight );
     2366
     2367  //mask
     2368  if( uiPartitionSize == SIZE_2NxN || uiPartitionSize == SIZE_2NxnD || uiPartitionSize == SIZE_2NxnU )
     2369  {
     2370    for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )
     2371    {
     2372      for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     2373      {
     2374        pMask[uiPelX + uiPelY*uiWidth] = 0;
     2375      }
     2376    }
     2377
     2378    for( ; uiPelY < uiHeight; uiPelY++ )
     2379    {
     2380      for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     2381      {
     2382        pMask[uiPelX + uiPelY*uiWidth] = 1;
     2383      }
     2384    }
     2385  }
     2386  else if( uiPartitionSize == SIZE_Nx2N || uiPartitionSize == SIZE_nLx2N || uiPartitionSize == SIZE_nRx2N )
     2387  {
     2388    for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ )
     2389    {
     2390      for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
     2391      {
     2392        pMask[uiPelX + uiPelY*uiWidth] = 0;
     2393      }
     2394
     2395      for( ; uiPelX < uiWidth; uiPelX++ )
     2396      {
     2397        pMask[uiPelX + uiPelY*uiWidth] = 1;
     2398      }
     2399    }
     2400  }
     2401  else if( uiPartitionSize == SIZE_NxN )
     2402  {
     2403    for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )
     2404    {
     2405      for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
     2406      {
     2407        pMask[uiPelX + uiPelY*uiWidth] = 0;
     2408      }
     2409
     2410      for( ; uiPelX < uiWidth; uiPelX++ )
     2411      {
     2412        pMask[uiPelX + uiPelY*uiWidth] = 1;
     2413      }
     2414    }
     2415
     2416    for( ; uiPelY < uiHeight; uiPelY++ )
     2417    {
     2418      for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
     2419      {
     2420        pMask[uiPelX + uiPelY*uiWidth] = 2;
     2421      }
     2422
     2423      for( ; uiPelX < uiWidth; uiPelX++ )
     2424      {
     2425        pMask[uiPelX + uiPelY*uiWidth] = 3;
     2426      }
     2427    }
     2428  }
     2429
     2430}
     2431#endif
     2432
    22402433UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx )
    22412434{
  • branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComDataCU.h

    r564 r571  
    223223#endif
    224224#endif
     225#if LGE_INTER_SDC_E0156
     226  Bool*         m_pbInterSDCFlag;
     227  Int*          m_apSegmentInterDCOffset[4];
     228  UChar*        m_pucInterSDCMask;
     229#endif
    225230
    226231  // -------------------------------------------------------------------------------------------------------------------
     
    565570  Void          setSDCSegmentDCOffset( Pel pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentDCOffset[uiSeg][uiPartIdx] = pOffset; }
    566571#endif
     572#endif
     573#if LGE_INTER_SDC_E0156
     574  Bool*         getInterSDCFlag     ()                        { return m_pbInterSDCFlag;               }
     575  Bool          getInterSDCFlag     ( UInt uiIdx )            { return m_pbInterSDCFlag[uiIdx];        }
     576  Void          setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     577  UInt          getCtxInterSDCFlag  ( UInt uiAbsPartIdx );
     578  Int*          getInterSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentInterDCOffset[uiSeg]; }
     579  Int           getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; }
     580  Void          setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; }
     581
     582  Void          xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask );
     583
     584  UChar*        getInterSDCMask     ()                        { return m_pucInterSDCMask;              }
    567585#endif
    568586 
  • branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComPattern.h

    r504 r571  
    102102  Bool              m_bICFlag;
    103103#endif
     104#if LGE_INTER_SDC_E0156
     105  Bool              m_bSDCMRSADFlag;
     106#endif
    104107  static const UChar m_aucIntraFilter[5];
    105108 
     
    115118  Bool  getICFlag()               { return m_bICFlag; }
    116119  Void  setICFlag( Bool bICFlag ) { m_bICFlag = bICFlag; }
     120#endif
     121#if LGE_INTER_SDC_E0156
     122  Bool  getSDCMRSADFlag()         { return m_bSDCMRSADFlag; }
     123  Void  setSDCMRSADFlag( Bool bSDCMRSADFlag )    { m_bSDCMRSADFlag = bSDCMRSADFlag; }
    117124#endif
    118125
  • branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComRdCost.cpp

    r537 r571  
    505505  cDtParam.bUseIC       = false;
    506506#endif
     507#if LGE_INTER_SDC_E0156
     508  cDtParam.bUseSDCMRSAD = false;
     509#endif
    507510#if WEIGHTED_CHROMA_DISTORTION
    508511  if (eText == TEXT_CHROMA_U)
     
    608611  }
    609612#endif
     613#if LGE_INTER_SDC_E0156
     614  if( pcDtParam->bUseSDCMRSAD )
     615  {
     616    return xGetSADic( pcDtParam );
     617  }
     618#endif
    610619  Pel* piOrg   = pcDtParam->pOrg;
    611620  Pel* piCur   = pcDtParam->pCur;
     
    638647#if H_3D_IC
    639648  if( pcDtParam->bUseIC )
     649  {
     650    return xGetSAD4ic( pcDtParam );
     651  }
     652#endif
     653#if LGE_INTER_SDC_E0156
     654  if( pcDtParam->bUseSDCMRSAD )
    640655  {
    641656    return xGetSAD4ic( pcDtParam );
     
    675690#if H_3D_IC
    676691  if( pcDtParam->bUseIC )
     692  {
     693    return xGetSAD8ic( pcDtParam );
     694  }
     695#endif
     696#if LGE_INTER_SDC_E0156
     697  if( pcDtParam->bUseSDCMRSAD )
    677698  {
    678699    return xGetSAD8ic( pcDtParam );
     
    716737#if H_3D_IC
    717738  if( pcDtParam->bUseIC )
     739  {
     740    return xGetSAD16ic( pcDtParam );
     741  }
     742#endif
     743#if LGE_INTER_SDC_E0156
     744  if( pcDtParam->bUseSDCMRSAD )
    718745  {
    719746    return xGetSAD16ic( pcDtParam );
     
    770797  }
    771798#endif
     799#if LGE_INTER_SDC_E0156
     800  if( pcDtParam->bUseSDCMRSAD )
     801  {
     802    return xGetSAD12ic( pcDtParam );
     803  }
     804#endif
    772805  Pel* piOrg   = pcDtParam->pOrg;
    773806  Pel* piCur   = pcDtParam->pCur;
     
    808841#if H_3D_IC
    809842  if( pcDtParam->bUseIC )
     843  {
     844    return xGetSAD16Nic( pcDtParam );
     845  }
     846#endif
     847#if LGE_INTER_SDC_E0156
     848  if( pcDtParam->bUseSDCMRSAD )
    810849  {
    811850    return xGetSAD16Nic( pcDtParam );
     
    860899#if H_3D_IC
    861900  if( pcDtParam->bUseIC )
     901  {
     902    return xGetSAD32ic( pcDtParam );
     903  }
     904#endif
     905#if LGE_INTER_SDC_E0156
     906  if( pcDtParam->bUseSDCMRSAD )
    862907  {
    863908    return xGetSAD32ic( pcDtParam );
     
    930975  }
    931976#endif
     977#if LGE_INTER_SDC_E0156
     978  if( pcDtParam->bUseSDCMRSAD )
     979  {
     980    return xGetSAD24ic( pcDtParam );
     981  }
     982#endif
    932983  Pel* piOrg   = pcDtParam->pOrg;
    933984  Pel* piCur   = pcDtParam->pCur;
     
    9851036#if H_3D_IC
    9861037  if( pcDtParam->bUseIC )
     1038  {
     1039    return xGetSAD64ic( pcDtParam );
     1040  }
     1041#endif
     1042#if LGE_INTER_SDC_E0156
     1043  if( pcDtParam->bUseSDCMRSAD )
    9871044  {
    9881045    return xGetSAD64ic( pcDtParam );
     
    10871144  }
    10881145#endif
     1146#if LGE_INTER_SDC_E0156
     1147  if( pcDtParam->bUseSDCMRSAD )
     1148  {
     1149    return xGetSAD48ic( pcDtParam );
     1150  }
     1151#endif
    10891152  Pel* piOrg   = pcDtParam->pOrg;
    10901153  Pel* piCur   = pcDtParam->pCur;
     
    34093472  }
    34103473#endif
     3474#if LGE_INTER_SDC_E0156
     3475  if( pcDtParam->bUseSDCMRSAD )
     3476  {
     3477    return xGetHADsic( pcDtParam );
     3478  }
     3479#endif
    34113480  Pel* piOrg   = pcDtParam->pOrg;
    34123481  Pel* piCur   = pcDtParam->pCur;
  • branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComRdCost.h

    r537 r571  
    9494  Bool  bUseIC;
    9595#endif
     96#if LGE_INTER_SDC_E0156
     97  Bool  bUseSDCMRSAD;
     98#endif
    9699  Int   iRows;
    97100  Int   iCols;
     
    132135    pVirOrg = NULL;
    133136    iStrideVir = 0;
     137#endif
     138#if LGE_INTER_SDC_E0156
     139    bUseSDCMRSAD = false;
    134140#endif
    135141  }
  • branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComSlice.cpp

    r542 r571  
    15401540#if H_3D_NBDV_REF
    15411541    m_depthRefinementFlag  [ i ] = false;
     1542#endif
     1543#if LGE_INTER_SDC_E0156
     1544    m_bInterSDCFlag        [ i ] = false;
    15421545#endif
    15431546  } 
  • branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TComSlice.h

    r542 r571  
    507507  Bool        m_ivMvScalingFlag;
    508508#endif
     509#if LGE_INTER_SDC_E0156
     510  Bool        m_bInterSDCFlag[MAX_NUM_LAYERS   ];
     511#endif
    509512
    510513#endif
     
    716719  Bool    getIvMvScalingFlag   (  )                       { return m_ivMvScalingFlag; }
    717720  Void    setIvMvScalingFlag   ( Bool b )                 { m_ivMvScalingFlag = b;    } 
     721#endif
     722#if LGE_INTER_SDC_E0156
     723  Bool    getInterSDCFlag      ( Int layerIdInVps )           { return m_bInterSDCFlag[layerIdInVps]; }
     724  Void    setInterSDCFlag      ( Int layerIdInVps, Bool bval ){ m_bInterSDCFlag[layerIdInVps] = bval; }
    718725#endif
    719726
  • branches/HTM-DEV-2.0-dev2-LG/source/Lib/TLibCommon/TypeDef.h

    r564 r571  
    100100#define MTK_CLIPPING_ALIGN_IC_E0168       1   // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
    101101#define MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170            1   // Progressive MV Compression, JCT3V-E0170
     102#define LGE_INTER_SDC_E0156               1   // Enable inter SDC for depth coding
    102103
    103104#if H_3D_NBDV
Note: See TracChangeset for help on using the changeset viewer.