📄 umc_h264_mc.cpp
字号:
futr_frame = pRefPicList1[block_ref]->m_pYPlane + uOffset
+ curr_slice->m_InitialOffset[pFields1[block_ref]];
pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, pitchPixels, iXType, iYType);
// interpolate copy the 8x16 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels,pDst, 16, iXType, iYType, size8x16, pMVBwd->mvy, uMBy, 0);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pDst, sizeof(PixType)*16, iXType, iYType, size8x16, m_PicParamSet.bit_depth_luma);
#endif
// Copy the stored 2nd 8x16 prediction data from the BiPred Mode Buffer
pBiPred = curr_slice->m_pPred4BiPred + 8;
pMCDst = pDst + 8;
for (uRow=0; uRow<16; uRow++) {
memcpy(pMCDst, pBiPred, 8*sizeof(PixType));
pMCDst += DEST_PITCH;
pBiPred += 16;
}
break;
case MBTYPE_INTER_8x8_REF0:
case MBTYPE_INTER_8x8:
case MBTYPE_B_8x8:
{
Ipp32s ref_off = 0;
Ipp32s sb_pos = 0;
// 4 8x8 blocks
for (uBlock=0; uBlock < 4; uBlock++)
{
block_ref = pRefIdxL0[ref_off];
prev_frame = block_ref >= 0 ? pRefPicList0[block_ref]->m_pYPlane + uOffset
+ curr_slice->m_InitialOffset[pFields0[block_ref]]: 0;
block_ref = pRefIdxL1[ref_off];
futr_frame = block_ref >= 0 ? pRefPicList1[block_ref] ?
pRefPicList1[block_ref]->m_pYPlane + uOffset
+ curr_slice->m_InitialOffset[pFields1[block_ref]]: 0 : 0;
switch (cur_mb.GlobalMacroblockInfo->sbtype[uBlock])
{
case SBTYPE_8x8:
case SBTYPE_FORWARD_8x8:
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, pitchPixels, iXType, iYType);
// interpolate copy the 8x8 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels,pDst, 16, iXType, iYType, size8x8, pMVFwd->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pDst, sizeof(PixType)*16, iXType, iYType, size8x8, m_PicParamSet.bit_depth_luma);
#endif
break;
case SBTYPE_BACKWARD_8x8:
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, pitchPixels, iXType, iYType);
// interpolate copy the 8x8 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels,pDst, 16, iXType, iYType, size8x8, pMVBwd->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pDst, sizeof(PixType)*16, iXType, iYType, size8x8, m_PicParamSet.bit_depth_luma);
#endif
break;
case SBTYPE_8x4:
case SBTYPE_FORWARD_8x4:
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, pitchPixels, iXType, iYType);
// interpolate copy the first 8x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels,pDst, 16, iXType, iYType, size8x4, pMVFwd->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pDst, sizeof(PixType)*16, iXType, iYType, size8x4, m_PicParamSet.bit_depth_luma);
#endif
// Update MV, Ref & Dst pointers for block 1
pMCMV = pMVFwd + 4;
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = prev_frame + pitchPixels*4 + SubpelMVAdjust(pMCMV, pitchPixels, iXType, iYType);
pMCDst = pDst + DEST_PITCH*4;
// interpolate copy the second 8x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels,pMCDst, 16, iXType, iYType, size8x4, pMCMV->mvy, uMBy, sb_pos + 4);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pMCDst, sizeof(PixType)*16, iXType, iYType, size8x4, m_PicParamSet.bit_depth_luma);
#endif
break;
case SBTYPE_BACKWARD_8x4:
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, pitchPixels, iXType, iYType);
// interpolate copy the first 8x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pDst, 16, iXType, iYType, size8x4, pMVBwd->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType), pDst, sizeof(PixType)*16, iXType, iYType, size8x4, m_PicParamSet.bit_depth_luma);
#endif
// Update MV, Ref & Dst pointers for block 1
pMCMV = pMVBwd + 4;
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = futr_frame + pitchPixels*4 + SubpelMVAdjust(pMCMV, pitchPixels, iXType, iYType);
pMCDst = pDst + DEST_PITCH*4;
// interpolate copy the second 8x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pMCDst, 16, iXType, iYType, size8x4, pMCMV->mvy, uMBy, sb_pos + 4);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType), pMCDst, sizeof(PixType)*16, iXType, iYType, size8x4, m_PicParamSet.bit_depth_luma);
#endif
break;
case SBTYPE_4x8:
case SBTYPE_FORWARD_4x8:
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, pitchPixels, iXType, iYType);
// interpolate copy the first 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pDst, 16, iXType, iYType, size4x8, pMVFwd->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType), pDst, sizeof(PixType)*16, iXType, iYType, size4x8, m_PicParamSet.bit_depth_luma);
#endif
// Update MV, Ref & Dst pointers for block 1
pMCMV = pMVFwd + 1;
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = prev_frame + 4 + SubpelMVAdjust(pMCMV, pitchPixels, iXType, iYType);
pMCDst = pDst + 4;
// interpolate copy the second 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pMCDst, 16, iXType, iYType, size4x8, pMCMV->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pMCDst, sizeof(PixType)*16, iXType, iYType, size4x8, m_PicParamSet.bit_depth_luma);
#endif
break;
case SBTYPE_BACKWARD_4x8:
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, pitchPixels, iXType, iYType);
// interpolate copy the first 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pDst, 16, iXType, iYType, size4x8, pMVBwd->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType), pDst, sizeof(PixType)*16, iXType, iYType, size4x8, m_PicParamSet.bit_depth_luma);
#endif
// Update MV, Ref & Dst pointers for block 1
pMCMV = pMVBwd + 1;
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = futr_frame + 4 + SubpelMVAdjust(pMCMV, pitchPixels, iXType, iYType);
pMCDst = pDst + 4;
// interpolate copy the second 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pMCDst, 16, iXType, iYType, size4x8, pMCMV->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pMCDst, sizeof(PixType)*16, iXType, iYType, size4x8, m_PicParamSet.bit_depth_luma);
#endif
break;
case SBTYPE_4x4:
case SBTYPE_FORWARD_4x4:
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, pitchPixels, iXType, iYType);
// interpolate copy the first 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pDst, 16, iXType, iYType, size4x4, pMVFwd->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pDst, sizeof(PixType)*16, iXType, iYType, size4x4, m_PicParamSet.bit_depth_luma);
#endif
// Update MV, Ref & Dst pointers for block 1
pMCMV = pMVFwd + 1;
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = prev_frame + 4 + SubpelMVAdjust(pMCMV, pitchPixels, iXType, iYType);
pMCDst = pDst + 4;
// interpolate copy the second 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pMCDst, 16, iXType, iYType, size4x4, pMCMV->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pMCDst, sizeof(PixType)*16, iXType, iYType, size4x4, m_PicParamSet.bit_depth_luma);
#endif
// Update MV, Ref & Dst pointers for block 2
pMCMV = pMVFwd + 4;
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = prev_frame + pitchPixels*4 + SubpelMVAdjust(pMCMV, pitchPixels, iXType, iYType);
pMCDst = pDst + DEST_PITCH*4;
// interpolate copy the third 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pMCDst, 16, iXType, iYType, size4x4, pMCMV->mvy, uMBy, sb_pos + 2);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pMCDst, sizeof(PixType)*16, iXType, iYType, size4x4, m_PicParamSet.bit_depth_luma);
#endif
// Update MV, Ref & Dst pointers for block 3
pMCMV = pMVFwd + 4 + 1;
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = prev_frame + pitchPixels*4 + 4 + SubpelMVAdjust(pMCMV, pitchPixels, iXType, iYType);
pMCDst = pDst + DEST_PITCH*4 + 4;
// interpolate copy the fourth 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pMCDst, 16, iXType, iYType, size4x4, pMCMV->mvy, uMBy, sb_pos + 2);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pMCDst, sizeof(PixType)*16, iXType, iYType, size4x4, m_PicParamSet.bit_depth_luma);
#endif
break;
case SBTYPE_BACKWARD_4x4:
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, pitchPixels, iXType, iYType);
// interpolate copy the first 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pDst, 16, iXType, iYType, size4x4, pMVBwd->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pDst, sizeof(PixType)*16, iXType, iYType, size4x4, m_PicParamSet.bit_depth_luma);
#endif
// Update MV, Ref & Dst pointers for block 1
pMCMV = pMVBwd + 1;
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = futr_frame + 4 + SubpelMVAdjust(pMCMV, pitchPixels, iXType, iYType);
pMCDst = pDst + 4;
// interpolate copy the second 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pMCDst, 16, iXType, iYType, size4x4, pMCMV->mvy, uMBy, sb_pos);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pMCDst, sizeof(PixType)*16, iXType, iYType, size4x4, m_PicParamSet.bit_depth_luma);
#endif
// Update MV, Ref & Dst pointers for block 2
pMCMV = pMVBwd + 4;
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = futr_frame + pitchPixels*4 + SubpelMVAdjust(pMCMV, pitchPixels, iXType, iYType);
pMCDst = pDst + DEST_PITCH*4;
// interpolate copy the third 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pMCDst, 16, iXType, iYType, size4x4, pMCMV->mvy, uMBy, sb_pos + 2);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pMCDst, sizeof(PixType)*16, iXType, iYType, size4x4, m_PicParamSet.bit_depth_luma);
#endif
// Update MV, Ref & Dst pointers for block 3
pMCMV = pMVBwd + 4 + 1;
// convert 1/4 pel vector to pel vector and interpolation type
pMCRef = futr_frame + pitchPixels*4 + 4 + SubpelMVAdjust(pMCMV, pitchPixels, iXType, iYType);
pMCDst = pDst + DEST_PITCH*4 + 4;
// interpolate copy the fourth 4x4 block
#ifdef NEW_INTERPOLATE
Interpolate(mb_decoding_flag, pMCRef, pitchPixels, pMCDst, 16, iXType, iYType, size4x4, pMCMV->mvy, uMBy, sb_pos + 2);
#else
ippiInterpolateLuma_H264(pMCRef, pitchPixels*sizeof(PixType),pMCDst, sizeof(PixType)*16, iXType, iYType, size4x4, m_PicParamSet.bit_depth_luma);
#endif
break;
case SBTYPE_BIDIR_8x8:
case SBTYPE_BIDIR_8x4:
case SBTYPE_BIDIR_4x8:
case SBTYPE_BIDIR_4x4: {
// Copy the stored 8x8 prediction data from the BiPred Mode Buffer
Ipp32u uRow;
PixType* pBiPred = curr_slice->m_pPred4BiPred + (uBlock&1)*8 + (uBlock&2)*16*4;
pMCDst = pDst;
for (uRow=0; uRow<8; uRow++) {
memcpy(pMCDst, pBiPred, 8*sizeof(PixType));
pMCDst += DEST_PITCH;
pBiPred += 16;
}
}
break;
case SBTYPE_DIRECT: {
// Copy the stored 8x8 prediction data from the Direct Mode Buffer
Ipp32u uRow;
PixType* pDirect = curr_slice->m_pPred4DirectB + (uBlock&1)*8 + (uBlock&2)*16*4;
pMCDst = pDst;
for (uRow=0; uRow<8; uRow++) {
memcpy(pMCDst, pDirect, 8*sizeof(PixType));
pMCDst += DEST_PITCH;
pDirect += 16;
}
}
break;
default:
break;
}
// advance MV pointers and source ptrs to next 8x8 block
if (1 == uBlock)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -