Changeset 598 in 3DVCSoftware


Ignore:
Timestamp:
29 Aug 2013, 13:55:40 (11 years ago)
Author:
tech
Message:

Merged dev2: DEV-2.0-LG@595

Location:
branches/HTM-DEV-2.0-dev0
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • branches/HTM-DEV-2.0-dev0/cfg/3D-HEVC/baseCfg_2view+depth.cfg

    r539 r598  
    209209QTL                                : 1
    210210PC                                 : 1
     211InterSDC                           : 1                             # use of inter sdc
    211212
    212213#========== view synthesis optimization (VSO) ==========
  • branches/HTM-DEV-2.0-dev0/cfg/3D-HEVC/baseCfg_3view+depth.cfg

    r539 r598  
    241241QTL                                : 1
    242242PC                                 : 1
     243InterSDC                           : 1                             # use of inter sdc
    243244
    244245#========== view synthesis optimization (VSO) ==========
  • branches/HTM-DEV-2.0-dev0/cfg/3D-HEVC/fullCfg.cfg

    r539 r598  
    245245QTL                                : 1
    246246PC                                 : 1
     247InterSDC                           : 1                             # use of inter sdc
    247248
    248249#========== view synthesis optimization (VSO) ==========
  • branches/HTM-DEV-2.0-dev0/source/App/TAppDecoder/TAppDecTop.cpp

    r542 r598  
    311311        TComPic* picLastCoded = m_ivPicLists.getPic( m_tDecTop[dI]->getLayerId(), pocLastPic );
    312312        assert( picLastCoded != NULL );       
     313#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     314        picLastCoded->compressMotion(1);
     315#else
    313316        picLastCoded->compressMotion();         
     317#endif
    314318      }
    315319    }
  • branches/HTM-DEV-2.0-dev0/source/App/TAppEncoder/TAppEncCfg.cpp

    r542 r598  
    505505#if H_3D_IC
    506506  ("IlluCompEnable",           m_abUseIC, std::vector<Bool>(2, true), "Enable illumination compensation")
     507#endif
     508#if LGE_INTER_SDC_E0156
     509  ("InterSDC",                 m_bDepthInterSDCFlag,        true, "Enable depth inter SDC")
    507510#endif
    508511  // Coding tools
     
    22892292  printf("DLT:%d ", m_useDLT );
    22902293#endif
     2294#if LGE_INTER_SDC_E0156
     2295  printf( "interSDC: %d ", m_bDepthInterSDCFlag ? 1 : 0 );
     2296#endif
    22912297  printf("\n\n"); 
    22922298
  • branches/HTM-DEV-2.0-dev0/source/App/TAppEncoder/TAppEncCfg.h

    r539 r598  
    432432  Bool      m_bUsePC;                                         ///< flag for using Predictive Coding with QTL
    433433#endif
     434#if LGE_INTER_SDC_E0156
     435  Bool m_bDepthInterSDCFlag;                                ///< flag for inter SDC of depth map coding
     436#endif
    434437#endif
    435438  // internal member functions
  • branches/HTM-DEV-2.0-dev0/source/App/TAppEncoder/TAppEncTop.cpp

    r542 r598  
    187187    m_cTEncTop.setUseQTL                       ( isDepth ? m_bUseQTL               : false );
    188188    m_cTEncTop.setUsePC                        ( isDepth ? m_bUsePC                : false );
     189#endif
     190    //====== Depth Inter SDC =========
     191#if LGE_INTER_SDC_E0156
     192    m_cTEncTop.setInterSDCEnable               ( isDepth ? m_bDepthInterSDCFlag    : false );
    189193#endif
    190194#endif // H_3D
     
    12251229    vps.setViewSynthesisPredFlag( layer, !isLayerZero && !isDepth && m_viewSynthesisPredFlag );         
    12261230#endif     
     1231#if LGE_INTER_SDC_E0156
     1232    vps.setInterSDCFlag( layer, !isLayerZero && isDepth && m_bDepthInterSDCFlag );
     1233#endif
    12271234  } 
    12281235#if H_3D_TMVP
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/ContextTables.h

    r531 r598  
    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-dev0/source/Lib/TLibCommon/TComDataCU.cpp

    r597 r598  
    154154  m_pbICFlag             = NULL;
    155155#endif
     156#if LGE_INTER_SDC_E0156
     157  m_pbInterSDCFlag       = NULL;
     158  for( Int i = 0; i < 4; i++ )
     159  {
     160    m_apSegmentInterDCOffset[i] = NULL;
     161  }
     162  m_pucInterSDCMask       = NULL;
     163#endif
    156164}
    157165
     
    286294#endif
    287295#endif
     296#if LGE_INTER_SDC_E0156
     297    m_pbInterSDCFlag     = (Bool*  )xMalloc(Bool,   uiNumPartition);
     298    for( Int i = 0; i < 4; i++ )
     299    {
     300      m_apSegmentInterDCOffset[i] = (Int*)xMalloc(Int, uiNumPartition);
     301    }
     302#endif
    288303  }
    289304  else
     
    292307    m_acCUMvField[1].setNumPartition(uiNumPartition );
    293308  }
    294  
     309#if LGE_INTER_SDC_E0156
     310  m_pucInterSDCMask     = (UChar*  )xMalloc(UChar,    g_uiMaxCUHeight*g_uiMaxCUWidth);
     311#endif
    295312  m_sliceStartCU        = (UInt*  )xMalloc(UInt, uiNumPartition);
    296313  m_sliceSegmentStartCU = (UInt*  )xMalloc(UInt, uiNumPartition);
     
    414431#endif
    415432#endif   
    416   }
    417  
     433#if LGE_INTER_SDC_E0156
     434    if ( m_pbInterSDCFlag     ) { xFree(m_pbInterSDCFlag);      m_pbInterSDCFlag    = NULL; }
     435    for(Int i = 0; i < 4; i++ )
     436    {
     437      if ( m_apSegmentInterDCOffset[i] ) { xFree( m_apSegmentInterDCOffset[i] ); m_apSegmentInterDCOffset[i] = NULL; }
     438  }
     439#endif
     440  }
     441#if LGE_INTER_SDC_E0156
     442  if ( m_pucInterSDCMask     ) { xFree(m_pucInterSDCMask);      m_pucInterSDCMask    = NULL; }
     443#endif
    418444  m_pcCUAboveLeft       = NULL;
    419445  m_pcCUAboveRight      = NULL;
     
    554580#if H_3D_DIM_SDC
    555581    m_pbSDCFlag[ui] = pcFrom->m_pbSDCFlag[ui];
     582#endif
     583#if LGE_INTER_SDC_E0156
     584    m_pbInterSDCFlag[ui] = pcFrom->m_pbInterSDCFlag[ui];
    556585#endif
    557586  }
     
    626655    memset( m_apSegmentDCOffset[1]  + firstElement,     0,                numElements * sizeof( *m_apSegmentDCOffset[1] ) );
    627656#endif
     657#endif
     658#if LGE_INTER_SDC_E0156
     659    memset( m_pbInterSDCFlag   + firstElement,     0,                    numElements * sizeof( *m_pbInterSDCFlag ) );
     660    for( Int i = 0; i < 4; i++ )
     661    {
     662      memset( m_apSegmentInterDCOffset[i] + firstElement,     0,         numElements * sizeof( *m_apSegmentInterDCOffset[i] ) );
     663    }
    628664#endif
    629665  }
     
    794830#endif
    795831#endif
     832#if LGE_INTER_SDC_E0156
     833      m_pbInterSDCFlag[ui] = false;
     834      for( Int i = 0; i < 4; i++ )
     835      {
     836        m_apSegmentInterDCOffset[i][ui] = 0;
     837      }
     838#endif
    796839    }
    797840  }
     
    908951  memset( m_apSegmentDCOffset[1], 0, sizeof(Pel) * m_uiNumPartition   );
    909952#endif
     953#endif
     954#if LGE_INTER_SDC_E0156
     955  memset( m_pbInterSDCFlag,           0, sizeof( Bool ) * m_uiNumPartition );
     956  for( Int i = 0; i < 4; i++ )
     957  {
     958    memset( m_apSegmentInterDCOffset[i], 0, sizeof( Int ) * m_uiNumPartition );
     959  }
    910960#endif
    911961
     
    9831033#endif
    9841034#endif
     1035#if LGE_INTER_SDC_E0156
     1036      m_pbInterSDCFlag      [ui] = pcCU->m_pbInterSDCFlag    [ uiPartOffset + ui ];
     1037      for( Int i = 0; i < 4; i++ )
     1038      {
     1039        m_apSegmentInterDCOffset[i][ui] = pcCU->m_apSegmentInterDCOffset[i][ uiPartOffset + ui ];
     1040      }
     1041#endif
    9851042    }
    9861043  }
     
    11411198#endif
    11421199#endif 
     1200#if LGE_INTER_SDC_E0156
     1201  m_pbInterSDCFlag          = pcCU->getInterSDCFlag()       + uiPart;
     1202  for( Int i = 0; i < 4; i++ )
     1203  {
     1204    m_apSegmentInterDCOffset[i] = pcCU->getInterSDCSegmentDCOffset( i ) + uiPart;
     1205  }
     1206#endif
    11431207  m_puhDepth=pcCU->getDepth()                     + uiPart;
    11441208  m_puhWidth=pcCU->getWidth()                     + uiPart;
     
    13401404#endif
    13411405#endif
     1406#if LGE_INTER_SDC_E0156
     1407  memcpy( m_pbInterSDCFlag  + uiOffset, pcCU->getInterSDCFlag(),      iSizeInBool  );
     1408  for( Int i = 0; i < 4; i++ )
     1409  {
     1410    memcpy( m_apSegmentInterDCOffset[i] + uiOffset, pcCU->getInterSDCSegmentDCOffset( i ), sizeof( Int ) * uiNumPartition);
     1411  }
     1412#endif
    13421413
    13431414  memcpy( m_puhDepth  + uiOffset, pcCU->getDepth(),  iSizeInUchar );
     
    14651536  memcpy( rpcCU->getSDCSegmentDCOffset(1) + m_uiAbsIdxInLCU, m_apSegmentDCOffset[1], sizeof( Pel ) * m_uiNumPartition);
    14661537#endif
     1538#endif
     1539#if LGE_INTER_SDC_E0156
     1540  memcpy( rpcCU->getInterSDCFlag() + m_uiAbsIdxInLCU, m_pbInterSDCFlag,      iSizeInBool  );
     1541  for( Int i = 0;i < 4; i++ )
     1542  {
     1543    memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + m_uiAbsIdxInLCU, m_apSegmentInterDCOffset[i], sizeof( Int ) * m_uiNumPartition);
     1544  }
    14671545#endif
    14681546  memcpy( rpcCU->getDepth()  + m_uiAbsIdxInLCU, m_puhDepth,  iSizeInUchar );
     
    15761654#endif
    15771655#endif
     1656#if LGE_INTER_SDC_E0156
     1657  memcpy( rpcCU->getInterSDCFlag() + uiPartOffset, m_pbInterSDCFlag,      iSizeInBool  );
     1658  for( Int i = 0; i < 4; i++ )
     1659  {
     1660    memcpy( rpcCU->getInterSDCSegmentDCOffset( i ) + uiPartOffset, m_apSegmentInterDCOffset[i], sizeof( Int ) * uiQNumPart);
     1661  }
     1662#endif
    15781663  memcpy( rpcCU->getDepth()  + uiPartOffset, m_puhDepth,  iSizeInUchar );
    15791664  memcpy( rpcCU->getWidth()  + uiPartOffset, m_puhWidth,  iSizeInUchar );
     
    22892374}
    22902375#endif
     2376
     2377#if LGE_INTER_SDC_E0156
     2378Void TComDataCU::setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     2379{
     2380  setSubPart( bInterSDCFlag, m_pbInterSDCFlag, uiAbsPartIdx, uiDepth, uiPartIdx );
     2381}
     2382
     2383UInt TComDataCU::getCtxInterSDCFlag( UInt uiAbsPartIdx )
     2384{
     2385  return 0;
     2386}
     2387
     2388Void TComDataCU::xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask )
     2389{
     2390  UInt  uiWidth      = pcCU->getWidth ( 0 );
     2391  UInt  uiHeight     = pcCU->getHeight( 0 );
     2392  UInt  uiPartitionSize = pcCU->getPartitionSize( 0 );
     2393  UInt  uiXOffset = 0, uiYOffset = 0;
     2394
     2395  switch( uiPartitionSize )
     2396  {
     2397  case SIZE_2NxN:
     2398    uiXOffset = uiWidth;      uiYOffset = uiHeight >> 1;   break;
     2399  case SIZE_2NxnU:
     2400    uiXOffset = uiWidth;      uiYOffset = uiHeight >> 2;   break;
     2401  case SIZE_2NxnD:
     2402    uiXOffset = uiWidth;      uiYOffset = ( uiHeight >> 1 ) + ( uiHeight >> 2 );   break;
     2403  case SIZE_Nx2N:
     2404    uiXOffset = uiWidth >> 1; uiYOffset = uiHeight; break;
     2405  case SIZE_nLx2N:
     2406    uiXOffset = uiWidth >> 2; uiYOffset = uiHeight; break;
     2407  case SIZE_nRx2N:
     2408    uiXOffset = ( uiWidth >> 1 ) + ( uiWidth >> 2 ); uiYOffset = uiHeight; break;
     2409  case SIZE_NxN:
     2410    uiXOffset = uiWidth >> 1; uiYOffset = uiHeight >> 1;  break;
     2411  default:
     2412    assert( uiPartitionSize == SIZE_2Nx2N );
     2413    uiXOffset = uiWidth;     uiYOffset = uiHeight;    break;
     2414  }
     2415
     2416  UInt uiPelX, uiPelY;
     2417
     2418  memset( pMask, 0, uiWidth*uiHeight );
     2419
     2420  //mask
     2421  if( uiPartitionSize == SIZE_2NxN || uiPartitionSize == SIZE_2NxnD || uiPartitionSize == SIZE_2NxnU )
     2422  {
     2423    for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )
     2424    {
     2425      for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     2426      {
     2427        pMask[uiPelX + uiPelY*uiWidth] = 0;
     2428      }
     2429    }
     2430
     2431    for( ; uiPelY < uiHeight; uiPelY++ )
     2432    {
     2433      for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     2434      {
     2435        pMask[uiPelX + uiPelY*uiWidth] = 1;
     2436      }
     2437    }
     2438  }
     2439  else if( uiPartitionSize == SIZE_Nx2N || uiPartitionSize == SIZE_nLx2N || uiPartitionSize == SIZE_nRx2N )
     2440  {
     2441    for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ )
     2442    {
     2443      for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
     2444      {
     2445        pMask[uiPelX + uiPelY*uiWidth] = 0;
     2446      }
     2447
     2448      for( ; uiPelX < uiWidth; uiPelX++ )
     2449      {
     2450        pMask[uiPelX + uiPelY*uiWidth] = 1;
     2451      }
     2452    }
     2453  }
     2454  else if( uiPartitionSize == SIZE_NxN )
     2455  {
     2456    for( uiPelY = 0; uiPelY < uiYOffset; uiPelY++ )
     2457    {
     2458      for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
     2459      {
     2460        pMask[uiPelX + uiPelY*uiWidth] = 0;
     2461      }
     2462
     2463      for( ; uiPelX < uiWidth; uiPelX++ )
     2464      {
     2465        pMask[uiPelX + uiPelY*uiWidth] = 1;
     2466      }
     2467    }
     2468
     2469    for( ; uiPelY < uiHeight; uiPelY++ )
     2470    {
     2471      for( uiPelX = 0; uiPelX < uiXOffset; uiPelX++ )
     2472      {
     2473        pMask[uiPelX + uiPelY*uiWidth] = 2;
     2474      }
     2475
     2476      for( ; uiPelX < uiWidth; uiPelX++ )
     2477      {
     2478        pMask[uiPelX + uiPelY*uiWidth] = 3;
     2479      }
     2480    }
     2481  }
     2482
     2483}
     2484#endif
     2485
    22912486UInt TComDataCU::getCtxInterDir( UInt uiAbsPartIdx )
    22922487{
     
    34813676      abCandIsInter[iCount] = true;     
    34823677      puhInterDirNeighbours[iCount] = pcTextureCU->getInterDir( uiPartIdxCenter );
     3678#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     3679      pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
     3680      if (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0)
     3681#else
    34833682      if( ( puhInterDirNeighbours[iCount] & 1 ) == 1 )
    3484       {
     3683#endif
     3684      {
     3685#if !MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
    34853686        pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_0, pcMvFieldNeighbours[iCount<<1] );
     3687#endif
    34863688        TComMv cMvPred = pcMvFieldNeighbours[iCount<<1].getMv();
    34873689
     
    35003702      if ( getSlice()->isInterB() )
    35013703      {
     3704#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     3705        pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     3706        if (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0)
     3707#else
    35023708        if( ( puhInterDirNeighbours[iCount] & 2 ) == 2 )
     3709#endif
    35033710        {
     3711#if !MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
    35043712          pcTextureCU->getMvField( pcTextureCU, uiPartIdxCenter, REF_PIC_LIST_1, pcMvFieldNeighbours[(iCount<<1)+1] );
     3713#endif
    35053714          TComMv cMvPred = pcMvFieldNeighbours[(iCount<<1)+1].getMv();
    35063715#if H_3D_IC
     
    35133722        }
    35143723      }
     3724#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     3725      puhInterDirNeighbours[iCount] = (pcMvFieldNeighbours[iCount<<1].getRefIdx()>=0)?1:0;
     3726      puhInterDirNeighbours[iCount] += (pcMvFieldNeighbours[(iCount<<1)+1].getRefIdx()>=0)?2:0;
     3727#endif
    35153728#if H_3D_NBDV
    35163729      pcMvFieldNeighbours[iCount<<1    ].getMv().setIDVFlag (false);
     
    48665079                                        + ( iPartWidth/m_pcPic->getMinCUWidth()  )/2];
    48675080}
    4868 
     5081#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     5082Void TComDataCU::compressMV(int scale)
     5083#else
    48695084Void TComDataCU::compressMV()
    4870 {
     5085#endif
     5086{
     5087#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     5088  Int scaleFactor = (4 / scale ) * AMVP_DECIMATION_FACTOR / m_unitSize;
     5089#else
    48715090  Int scaleFactor = 4 * AMVP_DECIMATION_FACTOR / m_unitSize;
     5091#endif
    48725092  if (scaleFactor > 0)
    48735093  {
     
    58276047}
    58286048#endif
     6049#if  MTK_FAST_TEXTURE_ENCODING_E0173
     6050Void
     6051TComDataCU::getIVNStatus       ( UInt uiPartIdx,  DisInfo* pDInfo, Bool& bIVFMerge, Int& iIVFMaxD)
     6052{
     6053  TComSlice*    pcSlice         = getSlice (); 
     6054  Int iViewIndex = pDInfo->m_aVIdxCan;
     6055  //--- get base CU/PU and check prediction mode ---
     6056  TComPic*    pcBasePic   = pcSlice->getIvPic( false, iViewIndex );
     6057  TComPicYuv* pcBaseRec   = pcBasePic->getPicYuvRec   ();
     6058
     6059  UInt          uiPartAddr;
     6060  Int           iWidth;
     6061  Int           iHeight;
     6062  getPartIndexAndSize( uiPartIdx, uiPartAddr, iWidth, iHeight );
     6063
     6064  Int  iCurrPosX, iCurrPosY;
     6065  pcBaseRec->getTopLeftSamplePos( getAddr(), getZorderIdxInCU() + uiPartAddr, iCurrPosX, iCurrPosY );
     6066
     6067  iCurrPosX  += ( ( iWidth  - 1 ) >> 1 );
     6068  iCurrPosY  += ( ( iHeight - 1 ) >> 1 );
     6069
     6070  Bool depthRefineFlag = false;
     6071#if H_3D_NBDV_REF
     6072  depthRefineFlag = m_pcSlice->getVPS()->getDepthRefinementFlag( m_pcSlice->getLayerIdInVps() );
     6073#endif // H_3D_NBDV_REF
     6074
     6075  TComMv      cDv = depthRefineFlag ? pDInfo->m_acDoNBDV : pDInfo->m_acNBDV;
     6076
     6077  Int         iBasePosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     6078  Int         iBasePosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 ));
     6079  Int         iBaseLPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX - (iWidth >> 1) + ( (cDv.getHor() + 2 ) >> 2 ) );
     6080  Int         iBaseLPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 ));
     6081  Int         iBaseRPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + (iWidth >> 1) + 1 + ( (cDv.getHor() + 2 ) >> 2 ) );
     6082  Int         iBaseRPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + ( (cDv.getVer() + 2 ) >> 2 ));
     6083  Int         iBaseUPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     6084  Int         iBaseUPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY - (iHeight >> 1) + ( (cDv.getVer() + 2 ) >> 2 ));
     6085  Int         iBaseDPosX   = Clip3( 0, pcBaseRec->getWidth () - 1, iCurrPosX + ( (cDv.getHor() + 2 ) >> 2 ) );
     6086  Int         iBaseDPosY   = Clip3( 0, pcBaseRec->getHeight() - 1, iCurrPosY + (iHeight >> 1) + 1 + ( (cDv.getVer() + 2 ) >> 2 ));
     6087
     6088  Int         iBaseCUAddr;
     6089  Int         iBaseAbsPartIdx;
     6090  Int         iBaseLCUAddr;
     6091  Int         iBaseLAbsPartIdx;
     6092  Int         iBaseRCUAddr;
     6093  Int         iBaseRAbsPartIdx;
     6094  Int         iBaseUCUAddr;
     6095  Int         iBaseUAbsPartIdx;
     6096  Int         iBaseDCUAddr;
     6097  Int         iBaseDAbsPartIdx;
     6098  pcBaseRec->getCUAddrAndPartIdx( iBasePosX , iBasePosY , iBaseCUAddr, iBaseAbsPartIdx );
     6099  pcBaseRec->getCUAddrAndPartIdx( iBaseLPosX , iBaseLPosY , iBaseLCUAddr, iBaseLAbsPartIdx );
     6100  pcBaseRec->getCUAddrAndPartIdx( iBaseRPosX , iBaseRPosY , iBaseRCUAddr, iBaseRAbsPartIdx );
     6101  pcBaseRec->getCUAddrAndPartIdx( iBaseUPosX , iBaseUPosY , iBaseUCUAddr, iBaseUAbsPartIdx );
     6102  pcBaseRec->getCUAddrAndPartIdx( iBaseDPosX , iBaseDPosY , iBaseDCUAddr, iBaseDAbsPartIdx );
     6103  TComDataCU* pcBaseCU    = pcBasePic->getCU( iBaseCUAddr );
     6104  TComDataCU* pcBaseLCU    = pcBasePic->getCU( iBaseLCUAddr );
     6105  TComDataCU* pcBaseRCU    = pcBasePic->getCU( iBaseRCUAddr );
     6106  TComDataCU* pcBaseUCU    = pcBasePic->getCU( iBaseUCUAddr );
     6107  TComDataCU* pcBaseDCU    = pcBasePic->getCU( iBaseDCUAddr );
     6108  bIVFMerge = pcBaseLCU->getMergeFlag( iBaseLAbsPartIdx ) && pcBaseCU->getMergeFlag( iBaseAbsPartIdx ) && pcBaseRCU->getMergeFlag( iBaseRAbsPartIdx ) && pcBaseUCU->getMergeFlag( iBaseUAbsPartIdx ) && pcBaseDCU->getMergeFlag( iBaseDAbsPartIdx );
     6109  Int aiDepthL[5]; //depth level
     6110  aiDepthL[0] = pcBaseCU->getDepth(iBaseAbsPartIdx);
     6111  aiDepthL[1] = pcBaseLCU->getDepth(iBaseLAbsPartIdx);
     6112  aiDepthL[2] = pcBaseRCU->getDepth(iBaseRAbsPartIdx);
     6113  aiDepthL[3] = pcBaseUCU->getDepth(iBaseUAbsPartIdx);
     6114  aiDepthL[4] = pcBaseDCU->getDepth(iBaseDAbsPartIdx);
     6115  for (Int i = 0; i < 5; i++)
     6116  {
     6117    if (iIVFMaxD < aiDepthL[i])
     6118      iIVFMaxD = aiDepthL[i];
     6119  }
     6120}
     6121#endif
    58296122#if H_3D_IV_MERGE
    58306123Bool
     
    60276320#endif
    60286321
     6322#if H_3D_FIX
    60296323#if H_3D_IC
    60306324Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     
    60806374  return false;
    60816375}
     6376#endif
    60826377#if H_3D_DIM_DMM
    60836378Void TComDataCU::setDmmWedgeTabIdxSubParts( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth )
     
    67187013}
    67197014#endif
     7015#else
     7016#if H_3D_IC
     7017Void TComDataCU::setICFlagSubParts( Bool bICFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth )
     7018{
     7019  memset( m_pbICFlag + uiAbsPartIdx, bICFlag, (m_pcPic->getNumPartInCU() >> ( 2 * uiDepth ))*sizeof(Bool) );
     7020}
     7021
     7022Bool TComDataCU::isICFlagRequired( UInt uiAbsPartIdx )
     7023{
     7024  UInt uiPartAddr;
     7025  UInt iNumbPart;
     7026
     7027  if( !( getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) )
     7028  {
     7029    return false;
     7030  }
     7031
     7032  if( getSlice()->getIcSkipParseFlag() )
     7033  {
     7034    if( getMergeFlag( uiAbsPartIdx ) && getMergeIndex( uiAbsPartIdx ) == 0 )
     7035    {
     7036      return false;
     7037    }
     7038  }
     7039
     7040  if( getMergeFlag( uiAbsPartIdx ) )
     7041  {
     7042    return true;
     7043  }
     7044
     7045
     7046  Int iWidth, iHeight;
     7047
     7048  iNumbPart = ( getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ? 1 : ( getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 ) );
     7049
     7050  for(UInt i = 0; i < iNumbPart; i++)
     7051  {
     7052    getPartIndexAndSize( i, uiPartAddr, iWidth, iHeight, uiAbsPartIdx, true );
     7053    uiPartAddr += uiAbsPartIdx;
     7054
     7055    for(UInt uiRefIdx = 0; uiRefIdx < 2; uiRefIdx++)
     7056    {
     7057      RefPicList eRefList = uiRefIdx ? REF_PIC_LIST_1 : REF_PIC_LIST_0;
     7058      Int iBestRefIdx = getCUMvField(eRefList)->getRefIdx(uiPartAddr);
     7059
     7060      if( ( getInterDir( uiPartAddr ) & ( uiRefIdx+1 ) ) && iBestRefIdx >= 0 && getSlice()->getViewIndex() != getSlice()->getRefPic( eRefList, iBestRefIdx )->getViewIndex() )
     7061      {
     7062        return true;
     7063      }
     7064    }
     7065  }
     7066
     7067  return false;
     7068}
     7069#if H_3D_DIM_DMM
     7070Void TComDataCU::setDmmWedgeTabIdxSubParts( UInt tabIdx, UInt dmmType, UInt uiAbsPartIdx, UInt uiDepth )
     7071{
     7072  UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);
     7073  for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmmWedgeTabIdx[dmmType][uiAbsPartIdx+ui] = tabIdx; }
     7074}
     7075Void  TComDataCU::setDmm2DeltaEndSubParts( Int iDelta, UInt uiAbsPartIdx, UInt uiDepth )
     7076{
     7077  UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);
     7078  for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm2DeltaEnd[uiAbsPartIdx+ui] = iDelta; }
     7079}
     7080Void  TComDataCU::setDmm3IntraTabIdxSubParts( UInt uiTIdx, UInt uiAbsPartIdx, UInt uiDepth )
     7081{
     7082  UInt uiCurrPartNumb = m_pcPic->getNumPartInCU() >> (uiDepth << 1);
     7083  for( UInt ui = 0; ui < uiCurrPartNumb; ui++ ) { m_dmm3IntraTabIdx[uiAbsPartIdx+ui] = uiTIdx; }
     7084}
     7085#endif
     7086#if H_3D_DIM_RBC
     7087Void TComDataCU::reconPartition( UInt uiAbsPartIdx, UInt uiDepth, Bool bLeft, UChar ucStartPos, UChar ucNumEdge, UChar* pucEdgeCode, Bool* pbRegion )
     7088{
     7089  Int iWidth;
     7090  Int iHeight;
     7091  if( uiDepth == 0 )
     7092  {
     7093    iWidth = 64;
     7094    iHeight = 64;
     7095  }
     7096  else if( uiDepth == 1 )
     7097  {
     7098    iWidth = 32;
     7099    iHeight = 32;
     7100  }
     7101  else if( uiDepth == 2 )
     7102  {
     7103    iWidth = 16;
     7104    iHeight = 16;
     7105  }
     7106  else if( uiDepth == 3 )
     7107  {
     7108    iWidth = 8;
     7109    iHeight = 8;
     7110  }
     7111  else // uiDepth == 4
     7112  {
     7113    iWidth = 4;
     7114    iHeight = 4;
     7115  }
     7116
     7117  Int iPtr = 0;
     7118  Int iX, iY;
     7119  Int iDir = -1;
     7120  Int iDiffX = 0, iDiffY = 0;
     7121
     7122  // 1. Edge Code -> Vert & Horz Edges
     7123  Bool*  pbEdge = (Bool*) xMalloc( Bool, 4 * iWidth * iHeight );
     7124
     7125  for( UInt ui = 0; ui < 4 * iWidth * iHeight; ui++ )
     7126    pbEdge  [ ui ] = false;
     7127
     7128  // Direction : left(0), right(1), top(2), bottom(3), left-top(4), right-top(5), left-bottom(6), right-bottom(7)
     7129  // Code      : 0deg(0), 45deg(1), -45deg(2), 90deg(3), -90deg(4), 135deg(5), -135deg(6)
     7130  const UChar tableDir[8][7] = { { 0, 6, 4, 3, 2, 7, 5 },
     7131  { 1, 5, 7, 2, 3, 4, 6 },
     7132  { 2, 4, 5, 0, 1, 6, 7 },
     7133  { 3, 7, 6, 1, 0, 5, 4 },
     7134  { 4, 0, 2, 6, 5, 3, 1 },
     7135  { 5, 2, 1, 4, 7, 0, 3 },
     7136  { 6, 3, 0, 7, 4, 1, 2 },
     7137  { 7, 1, 3, 5, 6, 2, 0 }};
     7138
     7139  UChar ucCode = pucEdgeCode[iPtr++];
     7140
     7141  if( !bLeft )
     7142  {
     7143    iX = ucStartPos;
     7144    iY = 0;
     7145
     7146    switch(ucCode)
     7147    {
     7148    case 0: // bottom
     7149      iDir = 3;
     7150      if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7151      break;
     7152    case 2: // left-bottom
     7153      iDir = 6;
     7154      if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7155      break;
     7156    case 1: // right-bottom
     7157      iDir = 7;
     7158      if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7159      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7160      break;
     7161    case 4: // left
     7162      iDir = 0;
     7163      assert(false);
     7164      break;
     7165    case 3: // right
     7166      iDir = 1;
     7167      if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7168      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7169      break;
     7170    }
     7171  }
     7172  else
     7173  {
     7174    iX = 0;
     7175    iY = ucStartPos;
     7176
     7177    switch(ucCode)
     7178    {
     7179    case 0: // right
     7180      iDir = 1;
     7181      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7182      break;
     7183    case 1: // right-top
     7184      iDir = 5;
     7185      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7186      if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7187      break;
     7188    case 2: // right-bottom
     7189      iDir = 7;
     7190      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7191      break;
     7192    case 3: // top
     7193      iDir = 2;
     7194      if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7195      if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7196      break;
     7197    case 4: // bottom
     7198      iDir = 3;
     7199      assert(false);
     7200      break;
     7201    }
     7202  }
     7203
     7204  switch( iDir )
     7205  {
     7206  case 0: // left
     7207    iDiffX = -1;
     7208    iDiffY = 0;
     7209    break;
     7210  case 1: // right
     7211    iDiffX = +1;
     7212    iDiffY = 0;
     7213    break;
     7214  case 2: // top
     7215    iDiffX = 0;
     7216    iDiffY = -1;
     7217    break;
     7218  case 3: // bottom
     7219    iDiffX = 0;
     7220    iDiffY = +1;
     7221    break;
     7222  case 4: // left-top
     7223    iDiffX = -1;
     7224    iDiffY = -1;
     7225    break;
     7226  case 5: // right-top
     7227    iDiffX = +1;
     7228    iDiffY = -1;
     7229    break;
     7230  case 6: // left-bottom
     7231    iDiffX = -1;
     7232    iDiffY = +1;
     7233    break;
     7234  case 7: // right-bottom
     7235    iDiffX = +1;
     7236    iDiffY = +1;
     7237    break;
     7238  }
     7239
     7240  iX += iDiffX;
     7241  iY += iDiffY;
     7242
     7243  while( iPtr < ucNumEdge )
     7244  {
     7245    ucCode = pucEdgeCode[iPtr++];
     7246
     7247    Int iNewDir = tableDir[iDir][ucCode];
     7248
     7249    switch( iNewDir )
     7250    {
     7251    case 0: // left
     7252      iDiffX = -1;
     7253      iDiffY = 0;
     7254      break;
     7255    case 1: // right
     7256      iDiffX = +1;
     7257      iDiffY = 0;
     7258      break;
     7259    case 2: // top
     7260      iDiffX = 0;
     7261      iDiffY = -1;
     7262      break;
     7263    case 3: // bottom
     7264      iDiffX = 0;
     7265      iDiffY = +1;
     7266      break;
     7267    case 4: // left-top
     7268      iDiffX = -1;
     7269      iDiffY = -1;
     7270      break;
     7271    case 5: // right-top
     7272      iDiffX = +1;
     7273      iDiffY = -1;
     7274      break;
     7275    case 6: // left-bottom
     7276      iDiffX = -1;
     7277      iDiffY = +1;
     7278      break;
     7279    case 7: // right-bottom
     7280      iDiffX = +1;
     7281      iDiffY = +1;
     7282      break;
     7283    }
     7284
     7285    switch( iDir )
     7286    {
     7287    case 0: // left
     7288      switch( ucCode )
     7289      {
     7290      case 0:
     7291      case 2:
     7292        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7293        break;
     7294      case 1:
     7295      case 3:
     7296        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7297        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7298        break;
     7299      case 4:
     7300      case 6:
     7301        // no
     7302        break;
     7303      case 5:
     7304        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7305        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7306        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7307        break;
     7308      }
     7309      break;
     7310    case 1: // right
     7311      switch( ucCode )
     7312      {
     7313      case 0:
     7314      case 2:
     7315        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7316        break;
     7317      case 1:
     7318      case 3:
     7319        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7320        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7321        break;
     7322      case 4:
     7323      case 6:
     7324        // no
     7325        break;
     7326      case 5:
     7327        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7328        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7329        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7330        break;
     7331      }
     7332      break;
     7333    case 2: // top
     7334      switch( ucCode )
     7335      {
     7336      case 0:
     7337      case 2:
     7338        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7339        break;
     7340      case 1:
     7341      case 3:
     7342        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7343        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7344        break;
     7345      case 4:
     7346      case 6:
     7347        // no
     7348        break;
     7349      case 5:
     7350        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7351        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7352        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7353        break;
     7354      }
     7355      break;
     7356    case 3: // bottom
     7357      switch( ucCode )
     7358      {
     7359      case 0:
     7360      case 2:
     7361        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7362        break;
     7363      case 1:
     7364      case 3:
     7365        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7366        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7367        break;
     7368      case 4:
     7369      case 6:
     7370        // no
     7371        break;
     7372      case 5:
     7373        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7374        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7375        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7376        break;
     7377      }
     7378      break;
     7379    case 4: // left-top
     7380      switch( ucCode )
     7381      {
     7382      case 0:
     7383      case 1:
     7384        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7385        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7386        break;
     7387      case 2:
     7388      case 4:
     7389        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7390        break;
     7391      case 3:
     7392      case 5:
     7393        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7394        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7395        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7396        break;
     7397      case 6:
     7398        // no
     7399        break;
     7400      }
     7401      break;
     7402    case 5: // right-top
     7403      switch( ucCode )
     7404      {
     7405      case 0:
     7406      case 1:
     7407        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7408        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7409        break;
     7410      case 2:
     7411      case 4:
     7412        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7413        break;
     7414      case 3:
     7415      case 5:
     7416        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7417        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7418        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7419        break;
     7420      case 6:
     7421        // no
     7422        break;
     7423      }
     7424      break;
     7425    case 6: // left-bottom
     7426      switch( ucCode )
     7427      {
     7428      case 0:
     7429      case 1:
     7430        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7431        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7432        break;
     7433      case 2:
     7434      case 4:
     7435        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7436        break;
     7437      case 3:
     7438      case 5:
     7439        if(iY > 0) pbEdge[ 2 * iX + (2 * (iY - 1) + 1) * 2 * iWidth ] = true;
     7440        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7441        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7442        break;
     7443      case 6:
     7444        // no
     7445        break;
     7446      }
     7447      break;
     7448    case 7: // right-bottom
     7449      switch( ucCode )
     7450      {
     7451      case 0:
     7452      case 1:
     7453        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7454        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7455        break;
     7456      case 2:
     7457      case 4:
     7458        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7459        break;
     7460      case 3:
     7461      case 5:
     7462        if(iX > 0) pbEdge[ 2 * (iX - 1) + 1 + iY * 4 * iWidth ] = true;
     7463        if(iX < iWidth - 1) pbEdge[ 2 * (iX + 0) + 1 + iY * 4 * iWidth ] = true;
     7464        if(iY < iHeight - 1) pbEdge[ 2 * iX + (2 * (iY + 0) + 1) * 2 * iWidth ] = true;
     7465        break;
     7466      case 6:
     7467        // no
     7468        break;
     7469      }
     7470      break;
     7471    }
     7472
     7473    assert( iX >= 0 && iX <= iWidth );
     7474    assert( iY >= 0 && iY <= iHeight );
     7475
     7476    iX += iDiffX;
     7477    iY += iDiffY;
     7478    iDir = iNewDir;
     7479  }
     7480
     7481  // finalize edge chain
     7482  if( iX == iWidth-1 )
     7483  {
     7484    if( iY == 0 )
     7485    {
     7486      if( iDir == 1 )
     7487      {
     7488        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
     7489      }
     7490      else if( iDir == 5 )
     7491      {
     7492        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
     7493      }
     7494      else
     7495      {
     7496        assert(false);
     7497      }
     7498    }
     7499    else if( iY == iHeight-1 )
     7500    {
     7501      if( iDir == 3 )
     7502      {
     7503        pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
     7504      }
     7505      else if( iDir == 7 )
     7506      {
     7507        pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
     7508      }
     7509      else
     7510      {
     7511        assert(false);
     7512      }
     7513    }
     7514    else
     7515    {
     7516      if( iDir == 1 )
     7517      {
     7518        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
     7519      }
     7520      else if( iDir == 3 )
     7521      {
     7522        pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
     7523        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
     7524      }
     7525      else if( iDir == 5 )
     7526      {
     7527        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
     7528      }
     7529      else if( iDir == 7 )
     7530      {
     7531        pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
     7532        pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
     7533      }
     7534      else
     7535      {
     7536        assert(false);
     7537      }
     7538    }
     7539  }
     7540  else if( iX == 0 )
     7541  {
     7542    if( iY == 0 )
     7543    {
     7544      if( iDir == 2 )
     7545      {
     7546        pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
     7547      }
     7548      else if( iDir == 4 )
     7549      {
     7550        pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
     7551      }
     7552      else
     7553      {
     7554        assert(false);
     7555      }
     7556    }
     7557    else if( iY == iHeight-1 )
     7558    {
     7559      if( iDir == 0 )
     7560      {
     7561        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
     7562      }
     7563      else if( iDir == 6 )
     7564      {
     7565        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
     7566      }
     7567      else
     7568      {
     7569        assert(false);
     7570      }
     7571    }
     7572    else
     7573    {
     7574      if( iDir == 0 )
     7575      {
     7576        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
     7577      }
     7578      else if( iDir == 2 )
     7579      {
     7580        pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
     7581        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
     7582      }
     7583      else if( iDir == 4 )
     7584      {
     7585        pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
     7586        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
     7587      }
     7588      else if( iDir == 6 )
     7589      {
     7590        pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
     7591      }
     7592      else
     7593      {
     7594        assert(false);
     7595      }
     7596    }
     7597  }
     7598  else if( iY == 0 )
     7599  {
     7600    if( iDir == 1 )
     7601    {
     7602      pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
     7603      pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
     7604    }
     7605    else if( iDir == 2 )
     7606    {
     7607      pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
     7608    }
     7609    else if( iDir == 4 )
     7610    {
     7611      pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
     7612    }
     7613    else if( iDir == 5 )
     7614    {
     7615      pbEdge[ 2 * iX + (2 * iY + 1) * 2 * iWidth ] = true;
     7616      pbEdge[ 2 * iX + 1 + 2 * iY * 2 * iWidth ] = true;
     7617    }
     7618    else
     7619    {
     7620      assert(false);
     7621    }
     7622  }
     7623  else if( iY == iHeight-1 )
     7624  {
     7625    if( iDir == 0 )
     7626    {
     7627      pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
     7628      pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
     7629    }
     7630    else if( iDir == 3 )
     7631    {
     7632      pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
     7633    }
     7634    else if( iDir == 6 )
     7635    {
     7636      pbEdge[ 2 * iX + (2 * iY - 1) * 2 * iWidth ] = true;
     7637      pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
     7638    }
     7639    else if( iDir == 7 )
     7640    {
     7641      pbEdge[ 2 * iX - 1 + 2 * iY * 2 * iWidth ] = true;
     7642    }
     7643    else
     7644    {
     7645      assert(false);
     7646    }
     7647  }
     7648  else
     7649  {
     7650    printf("reconPartiton: wrong termination\n");
     7651    assert(false);
     7652  }
     7653
     7654  // Reconstruct Region from Chain Code
     7655  Bool* pbVisit  = (Bool*) xMalloc( Bool, iWidth * iHeight );
     7656  Int*  piStack  = (Int* ) xMalloc( Int,  iWidth * iHeight );
     7657
     7658  for( UInt ui = 0; ui < iWidth * iHeight; ui++ )
     7659  {
     7660    pbRegion[ ui ] = true; // fill it as region 1 (we'll discover region 0 next)
     7661    pbVisit [ ui ] = false;
     7662  }
     7663
     7664  iPtr = 0;
     7665  piStack[iPtr++] = (0 << 8) | (0);
     7666  pbRegion[ 0 ] = false;
     7667
     7668  while(iPtr > 0)
     7669  {
     7670    Int iTmp = piStack[--iPtr];
     7671    Int iX1, iY1;
     7672    iX1 = iTmp & 0xff;
     7673    iY1 = (iTmp >> 8) & 0xff;
     7674
     7675    pbVisit[ iX1 + iY1 * iWidth ] = true;
     7676
     7677    assert( iX1 >= 0 && iX1 < iWidth );
     7678    assert( iY1 >= 0 && iY1 < iHeight );
     7679
     7680    if( iX1 > 0 && !pbEdge[ 2 * iX1 - 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 - 1 + iY1 * iWidth ] )
     7681    {
     7682      piStack[iPtr++] = (iY1 << 8) | (iX1 - 1);
     7683      pbRegion[ iX1 - 1 + iY1 * iWidth ] = false;
     7684    }
     7685    if( iX1 < iWidth - 1 && !pbEdge[ 2 * iX1 + 1 + 4 * iY1 * iWidth ] && !pbVisit[ iX1 + 1 + iY1 * iWidth ] )
     7686    {
     7687      piStack[iPtr++] = (iY1 << 8) | (iX1 + 1);
     7688      pbRegion[ iX1 + 1 + iY1 * iWidth ] = false;
     7689    }
     7690    if( iY1 > 0 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 - 1) * iWidth ] && !pbVisit[ iX1 + (iY1 - 1) * iWidth ] )
     7691    {
     7692      piStack[iPtr++] = ((iY1 - 1) << 8) | iX1;
     7693      pbRegion[ iX1 + (iY1 - 1) * iWidth ] = false;
     7694    }
     7695    if( iY1 < iHeight - 1 && !pbEdge[ 2 * iX1 + 2 * (2 * iY1 + 1) * iWidth ] && !pbVisit[ iX1 + (iY1 + 1) * iWidth ] )
     7696    {
     7697      piStack[iPtr++] = ((iY1 + 1) << 8) | iX1;
     7698      pbRegion[ iX1 + (iY1 + 1) * iWidth ] = false;
     7699    }
     7700  }
     7701
     7702  xFree( pbEdge );
     7703  xFree( pbVisit );
     7704  xFree( piStack );
     7705}
     7706#endif
     7707#endif
    67207708#endif
    67217709
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComDataCU.h

    r597 r598  
    226226#endif
    227227#endif
     228#if LGE_INTER_SDC_E0156
     229  Bool*         m_pbInterSDCFlag;
     230  Int*          m_apSegmentInterDCOffset[4];
     231  UChar*        m_pucInterSDCMask;
     232#endif
    228233
    229234  // -------------------------------------------------------------------------------------------------------------------
     
    508513#endif //H_3D_NBDV_REF
    509514#endif
     515#if  MTK_FAST_TEXTURE_ENCODING_E0173
     516  Void          getIVNStatus       ( UInt uiPartIdx,  DisInfo* pDInfo, Bool& bIVFMerge,  Int& iIVFMaxD);
     517#endif
    510518#if H_3D_IV_MERGE
    511519  Bool          getInterViewMergeCands          ( UInt uiPartIdx, Int* paiPdmRefIdx, TComMv* pacPdmMv, DisInfo* pDInfo, Int* availableMcDc );   
     
    586594#endif
    587595#endif
     596#if LGE_INTER_SDC_E0156
     597  Bool*         getInterSDCFlag     ()                        { return m_pbInterSDCFlag;               }
     598  Bool          getInterSDCFlag     ( UInt uiIdx )            { return m_pbInterSDCFlag[uiIdx];        }
     599  Void          setInterSDCFlagSubParts ( Bool bInterSDCFlag, UInt uiAbsPartIdx, UInt uiPartIdx, UInt uiDepth );
     600  UInt          getCtxInterSDCFlag  ( UInt uiAbsPartIdx );
     601  Int*          getInterSDCSegmentDCOffset( UInt uiSeg ) { return m_apSegmentInterDCOffset[uiSeg]; }
     602  Int           getInterSDCSegmentDCOffset( UInt uiSeg, UInt uiPartIdx ) { return m_apSegmentInterDCOffset[uiSeg][uiPartIdx]; }
     603  Void          setInterSDCSegmentDCOffset( Int pOffset, UInt uiSeg, UInt uiPartIdx) { m_apSegmentInterDCOffset[uiSeg][uiPartIdx] = pOffset; }
     604
     605  Void          xSetInterSDCCUMask( TComDataCU *pcCU, UChar *pMask );
     606
     607  UChar*        getInterSDCMask     ()                        { return m_pucInterSDCMask;              }
     608#endif
    588609 
    589610  // -------------------------------------------------------------------------------------------------------------------
     
    611632  Void          getMvPredAbove        ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldB.getMv(); }
    612633  Void          getMvPredAboveRight   ( TComMv&     rcMvPred )   { rcMvPred = m_cMvFieldC.getMv(); }
    613  
     634#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     635  Void          compressMV            (int scale);
     636#else           
    614637  Void          compressMV            ();
    615  
     638#endif 
    616639  // -------------------------------------------------------------------------------------------------------------------
    617640  // utility functions for neighbouring information
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPattern.h

    r504 r598  
    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-dev0/source/Lib/TLibCommon/TComPic.cpp

    r597 r598  
    146146  deleteSEIs(m_SEIs);
    147147}
    148 
     148#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     149Void TComPic::compressMotion(int scale)
     150#else
    149151Void TComPic::compressMotion()
     152#endif
    150153{
    151154  TComPicSym* pPicSym = getPicSym();
     
    153156  {
    154157    TComDataCU* pcCU = pPicSym->getCU(uiCUAddr);
     158#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     159    pcCU->compressMV(scale);
     160#else
    155161    pcCU->compressMV();
     162#endif
    156163  }
    157164}
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPic.h

    r597 r598  
    3636*/
    3737
     38
    3839#ifndef __TCOMPIC__
    3940#define __TCOMPIC__
     
    185186  Void          setNumReorderPics(Int i, UInt tlayer) { m_numReorderPics[tlayer] = i;    }
    186187  Int           getNumReorderPics(UInt tlayer)        { return m_numReorderPics[tlayer]; }
    187 
     188#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     189  Void          compressMotion(int scale);
     190#else   
    188191  Void          compressMotion();
     192#endif
    189193  UInt          getCurrSliceIdx()            { return m_uiCurrSliceIdx;                }
    190194  Void          setCurrSliceIdx(UInt i)      { m_uiCurrSliceIdx = i;                   }
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPrediction.cpp

    r597 r598  
    3939#include "TComPrediction.h"
    4040
     41#if SHARP_ILLUCOMP_REFINE_E0046
     42#define IC_REG_COST_SHIFT 7
     43#define IC_CONST_SHIFT 5
     44#define IC_SHIFT_DIFF 12
     45#endif
     46
    4147//! \ingroup TLibCommon
    4248//! \{
     
    137143  }
    138144#if H_3D_IC
     145#if SHARP_ILLUCOMP_REFINE_E0046
     146  m_uiaShift[0] = 0;
    139147  for( Int i = 1; i < 64; i++ )
    140148  {
     149    m_uiaShift[i] = ( (1 << 15) + i/2 ) / i;
     150  }
     151#else
     152  for( Int i = 1; i < 64; i++ )
     153  {
    141154    m_uiaShift[i-1] = ( (1 << 15) + i/2 ) / i;
    142155  }
     156#endif
    143157#endif
    144158}
     
    685699#endif
    686700      , bICFlag );
     701#if SHARP_ILLUCOMP_REFINE_E0046
     702    bICFlag = bICFlag && (iWidth > 8);
     703#endif
    687704    xPredInterChromaBlk( pcCU, pcCU->getSlice()->getRefPic( eRefPicList, iRefIdx )->getPicYuvRec(), uiPartAddr, &cMv, iWidth, iHeight, rpcYuvPred, bi
    688705#if H_3D_ARP
     
    970987  if ( yFrac == 0 )
    971988  {
     989#if MTK_CLIPPING_ALIGN_IC_E0168
     990    m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac,       !bi || bICFlag
     991#else
    972992    m_if.filterHorLuma( ref, refStride, dst, dstStride, width, height, xFrac,       !bi
     993#endif
    973994#if H_3D_ARP
    974995    , filterType
     
    978999  else if ( xFrac == 0 )
    9791000  {
     1001#if MTK_CLIPPING_ALIGN_IC_E0168
     1002    m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi || bICFlag
     1003#else
    9801004    m_if.filterVerLuma( ref, refStride, dst, dstStride, width, height, yFrac, true, !bi
     1005#endif
    9811006#if H_3D_ARP
    9821007    , filterType
     
    9971022#endif
    9981023      );
     1024#if MTK_CLIPPING_ALIGN_IC_E0168
     1025    m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height,              yFrac, false, !bi || bICFlag
     1026#else
    9991027    m_if.filterVerLuma(tmp + (halfFilterSize-1)*tmpStride, tmpStride, dst, dstStride, width, height,              yFrac, false, !bi
     1028#endif
    10001029#if H_3D_ARP
    10011030    , filterType
     
    10071036  if( bICFlag )
    10081037  {
     1038#if SHARP_ILLUCOMP_REFINE_E0046
     1039    Int a, b, i, j;
     1040    const Int iShift = IC_CONST_SHIFT;
     1041
     1042    xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_LUMA );
     1043#else
    10091044    Int a, b, iShift, i, j;
    10101045
    10111046    xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_LUMA );
     1047#endif
     1048
    10121049
    10131050    for ( i = 0; i < height; i++ )
     
    10151052      for ( j = 0; j < width; j++ )
    10161053      {
     1054#if !MTK_CLIPPING_ALIGN_IC_E0168
    10171055        if( bi )
    10181056        {
     
    10211059        }
    10221060        else
     1061#endif
    10231062          dst[j] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, ( ( a*dst[j] ) >> iShift ) + b );
    10241063      }
    10251064      dst += dstStride;
    10261065    }
     1066#if MTK_CLIPPING_ALIGN_IC_E0168
     1067    if(bi)
     1068    {
     1069      Pel *dst2      = dstPic->getLumaAddr( partAddr );
     1070      Int shift = IF_INTERNAL_PREC - g_bitDepthY;
     1071      for (i = 0; i < height; i++)
     1072      {
     1073        for (j = 0; j < width; j++)
     1074        {
     1075          Short val = dst2[j] << shift;
     1076          dst2[j] = val - (Short)IF_INTERNAL_OFFS;
     1077        }
     1078        dst2 += dstStride;
     1079      }
     1080    }
     1081#endif
    10271082  }
    10281083#endif
     
    10751130  if ( yFrac == 0 )
    10761131  {
     1132#if MTK_CLIPPING_ALIGN_IC_E0168
     1133    m_if.filterHorChroma(refCb, refStride, dstCb,  dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag
     1134#else
    10771135    m_if.filterHorChroma(refCb, refStride, dstCb,  dstStride, cxWidth, cxHeight, xFrac, !bi
     1136#endif
    10781137#if H_3D_ARP
    10791138    , filterType
    10801139#endif
    10811140    );   
     1141#if MTK_CLIPPING_ALIGN_IC_E0168
     1142    m_if.filterHorChroma(refCr, refStride, dstCr,  dstStride, cxWidth, cxHeight, xFrac, !bi || bICFlag
     1143#else
    10821144    m_if.filterHorChroma(refCr, refStride, dstCr,  dstStride, cxWidth, cxHeight, xFrac, !bi
     1145#endif
    10831146#if H_3D_ARP
    10841147    , filterType
     
    10881151  else if ( xFrac == 0 )
    10891152  {
     1153#if MTK_CLIPPING_ALIGN_IC_E0168
     1154    m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag
     1155#else
    10901156    m_if.filterVerChroma(refCb, refStride, dstCb, dstStride, cxWidth, cxHeight, yFrac, true, !bi
     1157#endif
    10911158#if H_3D_ARP
    10921159    , filterType
    10931160#endif
    10941161    );
     1162#if MTK_CLIPPING_ALIGN_IC_E0168
     1163    m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi || bICFlag
     1164#else
    10951165    m_if.filterVerChroma(refCr, refStride, dstCr, dstStride, cxWidth, cxHeight, yFrac, true, !bi
     1166#endif
    10961167#if H_3D_ARP
    10971168    , filterType
     
    11061177#endif 
    11071178      );
     1179#if MTK_CLIPPING_ALIGN_IC_E0168
     1180    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight  , yFrac, false, !bi || bICFlag
     1181#else
    11081182    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCb, dstStride, cxWidth, cxHeight  , yFrac, false, !bi
     1183#endif
    11091184#if H_3D_ARP
    11101185    , filterType
     
    11171192#endif
    11181193      );
     1194#if MTK_CLIPPING_ALIGN_IC_E0168
     1195    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight  , yFrac, false, !bi || bICFlag
     1196#else
    11191197    m_if.filterVerChroma(extY  + (halfFilterSize-1)*extStride, extStride, dstCr, dstStride, cxWidth, cxHeight  , yFrac, false, !bi
     1198#endif
    11201199#if H_3D_ARP
    11211200    , filterType
     
    11271206  if( bICFlag )
    11281207  {
     1208#if SHARP_ILLUCOMP_REFINE_E0046
     1209    Int a, b, i, j;
     1210    const Int iShift = IC_CONST_SHIFT;
     1211    xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_U ); // Cb
     1212#else
    11291213    Int a, b, iShift, i, j;
    11301214    xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_U ); // Cb
     1215#endif
    11311216    for ( i = 0; i < cxHeight; i++ )
    11321217    {
    11331218      for ( j = 0; j < cxWidth; j++ )
    11341219      {
     1220#if !MTK_CLIPPING_ALIGN_IC_E0168
    11351221        if( bi )
    11361222        {
     
    11391225        }
    11401226        else
     1227#endif
    11411228          dstCb[j] = Clip3(  0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCb[j] ) >> iShift ) + b );
    11421229      }
    11431230      dstCb += dstStride;
    11441231    }
     1232#if SHARP_ILLUCOMP_REFINE_E0046
     1233    xGetLLSICPrediction( cu, mv, refPic, a, b, TEXT_CHROMA_V ); // Cr
     1234#else
    11451235    xGetLLSICPrediction( cu, mv, refPic, a, b, iShift, TEXT_CHROMA_V ); // Cr
     1236#endif
    11461237    for ( i = 0; i < cxHeight; i++ )
    11471238    {
    11481239      for ( j = 0; j < cxWidth; j++ )
    11491240      {
     1241#if !MTK_CLIPPING_ALIGN_IC_E0168
    11501242        if( bi )
    11511243        {
     
    11541246        }
    11551247        else
     1248#endif
    11561249          dstCr[j] = Clip3( 0, ( 1 << g_bitDepthC ) - 1, ( ( a*dstCr[j] ) >> iShift ) + b );
    11571250      }
    11581251      dstCr += dstStride;
    11591252    }
     1253#if MTK_CLIPPING_ALIGN_IC_E0168
     1254    if(bi)
     1255    {
     1256      Pel* dstCb2 = dstPic->getCbAddr( partAddr );
     1257      Pel* dstCr2 = dstPic->getCrAddr( partAddr );
     1258      Int shift = IF_INTERNAL_PREC - g_bitDepthC;
     1259      for (i = 0; i < cxHeight; i++)
     1260      {
     1261        for (j = 0; j < cxWidth; j++)
     1262        {
     1263          Short val = dstCb2[j] << shift;
     1264          dstCb2[j] = val - (Short)IF_INTERNAL_OFFS;
     1265
     1266          val = dstCr2[j] << shift;
     1267          dstCr2[j] = val - (Short)IF_INTERNAL_OFFS;
     1268        }
     1269        dstCb2 += dstStride;
     1270        dstCr2 += dstStride;
     1271      }
     1272    }
     1273#endif
    11601274  }
    11611275#endif
     
    13061420}
    13071421
     1422#if !SHARP_ILLUCOMP_REFINE_E0046
    13081423/** Function for counting leading number of zeros/ones
    13091424 * \param x input value
     
    13471462  return clz;
    13481463}
     1464#endif
    13491465
    13501466/** Function for deriving LM illumination compensation.
    13511467 */
     1468#if SHARP_ILLUCOMP_REFINE_E0046
     1469Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType )
     1470#else
    13521471Void TComPrediction::xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType )
     1472#endif
    13531473{
    13541474  TComPicYuv *pRecPic = pcCU->getPic()->getPicYuvRec();
     
    13781498
    13791499  Int x = 0, y = 0, xx = 0, xy = 0;
     1500#if SHARP_ILLUCOMP_REFINE_E0046
     1501  Int precShift = std::max(0, (( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC) - 12);
     1502#endif
    13801503
    13811504  if( pcCU->getPUAbove( uiTmpPartIdx, pcCU->getZorderIdxInCU() ) && iCUPelY > 0 && iRefY > 0 )
     
    13991522    }
    14001523
     1524#if SHARP_ILLUCOMP_REFINE_E0046
     1525    for( j = 0; j < uiWidth; j+=2 )
     1526#else
    14011527    for( j = 0; j < uiWidth; j++ )
     1528#endif
    14021529    {
    14031530      x += pRef[j];
    14041531      y += pRec[j];
     1532#if SHARP_ILLUCOMP_REFINE_E0046
     1533      xx += (pRef[j] * pRef[j])>>precShift;
     1534      xy += (pRef[j] * pRec[j])>>precShift;
     1535#else
    14051536      xx += pRef[j] * pRef[j];
    14061537      xy += pRef[j] * pRec[j];
    1407     }
     1538#endif
     1539    }
     1540#if SHARP_ILLUCOMP_REFINE_E0046
     1541    iCountShift += g_aucConvertToBit[ uiWidth ] + 1;
     1542#else
    14081543    iCountShift += g_aucConvertToBit[ uiWidth ] + 2;
     1544#endif
    14091545  }
    14101546
     
    14301566    }
    14311567
     1568#if SHARP_ILLUCOMP_REFINE_E0046
     1569    for( i = 0; i < uiHeight; i+=2 )
     1570#else
    14321571    for( i = 0; i < uiHeight; i++ )
     1572#endif
    14331573    {
    14341574      x += pRef[0];
    14351575      y += pRec[0];
     1576#if SHARP_ILLUCOMP_REFINE_E0046
     1577      xx += (pRef[0] * pRef[0])>>precShift;
     1578      xy += (pRef[0] * pRec[0])>>precShift;
     1579
     1580      pRef += iRefStride*2;
     1581      pRec += iRecStride*2;
     1582#else
    14361583      xx += pRef[0] * pRef[0];
    14371584      xy += pRef[0] * pRec[0];
     
    14391586      pRef += iRefStride;
    14401587      pRec += iRecStride;
    1441     }
     1588#endif
     1589    }
     1590#if SHARP_ILLUCOMP_REFINE_E0046
     1591    iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 1 );
     1592#else
    14421593    iCountShift += iCountShift > 0 ? 1 : ( g_aucConvertToBit[ uiWidth ] + 2 );
    1443   }
    1444 
     1594#endif
     1595  }
     1596
     1597#if SHARP_ILLUCOMP_REFINE_E0046
     1598  xy += xx >> IC_REG_COST_SHIFT;
     1599  xx += xx >> IC_REG_COST_SHIFT;
     1600  Int a1 = ( xy << iCountShift ) - ((y * x) >> precShift);
     1601  Int a2 = ( xx << iCountShift ) - ((x * x) >> precShift);
     1602  const Int iShift = IC_CONST_SHIFT;
     1603  {
     1604#else
    14451605  Int iTempShift = ( ( eType == TEXT_LUMA ) ? g_bitDepthY : g_bitDepthC ) + g_aucConvertToBit[ uiWidth ] + 3 - 15;
    14461606
     
    14661626    Int a1 = ( xy << iCountShift ) - y * x;
    14671627    Int a2 = ( xx << iCountShift ) - x * x;             
    1468 
     1628#endif
    14691629    {
    14701630      const Int iShiftA2 = 6;
     1631#if !SHARP_ILLUCOMP_REFINE_E0046
    14711632      const Int iShiftA1 = 15;
     1633#endif
    14721634      const Int iAccuracyShift = 15;
    14731635
     
    14771639      Int a2s = a2;
    14781640
     1641#if SHARP_ILLUCOMP_REFINE_E0046
     1642      a1 = Clip3(0, 2*a2, a1);
     1643      iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2;
     1644      iScaleShiftA1 = iScaleShiftA2 - IC_SHIFT_DIFF;
     1645#else
    14791646      iScaleShiftA1 = GetMSB( abs( a1 ) ) - iShiftA1;
    14801647      iScaleShiftA2 = GetMSB( abs( a2 ) ) - iShiftA2; 
     1648#endif
    14811649
    14821650      if( iScaleShiftA1 < 0 )
     
    14921660      Int iScaleShiftA = iScaleShiftA2 + iAccuracyShift - iShift - iScaleShiftA1;
    14931661
     1662
    14941663      a2s = a2 >> iScaleShiftA2;
    14951664
    14961665      a1s = a1 >> iScaleShiftA1;
    14971666
     1667#if SHARP_ILLUCOMP_REFINE_E0046
     1668      a = a1s * m_uiaShift[ a2s ];
     1669      a = a >> iScaleShiftA;
     1670#else
    14981671      if (a2s >= 1)
    14991672      {
     
    15281701        iShift -= (9-n);
    15291702      }
    1530 
     1703#endif
    15311704      b = (  y - ( ( a * x ) >> iShift ) + ( 1 << ( iCountShift - 1 ) ) ) >> iCountShift;
    15321705    }
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComPrediction.h

    r597 r598  
    7676  Int    m_iLumaRecStride;       ///< stride of #m_pLumaRecBuffer array
    7777#if H_3D_IC
     78#if SHARP_ILLUCOMP_REFINE_E0046
     79  UInt   m_uiaShift[ 64 ];       // Table for multiplication to substitue of division operation
     80#else
    7881  UInt   m_uiaShift[ 63 ];       // Table for multiplication to substitue of division operation
     82#endif
    7983#endif
    8084
     
    136140  Void xGetLLSPrediction ( TComPattern* pcPattern, Int* pSrc0, Int iSrcStride, Pel* pDst0, Int iDstStride, UInt uiWidth, UInt uiHeight, UInt uiExt0 );
    137141#if H_3D_IC
     142#if SHARP_ILLUCOMP_REFINE_E0046
     143  Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, TextType eType );
     144#else
    138145  Void xGetLLSICPrediction( TComDataCU* pcCU, TComMv *pMv, TComPicYuv *pRefPic, Int &a, Int &b, Int &iShift, TextType eType );
     146#endif
    139147#endif
    140148  Void xDCPredFiltering( Int* pSrc, Int iSrcStride, Pel*& rpDst, Int iDstStride, Int iWidth, Int iHeight );
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComRdCost.cpp

    r537 r598  
    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;
     
    11571220#endif
    11581221
    1159 #if H_3D_IC
     1222#if H_3D_IC || LGE_INTER_SDC_E0156
    11601223UInt TComRdCost::xGetSADic( DistParam* pcDtParam )
    11611224{
     
    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;
     
    35063575}
    35073576
    3508 #if H_3D_IC
     3577#if H_3D_IC || LGE_INTER_SDC_E0156
    35093578UInt TComRdCost::xGetHADsic( DistParam* pcDtParam )
    35103579{
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComRdCost.h

    r537 r598  
    9494  Bool  bUseIC;
    9595#endif
     96#if LGE_INTER_SDC_E0156
     97  Bool  bUseSDCMRSAD;
     98#endif
    9699  Int   iRows;
    97100  Int   iCols;
     
    133136    iStrideVir = 0;
    134137#endif
     138#if LGE_INTER_SDC_E0156
     139    bUseSDCMRSAD = false;
     140#endif
    135141  }
    136142};
     
    274280  static UInt xGetSSE64         ( DistParam* pcDtParam );
    275281  static UInt xGetSSE16N        ( DistParam* pcDtParam );
    276 #if H_3D_IC
     282#if H_3D_IC || LGE_INTER_SDC_E0156
    277283  static UInt xGetSADic         ( DistParam* pcDtParam );
    278284  static UInt xGetSAD4ic        ( DistParam* pcDtParam );
     
    302308
    303309#if AMP_SAD
    304 #if H_3D_IC
     310#if H_3D_IC || LGE_INTER_SDC_E0156
    305311  static UInt xGetSAD12ic       ( DistParam* pcDtParam );
    306312  static UInt xGetSAD24ic       ( DistParam* pcDtParam );
     
    313319#endif
    314320
    315 #if H_3D_IC
     321#if H_3D_IC || LGE_INTER_SDC_E0156
    316322  static UInt xGetHADsic          ( DistParam* pcDtParam );
    317323#endif
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComSlice.cpp

    r597 r598  
    15421542#if H_3D_NBDV_REF
    15431543    m_depthRefinementFlag  [ i ] = false;
     1544#endif
     1545#if LGE_INTER_SDC_E0156
     1546    m_bInterSDCFlag        [ i ] = false;
    15441547#endif
    15451548  } 
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibCommon/TComSlice.h

    r542 r598  
    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-dev0/source/Lib/TLibCommon/TypeDef.h

    r597 r598  
    9696                                              // Unifying rounding offset, for IC part, JCT3V-D0135
    9797                                              // Full Pel Interpolation for Depth, HHI_FULL_PEL_DEPTH_MAP_MV_ACC
     98#define H_3D_FIX                          1   // Bug Fix
     99#define SHARP_ILLUCOMP_REFINE_E0046       1
     100#define MTK_FAST_TEXTURE_ENCODING_E0173   1   // Fast merge mode decision and early CU determination for texture component of dependent view, JCT3V-E0173
     101#if H_3D_FIX
     102#if H_3D_IC
     103#define MTK_CLIPPING_ALIGN_IC_E0168       1   // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
     104#endif
     105#else
     106#define MTK_CLIPPING_ALIGN_IC_E0168       1   // To support simplify bi-prediction PU with identical motion checking, JCT3V-E0168
     107#endif
     108#define MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170            1   // Progressive MV Compression, JCT3V-E0170
     109#define LGE_INTER_SDC_E0156               1   // Enable inter SDC for depth coding
     110
    98111#if H_3D_NBDV
    99112#define H_3D_NBDV_REF                     1   // Depth oriented neighboring block disparity derivation
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecCAVLC.cpp

    r541 r598  
    10731073            }
    10741074#endif
     1075#if LGE_INTER_SDC_E0156
     1076            READ_FLAG( uiCode, "depth_inter_SDC_flag" );              pcVPS->setInterSDCFlag( i, uiCode ? true : false );
     1077#endif
    10751078          }
    10761079        }
     
    20332036}
    20342037#endif
     2038#if LGE_INTER_SDC_E0156
     2039Void TDecCavlc::parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2040{
     2041  assert(0);
     2042}
     2043
     2044Void TDecCavlc::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart )
     2045{
     2046  assert(0);
     2047}
     2048#endif
    20352049// ====================================================================================================================
    20362050// Protected member functions
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecCAVLC.h

    r537 r598  
    102102  Void  parseICFlag         ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    103103#endif
     104#if LGE_INTER_SDC_E0156
     105  Void  parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     106  Void  parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
     107#endif
    104108  Void parseSplitFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    105109  Void parsePartSize        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecCu.cpp

    r597 r598  
    437437  m_pcEntropyDecoder->decodeARPW    ( pcCU , uiAbsPartIdx , uiDepth ); 
    438438#endif 
     439#if LGE_INTER_SDC_E0156
     440  m_pcEntropyDecoder->decodeInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
     441#endif
    439442  // Coefficient decoding
    440443  Bool bCodeDQP = getdQPFlag();
     
    501504  {
    502505    case MODE_INTER:
     506#if LGE_INTER_SDC_E0156
     507      if( m_ppcCU[uiDepth]->getInterSDCFlag( 0 ) )
     508      {
     509        xReconInterSDC( m_ppcCU[uiDepth], uiAbsPartIdx, uiDepth );
     510      }
     511      else
     512      {
     513#endif
    503514      xReconInter( m_ppcCU[uiDepth], uiDepth );
     515#if LGE_INTER_SDC_E0156
     516      }
     517#endif
    504518      break;
    505519    case MODE_INTRA:
     
    542556  }
    543557}
     558
     559#if LGE_INTER_SDC_E0156
     560Void TDecCu::xReconInterSDC( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     561{
     562  // inter prediction
     563  m_pcPrediction->motionCompensation( pcCU, m_ppcYuvReco[uiDepth] );
     564
     565  UInt  uiWidth      = pcCU->getWidth ( 0 );
     566  UInt  uiHeight     = pcCU->getHeight( 0 );
     567  UChar* pMask       = pcCU->getInterSDCMask();
     568
     569  memset( pMask, 0, uiWidth*uiHeight );
     570  pcCU->xSetInterSDCCUMask( pcCU, pMask );
     571
     572  Pel  *pResi;
     573  UInt uiPelX, uiPelY;
     574  UInt uiResiStride = m_ppcYuvResi[uiDepth]->getStride();
     575
     576  pResi = m_ppcYuvResi[uiDepth]->getLumaAddr( 0 );
     577  for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ )
     578  {
     579    for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     580    {
     581      UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
     582
     583      pResi[ uiPelX ] = pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 );;
     584    }
     585    pResi += uiResiStride;
     586  }
     587
     588  m_ppcYuvReco[uiDepth]->addClip( m_ppcYuvReco[uiDepth], m_ppcYuvResi[uiDepth], 0, pcCU->getWidth( 0 ) );
     589
     590  // clear UV
     591  UInt  uiStrideC     = m_ppcYuvReco[uiDepth]->getCStride();
     592  Pel   *pRecCb       = m_ppcYuvReco[uiDepth]->getCbAddr();
     593  Pel   *pRecCr       = m_ppcYuvReco[uiDepth]->getCrAddr();
     594
     595  for (Int y = 0; y < uiHeight/2; y++)
     596  {
     597    for (Int x = 0; x < uiWidth/2; x++)
     598    {
     599      pRecCb[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) );
     600      pRecCr[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) );
     601    }
     602
     603    pRecCb += uiStrideC;
     604    pRecCr += uiStrideC;
     605  }
     606}
     607#endif
    544608
    545609Void
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecCu.h

    r531 r598  
    118118  Void xReconIntraSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    119119#endif
     120#if LGE_INTER_SDC_E0156
     121  Void xReconInterSDC           ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     122#endif
    120123};
    121124
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecEntropy.cpp

    r597 r598  
    675675#endif
    676676 
     677#if LGE_INTER_SDC_E0156
     678  if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )
     679  {
     680    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
     681    assert( !pcCU->isIntra( uiAbsPartIdx) );
     682    assert( pcCU->getSlice()->getIsDepth() );
     683
     684    decodeInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth );
     685    return;
     686  }
     687#endif
     688
    677689  if( pcCU->isIntra(uiAbsPartIdx) )
    678690  {
     
    696708}
    697709
     710#if LGE_INTER_SDC_E0156
     711Void TDecEntropy::decodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     712{
     713  pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth);
     714
     715  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
     716  {
     717    return;
     718  }
     719
     720  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) )
     721  {
     722    return;
     723  }
     724
     725  m_pcEntropyDecoderIf->parseInterSDCFlag( pcCU, uiAbsPartIdx, uiDepth );
     726}
     727
     728Void TDecEntropy::decodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     729{
     730  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
     731  {
     732    return;
     733  }
     734
     735  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) )
     736  {
     737    return;
     738  }
     739
     740  UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 );
     741
     742  // decode residual data for each segment
     743  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
     744  {
     745    m_pcEntropyDecoderIf->parseInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth, uiSeg );
     746  }
     747}
     748#endif
     749
    698750//! \}
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecEntropy.h

    r504 r598  
    9191  virtual Void parseICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    9292#endif
     93#if LGE_INTER_SDC_E0156
     94  virtual Void parseInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     95  virtual Void parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart ) = 0;
     96#endif
    9397  virtual Void parsePartSize      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
    9498  virtual Void parsePredMode      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    166170  Void decodeICFlag            ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    167171#endif
    168 
     172#if LGE_INTER_SDC_E0156
     173  Void decodeInterSDCFlag      ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     174  Void decodeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     175#endif
    169176  Void decodeIPCMInfo          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    170177
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecGop.cpp

    r597 r598  
    226226    rpcPic->destroyNonDBFilterInfo();
    227227  }
    228 
     228#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     229  rpcPic->compressMotion(2);
     230#endif
    229231#if !H_3D
    230232  rpcPic->compressMotion();
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecSbac.cpp

    r541 r598  
    100100#endif
    101101#endif
     102#if LGE_INTER_SDC_E0156
     103, m_cInterSDCFlagSCModel             ( 1,             1,  NUM_INTER_SDC_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
     104, m_cInterSDCResidualSCModel         ( 1,             1,  NUM_INTER_SDC_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
     105, m_cInterSDCResidualSignFlagSCModel ( 1,             1,  NUM_INTER_SDC_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     106#endif
    102107{
    103108  assert( m_numContextModels <= MAX_NUM_CTX_MOD );
     
    182187  m_cSDCResidualSCModel.initBuffer        ( sliceType, qp, (UChar*)INIT_SDC_RESIDUAL );
    183188#endif
     189#endif
     190#if LGE_INTER_SDC_E0156
     191  m_cInterSDCFlagSCModel.initBuffer       ( sliceType, qp, (UChar*)INIT_INTER_SDC_FLAG );
     192  m_cInterSDCResidualSCModel.initBuffer   ( sliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL );
     193  m_cInterSDCResidualSignFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
    184194#endif
    185195  m_uiLastDQpNonZero  = 0;
     
    251261  m_cSDCResidualSCModel.initBuffer        ( eSliceType, iQp, (UChar*)INIT_SDC_RESIDUAL );
    252262#endif
     263#endif
     264#if LGE_INTER_SDC_E0156
     265  m_cInterSDCFlagSCModel.initBuffer       ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
     266  m_cInterSDCResidualSCModel.initBuffer   ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
     267  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
    253268#endif
    254269  m_pcTDecBinIf->start();
     
    22372252#endif
    22382253
     2254#if LGE_INTER_SDC_E0156
     2255Void TDecSbac::parseInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     2256{
     2257  UInt uiSymbol = 0;
     2258  UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx );
     2259
     2260  m_pcTDecBinIf->decodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) );
     2261
     2262  if( uiSymbol )
     2263  {
     2264    pcCU->setInterSDCFlagSubParts( true, uiAbsPartIdx, 0, uiDepth );
     2265    pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth );
     2266    pcCU->setCbfSubParts( 1, 1, 1, uiAbsPartIdx, uiDepth );
     2267  }
     2268  else
     2269  {
     2270    pcCU->setInterSDCFlagSubParts( false, uiAbsPartIdx, 0, uiDepth);
     2271  }
     2272}
     2273
     2274Void TDecSbac::parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiSegment )
     2275{
     2276  UInt uiAbsIdx   = 0;
     2277  UInt uiSign     = 0;
     2278  Int  iIdx       = 0;
     2279
     2280  xReadExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) );
     2281
     2282  uiAbsIdx++;
     2283  m_pcTDecBinIf->decodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) );
     2284  iIdx = (Int)( uiSign ? -1 : 1 ) * uiAbsIdx;
     2285
     2286  pcCU->setInterSDCSegmentDCOffset( iIdx, uiSegment, uiAbsPartIdx );
     2287}
     2288#endif
     2289
    22392290//! \}
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibDecoder/TDecSbac.h

    r531 r598  
    112112#endif
    113113#endif
     114#if LGE_INTER_SDC_E0156
     115  Void  parseInterSDCFlag    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
     116  Void  parseInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPart );
     117#endif
    114118private:
    115119  TComInputBitstream* m_pcBitstream;
     
    221225#endif
    222226#endif
     227#if LGE_INTER_SDC_E0156
     228  ContextModel3DBuffer m_cInterSDCFlagSCModel;
     229  ContextModel3DBuffer m_cInterSDCResidualSCModel;
     230  ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel;
     231#endif
    223232};
    224233
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncCavlc.cpp

    r542 r598  
    842842        }       
    843843#endif
     844#if LGE_INTER_SDC_E0156
     845        WRITE_FLAG( pcVPS->getInterSDCFlag( i ) ? 1 : 0, "depth_inter_SDC_flag" );
     846#endif
    844847      }
    845848    } 
     
    17761779  return true;
    17771780}
     1781
     1782#if LGE_INTER_SDC_E0156
     1783Void TEncCavlc::codeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx )
     1784{
     1785  assert(0);
     1786}
     1787
     1788Void TEncCavlc::codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
     1789{
     1790  assert(0);
     1791}
     1792#endif
    17781793//! \}
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncCavlc.h

    r537 r598  
    117117  Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    118118#endif
     119#if LGE_INTER_SDC_E0156
     120  Void codeInterSDCFlag          ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     121  Void codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
     122#endif
    119123
    120124  Void codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode );
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncCfg.h

    r541 r598  
    394394  Bool      m_bUseIC;
    395395#endif
     396#if LGE_INTER_SDC_E0156
     397  bool      m_bInterSDC;
     398#endif
    396399  //====== Depth Intra Modes ======
    397400#if H_3D_DIM
     
    490493  Void       setUseIC                       ( Bool bVal )    { m_bUseIC = bVal; }
    491494  Bool       getUseIC                       ()               { return m_bUseIC; }
     495#endif
     496#if LGE_INTER_SDC_E0156
     497  Void       setInterSDCEnable              ( Bool bVal )    { m_bInterSDC = bVal; }
     498  Bool       getInterSDCEnable              ()               { return m_bInterSDC; }
    492499#endif
    493500  //======== Transform =============
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncCu.cpp

    r597 r598  
    489489  if(!bSliceEnd && !bSliceStart && bInsidePicture )
    490490  {
     491#if  MTK_FAST_TEXTURE_ENCODING_E0173
     492    Bool bIVFMerge = false;
     493    Int  iIVFMaxD = 0;
     494    Bool bFMD = false;
     495#endif
    491496    for (Int iQP=iMinQP; iQP<=iMaxQP; iQP++)
    492497    {
     
    564569        }
    565570      }
     571#if  MTK_FAST_TEXTURE_ENCODING_E0173
     572      if(rpcTempCU->getSlice()->getViewIndex() && !rpcTempCU->getSlice()->getIsDepth())
     573      {
     574        PartSize ePartTemp = rpcTempCU->getPartitionSize(0);
     575        rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );
     576        rpcTempCU->getIVNStatus( 0, &DvInfo,  bIVFMerge, iIVFMaxD);
     577        rpcTempCU->setPartSizeSubParts( ePartTemp, 0, uiDepth );
     578      }
     579#endif
    566580#endif
    567581      // do inter modes, SKIP and 2Nx2N
     
    579593          rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    580594#endif
     595#if  MTK_FAST_TEXTURE_ENCODING_E0173
     596          xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD );  rpcTempCU->initEstData( uiDepth, iQP );//by Competition for inter_2Nx2N
     597#else
    581598          xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );  rpcTempCU->initEstData( uiDepth, iQP );//by Competition for inter_2Nx2N
     599#endif
    582600#if MTK_VSP_FIX_ALIGN_WD_E0172
    583601          rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     
    589607#endif
    590608        xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU, &earlyDetectionSkipMode );//by Merge for inter_2Nx2N
     609#if  MTK_FAST_TEXTURE_ENCODING_E0173
     610        bFMD = bIVFMerge && rpcBestCU->isSkipped(0);
     611#endif
    591612        rpcTempCU->initEstData( uiDepth, iQP );
    592613#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    612633            rpcTempCU->setICFlagSubParts(bICFlag, 0, 0, uiDepth);
    613634#endif
     635#if  MTK_FAST_TEXTURE_ENCODING_E0173
     636            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N, bFMD );  rpcTempCU->initEstData( uiDepth, iQP );
     637#else
    614638            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2Nx2N );  rpcTempCU->initEstData( uiDepth, iQP );
     639#endif
    615640#if MTK_VSP_FIX_ALIGN_WD_E0172
    616641            rpcTempCU->setDvInfoSubParts(DvInfo, 0, uiDepth);
     
    694719                )
    695720              {
     721#if  MTK_FAST_TEXTURE_ENCODING_E0173
     722                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN, bFMD  );
     723#else
    696724                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_NxN   );
     725#endif
    697726                rpcTempCU->initEstData( uiDepth, iQP );
    698727#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    710739            )
    711740          {
     741#if  MTK_FAST_TEXTURE_ENCODING_E0173
     742            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N, bFMD  );
     743#else
    712744            xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_Nx2N  );
     745#endif
    713746            rpcTempCU->initEstData( uiDepth, iQP );
    714747#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    726759            )
    727760          {
     761#if  MTK_FAST_TEXTURE_ENCODING_E0173
     762            xCheckRDCostInter      ( rpcBestCU, rpcTempCU, SIZE_2NxN, bFMD  );
     763#else
    728764            xCheckRDCostInter      ( rpcBestCU, rpcTempCU, SIZE_2NxN  );
     765#endif
    729766            rpcTempCU->initEstData( uiDepth, iQP );
    730767#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    761798                )
    762799              {
     800#if  MTK_FAST_TEXTURE_ENCODING_E0173
     801                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFMD );
     802#else
    763803                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU );
     804#endif
    764805                rpcTempCU->initEstData( uiDepth, iQP );
    765806#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    777818                )
    778819              {
     820#if  MTK_FAST_TEXTURE_ENCODING_E0173
     821                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFMD );
     822#else
    779823                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD );
     824#endif
    780825                rpcTempCU->initEstData( uiDepth, iQP );
    781826#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    797842                )
    798843              {
     844#if  MTK_FAST_TEXTURE_ENCODING_E0173
     845                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, bFMD, true );
     846#else
    799847                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnU, true );
     848#endif
    800849                rpcTempCU->initEstData( uiDepth, iQP );
    801850#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    813862                )
    814863              {
     864#if  MTK_FAST_TEXTURE_ENCODING_E0173
     865                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, bFMD, true );
     866#else
    815867                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_2NxnD, true );
     868#endif
    816869                rpcTempCU->initEstData( uiDepth, iQP );
    817870#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    835888                )
    836889              {
     890#if  MTK_FAST_TEXTURE_ENCODING_E0173
     891                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFMD );
     892#else
    837893                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N );
     894#endif
    838895                rpcTempCU->initEstData( uiDepth, iQP );
    839896#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    851908                )
    852909              {
     910#if  MTK_FAST_TEXTURE_ENCODING_E0173
     911                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFMD );
     912#else
    853913                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N );
     914#endif
    854915                rpcTempCU->initEstData( uiDepth, iQP );
    855916#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    867928                )
    868929              {
     930#if  MTK_FAST_TEXTURE_ENCODING_E0173
     931                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, bFMD, true );
     932#else
    869933                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nLx2N, true );
     934#endif
    870935                rpcTempCU->initEstData( uiDepth, iQP );
    871936#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    883948                )
    884949              {
     950#if  MTK_FAST_TEXTURE_ENCODING_E0173
     951                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, bFMD, true );
     952#else
    885953                xCheckRDCostInter( rpcBestCU, rpcTempCU, SIZE_nRx2N, true );
     954#endif
    886955                rpcTempCU->initEstData( uiDepth, iQP );
    887956#if MTK_VSP_FIX_ALIGN_WD_E0172
     
    930999#endif
    9311000        }
    932 
     1001#if  MTK_FAST_TEXTURE_ENCODING_E0173
     1002        if(!bFMD)
     1003        {
     1004#endif
    9331005        // do normal intra modes
    9341006#if H_3D_DIM_ENC
     
    9861058          }
    9871059        }
     1060#if  MTK_FAST_TEXTURE_ENCODING_E0173
     1061        }
     1062#endif
    9881063        if (isAddLowestQP && (iQP == lowestQP))
    9891064        {
     
    10281103      bSubBranch = true;
    10291104    }
     1105#if  MTK_FAST_TEXTURE_ENCODING_E0173
     1106    if(rpcBestCU->getSlice()->getViewIndex() && !rpcBestCU->getSlice()->getIsDepth() && (uiDepth >=iIVFMaxD) && rpcBestCU->isSkipped(0))
     1107    {
     1108      bSubBranch = false;
     1109    }
     1110#endif
    10301111  }
    10311112  else if(!(bSliceEnd && bInsidePicture))
     
    15071588#if H_3D_ARP
    15081589  m_pcEntropyCoder->encodeARPW( pcCU , uiAbsPartIdx );
     1590#endif
     1591#if LGE_INTER_SDC_E0156
     1592  m_pcEntropyCoder->encodeInterSDCFlag( pcCU, uiAbsPartIdx, false );
    15091593#endif
    15101594
     
    18151899
    18161900          rpcTempCU->setSkipFlagSubParts( rpcTempCU->getQtRootCbf(0) == 0, 0, uhDepth );
     1901#if LGE_INTER_SDC_E0156
     1902          TComDataCU *rpcTempCUPre = rpcTempCU;
     1903#endif
    18171904          Int orgQP = rpcTempCU->getQP( 0 );
    18181905          xCheckDQP( rpcTempCU );
    18191906          xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
     1907#if LGE_INTER_SDC_E0156
     1908          if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() && !uiNoResidual )
     1909          {
     1910            if( rpcTempCU != rpcTempCUPre )
     1911            {
     1912              rpcTempCU->initEstData( uhDepth, orgQP );
     1913              rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth );
     1914            }
     1915            rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     1916            rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
     1917            rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );
     1918#if H_3D_VSO //M2
     1919            if( m_pcRdCost->getUseRenModel() )
     1920            { //Reset
     1921              UInt  uiWidth     = m_ppcOrigYuv[uhDepth]->getWidth    ();
     1922              UInt  uiHeight    = m_ppcOrigYuv[uhDepth]->getHeight   ();
     1923              Pel*  piSrc       = m_ppcOrigYuv[uhDepth]->getLumaAddr ();
     1924              UInt  uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride   ();
     1925              m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
     1926            }
     1927#endif
     1928            m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU,
     1929              m_ppcOrigYuv[uhDepth],
     1930              ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth],
     1931              m_ppcResiYuvTemp[uhDepth],
     1932              m_ppcRecoYuvTemp[uhDepth],
     1933              uhDepth );
     1934
     1935            xCheckDQP( rpcTempCU );
     1936            xCheckBestMode( rpcBestCU, rpcTempCU, uhDepth );
     1937          }
     1938#endif
    18201939          rpcTempCU->initEstData( uhDepth, orgQP );
    18211940
    18221941      if( m_pcEncCfg->getUseFastDecisionForMerge() && !bestIsSkip )
    18231942      {
     1943#if LGE_INTER_SDC_E0156
     1944        if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) )
     1945        {
     1946          bestIsSkip = !rpcBestCU->getSDCFlag( 0 ) && ( rpcBestCU->getQtRootCbf(0) == 0 );
     1947        }
     1948        else
     1949        {
     1950#endif
    18241951        bestIsSkip = rpcBestCU->getQtRootCbf(0) == 0;
     1952#if LGE_INTER_SDC_E0156
     1953        }
     1954#endif
    18251955      }
    18261956    }
     
    18651995
    18661996#if AMP_MRG
     1997#if  MTK_FAST_TEXTURE_ENCODING_E0173
     1998Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bFMD, Bool bUseMRG)
     1999#else
    18672000Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bUseMRG)
     2001#endif
    18682002#else
    18692003Void TEncCu::xCheckRDCostInter( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize )
    18702004#endif
    18712005{
     2006#if  MTK_FAST_TEXTURE_ENCODING_E0173
     2007  if(!(bFMD && (ePartSize == SIZE_2Nx2N)))  //have  motion estimation or merge check
     2008  {
     2009#endif
    18722010  UChar uhDepth = rpcTempCU->getDepth( 0 );
    18732011#if H_3D_ARP
     
    19432081#if AMP_MRG
    19442082  rpcTempCU->setMergeAMP (true);
     2083#if  MTK_FAST_TEXTURE_ENCODING_E0173
     2084  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], bFMD, false, bUseMRG );
     2085#else
    19452086  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth], false, bUseMRG );
     2087#endif
    19462088#else 
    19472089  m_pcPredSearch->predInterSearch ( rpcTempCU, m_ppcOrigYuv[uhDepth], m_ppcPredYuvTemp[uhDepth], m_ppcResiYuvTemp[uhDepth], m_ppcRecoYuvTemp[uhDepth] );
     
    20032145#endif
    20042146  rpcTempCU->getTotalCost()  = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );
    2005 
     2147#if LGE_INTER_SDC_E0156
     2148  TComDataCU *rpcTempCUPre = rpcTempCU;
     2149#endif
    20062150  xCheckDQP( rpcTempCU );
    20072151  xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
     2152#if LGE_INTER_SDC_E0156
     2153  if( rpcTempCU->getSlice()->getVPS()->getInterSDCFlag( rpcTempCU->getSlice()->getLayerIdInVps() ) && rpcTempCU->getSlice()->getIsDepth() )
     2154  {
     2155    if( rpcTempCU != rpcTempCUPre )
     2156    {
     2157      Int orgQP = rpcBestCU->getQP( 0 );
     2158      rpcTempCU->initEstData( uhDepth, orgQP );
     2159      rpcTempCU->copyPartFrom( rpcBestCU, 0, uhDepth );
     2160    }
     2161    rpcTempCU->setSkipFlagSubParts( false, 0, uhDepth );
     2162    rpcTempCU->setTrIdxSubParts( 0, 0, uhDepth );
     2163    rpcTempCU->setCbfSubParts( 1, 1, 1, 0, uhDepth );
     2164#if H_3D_VSO // M3
     2165    if( m_pcRdCost->getUseRenModel() )
     2166    {
     2167      UInt  uiWidth     = m_ppcOrigYuv[uhDepth]->getWidth ( );
     2168      UInt  uiHeight    = m_ppcOrigYuv[uhDepth]->getHeight( );
     2169      Pel*  piSrc       = m_ppcOrigYuv[uhDepth]->getLumaAddr( );
     2170      UInt  uiSrcStride = m_ppcOrigYuv[uhDepth]->getStride();
     2171      m_pcRdCost->setRenModelData( rpcTempCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
     2172    }
     2173#endif
     2174
     2175    m_pcPredSearch->encodeResAndCalcRdInterSDCCU( rpcTempCU,
     2176      m_ppcOrigYuv[uhDepth],
     2177      ( rpcTempCU != rpcTempCUPre ) ? m_ppcPredYuvBest[uhDepth] : m_ppcPredYuvTemp[uhDepth],
     2178      m_ppcResiYuvTemp[uhDepth],
     2179      m_ppcRecoYuvTemp[uhDepth],
     2180      uhDepth );
     2181
     2182  xCheckDQP( rpcTempCU );
     2183  xCheckBestMode(rpcBestCU, rpcTempCU, uhDepth);
     2184  }
     2185#endif
    20082186#if H_3D_ARP
     2187  }
     2188#endif
     2189#if  MTK_FAST_TEXTURE_ENCODING_E0173
    20092190  }
    20102191#endif
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncCu.h

    r537 r598  
    145145
    146146#if AMP_MRG
     147#if  MTK_FAST_TEXTURE_ENCODING_E0173
     148  Void  xCheckRDCostInter   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize,  Bool bFMD, Bool bUseMRG = false  ) ;
     149#else
    147150  Void  xCheckRDCostInter   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize, Bool bUseMRG = false  );
     151#endif
    148152#else
    149153  Void  xCheckRDCostInter   ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize  );
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncEntropy.cpp

    r531 r598  
    662662#endif
    663663
     664#if LGE_INTER_SDC_E0156
     665  if( pcCU->getInterSDCFlag( uiAbsPartIdx ) )
     666  {
     667    assert( !pcCU->isSkipped( uiAbsPartIdx ) );
     668    assert( !pcCU->isIntra( uiAbsPartIdx) );
     669    assert( pcCU->getSlice()->getIsDepth() );
     670
     671    encodeInterSDCResidualData( pcCU, uiAbsPartIdx, false );
     672    return;
     673  }
     674#endif
     675
    664676  if( pcCU->isIntra(uiAbsPartIdx) )
    665677  {
     
    812824}
    813825
     826#if LGE_INTER_SDC_E0156
     827Void TEncEntropy::encodeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     828{
     829  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
     830  {
     831    return;
     832  }
     833
     834  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || pcCU->isSkipped( uiAbsPartIdx ) )
     835  {
     836    return;
     837  }
     838
     839  if( bRD )
     840  {
     841    uiAbsPartIdx = 0;
     842  }
     843
     844  m_pcEntropyCoderIf->codeInterSDCFlag( pcCU, uiAbsPartIdx );
     845}
     846
     847Void TEncEntropy::encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )
     848{
     849  if( !pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
     850  {
     851    return;
     852  }
     853
     854  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( uiAbsPartIdx ) || !pcCU->getInterSDCFlag( uiAbsPartIdx ) )
     855  {
     856    return;
     857  }
     858
     859  if( bRD )
     860  {
     861    uiAbsPartIdx = 0;
     862  }
     863
     864  // number of segments depends on prediction mode for INTRA
     865  UInt uiNumSegments = ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_2Nx2N ) ? 1 : ( pcCU->getPartitionSize( uiAbsPartIdx ) == SIZE_NxN ? 4 : 2 );
     866
     867  // encode residual data for each segment
     868  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
     869  {
     870    m_pcEntropyCoderIf->codeInterSDCResidualData( pcCU, uiAbsPartIdx, uiSeg );
     871  }
     872}
     873#endif
     874
    814875//! \}
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncEntropy.h

    r504 r598  
    9393#if H_3D_IC
    9494  virtual Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     95#endif
     96#if LGE_INTER_SDC_E0156
     97  virtual Void codeInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0;
     98  virtual Void codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment ) = 0;
    9599#endif
    96100  virtual Void codeSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0;
     
    181185  Void encodeICFlag       ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    182186#endif
     187#if LGE_INTER_SDC_E0156
     188  Void encodeInterSDCFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
     189  Void encodeInterSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD );
     190#endif
    183191  Void encodePredMode          ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );
    184192  Void encodePartSize          ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false );
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncGOP.cpp

    r597 r598  
    17801780        pcPic->destroyNonDBFilterInfo();
    17811781      }
    1782 
    17831782#if !H_3D
    17841783      pcPic->compressMotion();
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncSbac.cpp

    r541 r598  
    106106#endif
    107107#endif
     108#if LGE_INTER_SDC_E0156
     109, m_cInterSDCFlagSCModel             ( 1,             1,  NUM_INTER_SDC_FLAG_CTX           , m_contextModels + m_numContextModels, m_numContextModels)
     110, m_cInterSDCResidualSCModel         ( 1,             1,  NUM_INTER_SDC_RESIDUAL_CTX       , m_contextModels + m_numContextModels, m_numContextModels)
     111, m_cInterSDCResidualSignFlagSCModel ( 1,             1,  NUM_INTER_SDC_SIGN_FLAG_CTX      , m_contextModels + m_numContextModels, m_numContextModels)
     112#endif
    108113{
    109114  assert( m_numContextModels <= MAX_NUM_CTX_MOD );
     
    181186#endif
    182187#endif
     188#if LGE_INTER_SDC_E0156
     189  m_cInterSDCFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
     190  m_cInterSDCResidualSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
     191  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
     192#endif
    183193  // new structure
    184194  m_uiLastQp = iQp;
     
    217227#if H_3D_IC
    218228      curCost += m_cCUICFlagSCModel.calcCost          ( curSliceType, qp, (UChar*)INIT_IC_FLAG );
     229#endif
     230#if LGE_INTER_SDC_E0156
     231      curCost += m_cInterSDCFlagSCModel.calcCost      ( curSliceType, qp, (UChar*)INIT_INTER_SDC_FLAG );
     232      curCost += m_cInterSDCResidualSCModel.calcCost  ( curSliceType, qp, (UChar*)INIT_INTER_SDC_RESIDUAL );
     233      curCost += m_cInterSDCResidualSignFlagSCModel.calcCost( curSliceType, qp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
    219234#endif
    220235      curCost += m_cCUPartSizeSCModel.calcCost        ( curSliceType, qp, (UChar*)INIT_PART_SIZE );
     
    330345#endif
    331346#endif
     347#if LGE_INTER_SDC_E0156
     348  m_cInterSDCFlagSCModel.initBuffer         ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_FLAG );
     349  m_cInterSDCResidualSCModel.initBuffer     ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_RESIDUAL );
     350  m_cInterSDCResidualSignFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTER_SDC_SIGN_FLAG );
     351#endif
    332352  m_pcBinIf->start();
    333353}
     
    22092229  this->xCopyContextsFrom(pScr);
    22102230}
     2231
     2232#if LGE_INTER_SDC_E0156
     2233Void TEncSbac::codeInterSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )
     2234{
     2235  UInt uiSymbol = pcCU->getInterSDCFlag( uiAbsPartIdx ) ? 1 : 0;
     2236  UInt uiCtxInterSDCFlag = pcCU->getCtxInterSDCFlag( uiAbsPartIdx );
     2237
     2238  m_pcBinIf->encodeBin( uiSymbol, m_cInterSDCFlagSCModel.get( 0, 0, uiCtxInterSDCFlag ) );
     2239}
     2240
     2241Void TEncSbac::codeInterSDCResidualData ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment )
     2242{
     2243  Pel segmentDCOffset = pcCU->getInterSDCSegmentDCOffset( uiSegment, uiAbsPartIdx );
     2244
     2245  UInt uiSign     = segmentDCOffset < 0 ? 1 : 0;
     2246  UInt uiAbsIdx   = abs( segmentDCOffset );
     2247
     2248  assert( uiAbsIdx > 0 );
     2249  uiAbsIdx--;
     2250  xWriteExGolombLevel( uiAbsIdx, m_cInterSDCResidualSCModel.get( 0, 0, 0 ) );
     2251  m_pcBinIf->encodeBin( uiSign, m_cInterSDCResidualSignFlagSCModel.get( 0, 0, 0 ) );
     2252}
     2253#endif
    22112254//! \}
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncSbac.h

    r531 r598  
    158158  Void codeICFlag        ( TComDataCU* pcCU, UInt uiAbsPartIdx );
    159159#endif
     160#if LGE_INTER_SDC_E0156
     161  Void codeInterSDCFlag  ( TComDataCU* pcCU, UInt uiAbsPartIdx );
     162  Void codeInterSDCResidualData  ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiSegment );
     163#endif
    160164  Void codeSplitFlag     ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth );
    161165  Void codeMVPIdx        ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList );
     
    261265#endif
    262266#endif
     267#if LGE_INTER_SDC_E0156
     268  ContextModel3DBuffer m_cInterSDCFlagSCModel;
     269  ContextModel3DBuffer m_cInterSDCResidualSCModel;
     270  ContextModel3DBuffer m_cInterSDCResidualSignFlagSCModel;
     271#endif
    263272};
    264273
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncSearch.cpp

    r597 r598  
    4141#include "TEncSearch.h"
    4242#include <math.h>
     43#if LGE_INTER_SDC_E0156
     44#include <memory.h>
     45#endif
    4346
    4447//! \ingroup TLibEncoder
     
    319322#if H_3D_IC
    320323  m_cDistParam.bUseIC = pcPatternKey->getICFlag();
     324#endif
     325#if LGE_INTER_SDC_E0156
     326  m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag();
    321327#endif
    322328  //-- jclee for using the SAD function pointer
     
    748754#if H_3D_IC
    749755    m_cDistParam.bUseIC = pcPatternKey->getICFlag();
     756#endif
     757#if LGE_INTER_SDC_E0156
     758    m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag();
    750759#endif
    751760    m_cDistParam.pCur = piRefPos;
     
    35313540  cDistParam.bUseIC = false;
    35323541#endif
     3542#if LGE_INTER_SDC_E0156
     3543  cDistParam.bUseSDCMRSAD = false;
     3544#endif
    35333545  ruiErr = cDistParam.DistFunc( &cDistParam );
    35343546}
     
    36903702 */
    36913703#if AMP_MRG
     3704#if  MTK_FAST_TEXTURE_ENCODING_E0173
     3705Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bFMD, Bool bUseRes, Bool bUseMRG )
     3706#else
    36923707Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes, Bool bUseMRG )
     3708#endif
    36933709#else
    36943710Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& rpcPredYuv, TComYuv*& rpcResiYuv, TComYuv*& rpcRecoYuv, Bool bUseRes )
     
    38013817#if AMP_MRG
    38023818    Bool bTestNormalMC = true;
    3803    
     3819#if  MTK_FAST_TEXTURE_ENCODING_E0173
     3820    if (bFMD||( bUseMRG && pcCU->getWidth( 0 ) > 8 && iNumPart == 2 ))
     3821#else           
    38043822    if ( bUseMRG && pcCU->getWidth( 0 ) > 8 && iNumPart == 2 )
     3823#endif
    38053824    {
    38063825      bTestNormalMC = false;
     
    46894708  pcPatternKey->setICFlag( bICFlag );
    46904709#endif
     4710#if LGE_INTER_SDC_E0156
     4711  if ( pcCU->getSlice()->getIsDepth() && pcCU->getSlice()->getVPS()->getInterSDCFlag( pcCU->getSlice()->getLayerIdInVps() ) )
     4712  {
     4713    pcPatternKey->setSDCMRSADFlag( true );
     4714  }
     4715  else
     4716  {
     4717    pcPatternKey->setSDCMRSADFlag( false );
     4718  }
     4719#endif
    46914720
    46924721  if ( bBi )
     
    48344863#if H_3D_IC
    48354864      m_cDistParam.bUseIC = pcPatternKey->getICFlag();
     4865#endif
     4866#if LGE_INTER_SDC_E0156
     4867      m_cDistParam.bUseSDCMRSAD = pcPatternKey->getSDCMRSADFlag();
    48364868#endif
    48374869      m_cDistParam.bitDepth = g_bitDepthY;
     
    54405472#endif
    54415473}
     5474
     5475#if LGE_INTER_SDC_E0156
     5476Void TEncSearch::encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU, TComYuv* pcOrg, TComYuv* pcPred, TComYuv* pcResi, TComYuv* pcRec, const UInt uiDepth )
     5477{
     5478  if( !pcCU->getSlice()->getIsDepth() || pcCU->isIntra( 0 ) )
     5479  {
     5480    return;
     5481  }
     5482
     5483  pcCU->setInterSDCFlagSubParts( true, 0, 0, uiDepth );
     5484
     5485  UInt  uiWidth      = pcCU->getWidth ( 0 );
     5486  UInt  uiHeight     = pcCU->getHeight( 0 );
     5487  UChar* pMask       = pcCU->getInterSDCMask();
     5488  memset( pMask, 0, uiWidth*uiHeight );
     5489
     5490  pcCU->xSetInterSDCCUMask( pcCU, pMask );
     5491
     5492  UInt uiSegSize[4] = { 0, 0, 0, 0 };
     5493  Pel *pPred, *pOrg;
     5494  UInt uiPredStride = pcPred->getStride();
     5495  UInt uiOrgStride  = pcOrg->getStride();
     5496  UInt uiPelX, uiPelY;
     5497  UInt uiPartitionSize = pcCU->getPartitionSize( 0 );
     5498  UInt uiSegmentNum = ( uiPartitionSize == SIZE_2Nx2N ) ? 1 : ( uiPartitionSize == SIZE_NxN ? 4 : 2 );
     5499
     5500  pPred = pcPred->getLumaAddr( 0 );
     5501  pOrg  = pcOrg->getLumaAddr( 0 );
     5502  Int pResDC[4] = { 0, 0, 0, 0};
     5503
     5504  //calculate dc value for prediction and original signal, and calculate residual and reconstruction
     5505  for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ )
     5506  {
     5507    for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     5508    {
     5509      UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
     5510      pResDC[uiSeg] += (Int)( pOrg [uiPelX] - pPred[uiPelX] );
     5511      uiSegSize[uiSeg]++;
     5512    }
     5513    pOrg  += uiOrgStride;
     5514    pPred += uiPredStride;
     5515  }
     5516
     5517  for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ )
     5518  {
     5519    Int iResiOffset = ( pResDC [uiSeg] > 0 ? ( uiSegSize[uiSeg] >> 1 ) : -1*( uiSegSize[uiSeg] >> 1 ) );
     5520    pResDC [uiSeg]  = ( pResDC [uiSeg] + iResiOffset ) / (Int) uiSegSize[uiSeg];
     5521
     5522    pcCU->setInterSDCSegmentDCOffset( pResDC[uiSeg], uiSeg, 0 );
     5523  }
     5524
     5525  Pel *pRec;
     5526  UInt uiRecStride  = pcRec->getStride();
     5527  pPred = pcPred->getLumaAddr( 0 );
     5528  pRec  = pcRec->getLumaAddr( 0 );
     5529
     5530  for( uiPelY = 0; uiPelY < uiHeight; uiPelY++ )
     5531  {
     5532    for( uiPelX = 0; uiPelX < uiWidth; uiPelX++ )
     5533    {
     5534      UChar uiSeg = pMask[ uiPelX + uiPelY*uiWidth ];
     5535      assert( uiSeg < uiSegmentNum );
     5536
     5537      pRec[ uiPelX ] = Clip3( 0, ( 1 << g_bitDepthY ) - 1, pPred[uiPelX] + pResDC[uiSeg] );
     5538    }
     5539    pPred     += uiPredStride;
     5540    pRec      += uiRecStride;
     5541  }
     5542
     5543  // clear UV
     5544  UInt  uiStrideC     = pcRec->getCStride();
     5545  Pel   *pRecCb       = pcRec->getCbAddr();
     5546  Pel   *pRecCr       = pcRec->getCrAddr();
     5547
     5548  for (Int y=0; y < uiHeight/2; y++)
     5549  {
     5550    for (Int x=0; x < uiWidth/2; x++)
     5551    {
     5552      pRecCb[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) );
     5553      pRecCr[x] = (Pel)( 1 << ( g_bitDepthC - 1 ) );
     5554    }
     5555
     5556    pRecCb += uiStrideC;
     5557    pRecCr += uiStrideC;
     5558  }
     5559
     5560  Dist ruiDist;
     5561  Double rdCost;
     5562#if H_3D_VSO // M13
     5563  if ( m_pcRdCost->getUseVSO() )
     5564  {
     5565    ruiDist = m_pcRdCost->getDistPartVSO( pcCU, 0, pcRec->getLumaAddr(), pcRec->getStride(),  pcOrg->getLumaAddr(), pcOrg->getStride(),  uiWidth,      uiHeight     , false );
     5566  }
     5567  else   
     5568  {
     5569#endif
     5570    {
     5571      ruiDist = m_pcRdCost->getDistPart( g_bitDepthY, pcRec->getLumaAddr( 0 ), uiRecStride, pcOrg->getLumaAddr( 0 ), uiOrgStride, uiWidth, uiHeight );
     5572    }
     5573#if H_3D_VSO
     5574  }
     5575#endif
     5576
     5577  Bool bNonSkip = true;
     5578  for( UInt uiSeg = 0; uiSeg < uiSegmentNum; uiSeg++ )
     5579  {
     5580    bNonSkip &= ( pcCU->getInterSDCSegmentDCOffset( uiSeg, 0 ) != 0 ) ? 1 : 0;
     5581  }
     5582
     5583  if( !bNonSkip )
     5584  {
     5585    pcCU->getTotalBits()       = MAX_INT;
     5586    pcCU->getTotalDistortion() = MAX_INT;
     5587    pcCU->getTotalCost()       = MAX_DOUBLE;
     5588  }
     5589  else
     5590  {
     5591    //----- determine rate and r-d cost -----
     5592    UInt uiBits = 0;
     5593    TComYuv *pDummy = NULL;
     5594    if( m_bUseSBACRD )
     5595    {
     5596      m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[pcCU->getDepth(0)][CI_CURR_BEST] );
     5597    }
     5598
     5599    xAddSymbolBitsInter( pcCU, 0, 0, uiBits, pDummy, NULL, pDummy );
     5600
     5601#if H_3D_VSO //M 14
     5602    if ( m_pcRdCost->getUseLambdaScaleVSO() )   
     5603    {
     5604      rdCost = m_pcRdCost->calcRdCostVSO( uiBits, ruiDist );   
     5605    }
     5606    else
     5607#endif
     5608    {
     5609      rdCost = m_pcRdCost->calcRdCost( uiBits, ruiDist );
     5610    }
     5611
     5612    pcCU->getTotalBits()       = m_pcEntropyCoder->getNumberOfWrittenBits();
     5613    pcCU->getTotalDistortion() = ruiDist;
     5614    pcCU->getTotalCost()       = rdCost;
     5615
     5616    if( m_bUseSBACRD )
     5617    {
     5618      m_pcRDGoOnSbacCoder->store( m_pppcRDSbacCoder[ pcCU->getDepth( 0 ) ][ CI_TEMP_BEST ] );
     5619    }
     5620  }
     5621
     5622#if H_3D_VSO // necessary? // M15
     5623  // set Model
     5624  if( !m_pcRdCost->getUseEstimatedVSD() && m_pcRdCost->getUseRenModel() )
     5625  {
     5626    Pel*  piSrc       = pcRec->getLumaAddr();
     5627    UInt  uiSrcStride = pcRec->getStride();
     5628    m_pcRdCost->setRenModelData( pcCU, 0, piSrc, uiSrcStride, uiWidth, uiHeight );
     5629  }
     5630#endif
     5631}
     5632#endif
    54425633
    54435634#if H_3D_VSO // M25
     
    66056796    m_pcEntropyCoder->encodeARPW( pcCU , 0 );
    66066797#endif
     6798#if LGE_INTER_SDC_E0156
     6799    m_pcEntropyCoder->encodeInterSDCFlag( pcCU, 0, true );
     6800#endif
    66076801    Bool bDummy = false;
    66086802    m_pcEntropyCoder->encodeCoeff   ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy );
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncSearch.h

    r597 r598  
    196196                                  TComYuv*&   rpcResiYuv,
    197197                                  TComYuv*&   rpcRecoYuv,
     198#if MTK_FAST_TEXTURE_ENCODING_E0173
     199                                  Bool        bFMD,
     200#endif
    198201                                  Bool        bUseRes = false
    199202#if AMP_MRG
     
    210213                                  TComYuv*&   rpcYuvRec,
    211214                                  Bool        bSkipRes );
    212  
     215#if LGE_INTER_SDC_E0156
     216  Void encodeResAndCalcRdInterSDCCU( TComDataCU* pcCU,
     217    TComYuv* pcOrg,
     218    TComYuv* pcPred,
     219    TComYuv* pcResi,
     220    TComYuv* pcRec,
     221    const UInt uiDepth );
     222#endif
    213223  /// set ME search range
    214224  Void setAdaptiveSearchRange   ( Int iDir, Int iRefIdx, Int iSearchRange) { m_aaiAdaptSR[iDir][iRefIdx] = iSearchRange; }
  • branches/HTM-DEV-2.0-dev0/source/Lib/TLibEncoder/TEncTop.cpp

    r542 r598  
    392392  if( picLastCoded )
    393393  {
     394#if MTK_SONY_PROGRESSIVE_MV_COMPRESSION_E0170
     395    picLastCoded->compressMotion(1);
     396#else
    394397    picLastCoded->compressMotion();
     398#endif
    395399  }
    396400#endif
Note: See TracChangeset for help on using the changeset viewer.