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

📄 umc_h264_dec_reconstruct_mb_aff.cpp

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 CPP
📖 第 1 页 / 共 4 页
字号:
                                    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                            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                    block++;                }    // xpos            }    // ypos        }    // not 8x8        else        {            // MBTYPE_INTER_8x8:            // 4 8x8 subblocks, each of which can be a different mode.            for (block=0; block<4; block++)            {                /*if (bIsDirect || (psbdir[block] == D_DIR_DIRECT))                {                // For a DIRECT (temporal) block, get the subblock partitioning from the                // colocated MB in the reference frame. When direct 8x8 inference                // is ON, the smallest subpartition is 8x8.                blocktype = bUseDirect8x8Inference ?                SBTYPE_8x8 :                psbtype_ref[block];                }                else*/                {                    blocktype = psbtype[block];                }                switch (blocktype)                {                case SBTYPE_8x8:                    sbwidth = sbheight = 8;                    roi.width        = 8;                    roi.height        = 8;                    roi_cr.width    = 4;                    roi_cr.height    = 4;                    break;                case SBTYPE_8x4:                    sbwidth = 8;                    sbheight = 4;                    roi.width        = 8;                    roi.height        = 4;                    roi_cr.width    = 4;                    roi_cr.height    = 2;                    break;                case SBTYPE_4x8:                    sbwidth = 4;                    sbheight = 8;                    roi.width        = 4;                    roi.height        = 8;                    roi_cr.width    = 2;                    roi_cr.height    = 4;                    break;                case SBTYPE_4x4:                case SBTYPE_DIRECT:        // for spatial mode DIRECT                    sbwidth = sbheight = 4;                    roi.width        = 4;                    roi.height        = 4;                    roi_cr.width    = 2;                    roi_cr.height    = 2;                    break;                default:                    VM_ASSERT(0);                    break;                }    // switch sbtype                for (ypos=yoff8[block]; ypos<yoff8[block]+8; ypos+=sbheight)                {                    for (xpos=xoff8[block]; xpos<xoff8[block]+8; xpos+=sbwidth)                    {                        if ((psbdir[block] == D_DIR_BIDIR) || //bIsDirect ||                            (psbdir[block] == D_DIR_DIRECT) ||                            (psbdir[block] == D_DIR_DIRECT_SPATIAL_BIDIR))                        {                            uBlockDir = D_DIR_BIDIR;                            loopCnt = 2;                            bUnidirWeightSB =  false;                        }                        else                        {                            loopCnt = 1;                            if ((psbdir[block] == D_DIR_BWD) ||                                (psbdir[block] == D_DIR_DIRECT_SPATIAL_BWD))                                uBlockDir = D_DIR_BWD;                            else                                uBlockDir = D_DIR_FWD;                            bUnidirWeightSB =  bUnidirWeightMB;                        }                        for (i=0; i<loopCnt; i++)                        {                            if ((uBlockDir == D_DIR_BWD) || (i > 0))                            {                                pRefIndex = pRefIndexL1 + (xpos>>2) + (ypos>>2)*4;                                RefIndexL1 = *pRefIndex;                                VM_ASSERT(RefIndexL1 >= 0 && RefIndexL1 <                                    (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;                                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;                            }

⌨️ 快捷键说明

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