Ticket #334: HM-5.2-remove-global-MRG-flag.patch

File HM-5.2-remove-global-MRG-flag.patch, 30.0 KB (added by thomasd, 12 years ago)
  • cfg/encoder_intra.cfg

    diff --git a/cfg/encoder_intra.cfg b/cfg/encoder_intra.cfg
    index ca8f1e3..ca69132 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    4545InternalBitDepth              : 8          # internal bit-depth = BitDepth + BitIncrement
    4646
    4747#=========== Coding Tools =================
    48 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    4948SAO                           : 1           # Sample adaptive offset  (0: OFF, 1: ON)
    5049ALF                           : 1           # Adaptive loop filter  (0: OFF, 1: ON)
    5150ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_intra_10.cfg

    diff --git a/cfg/encoder_intra_10.cfg b/cfg/encoder_intra_10.cfg
    index 43c46bc..f3928bf 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    4545InternalBitDepth              : 10          # internal bit-depth = BitDepth + BitIncrement
    4646
    4747#=========== Coding Tools =================
    48 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    4948SAO                           : 1           # Sample adaptive offset  (0: OFF, 1: ON)
    5049ALF                           : 1           # Adaptive loop filter  (0: OFF, 1: ON)
    5150ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_intra_loco.cfg

    diff --git a/cfg/encoder_intra_loco.cfg b/cfg/encoder_intra_loco.cfg
    index d738b5a..00ae70c 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    4646InternalBitDepth              : 8           # internal bit-depth = BitDepth + BitIncrement
    4747
    4848#=========== Coding Tools =================
    49 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    5049SAO                           : 0           # Sample adaptive offset  (0: OFF, 1: ON)
    5150ALF                           : 0           # Adaptive loop filter  (0: OFF, 1: ON)
    5251ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_lowdelay.cfg

    diff --git a/cfg/encoder_lowdelay.cfg b/cfg/encoder_lowdelay.cfg
    index 642587c..8b02e12 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    5151InternalBitDepth              : 8          # internal bit-depth = BitDepth + BitIncrement
    5252
    5353#=========== Coding Tools =================
    54 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    5554SAO                           : 1           # Sample adaptive offset  (0: OFF, 1: ON)
    5655ALF                           : 1           # Adaptive loop filter  (0: OFF, 1: ON)
    5756ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_lowdelay_10.cfg

    diff --git a/cfg/encoder_lowdelay_10.cfg b/cfg/encoder_lowdelay_10.cfg
    index 8612e73..a481b91 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    5151InternalBitDepth              : 10          # internal bit-depth = BitDepth + BitIncrement
    5252
    5353#=========== Coding Tools =================
    54 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    5554SAO                           : 1           # Sample adaptive offset  (0: OFF, 1: ON)
    5655ALF                           : 1           # Adaptive loop filter  (0: OFF, 1: ON)
    5756ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_lowdelay_P.cfg

    diff --git a/cfg/encoder_lowdelay_P.cfg b/cfg/encoder_lowdelay_P.cfg
    index 77ffe9c..74c38b4 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    5151InternalBitDepth              : 8          # internal bit-depth = BitDepth + BitIncrement
    5252
    5353#=========== Coding Tools =================
    54 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    5554SAO                           : 1           # Sample adaptive offset  (0: OFF, 1: ON)
    5655ALF                           : 1           # Adaptive loop filter  (0: OFF, 1: ON)
    5756ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_lowdelay_P_10.cfg

    diff --git a/cfg/encoder_lowdelay_P_10.cfg b/cfg/encoder_lowdelay_P_10.cfg
    index 256923d..b15fc52 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    5151InternalBitDepth              : 10          # internal bit-depth = BitDepth + BitIncrement
    5252
    5353#=========== Coding Tools =================
    54 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    5554SAO                           : 1           # Sample adaptive offset  (0: OFF, 1: ON)
    5655ALF                           : 1           # Adaptive loop filter  (0: OFF, 1: ON)
    5756ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_lowdelay_P_loco.cfg

    diff --git a/cfg/encoder_lowdelay_P_loco.cfg b/cfg/encoder_lowdelay_P_loco.cfg
    index 12562ec..f422ae0 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    5151InternalBitDepth              : 8           # internal bit-depth = BitDepth + BitIncrement
    5252
    5353#=========== Coding Tools =================
    54 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    5554SAO                           : 0           # Sample adaptive offset  (0: OFF, 1: ON)
    5655ALF                           : 0           # Adaptive loop filter  (0: OFF, 1: ON)
    5756ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_lowdelay_loco.cfg

    diff --git a/cfg/encoder_lowdelay_loco.cfg b/cfg/encoder_lowdelay_loco.cfg
    index 3afac50..be8329d 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    5151InternalBitDepth              : 8           # internal bit-depth = BitDepth + BitIncrement
    5252
    5353#=========== Coding Tools =================
    54 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    5554SAO                           : 0           # Sample adaptive offset  (0: OFF, 1: ON)
    5655ALF                           : 0           # Adaptive loop filter  (0: OFF, 1: ON)
    5756ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_randomaccess.cfg

    diff --git a/cfg/encoder_randomaccess.cfg b/cfg/encoder_randomaccess.cfg
    index 62e6835..34d320b 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    5656InternalBitDepth              : 8          # internal bit-depth = BitDepth + BitIncrement
    5757
    5858#=========== Coding Tools =================
    59 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    6059SAO                           : 1           # Sample adaptive offset  (0: OFF, 1: ON)
    6160ALF                           : 1           # Adaptive loop filter  (0: OFF, 1: ON)
    6261ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_randomaccess_10.cfg

    diff --git a/cfg/encoder_randomaccess_10.cfg b/cfg/encoder_randomaccess_10.cfg
    index 6a6b638..e0f7cc3 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    5656InternalBitDepth              : 10          # internal bit-depth = BitDepth + BitIncrement
    5757
    5858#=========== Coding Tools =================
    59 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    6059SAO                           : 1           # Sample adaptive offset  (0: OFF, 1: ON)
    6160ALF                           : 1           # Adaptive loop filter  (0: OFF, 1: ON)
    6261ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • cfg/encoder_randomaccess_loco.cfg

    diff --git a/cfg/encoder_randomaccess_loco.cfg b/cfg/encoder_randomaccess_loco.cfg
    index 7c6c6da..52bd42a 100644
    a b LoopFilterBetaOffset : 0 # Range: -26 ~ 26 
    5656InternalBitDepth              : 8           # internal bit-depth = BitDepth + BitIncrement
    5757
    5858#=========== Coding Tools =================
    59 MRG                           : 1           # Merge mode                      (0: OFF, 1: ON)
    6059SAO                           : 0           # Sample adaptive offset  (0: OFF, 1: ON)
    6160ALF                           : 0           # Adaptive loop filter  (0: OFF, 1: ON)
    6261ALFEncodePassReduction        : 0           # Reduce ALF encoding passes (0:Original 16-pass, 1: 1-pass, 2: 2-pass encoding)
  • source/App/TAppEncoder/TAppEncCfg.cpp

    diff --git a/source/App/TAppEncoder/TAppEncCfg.cpp b/source/App/TAppEncoder/TAppEncCfg.cpp
    index 25f2028..951f088 100644
    a b Bool TAppEncCfg::parseCfg( Int argc, Char* argv[] ) 
    236236  ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0 )
    237237
    238238  /* Coding tools */
    239   ("MRG", m_bUseMRG, true, "merging of motion partitions")
    240 
    241239  ("LMChroma", m_bUseLMChroma, true, "intra chroma prediction based on recontructed luma")
    242240
    243241  ("ALF", m_bUseALF, true, "Adaptive Loop Filter")
    Void TAppEncCfg::xPrintParameter() 
    809807  printf("ECU:%d ", m_bUseEarlyCU         );
    810808  printf("CFM:%d ", m_bUseCbfFastMode         );
    811809  printf("RQT:%d ", 1     );
    812   printf("MRG:%d ", m_bUseMRG             ); // SOPH: Merge Mode
    813810  printf("LMC:%d ", m_bUseLMChroma        );
    814811  printf("Slice: G=%d M=%d ", m_iSliceGranularity, m_iSliceMode);
    815812  if (m_iSliceMode!=0)
    Void TAppEncCfg::xPrintUsage() 
    868865  printf( "                   FEN - fast encoder setting\n"); 
    869866  printf( "                   ECU - Early CU setting\n");
    870867  printf( "                   CFM - Cbf fast mode setting\n");
    871   printf( "                   MRG - merging of motion partitions\n"); // SOPH: Merge Mode
    872868
    873869  printf( "                   LMC - intra chroma prediction based on luma\n");
    874870
  • source/App/TAppEncoder/TAppEncCfg.h

    diff --git a/source/App/TAppEncoder/TAppEncCfg.h b/source/App/TAppEncoder/TAppEncCfg.h
    index e6b06c0..ec1f398 100644
    a b protected: 
    137137  Int       m_loopFilterBetaOffsetDiv2;                     ///< beta offset for deblocking filter
    138138  Int       m_loopFilterTcOffsetDiv2;                       ///< tc offset for deblocking filter
    139139
    140   // coding tools (inter - merge motion partitions)
    141   Bool      m_bUseMRG;                                        ///< SOPH: flag for using motion partition Merge Mode
    142  
    143140  Bool      m_bUseLMChroma;                                  ///< JL: Chroma intra prediction based on luma signal
    144141
    145142  // coding tools (PCM)
  • source/App/TAppEncoder/TAppEncTop.cpp

    diff --git a/source/App/TAppEncoder/TAppEncTop.cpp b/source/App/TAppEncoder/TAppEncTop.cpp
    index 07c1fbf..fb04807 100644
    a b Void TAppEncTop::xInitLibCfg() 
    147147  m_cTEncTop.setUseFastEnc                   ( m_bUseFastEnc  );
    148148  m_cTEncTop.setUseEarlyCU                   ( m_bUseEarlyCU  );
    149149  m_cTEncTop.setUseCbfFastMode            ( m_bUseCbfFastMode  );
    150   m_cTEncTop.setUseMRG                       ( m_bUseMRG      ); // SOPH:
    151150
    152151  m_cTEncTop.setUseLMChroma                  ( m_bUseLMChroma );
    153152  m_cTEncTop.setUseConstrainedIntraPred      ( m_bUseConstrainedIntraPred );
  • source/Lib/TLibCommon/TComDataCU.cpp

    diff --git a/source/Lib/TLibCommon/TComDataCU.cpp b/source/Lib/TLibCommon/TComDataCU.cpp
    index 2c9c5c2..2f68d0f 100644
    a b Bool TComDataCU::isSkipped( UInt uiPartIdx ) 
    32153215  {
    32163216    return false;
    32173217  }
    3218   if ( getSlice()->getSPS()->getUseMRG() )
    3219   {
    3220     return ( m_pePredMode[ uiPartIdx ] == MODE_SKIP && getMergeFlag( uiPartIdx ) && !getQtRootCbf( uiPartIdx ) );
    3221   }
    3222   else
    3223   {
    3224     if ( m_pcSlice->isInterP() )
    3225     {
    3226       return ( ( m_pePredMode[ uiPartIdx ] == MODE_SKIP ) && ( ( m_puhCbf[0][uiPartIdx] & 0x1 ) + ( m_puhCbf[1][uiPartIdx] & 0x1 ) + ( m_puhCbf[2][uiPartIdx] & 0x1 ) == 0) );
    3227     }
    3228     else //if ( m_pcSlice->isInterB()  )
    3229     {
    3230       return ( ( m_pePredMode[ uiPartIdx ] == MODE_SKIP ) && ( ( m_puhCbf[0][uiPartIdx] & 0x1 ) + ( m_puhCbf[1][uiPartIdx] & 0x1 ) + ( m_puhCbf[2][uiPartIdx] & 0x1 ) == 0) && (m_puhInterDir[uiPartIdx] == 3) );
    3231     }
    3232   }
     3218
     3219  return ( m_pePredMode[ uiPartIdx ] == MODE_SKIP && getMergeFlag( uiPartIdx ) && !getQtRootCbf( uiPartIdx ) );
    32333220}
    32343221
    32353222// ====================================================================================================================
  • source/Lib/TLibCommon/TComSlice.cpp

    diff --git a/source/Lib/TLibCommon/TComSlice.cpp b/source/Lib/TLibCommon/TComSlice.cpp
    index 7a2f8c3..f929b48 100644
    a b TComSPS::TComSPS() 
    11621162, m_bDisInter4x4              (  1)
    11631163, m_bUseALF                   (false)
    11641164, m_bUsePAD                   (false)
    1165 , m_bUseMRG                   (false)
    11661165, m_bUseLMChroma              (false)
    11671166, m_bUseLComb                 (false)
    11681167, m_bLCMod                    (false)
  • source/Lib/TLibCommon/TComSlice.h

    diff --git a/source/Lib/TLibCommon/TComSlice.h b/source/Lib/TLibCommon/TComSlice.h
    index c5b2fcd..3b0c93f 100644
    a b private: 
    9696  Bool        m_useAMP;
    9797  Bool        m_bUseALF;
    9898  Bool        m_bUsePAD;
    99   Bool        m_bUseMRG; // SOPH:
    10099
    101100  Bool        m_bUseLMChroma; // JL:
    102101
    public: 
    205204  Bool getUseALF      ()         { return m_bUseALF;        }
    206205
    207206  Bool getUsePAD      ()         { return m_bUsePAD;        }
    208   Bool getUseMRG      ()         { return m_bUseMRG;        } // SOPH:
    209207 
    210208  Void setUseALF      ( Bool b ) { m_bUseALF  = b;          }
    211209 
    212210  Void setUsePAD      ( Bool b ) { m_bUsePAD   = b;         }
    213   Void setUseMRG      ( Bool b ) { m_bUseMRG  = b;          } // SOPH:
    214211 
    215212  Void setUseLComb    (Bool b)   { m_bUseLComb = b;         }
    216213  Bool getUseLComb    ()         { return m_bUseLComb;      }
  • source/Lib/TLibDecoder/TDecCAVLC.cpp

    diff --git a/source/Lib/TLibDecoder/TDecCAVLC.cpp b/source/Lib/TLibDecoder/TDecCAVLC.cpp
    index d29f85f..366fd5d 100644
    a b Void TDecCavlc::parseSPS(TComSPS* pcSPS) 
    765765  xReadUvlc ( uiCode ); pcSPS->setPadX        ( uiCode    );
    766766  xReadUvlc ( uiCode ); pcSPS->setPadY        ( uiCode    );
    767767
    768   xReadFlag( uiCode ); pcSPS->setUseMRG ( uiCode ? true : false );
    769  
    770768  // AMVP mode for each depth (AM_NONE or AM_EXPL)
    771769  for (Int i = 0; i < pcSPS->getMaxCUDepth(); i++)
    772770  {
  • source/Lib/TLibDecoder/TDecCu.cpp

    diff --git a/source/Lib/TLibDecoder/TDecCu.cpp b/source/Lib/TLibDecoder/TDecCu.cpp
    index 918baab..f14bd06 100644
    a b Void TDecCu::xDecodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt& 
    280280
    281281  if( pcCU->isSkipped(uiAbsPartIdx) )
    282282  {
    283     if ( pcCU->getSlice()->getSPS()->getUseMRG() )
     283    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
     284    m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
     285    TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
     286    UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
     287    Int numValidMergeCand = 0;
     288    for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui )
    284289    {
    285       m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_0 );
    286       m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, REF_PIC_LIST_1 );
    287       TComMvField cMvFieldNeighbours[MRG_MAX_NUM_CANDS << 1]; // double length for mv of both lists
    288       UChar uhInterDirNeighbours[MRG_MAX_NUM_CANDS];
    289       Int numValidMergeCand = 0;
    290       for( UInt ui = 0; ui < MRG_MAX_NUM_CANDS; ++ui )
    291       {
    292         uhInterDirNeighbours[ui] = 0;
    293       }
    294       m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, SIZE_2Nx2N, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth );
    295       m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
     290      uhInterDirNeighbours[ui] = 0;
     291    }
     292    m_pcEntropyDecoder->decodeMergeIndex( pcCU, 0, uiAbsPartIdx, SIZE_2Nx2N, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth );
     293    m_ppcCU[uiDepth]->getInterMergeCandidates( 0, 0, uiDepth, cMvFieldNeighbours, uhInterDirNeighbours, numValidMergeCand );
    296294
    297       UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
    298       pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
     295    UInt uiMergeIndex = pcCU->getMergeIndex(uiAbsPartIdx);
     296    pcCU->setInterDirSubParts( uhInterDirNeighbours[uiMergeIndex], uiAbsPartIdx, 0, uiDepth );
    299297
    300       TComMv cTmpMv( 0, 0 );
    301       if ( pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_0 ) > 0  ) //if ( ref. frame list0 has at least 1 entry )
    302       {
    303         pcCU->setMVPIdxSubParts( 0, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth);
    304         pcCU->setMVPNumSubParts( 0, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth);
    305         pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    306         pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    307       }
    308       if ( pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_1 ) > 0 ) //if ( ref. frame list1 has at least 1 entry )
    309       {
    310         pcCU->setMVPIdxSubParts( 0, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth);
    311         pcCU->setMVPNumSubParts( 0, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth);
    312         pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    313         pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + 1 ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    314       }
     298    TComMv cTmpMv( 0, 0 );
     299    if ( pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_0 ) > 0  ) //if ( ref. frame list0 has at least 1 entry )
     300    {
     301      pcCU->setMVPIdxSubParts( 0, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth);
     302      pcCU->setMVPNumSubParts( 0, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth);
     303      pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     304      pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    315305    }
    316     else
     306    if ( pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_1 ) > 0 ) //if ( ref. frame list1 has at least 1 entry )
    317307    {
    318       pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth);
    319       pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_0, uiAbsPartIdx, 0, uiDepth);
    320      
    321       pcCU->setMVPIdxSubParts( -1, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth);
    322       pcCU->setMVPNumSubParts( -1, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth);
    323      
    324       for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
    325       {       
    326         if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
    327         {
    328           m_ppcCU[uiDepth]->copyInterPredInfoFrom( pcCU, uiAbsPartIdx, RefPicList( uiRefListIdx ) );
    329           m_pcEntropyDecoder->decodeMVPIdxPU( m_ppcCU[uiDepth], 0, uiDepth, 0, RefPicList( uiRefListIdx ));
    330         }
    331       }
     308      pcCU->setMVPIdxSubParts( 0, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth);
     309      pcCU->setMVPNumSubParts( 0, REF_PIC_LIST_1, uiAbsPartIdx, 0, uiDepth);
     310      pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvd( cTmpMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
     311      pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvField( cMvFieldNeighbours[ 2*uiMergeIndex + 1 ], SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    332312    }
     313   
    333314    xFinishDecodeCU( pcCU, uiAbsPartIdx, uiDepth, ruiIsLast );
    334315    return;
    335316  }
  • source/Lib/TLibDecoder/TDecEntropy.cpp

    diff --git a/source/Lib/TLibDecoder/TDecEntropy.cpp b/source/Lib/TLibDecoder/TDecEntropy.cpp
    index 9a16548..0152f90 100644
    a b Void TDecEntropy::decodePUWise( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDept 
    397397    {
    398398      uhInterDirNeighbours[ui] = 0;
    399399    }
    400     if ( pcCU->getSlice()->getSPS()->getUseMRG() )
    401     {
    402       decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
    403     }
     400    decodeMergeFlag( pcCU, uiSubPartIdx, uiDepth, uiPartIdx );
     401
    404402    if ( pcCU->getMergeFlag( uiSubPartIdx ) )
    405403    {
    406404      decodeMergeIndex( pcCU, uiPartIdx, uiSubPartIdx, ePartSize, uhInterDirNeighbours, cMvFieldNeighbours, uiDepth );
  • source/Lib/TLibDecoder/TDecSbac.cpp

    diff --git a/source/Lib/TLibDecoder/TDecSbac.cpp b/source/Lib/TLibDecoder/TDecSbac.cpp
    index 6e107c5..ab1fc71 100644
    a b Void TDecSbac::parseSkipFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth 
    459459    pcCU->setPredModeSubParts( MODE_SKIP,  uiAbsPartIdx, uiDepth );
    460460    pcCU->setPartSizeSubParts( SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    461461    pcCU->setSizeSubParts( g_uiMaxCUWidth>>uiDepth, g_uiMaxCUHeight>>uiDepth, uiAbsPartIdx, uiDepth );
    462    
    463     if ( pcCU->getSlice()->getSPS()->getUseMRG() )
    464     {
    465       pcCU->setMergeFlagSubParts( true , uiAbsPartIdx, 0, uiDepth );
    466     }
    467     else
    468     {
    469       TComMv cZeroMv(0,0);
    470       pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllMvd    ( cZeroMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    471       pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllMvd    ( cZeroMv, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    472      
    473       pcCU->setTrIdxSubParts( 0, uiAbsPartIdx, uiDepth );
    474       pcCU->setCbfSubParts  ( 0, 0, 0, uiAbsPartIdx, uiDepth );
    475      
    476       if ( pcCU->getSlice()->isInterP() )
    477       {
    478         pcCU->setInterDirSubParts( 1, uiAbsPartIdx, 0, uiDepth );
    479        
    480         if ( pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_0 ) > 0 )
    481         {
    482           pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllRefIdx(  0, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    483         }
    484         if ( pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_1 ) > 0 )
    485         {
    486           pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllRefIdx( NOT_VALID, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    487         }
    488       }
    489       else
    490       {
    491         pcCU->setInterDirSubParts( 3, uiAbsPartIdx, 0, uiDepth );
    492        
    493         if ( pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_0 ) > 0 )
    494         {
    495           pcCU->getCUMvField( REF_PIC_LIST_0 )->setAllRefIdx(  0, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    496         }
    497         if ( pcCU->getSlice()->getNumRefIdx( REF_PIC_LIST_1 ) > 0 )
    498         {
    499           pcCU->getCUMvField( REF_PIC_LIST_1 )->setAllRefIdx( 0, SIZE_2Nx2N, uiAbsPartIdx, uiDepth );
    500         }
    501       }
    502     }
     462    pcCU->setMergeFlagSubParts( true , uiAbsPartIdx, 0, uiDepth );
    503463  }
    504464}
    505465
  • source/Lib/TLibEncoder/TEncCavlc.cpp

    diff --git a/source/Lib/TLibEncoder/TEncCavlc.cpp b/source/Lib/TLibEncoder/TEncCavlc.cpp
    index b5537fc..2c9227f 100644
    a b Void TEncCavlc::codeSPS( TComSPS* pcSPS ) 
    403403  xWriteUvlc  ( pcSPS->getPad (0) );
    404404  xWriteUvlc  ( pcSPS->getPad (1) );
    405405
    406   // Tools
    407   xWriteFlag  ( (pcSPS->getUseMRG ()) ? 1 : 0 ); // SOPH:
    408  
    409406  // AMVP mode for each depth
    410407  for (Int i = 0; i < pcSPS->getMaxCUDepth(); i++)
    411408  {
  • source/Lib/TLibEncoder/TEncCfg.h

    diff --git a/source/Lib/TLibEncoder/TEncCfg.h b/source/Lib/TLibEncoder/TEncCfg.h
    index d1e5e4e..f088b13 100644
    a b protected: 
    175175  Bool      m_bUseFastEnc;
    176176  Bool      m_bUseEarlyCU;
    177177  Bool      m_bUseCbfFastMode;
    178   Bool      m_bUseMRG; // SOPH:
    179178  Bool      m_bUseLMChroma;
    180179
    181180  Int*      m_aidQP;
    public: 
    368367  Void      setUseFastEnc                   ( Bool  b )     { m_bUseFastEnc = b; }
    369368  Void      setUseEarlyCU                   ( Bool  b )     { m_bUseEarlyCU = b; }
    370369  Void      setUseCbfFastMode            ( Bool  b )     { m_bUseCbfFastMode = b; }
    371   Void      setUseMRG                       ( Bool  b )     { m_bUseMRG     = b; } // SOPH:
    372370  Void      setUseConstrainedIntraPred      ( Bool  b )     { m_bUseConstrainedIntraPred = b; }
    373371  Void      setPCMInputBitDepthFlag         ( Bool  b )     { m_bPCMInputBitDepthFlag = b; }
    374372  Void      setPCMFilterDisableFlag         ( Bool  b )     {  m_bPCMFilterDisableFlag = b; }
    public: 
    394392  Bool      getUseFastEnc                   ()      { return m_bUseFastEnc; }
    395393  Bool      getUseEarlyCU                   ()      { return m_bUseEarlyCU; }
    396394  Bool      getUseCbfFastMode           ()      { return m_bUseCbfFastMode; }
    397   Bool      getUseMRG                       ()      { return m_bUseMRG;     } // SOPH:
    398395  Bool      getUseConstrainedIntraPred      ()      { return m_bUseConstrainedIntraPred; }
    399396#if NS_HAD
    400397  Bool      getUseNSQT                      ()      { return m_useNSQT; }
  • source/Lib/TLibEncoder/TEncCu.cpp

    diff --git a/source/Lib/TLibEncoder/TEncCu.cpp b/source/Lib/TLibEncoder/TEncCu.cpp
    index 2f93d12..5fd6af7 100644
    a b Void TEncCu::xCompressCU( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UInt u 
    450450      {
    451451        // SKIP
    452452
    453         if( pcPic->getSlice(0)->getSPS()->getUseMRG() )
    454         {
    455           xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU );
    456           rpcTempCU->initEstData( uiDepth, iQP );
    457         }
    458         else
    459         {
    460           xCheckRDCostAMVPSkip ( rpcBestCU, rpcTempCU );
    461           rpcTempCU->initEstData( uiDepth, iQP );
    462         }
     453        xCheckRDCostMerge2Nx2N( rpcBestCU, rpcTempCU );
     454        rpcTempCU->initEstData( uiDepth, iQP );
    463455
    464456        // fast encoder decision for early skip
    465457        if ( m_pcEncCfg->getUseFastEnc() )
    Void TEncCu::xEncodeCU( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 
    11161108 
    11171109  if( pcCU->isSkipped( uiAbsPartIdx ) )
    11181110  {
    1119     if ( pcCU->getSlice()->getSPS()->getUseMRG() )
    1120     {
    1121       m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 );
    1122     }
    1123     else
    1124     {
    1125       for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
    1126       {       
    1127         if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
    1128         {
    1129           m_pcEntropyCoder->encodeMVPIdxPU( pcCU, uiAbsPartIdx, RefPicList( uiRefListIdx ));
    1130         }
    1131       }
    1132     }
     1111    m_pcEntropyCoder->encodeMergeIndex( pcCU, uiAbsPartIdx, 0 );
    11331112    finishCU(pcCU,uiAbsPartIdx,uiDepth);
     1113
    11341114    return;
    11351115  }
    11361116  m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx );
  • source/Lib/TLibEncoder/TEncEntropy.cpp

    diff --git a/source/Lib/TLibEncoder/TEncEntropy.cpp b/source/Lib/TLibEncoder/TEncEntropy.cpp
    index 5e9e6bd..1d5ed0a 100644
    a b Void TEncEntropy::encodePUWise( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 
    744744
    745745  for ( UInt uiPartIdx = 0, uiSubPartIdx = uiAbsPartIdx; uiPartIdx < uiNumPU; uiPartIdx++, uiSubPartIdx += uiPUOffset )
    746746  {
    747     if ( pcCU->getSlice()->getSPS()->getUseMRG() )
    748     {
    749       {
    750         encodeMergeFlag( pcCU, uiSubPartIdx, uiPartIdx );
    751       }
    752     }
     747    encodeMergeFlag( pcCU, uiSubPartIdx, uiPartIdx );
    753748    if ( pcCU->getMergeFlag( uiSubPartIdx ) )
    754749    {
    755750      encodeMergeIndex( pcCU, uiSubPartIdx, uiPartIdx );
  • source/Lib/TLibEncoder/TEncSearch.cpp

    diff --git a/source/Lib/TLibEncoder/TEncSearch.cpp b/source/Lib/TLibEncoder/TEncSearch.cpp
    index 16f694f..4fce867 100644
    a b Void TEncSearch::predInterSearch( TComDataCU* pcCU, TComYuv* pcOrgYuv, TComYuv*& 
    28262826    } // end if bTestNormalMC
    28272827#endif
    28282828
    2829     if ( pcCU->getSlice()->getSPS()->getUseMRG() && pcCU->getPartitionSize( uiPartAddr ) != SIZE_2Nx2N )
     2829    if ( pcCU->getPartitionSize( uiPartAddr ) != SIZE_2Nx2N )
    28302830    {
    28312831      UInt uiMRGInterDir = 0;     
    28322832      TComMvField cMRGMvField[2];
    Void TEncSearch::encodeResAndCalcRdInterCU( TComDataCU* pcCU, TComYuv* pcYuvOrg, 
    36793679   
    36803680    m_pcEntropyCoder->resetBits();
    36813681    m_pcEntropyCoder->encodeSkipFlag(pcCU, 0, true);
    3682     if ( pcCU->getSlice()->getSPS()->getUseMRG() )
    3683     {
    3684       m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, 0, true );
    3685     }
    3686     else
    3687     {
    3688       for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
    3689       {
    3690         if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
    3691         {
    3692           m_pcEntropyCoder->encodeMVPIdxPU( pcCU, 0, RefPicList( uiRefListIdx ));
    3693         }
    3694       }
    3695     }
     3682    m_pcEntropyCoder->encodeMergeIndex( pcCU, 0, 0, true );
    36963683   
    36973684    uiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
    36983685    pcCU->getTotalBits()       = uiBits;
    Void TEncSearch::xAddSymbolBitsInter( TComDataCU* pcCU, UInt uiQp, UInt uiTrMod 
    48444831    ruiBits = m_pcEntropyCoder->getNumberOfWrittenBits();
    48454832   
    48464833    m_pcEntropyCoder->resetBits();
    4847     if ( pcCU->getSlice()->getSPS()->getUseMRG() )
    4848     {
    4849       m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, 0, true);
    4850     }
    4851     else
    4852     {
    4853       for ( UInt uiRefListIdx = 0; uiRefListIdx < 2; uiRefListIdx++ )
    4854       {       
    4855         if ( pcCU->getSlice()->getNumRefIdx( RefPicList( uiRefListIdx ) ) > 0 )
    4856         {
    4857           m_pcEntropyCoder->encodeMVPIdxPU( pcCU, 0, RefPicList( uiRefListIdx ));
    4858         }
    4859       }
    4860     }
     4834    m_pcEntropyCoder->encodeMergeIndex(pcCU, 0, 0, true);
    48614835    ruiBits += m_pcEntropyCoder->getNumberOfWrittenBits();
    48624836  }
    48634837  else
  • source/Lib/TLibEncoder/TEncTop.cpp

    diff --git a/source/Lib/TLibEncoder/TEncTop.cpp b/source/Lib/TLibEncoder/TEncTop.cpp
    index 27a5e10..dfe9de9 100644
    a b Void TEncTop::xInitSPS() 
    468468 
    469469  m_cSPS.setUsePAD        ( m_bUsePAD           );
    470470 
    471   m_cSPS.setUseMRG        ( m_bUseMRG           ); // SOPH:
    472 
    473471  m_cSPS.setUseLMChroma   ( m_bUseLMChroma           ); 
    474472 
    475473  m_cSPS.setMaxTrSize   ( 1 << m_uiQuadtreeTULog2MaxSize );