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

📄 umc_h264_mc.cpp

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 CPP
📖 第 1 页 / 共 5 页
字号:
        // Copy the stored 2nd 16x8 prediction data from the BiPred Mode Buffer        pBiPred = m_pCurrentFrame->pPred4BiPred + 128;        pMCDst = pDst + DEST_PITCH*8;        for (uRow=0; uRow<8; uRow++) {            memcpy(pMCDst, pBiPred, 16);            pMCDst += DEST_PITCH;            pBiPred += 16;        }        break;    case MBTYPE_BIDIR_BWD_16x8:        // Copy the stored 16x8 prediction data from the BiPred Mode Buffer        pBiPred = m_pCurrentFrame->pPred4BiPred;        pMCDst = pDst;        for (uRow=0; uRow<8; uRow++) {            memcpy(pMCDst, pBiPred, 16);            pMCDst += DEST_PITCH;            pBiPred += 16;        }        // Do other 16x8 block        pMVBwd += uWidthIn4x4Blocks * 2;      // Reposition MV pointer to next 16x8        pDst += DEST_PITCH*8;        block_ref = pRefIdxL1[uWidthIn4x4Blocks * 2];        futr_frame = pRefPicList1[block_ref]->m_pYPlane + uOffset + uPitch*8;        pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);        // interpolate copy the 16x8 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size16x8);        break;    case MBTYPE_BWD_BIDIR_16x8:        // 2 vectors for the MB        block_ref = pRefIdxL1[0];        futr_frame = pRefPicList1[block_ref]->m_pYPlane + uOffset;        pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);        // interpolate copy the 16x8 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size16x8);        // Copy the stored 2nd 16x8 prediction data from the BiPred Mode Buffer        pBiPred = m_pCurrentFrame->pPred4BiPred + 128;        pMCDst = pDst + DEST_PITCH*8;        for (uRow=0; uRow<8; uRow++) {            memcpy(pMCDst, pBiPred, 16);            pMCDst += DEST_PITCH;            pBiPred += 16;        }        break;    case MBTYPE_INTER_8x16:    case MBTYPE_FWD_FWD_8x16:        // 2 vectors for the MB        block_ref = pRefIdxL0[0];        prev_frame = pRefPicList0[block_ref]->m_pYPlane + uOffset;        pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        // Do other 8x16 block        pMVFwd += 2;                    // Reposition MV pointer to next 8x16        pDst += 8;        block_ref = pRefIdxL0[2];        prev_frame = pRefPicList0[block_ref]->m_pYPlane + uOffset + 8;        pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        break;    case MBTYPE_FWD_BWD_8x16:        // 2 vectors for the MB        block_ref = pRefIdxL0[0];        prev_frame = pRefPicList0[block_ref]->m_pYPlane + uOffset;        pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        // Do other 8x16 block        pMVBwd += 2;                    // Reposition MV pointer to next 8x16        pDst += 8;        block_ref = pRefIdxL1[2];        futr_frame = pRefPicList1[block_ref]->m_pYPlane + uOffset + 8;        pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        break;    case MBTYPE_BWD_FWD_8x16:        // 2 vectors for the MB        block_ref = pRefIdxL1[0];        futr_frame = pRefPicList1[block_ref]->m_pYPlane + uOffset;        pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        // Do other 8x16 block        pMVFwd += 2;                    // Reposition MV pointer to next 8x16        pDst += 8;        block_ref = pRefIdxL0[2];        prev_frame = pRefPicList0[block_ref]->m_pYPlane + uOffset + 8;        pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        break;    case MBTYPE_BWD_BWD_8x16:        // 2 vectors for the MB        block_ref = pRefIdxL1[0];        futr_frame = pRefPicList1[block_ref]->m_pYPlane + uOffset;        pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        // Do other 8x16 block        pMVBwd += 2;                    // Reposition MV pointer to next 8x16        pDst += 8;        block_ref = pRefIdxL1[2];        futr_frame = pRefPicList1[block_ref]->m_pYPlane + uOffset + 8;        pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        break;    case MBTYPE_BIDIR_FWD_8x16:        // Copy the stored 8x16 prediction data from the BiPred Mode Buffer        pBiPred = m_pCurrentFrame->pPred4BiPred;        pMCDst = pDst;        for (uRow=0; uRow<16; uRow++) {            memcpy(pMCDst, pBiPred, 8);            pMCDst += DEST_PITCH;            pBiPred += 16;        }        // Do other 8x16 block        pMVFwd += 2;                    // Reposition MV pointer to next 8x16        pDst += 8;        block_ref = pRefIdxL0[2];        prev_frame = pRefPicList0[block_ref]->m_pYPlane + uOffset + 8;        pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        break;    case MBTYPE_FWD_BIDIR_8x16:        // 2 vectors for the MB        block_ref = pRefIdxL0[0];        prev_frame = pRefPicList0[block_ref]->m_pYPlane + uOffset;        pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        // Copy the stored 2nd 8x16 prediction data from the BiPred Mode Buffer        pBiPred = m_pCurrentFrame->pPred4BiPred + 8;        pMCDst = pDst + 8;        for (uRow=0; uRow<16; uRow++) {            memcpy(pMCDst, pBiPred, 8);            pMCDst += DEST_PITCH;            pBiPred += 16;        }        break;    case MBTYPE_BIDIR_BWD_8x16:        // Copy the stored 8x16 prediction data from the BiPred Mode Buffer        pBiPred = m_pCurrentFrame->pPred4BiPred;        pMCDst = pDst;        for (uRow=0; uRow<16; uRow++) {            memcpy(pMCDst, pBiPred, 8);            pMCDst += DEST_PITCH;            pBiPred += 16;        }        // Do other 8x16 block        pMVBwd += 2;                    // Reposition MV pointer to next 8x16        pDst += 8;        block_ref = pRefIdxL1[2];        futr_frame = pRefPicList1[block_ref]->m_pYPlane + uOffset + 8;        pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        break;    case MBTYPE_BWD_BIDIR_8x16:        // 2 vectors for the MB        block_ref = pRefIdxL1[0];        futr_frame = pRefPicList1[block_ref]->m_pYPlane + uOffset;        pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);        // interpolate copy the 8x16 block        ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x16);        // Copy the stored 2nd 8x16 prediction data from the BiPred Mode Buffer        pBiPred = m_pCurrentFrame->pPred4BiPred + 8;        pMCDst = pDst + 8;        for (uRow=0; uRow<16; uRow++) {            memcpy(pMCDst, pBiPred, 8);            pMCDst += DEST_PITCH;            pBiPred += 16;        }        break;    case MBTYPE_INTER_8x8_REF0:    case MBTYPE_INTER_8x8:    case MBTYPE_B_8x8:        {        int ref_off = 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 : 0;            block_ref = pRefIdxL1[ref_off];            futr_frame = block_ref >= 0 ? pRefPicList1[block_ref] ?                pRefPicList1[block_ref]->m_pYPlane + uOffset : 0 : 0;            switch (pMBData->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, uPitch, iXType, iYType);                    // interpolate copy the 8x8 block                    ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x8);                    break;                case SBTYPE_BACKWARD_8x8:                    // convert 1/4 pel vector to pel vector and interpolation type                    pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);                    // interpolate copy the 8x8 block                    ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x8);                    break;                case SBTYPE_8x4:                case SBTYPE_FORWARD_8x4:                    // convert 1/4 pel vector to pel vector and interpolation type                    pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, uPitch, iXType, iYType);                    // interpolate copy the first 8x4 block                    ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x4);                    // Update MV, Ref & Dst pointers for block 1                    pMCMV = pMVFwd + uWidthIn4x4Blocks;                    // convert 1/4 pel vector to pel vector and interpolation type                    pMCRef = prev_frame + uPitch*4 + SubpelMVAdjust(pMCMV, uPitch, iXType, iYType);                    pMCDst = pDst + DEST_PITCH*4;                    // interpolate copy the second 8x4 block                    ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pMCDst, 16, iXType, iYType, size8x4);                    break;                case SBTYPE_BACKWARD_8x4:                    // convert 1/4 pel vector to pel vector and interpolation type                    pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);                    // interpolate copy the first 8x4 block                    ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size8x4);                    // Update MV, Ref & Dst pointers for block 1                    pMCMV = pMVBwd + uWidthIn4x4Blocks;                    // convert 1/4 pel vector to pel vector and interpolation type                    pMCRef = futr_frame + uPitch*4 + SubpelMVAdjust(pMCMV, uPitch, iXType, iYType);                    pMCDst = pDst + DEST_PITCH*4;                    // interpolate copy the second 8x4 block                    ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pMCDst, 16, iXType, iYType, size8x4);                    break;                case SBTYPE_4x8:                case SBTYPE_FORWARD_4x8:                    // convert 1/4 pel vector to pel vector and interpolation type                    pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, uPitch, iXType, iYType);                    // interpolate copy the first 4x4 block                    ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size4x8);                    // 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, uPitch, iXType, iYType);                    pMCDst = pDst + 4;                    // interpolate copy the second 4x4 block                    ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pMCDst, 16, iXType, iYType, size4x8);                    break;                case SBTYPE_BACKWARD_4x8:                    // convert 1/4 pel vector to pel vector and interpolation type                    pMCRef = futr_frame + SubpelMVAdjust(pMVBwd, uPitch, iXType, iYType);                    // interpolate copy the first 4x4 block                    ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pDst, 16, iXType, iYType, size4x8);                    // 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, uPitch, iXType, iYType);                    pMCDst = pDst + 4;                    // interpolate copy the second 4x4 block                    ippiInterpolateLuma_H264_8u_C1R(pMCRef, uPitch,pMCDst, 16, iXType, iYType, size4x8);                    break;                case SBTYPE_4x4:                case SBTYPE_FORWARD_4x4:                    // convert 1/4 pel vector to pel vector and interpolation type                    pMCRef = prev_frame + SubpelMVAdjust(pMVFwd, uPitch, iXType, iYType);

⌨️ 快捷键说明

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