设为首页 加入收藏

TOP

HEVC帧间预测之一――TComDataCU::getInterMergeCandidates函数分析(五)
2014-11-24 07:27:15 】 浏览:414
Tags:HEVC 预测 之一 TComDataCU::getInterMergeCandidates 函数分析
UInt uiPriorityList0[12] = {0 , 1, 0, 2, 1, 2, 0, 3, 1, 3, 2, 3};
UInt uiPriorityList1[12] = {1 , 0, 2, 0, 2, 1, 3, 0, 3, 1, 3, 2};
for (Int idx=0; idxgetMaxNumMergeCand(); idx++)
{
Int i = uiPriorityList0[idx]; Int j = uiPriorityList1[idx];
if (abCandIsInter[i] && abCandIsInter[j]&& (puhInterDirNeighbours[i]&0x1)&&(puhInterDirNeighbours[j]&0x2))
{
abCandIsInter[uiArrayAddr] = true;
puhInterDirNeighbours[uiArrayAddr] = 3;
// get Mv from cand[i] and cand[j]
pcMvFieldNeighbours[uiArrayAddr << 1].setMvField(pcMvFieldNeighbours[i<<1].getMv(), pcMvFieldNeighbours[i<<1].getRefIdx());
pcMvFieldNeighbours[( uiArrayAddr << 1 ) + 1].setMvField(pcMvFieldNeighbours[(j<<1)+1].getMv(), pcMvFieldNeighbours[(j<<1)+1].getRefIdx());
Int iRefPOCL0 = m_pcSlice->getRefPOC( REF_PIC_LIST_0, pcMvFieldNeighbours[(uiArrayAddr<<1)].getRefIdx() );
Int iRefPOCL1 = m_pcSlice->getRefPOC( REF_PIC_LIST_1, pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getRefIdx() );
if (iRefPOCL0 == iRefPOCL1 && pcMvFieldNeighbours[(uiArrayAddr<<1)].getMv() == pcMvFieldNeighbours[(uiArrayAddr<<1)+1].getMv())
{
abCandIsInter[uiArrayAddr] = false;
}
else
{
uiArrayAddr++;
}
}
}
}
// early termination
if (uiArrayAddr == getSlice()->getMaxNumMergeCand())
{
return;
}
//! 当可用的merge candidates数目仍小于预设值时,将余量均设置为零运动矢量
Int iNumRefIdx = (getSlice()->isInterB()) min(m_pcSlice->getNumRefIdx(REF_PIC_LIST_0), m_pcSlice->getNumRefIdx(REF_PIC_LIST_1)) : m_pcSlice->getNumRefIdx(REF_PIC_LIST_0);
Int r = 0;
Int refcnt = 0;
while (uiArrayAddr < getSlice()->getMaxNumMergeCand())
{
abCandIsInter[uiArrayAddr] = true;
puhInterDirNeighbours[uiArrayAddr] = 1;
pcMvFieldNeighbours[uiArrayAddr << 1].setMvField( TComMv(0, 0), r); //!< 设置为零运动矢量
if ( getSlice()->isInterB() )
{
puhInterDirNeighbours[uiArrayAddr] = 3;
pcMvFieldNeighbours[(uiArrayAddr << 1) + 1].setMvField(TComMv(0, 0), r);
} www.2cto.com
uiArrayAddr++;
if ( refcnt == iNumRefIdx - 1 ) //!< 达到参考帧列表的参考帧数
{
r = 0;
}
else
{
++r;
++refcnt;
}
}
numValidMergeCand = uiArrayAddr;
}
首页 上一页 2 3 4 5 下一页 尾页 5/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇输出对应的那一天是这一年的第几.. 下一篇合并有序链表

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目