HMVP是一种merge列表构建过程中merge候选产生的一种方法。
HMVP在Slice类中维护一个HMVP列表m_MotionCandLut,其中存储一帧中一行ctu已编码cu的运动信息。
struct LutMotionCand
{
MotionInfo* motionCand; //存储一帧中一行ctu已编码cu的运动信息,编码新一行ctu时重置
int currCnt; //HMVP列表长度
};
class Slice
{
public:
//.....
LutMotionCand* m_MotionCandLut; //Slice类中维护一个HMVP列表m_MotionCandLut
int getAvailableLUTMrgNum() const {
return m_MotionCandLut->currCnt; } //HMVP列表长度
LutMotionCand* getMotionLUTs() {
return m_MotionCandLut; }
}
void Slice::initMotionLUTs() //HMVP列表初始化
{
m_MotionCandLut = new LutMotionCand;
m_MotionCandLut->currCnt = 0;
m_MotionCandLut->motionCand = nullptr;
m_MotionCandLut->motionCand = new MotionInfo[MAX_NUM_HMVP_CANDS];
}
void Slice::destroyMotionLUTs() //destroy HMVP列表
{
delete[] m_MotionCandLut->motionCand;
m_MotionCandLut->motionCand = nullptr;
delete m_MotionCandLut;
m_MotionCandLut = NULL;
}
void Slice::resetMotionLUTs() //重置HMVP列表
{
m_MotionCandLut->currCnt = 0;
}
//从HMVP列表中get MVP信息
MotionInfo Slice::getMotionInfoFromLUTs(int MotCandIdx)