Changeset 608 in 3DVCSoftware for trunk/source/Lib/TLibDecoder/TDecEntropy.cpp


Ignore:
Timestamp:
1 Sep 2013, 22:47:26 (11 years ago)
Author:
tech
Message:

Merged DEV-2.0-dev0@604.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/Lib/TLibDecoder/TDecEntropy.cpp

    r443 r608  
    44 * granted under this license. 
    55 *
    6  * Copyright (c) 2010-2012, ITU/ISO/IEC
     6 * Copyright (c) 2010-2013, ITU/ISO/IEC
    77 * All rights reserved.
    88 *
     
    4646}
    4747
    48 #include "TLibCommon/TComAdaptiveLoopFilter.h"
    4948#include "TLibCommon/TComSampleAdaptiveOffset.h"
    5049
     
    5251{
    5352  m_pcEntropyDecoderIf->parseSkipFlag( pcCU, uiAbsPartIdx, uiDepth );
     53}
     54
     55Void TDecEntropy::decodeCUTransquantBypassFlag(TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     56{
     57  m_pcEntropyDecoderIf->parseCUTransquantBypassFlag( pcCU, uiAbsPartIdx, uiDepth );
    5458}
    5559
     
    6771}
    6872
    69 #if LGE_ILLUCOMP_B0045
    70 Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    71 {
    72   pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
    73 
    74   if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0)
    75 #if !LGE_ILLUCOMP_DEPTH_C0046
    76       || pcCU->getSlice()->getSPS()->isDepth()
    77 #endif
    78       )
    79   {
    80     return;
    81   }
    82 
    83   if(!pcCU->getSlice()->getApplyIC())
    84     return;
    85 
    86 #if LGE_ILLUCOMP_DEPTH_C0046
    87   if(pcCU->isICFlagRequired(uiAbsPartIdx, uiDepth)) //This modification is not needed after integrating JCT3V-C0137
    88 #else
    89   if(pcCU->isICFlagRequired(uiAbsPartIdx))
    90 #endif
    91     m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth );
    92 }
    93 #endif
    9473/** decode merge index
    9574 * \param pcCU
     
    10180 * \returns Void
    10281 */
    103 Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, PartSize eCUMode, UChar* puhInterDirNeighbours, TComMvField* pcMvFieldNeighbours, UInt uiDepth )
     82Void TDecEntropy::decodeMergeIndex( TComDataCU* pcCU, UInt uiPartIdx, UInt uiAbsPartIdx, UInt uiDepth )
    10483{
    10584  UInt uiMergeIndex = 0;
    106   m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex, uiAbsPartIdx, uiDepth );
     85  m_pcEntropyDecoderIf->parseMergeIndex( pcCU, uiMergeIndex );
    10786  pcCU->setMergeIndexSubParts( uiMergeIndex, uiAbsPartIdx, uiPartIdx, uiDepth );
    10887}
    10988
    110 #if QC_ARP_D0177
    111 Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU, UInt uiPUIdx )
    112 {
    113   if( pcCU->getSlice()->getViewId() == 0 || pcCU->getSlice()->getIsDepth() == true || !pcCU->getSlice()->getARPStepNum() )
    114     return;
    115   assert( !pcCU->isIntra( uiAbsPartIdx ) );
    116   Bool bResPredAvailable = !pcCU->getSlice()->getARPStepNum() ? false: ((pcCU->getPartitionSize(uiAbsPartIdx)==SIZE_2Nx2N || pcCU->isSkipped(uiAbsPartIdx)) ? true: false);
    117   if(!bResPredAvailable)
    118     pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth ); 
     89#if H_3D_ARP
     90Void TDecEntropy::decodeARPW( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     91{
     92  if( !pcCU->getSlice()->getARPStepNum() || pcCU->isIntra( uiAbsPartIdx ) )
     93  {
     94    return;
     95  }
     96
     97  if( pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N )
     98  {
     99    pcCU->setARPWSubParts( 0 , uiAbsPartIdx, uiDepth );
     100  }
    119101  else
     102  {
    120103    m_pcEntropyDecoderIf->parseARPW( pcCU , uiAbsPartIdx , uiDepth );
    121 }
    122 #endif
     104  }
     105}
     106#endif
     107
     108#if H_3D_IC
     109Void TDecEntropy::decodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
     110{
     111  pcCU->setICFlagSubParts( false , uiAbsPartIdx, 0, uiDepth );
     112
     113  if ( pcCU->isIntra( uiAbsPartIdx ) || ( pcCU->getSlice()->getViewIndex() == 0 ) )
     114  {
     115    return;
     116  }
     117
     118  if( !pcCU->getSlice()->getApplyIC() )
     119    return;
     120
     121  if( pcCU->isICFlagRequired( uiAbsPartIdx ) )
     122    m_pcEntropyDecoderIf->parseICFlag( pcCU, uiAbsPartIdx, uiDepth );
     123}
     124#endif
     125
    123126Void TDecEntropy::decodeSplitFlag   ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    124127{
     
    129132{
    130133  m_pcEntropyDecoderIf->parsePredMode( pcCU, uiAbsPartIdx, uiDepth );
    131  
    132 #if !PKU_QC_DEPTH_INTRA_UNI_D0195
    133 #if RWTH_SDC_DLT_B0036
    134   // if B-Slice, code SDC flag later
    135   if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSlice()->getSPS()->isDepth() )
    136   {
    137     // decode SDC flag
    138     decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth);
    139   }
    140 #endif
    141 #endif
    142134}
    143135
    144136Void TDecEntropy::decodePartSize( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    145137{
    146 #if !PKU_QC_DEPTH_INTRA_UNI_D0195
    147 #if RWTH_SDC_DLT_B0036
    148   if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx)  )
    149   {
    150     pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    151     pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
    152     return;
    153   }
    154 #endif
    155 #endif
    156  
    157138  m_pcEntropyDecoderIf->parsePartSize( pcCU, uiAbsPartIdx, uiDepth );
    158  
    159 #if !PKU_QC_DEPTH_INTRA_UNI_D0195
    160 #if RWTH_SDC_DLT_B0036
    161   if( pcCU->getSlice()->isInterB() && pcCU->getSlice()->getSPS()->isDepth() && pcCU->isIntra(uiAbsPartIdx) )
    162   {
    163     // decode SDC flag
    164     decodeSDCFlag(pcCU, uiAbsPartIdx, uiDepth);
    165    
    166     if( pcCU->getSDCFlag(uiAbsPartIdx) )
    167     {
    168       // part size is also known for SDC intra
    169       pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    170       pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
    171     }
    172   }
    173 #endif
    174 #endif
    175139}
    176140
    177141Void TDecEntropy::decodePredInfo    ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, TComDataCU* pcSubCU )
    178142{
    179 #if !PKU_QC_DEPTH_INTRA_UNI_D0195
    180 #if RWTH_SDC_DLT_B0036
    181   if( pcCU->getSDCFlag(uiAbsPartIdx) )
    182   {
    183     decodeSDCPredMode(pcCU, uiAbsPartIdx, uiDepth);
    184     return;
    185   }
    186 #endif
    187 #endif
    188  
    189   PartSize eMode = pcCU->getPartitionSize( uiAbsPartIdx );
    190  
    191143  if( pcCU->isIntra( uiAbsPartIdx ) )                                 // If it is Intra mode, encode intra prediction mode.
    192144  {
    193     if( eMode == SIZE_NxN )                                         // if it is NxN size, encode 4 intra directions.
    194     {
    195       UInt uiPartOffset = ( pcCU->getPic()->getNumPartInCU() >> ( pcCU->getDepth(uiAbsPartIdx) << 1 ) ) >> 2;
    196       // if it is NxN size, this size might be the smallest partition size.                                                         // if it is NxN size, this size might be the smallest partition size.
    197       decodeIntraDirModeLuma( pcCU, uiAbsPartIdx,                  uiDepth+1 );
    198       decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset,   uiDepth+1 );
    199       decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*2, uiDepth+1 );
    200       decodeIntraDirModeLuma( pcCU, uiAbsPartIdx + uiPartOffset*3, uiDepth+1 );
    201 #if PKU_QC_DEPTH_INTRA_UNI_D0195
    202       if(!pcCU->getSDCFlag(uiAbsPartIdx))
    203 #endif
    204       decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
    205     }
    206     else                                                                // if it is not NxN size, encode 1 intra directions
    207     {
    208       decodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx, uiDepth );
    209 #if PKU_QC_DEPTH_INTRA_UNI_D0195
    210       if(!pcCU->getSDCFlag(uiAbsPartIdx))
    211 #endif
    212       decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
    213     }
     145    decodeIntraDirModeLuma  ( pcCU, uiAbsPartIdx, uiDepth );
     146#if H_3D_DIM_SDC
     147    if(!pcCU->getSDCFlag(uiAbsPartIdx))
     148#endif
     149    decodeIntraDirModeChroma( pcCU, uiAbsPartIdx, uiDepth );
    214150  }
    215151  else                                                                // if it is Inter mode, encode motion vector and reference index
    216152  {
    217153    decodePUWise( pcCU, uiAbsPartIdx, uiDepth, pcSubCU );
    218 #if QC_ARP_D0177
    219     if( pcCU->getSlice()->getSPS()->getUseAdvRP() )
    220     {
    221       decodeARPW( pcCU , uiAbsPartIdx , uiDepth, pcSubCU, 0  );
    222     }
    223 #endif
    224154  }
    225155}
     
    239169    return;
    240170  }
    241  
    242 #if RWTH_SDC_DLT_B0036
     171#if H_3D_DIM_SDC
    243172  if( pcCU->getSDCFlag(uiAbsPartIdx) )
    244173  {
     
    273202  UInt uiPUOffset = ( g_auiPUOffset[UInt( ePartSize )] << ( ( pcCU->getSlice()->getSPS()->getMaxCUDepth() - uiDepth ) << 1 ) ) >> 4;
    274203
    275 #if CU_BASED_MRG_CAND_LIST
    276 #if H3D_IVMP
     204#if H_3D_IV_MERGE
    277205  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
    278206  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
    279   for ( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ui++ )
    280207#else
    281208  TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
    282209  UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
    283   for ( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ui++ )
    284 #endif
     210#endif
     211
     212  for ( UInt ui = 0; ui < pcCU->getSlice()->getMaxNumMergeCand(); ui++ )
    285213  {
    286214    uhInterDirNeighbours[ui] = 0;
    287215  }
    288216  Int numValidMergeCand = 0;
    289   bool isMerged = false;
    290 #endif
     217  Bool isMerged = false;
    291218
    292219  pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
    293220  pcSubCU->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
     221#if H_3D_IV_MERGE
     222  pcSubCU->copyDVInfoFrom( pcCU, uiAbsPartIdx);
     223#endif
    294224  for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )
    295225  {
    296 #if !CU_BASED_MRG_CAND_LIST
    297 #if H3D_IVMP
    298     TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS_MEM << 1]; // double length for mv of both lists
    299     UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS_MEM];
    300     Int numValidMergeCand = 0;
    301     for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS_MEM; ++ui )
    302 #else
    303     TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
    304     UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
    305     Int numValidMergeCand = 0;
    306     for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui )
    307 #endif
    308     {
    309       uhInterDirNeighbours[ui] = 0;
    310     }
     226#if H_MV_ENC_DEC_TRAC
     227    DTRACE_PU_S("=========== prediction_unit ===========\n")
     228    // ToDo:
     229    //DTRACE_PU("x0", uiLPelX)
     230    //DTRACE_PU("x1", uiTPelY)
    311231#endif
    312232    decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
    313233    if ( pcCU->getMergeFlag( uiSubPartIdx ) )
    314234    {
    315       decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, ePartSize, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth );
    316 #if CU_BASED_MRG_CAND_LIST
     235      decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, uiDepth );
    317236      UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
    318237      if ( pcCU->getSlice()->getPPS()->getLog2ParallelMergeLevelMinus2() && ePartSize != SIZE_2Nx2N && pcSubCU->getWidth( 0 ) <= 8 )
     
    321240        if ( !isMerged )
    322241        {
    323           pcSubCU->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
     242#if H_3D_VSP
     243          Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
     244          memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     245#if MTK_VSP_FIX_ALIGN_WD_E0172
     246          InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
     247          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo, numValidMergeCand );
     248#else
     249#if MTK_VSP_FIX_E0172
     250          Int vspDir[MRG_MAX_NUM_CANDS_MEM];
     251          memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     252          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, vspDir, numValidMergeCand );
     253          pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
     254#else
     255          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand );
     256#endif
     257#endif//end of MTK_VSP_FIX_ALIGN_WD_E0172
     258          pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
     259#if MTK_VSP_FIX_ALIGN_WD_E0172
     260          if(vspFlag[uiMergeIndex])
     261          {
     262            pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth);
     263          }
     264#endif
     265#else
     266          pcSubCU->getInterMergeCandidates( 0, 0, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
     267#endif
    324268          isMerged = true;
    325269        }
     
    328272      else
    329273      {
    330         uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
    331         pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    332       }
     274        uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx); // Redundant line
     275#if H_3D_VSP
     276        Int vspFlag[MRG_MAX_NUM_CANDS_MEM];
     277        memset(vspFlag, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     278#if MTK_VSP_FIX_ALIGN_WD_E0172
     279        InheritedVSPDisInfo inheritedVSPDisInfo[MRG_MAX_NUM_CANDS_MEM];
     280        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, inheritedVSPDisInfo,numValidMergeCand, uiMergeIndex );
    333281#else
    334       UInt uiMergeIndex = pcCU->getMergeIndex(uiSubPartIdx);
    335 #if MERL_VSP_C0152
    336 #if LGE_VSP_INHERIT_D0092
    337       Int iVSPIndexTrue[MRG_MAX_NUM_CANDS_MEM];
    338       for (Int i=0; i<MRG_MAX_NUM_CANDS_MEM; i++)
    339       {
    340           iVSPIndexTrue[i] = 0;
    341       }
     282#if MTK_VSP_FIX_E0172
     283        Int vspDir[MRG_MAX_NUM_CANDS_MEM];
     284        memset(vspDir, 0, sizeof(Int)*MRG_MAX_NUM_CANDS_MEM);
     285        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, vspDir,numValidMergeCand, uiMergeIndex );
     286        pcCU->setVSPDirSubParts( vspDir[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    342287#else
    343       Int iVSPIndexTrue[3] = {-1, -1, -1};
    344 #endif
    345 #if MERL_VSP_NBDV_RefVId_Fix_D0166
    346       Int iVSPDirTrue[3]   = {-1, -1, -1};
    347       pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, iVSPDirTrue, uiMergeIndex );
     288        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, vspFlag, numValidMergeCand, uiMergeIndex );
     289#endif
     290#endif//end of MTK_VSP_FIX_ALIGN_WD_E0172
     291        pcCU->setVSPFlagSubParts( vspFlag[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
     292#if MTK_VSP_FIX_ALIGN_WD_E0172
     293        if(vspFlag[uiMergeIndex])
     294        {
     295          pcCU->setDvInfoSubParts(inheritedVSPDisInfo[uiMergeIndex].m_acDvInfo, uiSubPartIdx, uiPartIdx, uiDepth);
     296        }
     297#endif
    348298#else
    349       pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, iVSPIndexTrue, uiMergeIndex );
    350 #endif
    351 #if HHI_MPI
    352       if(pcCU->getTextureModeDepth( uiSubPartIdx ) == uiDepth)//MPI is used
    353       {
    354         TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
    355         UInt uiCurrPartNumb = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
    356         for( UInt ui = 0; ui < uiCurrPartNumb; ui++ )
    357         {
    358           Int vspIdx = pcTextureCU->getVSPIndex( uiAbsPartIdx + ui );
    359           pcCU->setVSPIndex( uiAbsPartIdx + ui, vspIdx);
    360 #if MERL_VSP_NBDV_RefVId_Fix_D0166
    361           Int vspDir = pcTextureCU->getVSPDir( uiAbsPartIdx + ui );
    362           pcCU->setVSPDir( uiAbsPartIdx + ui, vspDir);
    363 #endif
    364         }
    365       }
    366       else // MPI not used
    367 #endif
    368 #if MTK_D0156
    369           if( !pcCU->getSlice()->getSPS()->getUseVSPCompensation() )
    370           {
    371               pcCU->setVSPIndexSubParts( 0, uiSubPartIdx, uiPartIdx, uiDepth );
    372           }
    373           else
    374 #endif
    375       {
    376         Int iVSPIdx = 0;
    377 #if LGE_VSP_INHERIT_D0092
    378         if (iVSPIndexTrue[uiMergeIndex] == 1)
    379         {
    380             iVSPIdx = 1;
    381         }
    382 #else
    383         Int numVspIdx;
    384         numVspIdx = 3;
    385         for (Int i = 0; i < numVspIdx; i++)
    386         {
    387           if (iVSPIndexTrue[i] == uiMergeIndex)
    388             {
    389               iVSPIdx = i+1;
    390               break;
    391             }
    392         }
    393 #endif
    394         pcCU->setVSPIndexSubParts( iVSPIdx, uiSubPartIdx, uiPartIdx, uiDepth );               // Initialize
    395 #if MERL_VSP_NBDV_RefVId_Fix_D0166
    396         pcCU->setVSPDirSubParts( 0, uiSubPartIdx, uiPartIdx, uiDepth );  // Initialize
    397 #endif
    398 #if QC_BVSP_CleanUP_D0191 && !LGE_VSP_INHERIT_D0092
    399        if(iVSPIdx != 0)
    400        {
    401          Int iIVCIdx = pcCU->getSlice()->getRefPic(REF_PIC_LIST_0, 0)->getPOC()==pcCU->getSlice()->getPOC() ? 0: pcCU->getSlice()->getNewRefIdx(REF_PIC_LIST_0);
    402          cMvFieldNeighbours[ 2*uiMergeIndex].setRefIdx(iIVCIdx);
    403        }
    404 #endif
    405       }
    406 
    407 #else
    408       pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
    409 #endif
    410 #endif
     299        pcSubCU->getInterMergeCandidates( uiSubPartIdx-uiAbsPartIdx, uiPartIdx, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand, uiMergeIndex );
     300#endif
     301      }
    411302      pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiSubPartIdx, uiPartIdx, uiDepth );
    412303
     
    420311          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvd( cTmpMv, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
    421312          pcCU->getCUMvField( RefPicList( uiRefListIdx ) )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + uiRefListIdx ], ePartSize, uiSubPartIdx, uiDepth, uiPartIdx );
    422 
    423313        }
    424314      }
     
    437327      }
    438328    }
     329#if MTK_VSP_FIX_E0172 || MTK_VSP_FIX_ALIGN_WD_E0172
     330    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) && (pcCU->getVSPFlag(uiSubPartIdx) == false))
     331#else
     332    if ( (pcCU->getInterDir(uiSubPartIdx) == 3) && pcSubCU->isBipredRestriction(uiPartIdx) )
     333#endif
     334    {
     335      pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMv( TComMv(0,0), ePartSize, uiSubPartIdx, uiDepth, uiPartIdx);
     336      pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllRefIdx( -1, ePartSize, uiSubPartIdx, uiDepth, uiPartIdx);
     337      pcCU->setInterDirSubParts( 1, uiSubPartIdx, uiPartIdx, uiDepth);
     338    }
    439339  }
    440340  return;
     
    458358  else
    459359  {
    460     m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx, uiDepth );
     360    m_pcEntropyDecoderIf->parseInterDir( pcCU, uiInterDir, uiAbsPartIdx );
    461361  }
    462362
     
    466366Void TDecEntropy::decodeRefFrmIdxPU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiPartIdx, RefPicList eRefList )
    467367{
    468   if(pcCU->getSlice()->getNumRefIdx(REF_PIC_LIST_C) > 0 && pcCU->getInterDir( uiAbsPartIdx ) != 3)
    469   {
    470     if(eRefList == REF_PIC_LIST_1)
    471     {
    472       return;
    473     }
    474 
    475     Int iRefFrmIdx = 0;
    476     Int iRefFrmIdxTemp;
    477     UInt uiInterDir;
    478     RefPicList eRefListTemp;
    479 
    480     PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
    481 
    482     if ( pcCU->getSlice()->getNumRefIdx ( REF_PIC_LIST_C ) > 1 )
    483     {
    484       m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, REF_PIC_LIST_C );
    485     }
    486     else
    487     {
    488       iRefFrmIdx=0;
    489     }
    490     uiInterDir = pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx) + 1;
    491     iRefFrmIdxTemp = pcCU->getSlice()->getRefIdxFromIdxOfLC(iRefFrmIdx);
    492     eRefListTemp = (RefPicList)pcCU->getSlice()->getListIdFromIdxOfLC(iRefFrmIdx);
    493 
    494     pcCU->getCUMvField( eRefListTemp )->setAllRefIdx( iRefFrmIdxTemp, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx );
    495 
    496     pcCU->setInterDirSubParts( uiInterDir, uiAbsPartIdx, uiPartIdx, uiDepth );
     368  Int iRefFrmIdx = 0;
     369  Int iParseRefFrmIdx = pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList );
     370
     371  if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx )
     372  {
     373    m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, eRefList );
     374  }
     375  else if ( !iParseRefFrmIdx )
     376  {
     377    iRefFrmIdx = NOT_VALID;
    497378  }
    498379  else
    499380  {
    500     Int iRefFrmIdx = 0;
    501     Int iParseRefFrmIdx = pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList );
    502 
    503     if ( pcCU->getSlice()->getNumRefIdx( eRefList ) > 1 && iParseRefFrmIdx )
    504     {
    505       m_pcEntropyDecoderIf->parseRefFrmIdx( pcCU, iRefFrmIdx, uiAbsPartIdx, uiDepth, eRefList );
    506     }
    507     else if ( !iParseRefFrmIdx )
    508     {
    509       iRefFrmIdx = NOT_VALID;
    510     }
    511     else
    512     {
    513       iRefFrmIdx = 0;
    514     }
    515 
    516     PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
    517     pcCU->getCUMvField( eRefList )->setAllRefIdx( iRefFrmIdx, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx );
    518   }
     381    iRefFrmIdx = 0;
     382  }
     383
     384  PartSize ePartSize = pcCU->getPartitionSize( uiAbsPartIdx );
     385  pcCU->getCUMvField( eRefList )->setAllRefIdx( iRefFrmIdx, ePartSize, uiAbsPartIdx, uiDepth, uiPartIdx );
    519386}
    520387
     
    549416  cMv = cZeroMv;
    550417
    551   if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) && (pcSubCU->getAMVPMode(uiPartAddr) == AM_EXPL) )
    552   {
    553 #if H3D_IVMP
    554 #if SEC_TWO_CANDIDATES_FOR_AMVP_D0122
    555     const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS;
    556 #else
    557     const Int iNumAMVPCands = AMVP_MAX_NUM_CANDS + ( pcSubCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 );
    558 #endif
    559     m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx, iNumAMVPCands );
    560 #else
     418  if ( (pcSubCU->getInterDir(uiPartAddr) & ( 1 << eRefList )) )
     419  {
    561420    m_pcEntropyDecoderIf->parseMVPIdx( iMVPIdx );
    562 #endif
    563   }
    564 #if H3D_IVMP
    565   pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo, iMVPIdx);
    566 #else
     421#if H_MV_ENC_DEC_TRAC
     422#if ENC_DEC_TRACE
     423    if ( eRefList == REF_PIC_LIST_0 )
     424    {
     425      DTRACE_PU("mvp_l0_flag", iMVPIdx)
     426    }
     427    else
     428    {
     429      DTRACE_PU("mvp_l1_flag", iMVPIdx)
     430    }
     431#endif
     432#endif
     433  }
    567434  pcSubCU->fillMvpCand(uiPartIdx, uiPartAddr, eRefList, iRefIdx, pAMVPInfo);
    568 #endif
    569435  pcSubCU->setMVPNumSubParts(pAMVPInfo->iN, eRefList, uiPartAddr, uiPartIdx, uiDepth);
    570436  pcSubCU->setMVPIdxSubParts( iMVPIdx, eRefList, uiPartAddr, uiPartIdx, uiDepth );
    571437  if ( iRefIdx >= 0 )
    572438  {
    573     m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, iRefIdx, cMv);
     439    m_pcPrediction->getMvPredAMVP( pcSubCU, uiPartIdx, uiPartAddr, eRefList, cMv);
    574440    cMv += pcSubCUMvField->getMvd( uiPartAddr );
    575441  }
     
    579445}
    580446
    581 Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP )
     447Void TDecEntropy::xDecodeTransform( TComDataCU* pcCU, UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, Bool& bCodeDQP)
    582448{
    583449  UInt uiSubdiv;
     
    620486  {
    621487    assert( uiLog2TrafoSize > pcCU->getQuadtreeTULog2MinSizeInCU(uiAbsPartIdx) );
    622     m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, uiDepth );
     488    m_pcEntropyDecoderIf->parseTransformSubdivFlag( uiSubdiv, 5 - uiLog2TrafoSize );
    623489  }
    624490 
    625491  const UInt uiTrDepth = uiDepth - pcCU->getDepth( uiAbsPartIdx );
    626  
    627   if( uiLog2TrafoSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
    628   {
    629     const Bool bFirstCbfOfCU = uiLog2TrafoSize == pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() || uiTrDepth == 0;
     492  {
     493    const Bool bFirstCbfOfCU = uiTrDepth == 0;
    630494    if( bFirstCbfOfCU )
    631495    {
     
    637501      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) )
    638502      {
    639         if ( uiInnerQuadIdx == 3 && uiUCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
    640         {
    641           uiUCbfFront3++;
    642           pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth );
    643           //printf( " \nsave bits, U Cbf");
    644         }
    645         else
    646         {
    647           m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth );
    648           uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth );
    649         }
     503        m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth, uiDepth );
    650504      }
    651505      if( bFirstCbfOfCU || pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) )
    652506      {
    653         if ( uiInnerQuadIdx == 3 && uiVCbfFront3 == 0 && uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() )
    654         {
    655           uiVCbfFront3++;
    656           pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth );
    657           //printf( " \nsave bits, V Cbf");
    658         }
    659         else
    660         {
    661           m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth );
    662           uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth );
    663         }
     507        m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth, uiDepth );
    664508      }
    665509    }
     
    668512      pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_U, uiAbsPartIdx, uiDepth );
    669513      pcCU->setCbfSubParts( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth - 1 ) << uiTrDepth, TEXT_CHROMA_V, uiAbsPartIdx, uiDepth );
    670       if ( uiLog2TrafoSize == 2 )
    671       {
    672         uiUCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth );
    673         uiVCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth );
    674       }
    675514    }
    676515  }
     
    686525    const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);
    687526    const UInt uiStartAbsPartIdx = uiAbsPartIdx;
    688     UInt uiLumaTrMode, uiChromaTrMode;
    689     pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth+1, uiLumaTrMode, uiChromaTrMode );
    690527    UInt uiYCbf = 0;
    691528    UInt uiUCbf = 0;
    692529    UInt uiVCbf = 0;
    693530   
    694     UInt uiCurrentCbfY = 0;
    695     UInt uiCurrentCbfU = 0;
    696     UInt uiCurrentCbfV = 0;
    697    
    698531    for( Int i = 0; i < 4; i++ )
    699532    {
    700       UInt nsAddr = 0;
    701       nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, i, uiTrDepth+1 );
    702       xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, i, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP );
    703       uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode );
    704       uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiChromaTrMode );
    705       uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiChromaTrMode );
     533      xDecodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, uiDepth, width, height, uiTrIdx, bCodeDQP );
     534      uiYCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrDepth+1 );
     535      uiUCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrDepth+1 );
     536      uiVCbf |= pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrDepth+1 );
    706537      uiAbsPartIdx += uiQPartNum;
    707538      offsetLuma += size;  offsetChroma += (size>>2);
    708539    }
    709540   
    710     uiYCbfFront3 += uiCurrentCbfY;
    711     uiUCbfFront3 += uiCurrentCbfU;
    712     uiVCbfFront3 += uiCurrentCbfV;
    713    
    714     pcCU->convertTransIdx( uiStartAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );
    715541    for( UInt ui = 0; ui < 4 * uiQPartNum; ++ui )
    716542    {
    717       pcCU->getCbf( TEXT_LUMA     )[uiStartAbsPartIdx + ui] |= uiYCbf << uiLumaTrMode;
    718       pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiChromaTrMode;
    719       pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiChromaTrMode;
     543      pcCU->getCbf( TEXT_LUMA     )[uiStartAbsPartIdx + ui] |= uiYCbf << uiTrDepth;
     544      pcCU->getCbf( TEXT_CHROMA_U )[uiStartAbsPartIdx + ui] |= uiUCbf << uiTrDepth;
     545      pcCU->getCbf( TEXT_CHROMA_V )[uiStartAbsPartIdx + ui] |= uiVCbf << uiTrDepth;
    720546    }
    721547  }
     
    725551    pcCU->setTrIdxSubParts( uiTrDepth, uiAbsPartIdx, uiDepth );
    726552   
     553#if !H_MV_ENC_DEC_TRAC
    727554    {
    728555      DTRACE_CABAC_VL( g_nSymbolCounter++ );
     
    735562      DTRACE_CABAC_T( "\n" );
    736563    }
     564#endif
    737565   
    738     UInt uiLumaTrMode, uiChromaTrMode;
    739     pcCU->convertTransIdx( uiAbsPartIdx, uiTrDepth, uiLumaTrMode, uiChromaTrMode );
    740     if(pcCU->getPredictionMode( uiAbsPartIdx ) == MODE_INTER && pcCU->useNonSquarePU( uiAbsPartIdx ) )
    741     {
    742       pcCU->setNSQTIdxSubParts( uiLog2TrafoSize, uiAbsPartIdx, absTUPartIdx, uiLumaTrMode );
    743     }
    744566    pcCU->setCbfSubParts ( 0, TEXT_LUMA, uiAbsPartIdx, uiDepth );
    745567    if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )
    746568    {
    747       pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth );
     569      pcCU->setCbfSubParts( 1 << uiTrDepth, TEXT_LUMA, uiAbsPartIdx, uiDepth );
    748570    }
    749571    else
    750572    {
    751       const UInt uiLog2CUSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()] + 2 - pcCU->getDepth( uiAbsPartIdx );
    752       if ( pcCU->getPredictionMode( uiAbsPartIdx ) != MODE_INTRA && uiInnerQuadIdx == 3 && uiYCbfFront3 == 0 && uiUCbfFront3 == 0 && uiVCbfFront3 == 0
    753           && ( uiLog2CUSize <= pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() + 1 || uiLog2TrafoSize < pcCU->getSlice()->getSPS()->getQuadtreeTULog2MaxSize() ) )
    754       {
    755         pcCU->setCbfSubParts( 1 << uiLumaTrMode, TEXT_LUMA, uiAbsPartIdx, uiDepth );
    756         //printf( " \nsave bits, Y Cbf");
    757         uiYCbfFront3++;   
    758       }
    759       else
    760       {
    761         m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode, uiDepth );
    762         uiYCbfFront3 += pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiLumaTrMode );
    763       }
    764     }
     573      m_pcEntropyDecoderIf->parseQtCbf( pcCU, uiAbsPartIdx, TEXT_LUMA, uiTrDepth, uiDepth );
     574    }
     575
     576
    765577    // transform_unit begin
    766578    UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA    , uiTrIdx );
     
    792604      Int trWidth = width;
    793605      Int trHeight = height;
    794       pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );
    795606      m_pcEntropyDecoderIf->parseCoeffNxN( pcCU, (pcCU->getCoeffY()+offsetLuma), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA );
    796607    }
     
    799610      Int trWidth = width >> 1;
    800611      Int trHeight = height >> 1;
    801       pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );
    802612      if( cbfU )
    803613      {
     
    816626        Int trWidth = width;
    817627        Int trHeight = height;
    818         pcCU->getNSQTSize( uiTrIdx - 1, uiAbsPartIdx, trWidth, trHeight );
    819628        if( cbfU )
    820629        {
     
    830639  }
    831640}
    832 
    833641
    834642Void TDecEntropy::decodeQP          ( TComDataCU* pcCU, UInt uiAbsPartIdx )
     
    854662  UInt uiLumaOffset   = uiMinCoeffSize*uiAbsPartIdx;
    855663  UInt uiChromaOffset = uiLumaOffset>>2;
    856   UInt temp  = 0;
    857   UInt temp1 = 0;
    858   UInt temp2 = 0;
    859664 
    860 #if RWTH_SDC_DLT_B0036
    861   if( pcCU->getSDCAvailable(uiAbsPartIdx) && pcCU->getSDCFlag( uiAbsPartIdx ) )
     665#if H_3D_DIM_SDC
     666  if( pcCU->getSDCFlag( uiAbsPartIdx ) )
    862667  {
    863668    assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
     
    866671    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_U) == 1 );
    867672    assert( pcCU->getCbf(uiAbsPartIdx, TEXT_CHROMA_V) == 1 );
    868 #if !PKU_QC_DEPTH_INTRA_UNI_D0195
    869     decodeSDCResidualData(pcCU, uiAbsPartIdx, uiDepth);
    870 #endif
    871673    return;
    872674  }
    873675#endif
    874676 
     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
    875689  if( pcCU->isIntra(uiAbsPartIdx) )
    876690  {
     
    879693  {
    880694    UInt uiQtRootCbf = 1;
    881 #if HHI_MPI
    882     if( !(pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&
    883           ( pcCU->getTextureModeDepth( uiAbsPartIdx ) == -1 || uiDepth == pcCU->getTextureModeDepth( uiAbsPartIdx ) ) ) )
    884 #else
    885695    if( !( pcCU->getPartitionSize( uiAbsPartIdx) == SIZE_2Nx2N && pcCU->getMergeFlag( uiAbsPartIdx ) ) )
    886 #endif
    887     {
    888       m_pcEntropyDecoderIf->parseQtRootCbf( pcCU, uiAbsPartIdx, uiDepth, uiQtRootCbf );
     696    {
     697      m_pcEntropyDecoderIf->parseQtRootCbf( uiAbsPartIdx, uiQtRootCbf );
    889698    }
    890699    if ( !uiQtRootCbf )
     
    892701      pcCU->setCbfSubParts( 0, 0, 0, uiAbsPartIdx, uiDepth );
    893702      pcCU->setTrIdxSubParts( 0 , uiAbsPartIdx, uiDepth );
    894       pcCU->setNSQTIdxSubParts( uiAbsPartIdx, uiDepth );
    895703      return;
    896704    }
    897705   
    898706  }
    899 
    900 #if FIX_MPI_B0065
    901   if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1  )
    902   {
    903     TComDataCU *pcTextureCU = pcCU->getSlice()->getTexturePic()->getCU( pcCU->getAddr() );
    904     if( uiDepth == pcTextureCU->getDepth(uiAbsPartIdx))
    905     {
    906       PartSize partSize = pcTextureCU->getPartitionSize(uiAbsPartIdx);
    907       pcCU->setPartSizeSubParts( partSize, uiAbsPartIdx, uiDepth );
    908     }
    909     else
    910     {
    911       pcCU->setPartSizeSubParts( SIZE_NxN, uiAbsPartIdx, uiDepth );
    912     }
    913   }
    914 #endif
    915 
    916   xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP );
    917 
    918 #if FIX_MPI_B0065
    919   if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTER && pcCU->getMergeFlag( uiAbsPartIdx ) && pcCU->getMergeIndex( uiAbsPartIdx ) == 0 && pcCU->getPartitionSize(uiAbsPartIdx) != SIZE_2Nx2N &&  pcCU->getTextureModeDepth( uiAbsPartIdx ) != -1 )
    920   {
    921     pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); 
    922   }
    923 #endif
    924 }
    925 
    926 #if RWTH_SDC_DLT_B0036
    927 #if !PKU_QC_DEPTH_INTRA_UNI_D0195
    928 Void TDecEntropy::decodeSDCPredMode( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    929 {
    930   assert( pcCU->getSlice()->getSPS()->isDepth() );
    931   assert( pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_2Nx2N );
    932  
    933   m_pcEntropyDecoderIf->parseSDCPredMode(pcCU, uiAbsPartIdx, uiDepth );
    934 }
    935 
    936 Void TDecEntropy::decodeSDCFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    937 {
    938   assert( pcCU->getSlice()->getSPS()->isDepth() );
    939  
    940   m_pcEntropyDecoderIf->parseSDCFlag(pcCU, uiAbsPartIdx, uiDepth );
    941 }
    942 #endif
    943 Void TDecEntropy::decodeSDCResidualData( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth )
    944 {
    945   assert( pcCU->getSlice()->getSPS()->isDepth() );
    946   assert( pcCU->getSDCFlag(uiAbsPartIdx) );
    947  
    948   // number of segments depends on prediction mode for INTRA
    949   UInt uiNumSegments = 2;
    950   UInt uiLumaPredMode = pcCU->getLumaIntraDir( uiAbsPartIdx );
    951   if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && (uiLumaPredMode == DC_IDX || uiLumaPredMode == PLANAR_IDX) )
    952     uiNumSegments = 1;
    953  
     707  xDecodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, bCodeDQP );
     708}
     709
     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
    954742  // decode residual data for each segment
    955743  for( UInt uiSeg = 0; uiSeg < uiNumSegments; uiSeg++ )
    956     m_pcEntropyDecoderIf->parseSDCResidualData(pcCU, uiAbsPartIdx, uiDepth, uiSeg);
     744  {
     745    m_pcEntropyDecoderIf->parseInterSDCResidualData( pcCU, uiAbsPartIdx, uiDepth, uiSeg );
     746  }
    957747}
    958748#endif
Note: See TracChangeset for help on using the changeset viewer.