TComDataCU::getInterMergeCandidates函数用于得到Merge模式的候选列表。Merge模式的候选列表最多为5个,且默认为5个:
software-manual可以设置参数:MaxNumMergeCand 5 Specifies the maximum number of merge candidates to use.
CommonDef.h中的最大值:
static const Int MRG_MAX_NUM_CANDS = 5; ///< MERGE
其中最多4个空域候选,一个时域候选。时域候选在software-manual开关为:
TMVPMode 1 Controls the temporal motion vector prediction mode.
TMVPMode的取值及其含义:
0 Disabled for all slices.
1 Enabled for all slices.
2 Disabled only for the first picture of each GOPSize.
此开关在TAppEncCfg::parseCfg函数中的对应代码为:
("TMVPMode", m_TMVPModeId, 1, "TMVP mode 0: TMVP disable for all slices. 1: TMVP enable for all slices (default) 2: TMVP enable for certain slices only")
而AMVP技术的候选列表长度为2,在software-manual没有对应的参数:
CommonDef.h中的最大值:
static const Int AMVP_MAX_NUM_CANDS = 2; ///< AMVP: advanced motion vector prediction - max number of final candidates
在JEM中,MRG_MAX_NUM_CANDS的值是7:
#if COM16_C806_VCEG_AZ10_SUB_PU_TMVP
printf("Max Num Merge Candidates : %d\n", m_maxNumMergeCand+(m_useAtmvpFlag? 2:0 ));
#else
printf("Max Num Merge Candidates : %d\n", m_maxNumMergeCand);
#endif
#if COM16_C806_VCEG_AZ10_SUB_PU_TMVP
static const Int MRG_MAX_NUM_CANDS = 7; ///< MERGE
#else
static const Int MRG_MAX_NUM_CANDS = 5; ///< MERGE
#endif
关于InterDir:若使用了list0,LSB置为1;若使用了list1,倒数第二位置为1。
相关功能在HM/JEM的TComDataCU::getInterMergeCandidates函数中实现