⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 umc_h264_dec_reconstruct_mb_aff.cpp

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 CPP
📖 第 1 页 / 共 4 页
字号:
                            xh = mvx & (INTERP_FACTOR-1);                            yh = mvy & (INTERP_FACTOR-1);                            Ipp8u pred_method=SelectPredictionMethod(                                (mbYOffset>>mb_field_decoding_flag)+ypos,                                mvy,                                sbheight,                                height>>mb_field_decoding_flag);                            // See comment above about clipping & xh,yh.                            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,                                        pitch<<mb_field_decoding_flag);                                    ippiInterpolateBlock_H264_8u_P2P1R(pDstU_sb-8, pDstU_sb, pDstU_sb-8,                                        roi_cr.width,                                        roi_cr.height,                                        pitch<<mb_field_decoding_flag);                                }                            }                            else                            {                                // combine bidir predictions into one with weighting                                // combine bidir predictions into one with weighting                                if (weighted_bipred_idc == 1)                                {                                    // combine bidir predictions into one, explicit weighting                                    // luma                                    BiDirWeightBlock(pDstY_sb-16, pDstY_sb, pDstY_sb-16,                                                        pitch, sbwidth, sbheight,                                                        luma_log2_weight_denom,                                                        pPredWeight[0][RefIndexL0].luma_weight,                                                        pPredWeight[0][RefIndexL0].luma_offset,                                                        pPredWeight[1][RefIndexL1].luma_weight,                                                        pPredWeight[1][RefIndexL1].luma_offset);                                    if (color_format==1)                                    {                                        // chroma                                        BiDirWeightBlock(pDstV_sb-8, pDstV_sb, pDstV_sb-8,                                                            pitch, sbwidth>>1, sbheight>>1,                                                            chroma_log2_weight_denom,                                                            pPredWeight[0][RefIndexL0].chroma_weight[1],                                                            pPredWeight[0][RefIndexL0].chroma_offset[1],                                                            pPredWeight[1][RefIndexL1].chroma_weight[1],                                                            pPredWeight[1][RefIndexL1].chroma_offset[1]);                                        BiDirWeightBlock(pDstU_sb-8, pDstU_sb, pDstU_sb-8,                                                            pitch, sbwidth>>1, sbheight>>1,                                                            chroma_log2_weight_denom,                                                            pPredWeight[0][RefIndexL0].chroma_weight[0],                                                            pPredWeight[0][RefIndexL0].chroma_offset[0],                                                            pPredWeight[1][RefIndexL1].chroma_weight[0],                                                            pPredWeight[1][RefIndexL1].chroma_offset[0]);                                    }                                }                                else if (weighted_bipred_idc == 2)                                {                                    // combine bidir predictions into one, implicit weighting                                    iDistScaleFactor = pDistScaleFactors[RefIndexL0]>>2;                                    // luma                                    BiDirWeightBlockImplicit(pDstY_sb-16, pDstY_sb, pDstY_sb-16,                                                        pitch, pitch, sbwidth, sbheight,                                                        64 - iDistScaleFactor,                                                        iDistScaleFactor);                                    if (color_format==1)                                    {                                        // chroma                                        BiDirWeightBlockImplicit(pDstV_sb-8, pDstV_sb, pDstV_sb-8,                                                            pitch, pitch, sbwidth>>1, sbheight>>1,                                                            64 - iDistScaleFactor,                                                            iDistScaleFactor);                                        BiDirWeightBlockImplicit(pDstU_sb-8, pDstU_sb, pDstU_sb-8,                                                            pitch, pitch, sbwidth>>1, sbheight>>1,                                                            64 - iDistScaleFactor,                                                            iDistScaleFactor);                                    }                                }                                else                                    VM_ASSERT(0);                            }    //  weighted                        }    // LoopCnt >1                    }    // for xpos                }    // for ypos            }    // for block        }    // 8x8    }    // ReconstructMacroblock} // end namespace UMC

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -