Ticket #703: max_num_merge_cand.patch

File max_num_merge_cand.patch, 8.4 KB (added by bheng, 12 years ago)
  • App/TAppEncoder/TAppEncCfg.cpp

     
    308308    ("ScalingList",                 m_useScalingListId,              0,          "0: no scaling list, 1: default scaling lists, 2: scaling lists specified in ScalingListFile")
    309309    ("ScalingListFile",             cfg_ScalingListFile,             string(""), "Scaling list file name")
    310310    ("SignHideFlag,-SBH",                m_signHideFlag, 1)
     311    ("MaxNumMergeCand",             m_uiMaxNumMergeCand,             5u,         "Maximum number of merge candidates")
     312
    311313  /* Misc. */
    312314  ("SEIpictureDigest", m_pictureDigestEnabled, 0, "Control generation of picture_digest SEI messages\n"
    313315                                              "\t3: checksum\n"
     
    546548  xConfirmPara( m_uiQuadtreeTUMaxDepthIntra < 1,                                                         "QuadtreeTUMaxDepthIntra must be greater than or equal to 1" );
    547549  xConfirmPara( m_uiQuadtreeTUMaxDepthIntra > m_uiQuadtreeTULog2MaxSize - m_uiQuadtreeTULog2MinSize + 1, "QuadtreeTUMaxDepthIntra must be less than or equal to the difference between QuadtreeTULog2MaxSize and QuadtreeTULog2MinSize plus 1" );
    548550
     551  xConfirmPara(  m_uiMaxNumMergeCand < 1,  "MaxNumMergeCand must be 1 or greater.");
     552  xConfirmPara(  m_uiMaxNumMergeCand > 5,  "MaxNumMergeCand must be 5 or smaller.");
     553
    549554#if ADAPTIVE_QP_SELECTION
    550555  xConfirmPara( m_bUseAdaptQpSelect == true && m_iQP < 0,                                              "AdaptiveQpSelection must be disabled when QP < 0.");
    551556  xConfirmPara( m_bUseAdaptQpSelect == true && (m_cbQpOffset !=0 || m_crQpOffset != 0 ),               "AdaptiveQpSelection must be disabled when ChromaQpOffset is not equal to 0.");
     
    10021007    printf("TargetBitrate                : %d\n", m_targetBitrate);
    10031008    printf("NumLCUInUnit                 : %d\n", m_numLCUInUnit);
    10041009  }
     1010  printf("Max Num Merge Candidates     : %d\n", m_uiMaxNumMergeCand);
    10051011  printf("\n");
    10061012 
    10071013  printf("TOOL CFG: ");
  • App/TAppEncoder/TAppEncCfg.h

     
    200200  Bool      m_useWeightedBiPred;                                    ///< Use of Bi-Directional Weighting Prediction (B_SLICE)
    201201 
    202202  UInt      m_log2ParallelMergeLevel;                 ///< Parallel merge estimation region
     203  UInt      m_uiMaxNumMergeCand;                      ///< Max number of merge candidates
    203204
    204205  Int       m_TMVPModeId;
    205206  Int       m_signHideFlag;
  • App/TAppEncoder/TAppEncTop.cpp

     
    179179  m_cTEncTop.setPCMLog2MinSize          ( m_uiPCMLog2MinSize);
    180180  m_cTEncTop.setUsePCM                       ( m_usePCM );
    181181  m_cTEncTop.setPCMLog2MaxSize               ( m_pcmLog2MaxSize);
     182  m_cTEncTop.setMaxNumMergeCand              ( m_uiMaxNumMergeCand );
     183 
    182184
    183185  //====== Weighted Prediction ========
    184186  m_cTEncTop.setUseWP                   ( m_bUseWeightPred      );
  • Lib/TLibCommon/TComDataCU.cpp

     
    30903090      ++refcnt;
    30913091    }
    30923092  }
    3093   if (uiArrayAddr > MRG_MAX_NUM_CANDS_SIGNALED)
     3093  if (uiArrayAddr > getSlice()->getMaxNumMergeCand())
    30943094  {
    3095     uiArrayAddr = MRG_MAX_NUM_CANDS_SIGNALED;
     3095    uiArrayAddr = getSlice()->getMaxNumMergeCand();
    30963096  }
    30973097  numValidMergeCand = uiArrayAddr;
    30983098}
  • Lib/TLibCommon/TComSlice.cpp

     
    201201
    202202  m_aiNumRefIdx[REF_PIC_LIST_C]      = 0;
    203203
    204   m_uiMaxNumMergeCand = MRG_MAX_NUM_CANDS_SIGNALED;
     204  m_uiMaxNumMergeCand = 5;
    205205
    206206  m_bFinalized=false;
    207207
  • Lib/TLibCommon/TypeDef.h

     
    140140#define MAX_NUM_PPS                256
    141141#define MAX_NUM_APS                32         //< !!!KS: number not defined in WD yet
    142142
    143 #define MRG_MAX_NUM_CANDS_SIGNALED         5   //<G091: value of maxNumMergeCand signaled in slice header
    144143
    145144#define WEIGHTED_CHROMA_DISTORTION  1   ///< F386: weighting of chroma for RDO
    146145#define RDOQ_CHROMA_LAMBDA          1   ///< F386: weighting of chroma for RDOQ
  • Lib/TLibDecoder/TDecCAVLC.cpp

     
    13521352
    13531353  READ_UVLC( uiCode, "5_minus_max_num_merge_cand");
    13541354  rpcSlice->setMaxNumMergeCand(MRG_MAX_NUM_CANDS - uiCode);
    1355   assert(rpcSlice->getMaxNumMergeCand()==MRG_MAX_NUM_CANDS_SIGNALED);
    13561355
    13571356  if (!bDependentSlice)
    13581357  {
  • Lib/TLibEncoder/TEncCavlc.cpp

     
    919919
    920920  // !!!! sytnax elements not in the WD !!!!
    921921 
    922   assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS_SIGNALED);
    923   assert(MRG_MAX_NUM_CANDS_SIGNALED<=MRG_MAX_NUM_CANDS);
     922  assert(pcSlice->getMaxNumMergeCand()<=MRG_MAX_NUM_CANDS);
    924923  WRITE_UVLC(MRG_MAX_NUM_CANDS - pcSlice->getMaxNumMergeCand(), "maxNumMergeCand");
    925924
    926925#if !REMOVE_ALF
  • Lib/TLibEncoder/TEncCfg.h

     
    239239  Bool      m_bUseWeightPred;       //< Use of Weighting Prediction (P_SLICE)
    240240  Bool      m_useWeightedBiPred;    //< Use of Bi-directional Weighting Prediction (B_SLICE)
    241241  UInt      m_log2ParallelMergeLevelMinus2;       // Parallel merge estimation region
     242  UInt      m_uiMaxNumMergeCand;                  ///< Maximum number of merge candidates
    242243  Int       m_useScalingListId;            ///< Using quantization matrix i.e. 0=off, 1=default, 2=file.
    243244  char*     m_scalingListFile;          ///< quantization matrix file name
    244245  Int       m_TMVPModeId;
     
    559560  Bool      getWPBiPred            ()            { return m_useWeightedBiPred; }
    560561  Void      setLog2ParallelMergeLevelMinus2   ( UInt u )    { m_log2ParallelMergeLevelMinus2       = u;    }
    561562  UInt      getLog2ParallelMergeLevelMinus2   ()            { return m_log2ParallelMergeLevelMinus2;       }
     563  Void      setMaxNumMergeCand              ( UInt u )      { m_uiMaxNumMergeCand = u;      }
     564  UInt      getMaxNumMergeCand              ()      { return m_uiMaxNumMergeCand;  }
    562565  Void      setUseScalingListId    ( Int  u )    { m_useScalingListId       = u;   }
    563566  Int       getUseScalingListId    ()            { return m_useScalingListId;      }
    564567  Void      setScalingListFile     ( char*  pch ){ m_scalingListFile     = pch; }
  • Lib/TLibEncoder/TEncSearch.cpp

     
    31283128
    31293129      xGetInterPredictionError( pcCU, pcYuvOrg, iPUIdx, uiCostCand, m_pcEncCfg->getUseHADME() );
    31303130      uiBitsCand = uiMergeCand + 1;
    3131       if (uiMergeCand == MRG_MAX_NUM_CANDS_SIGNALED -1)
     3131      if (uiMergeCand == m_pcEncCfg->getMaxNumMergeCand() -1)
    31323132      {
    31333133         uiBitsCand--;
    31343134      }
  • Lib/TLibEncoder/TEncSlice.cpp

     
    402402  rpcSlice->setSliceArgument        ( m_pcCfg->getSliceArgument()        );
    403403  rpcSlice->setDependentSliceMode     ( m_pcCfg->getDependentSliceMode()     );
    404404  rpcSlice->setDependentSliceArgument ( m_pcCfg->getDependentSliceArgument() );
    405   rpcSlice->setMaxNumMergeCand      (MRG_MAX_NUM_CANDS_SIGNALED);
     405  rpcSlice->setMaxNumMergeCand      ( m_pcCfg->getMaxNumMergeCand() );
    406406  xStoreWPparam( pPPS->getUseWP(), pPPS->getWPBiPred() );
    407407}
    408408