📄 umc_h264_dec_reconstruct_mb_aff.cpp
字号:
(Ipp8s)m_CurSliceHeader.num_ref_idx_l1_active<<mb_field_decoding_flag); if (mb_field_decoding_flag) { RefField=bottom_mb^(RefIndexL1&1); RefIndexL1>>=1; } else { RefField=0; } pRefYPlane = pRefPicList1[RefIndexL1]->m_pYPlane+RefField*pitch; pRefVPlane = pRefPicList1[RefIndexL1]->m_pVPlane+RefField*pitch; pRefUPlane = pRefPicList1[RefIndexL1]->m_pUPlane+RefField*pitch; ref_pic_struct = pRefPicList1[RefIndexL1]->m_PictureStructureForDec; VM_ASSERT(pRefYPlane); VM_ASSERT(pRefVPlane); VM_ASSERT(pRefUPlane); pMV = pMVBwd; } else { pRefIndex = pRefIndexL0 + (xpos>>2) + (ypos>>2)*4; RefIndexL0 = *pRefIndex; VM_ASSERT(RefIndexL0 >= 0 && RefIndexL0 < (Ipp8s)m_CurSliceHeader.num_ref_idx_l0_active<<mb_field_decoding_flag); if (mb_field_decoding_flag) { RefField=bottom_mb^(RefIndexL0&1); RefIndexL0>>=1; } else { RefField=0; } pRefYPlane = pRefPicList0[RefIndexL0]->m_pYPlane+RefField*pitch; pRefVPlane = pRefPicList0[RefIndexL0]->m_pVPlane+RefField*pitch; pRefUPlane = pRefPicList0[RefIndexL0]->m_pUPlane+RefField*pitch; ref_pic_struct = pRefPicList0[RefIndexL0]->m_PictureStructureForDec; VM_ASSERT(pRefYPlane); VM_ASSERT(pRefVPlane); VM_ASSERT(pRefUPlane); pMV = pMVFwd; } // set pointers for this subblock pMV_sb = pMV + (xpos>>2) + (ypos>>2)*4; mvx = pMV_sb->mvx; mvy = pMV_sb->mvy; /* if (mb_field_decoding_flag && bottom_mb) { pRefYPlane-=16*pitch; pRefVPlane-=8*pitch; pRefUPlane-=8*pitch; }*/ offsetToBlock = xpos + ypos*(pitch<<mb_field_decoding_flag); pDstY_sb = pDstY + offsetToBlock; pRefY_sb = pRefYPlane + offsetToBlock; pDstV_sb = pDstV + (offsetToBlock>>1); pRefV_sb = pRefVPlane + (offsetToBlock>>1); pDstU_sb = pDstU + (offsetToBlock>>1); pRefU_sb = pRefUPlane + (offsetToBlock>>1); if (i > 0) { // advance Dst ptrs to next MB position, used as temp store // for backward prediction. This is always OK because the Dst // buffer is padded at the edges. pDstY_sb += 16; pDstV_sb += 8; pDstU_sb += 8; } xh = mvx & (INTERP_FACTOR-1); yh = mvy & (INTERP_FACTOR-1); // Note must select filter (get xh, yh) before clipping in // order to preserve selection. Makes a difference only // when 3,3 filter is selected. Now clip mvx and mvy // rather than xint and yint to avoid clipping again for // chroma. Ipp8u pred_method=SelectPredictionMethod( (mbYOffset>>mb_field_decoding_flag)+ypos, mvy, sbheight, height>>mb_field_decoding_flag); mvx = MIN(mvx, (width - ((Ipp32s)mbXOffset + xpos + sbwidth - 1 - D_MV_CLIP_LIMIT))*INTERP_FACTOR); mvx = MAX(mvx, -((Ipp32s)(mbXOffset + xpos + D_MV_CLIP_LIMIT)*INTERP_FACTOR)); mvy = MIN(mvy, ((height>>mb_field_decoding_flag) - ((Ipp32s)(mbYOffset>>mb_field_decoding_flag) + ypos + sbheight - 1 - D_MV_CLIP_LIMIT))*INTERP_FACTOR); mvy = MAX(mvy, -((Ipp32s)((mbYOffset>>mb_field_decoding_flag) + ypos + D_MV_CLIP_LIMIT)*INTERP_FACTOR)); xint = mvx >> INTERP_SHIFT; yint = mvy >> INTERP_SHIFT; switch(pred_method) { case ALLOK: pRef = pRefY_sb + offsetY + xint + yint * (pitch<<mb_field_decoding_flag); ippiInterpolateLuma_H264_8u_C1R(pRef, pitch<<mb_field_decoding_flag, pDstY_sb, pitch<<mb_field_decoding_flag, xh, yh, roi); break; case PREDICTION_FROM_TOP: pRef = pRefY_sb + offsetY + xint + yint * (pitch<<mb_field_decoding_flag); InterpolateLumaTop(pRef, pitch<<mb_field_decoding_flag, pDstY_sb, pitch<<mb_field_decoding_flag, xh, yh, - ((Ipp32s)(mbYOffset>>mb_field_decoding_flag)+ypos+yint),roi); break; case PREDICTION_FROM_BOTTOM: pRef = pRefY_sb + offsetY + xint + yint * (pitch<<mb_field_decoding_flag); InterpolateLumaBottom(pRef, pitch<<mb_field_decoding_flag, pDstY_sb, pitch<<mb_field_decoding_flag, xh, yh, ((Ipp32s)(mbYOffset>>mb_field_decoding_flag)+ypos+yint+roi.height)- (height>>mb_field_decoding_flag),roi); break; default:VM_ASSERT(0); break; } // optional prediction weighting if (bUnidirWeightSB && pPredWeight[uBlockDir][*pRefIndex].luma_weight_flag != 0) { UniDirWeightBlock(pDstY_sb, pitch, sbwidth, sbheight, luma_log2_weight_denom, pPredWeight[uBlockDir][*pRefIndex].luma_weight, pPredWeight[uBlockDir][*pRefIndex].luma_offset); } if (color_format==1) { if (mb_field_decoding_flag) { mvy+=(bottom_mb-RefField)*2; } pred_method=SelectPredictionMethod( (mbYOffset>>mb_field_decoding_flag)+ypos, mvy, sbheight, height>>mb_field_decoding_flag); // chroma (1/8 pixel MV) xh = mvx & (INTERP_FACTOR*2-1); yh = mvy & (INTERP_FACTOR*2-1); xint = mvx >> (INTERP_SHIFT+1); yint = mvy >> (INTERP_SHIFT+1); switch(pred_method) { case ALLOK: pRef = pRefV_sb + (offsetY>>1) + xint + yint * (pitch<<mb_field_decoding_flag);; ippiInterpolateChroma_H264_8u_C1R(pRef, pitch<<mb_field_decoding_flag, pDstV_sb, pitch<<mb_field_decoding_flag, xh, yh, roi_cr); pRef = pRefU_sb + (offsetY>>1) + xint + yint * (pitch<<mb_field_decoding_flag);; ippiInterpolateChroma_H264_8u_C1R(pRef, pitch<<mb_field_decoding_flag, pDstU_sb, pitch<<mb_field_decoding_flag, xh, yh, roi_cr); break; case PREDICTION_FROM_TOP: pRef = pRefV_sb + (offsetY>>1) + xint + yint * (pitch<<mb_field_decoding_flag);; InterpolateChromaTop(pRef, pitch<<mb_field_decoding_flag, pDstV_sb, pitch<<mb_field_decoding_flag, xh, yh, - (((Ipp32s)(mbYOffset>>mb_field_decoding_flag)+ypos)/2+yint), roi_cr); pRef = pRefU_sb + (offsetY>>1) + xint + yint * (pitch<<mb_field_decoding_flag);; InterpolateChromaTop(pRef, pitch<<mb_field_decoding_flag, pDstU_sb, pitch<<mb_field_decoding_flag, xh, yh, - (((Ipp32s)(mbYOffset>>mb_field_decoding_flag)+ypos)/2+yint), roi_cr); break; case PREDICTION_FROM_BOTTOM: pRef = pRefV_sb + (offsetY>>1) + xint + yint * (pitch<<mb_field_decoding_flag);; InterpolateChromaBottom(pRef, pitch<<mb_field_decoding_flag, pDstV_sb, pitch<<mb_field_decoding_flag, xh, yh, (((Ipp32s)(mbYOffset>>mb_field_decoding_flag)+ypos)/2+yint+roi_cr.height)-(height>>mb_field_decoding_flag)/2, roi_cr); pRef = pRefU_sb + (offsetY>>1) + xint + yint * (pitch<<mb_field_decoding_flag);; InterpolateChromaBottom(pRef, pitch<<mb_field_decoding_flag, pDstU_sb, pitch<<mb_field_decoding_flag, xh, yh, (((Ipp32s)(mbYOffset>>mb_field_decoding_flag)+ypos)/2+yint+roi_cr.height)-(height>>mb_field_decoding_flag)/2, roi_cr); break; default:VM_ASSERT(0); break; } // optional prediction weighting if (bUnidirWeightSB && pPredWeight[uBlockDir][*pRefIndex].chroma_weight_flag != 0) { UniDirWeightBlock(pDstV_sb, pitch, sbwidth>>1, sbheight>>1, chroma_log2_weight_denom, pPredWeight[uBlockDir][*pRefIndex].chroma_weight[1], pPredWeight[uBlockDir][*pRefIndex].chroma_offset[1]); UniDirWeightBlock(pDstU_sb, pitch, sbwidth>>1, sbheight>>1, chroma_log2_weight_denom, pPredWeight[uBlockDir][*pRefIndex].chroma_weight[0], pPredWeight[uBlockDir][*pRefIndex].chroma_offset[0]); } } } // loopCnt if (loopCnt > 1) { if (!bBidirWeightMB) { // combine bidir predictions into one, no weighting // luma ippiInterpolateBlock_H264_8u_P2P1R(pDstY_sb-16, pDstY_sb, pDstY_sb-16, roi.width, roi.height, pitch<<mb_field_decoding_flag); if (color_format==1) { ippiInterpolateBlock_H264_8u_P2P1R(pDstV_sb-8, pDstV_sb, pDstV_sb-8, roi_cr.width, roi_cr.height,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -