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

📄 umc_h264_segment_decoder_mt_reconstruct_mv.cpp

📁 audio-video-codecs.rar语音编解码器
💻 CPP
📖 第 1 页 / 共 4 页
字号:
} // void H264SegmentDecoderMultiThreaded::ReconstructMVs8x8Top(Ipp32s iListNum)

void H264SegmentDecoderMultiThreaded::ReconstructMVs8x8Left(Ipp32s iListNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    {
        H264DecoderBlockLocation mbAddrC;

        mbAddrC.mb_num = m_CurMBAddr;
        mbAddrC.block_num = 6;
        ReconstructMVPredictorLeftBlock(iListNum, 2, mbAddrC, &mvPred);
    }

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[8].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[8].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[8] = mv;
        pMV[9] = mv;
        pMV[12] = mv;
        pMV[13] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs8x8Left(Ipp32s iListNum)

void H264SegmentDecoderMultiThreaded::ReconstructMVs8x8Internal(Ipp32s iListNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    ReconstructMVPredictorInternalBlock(iListNum, 10, 5, &mvPred);

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[10].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[10].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[10] = mv;
        pMV[11] = mv;
        pMV[14] = mv;
        pMV[15] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs8x8Internal(Ipp32s iListNum)

void H264SegmentDecoderMultiThreaded::ReconstructMVs8x4External(Ipp32s iListNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderBlockLocation mbAddrC;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    mbAddrC = m_cur_mb.CurrentBlockNeighbours.mb_above;
    mbAddrC.block_num += 2;
    ReconstructMVPredictorExternalBlock(iListNum, mbAddrC, &mvPred);

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[0].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[0].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[0] = mv;
        pMV[1] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs8x4External(Ipp32s iListNum)

void H264SegmentDecoderMultiThreaded::ReconstructMVs8x4Top(Ipp32s iListNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    {
        H264DecoderBlockLocation mbAddrC;

        mbAddrC = m_cur_mb.CurrentBlockNeighbours.mb_above_right;
        ReconstructMVPredictorTopBlock(iListNum, 2, mbAddrC, &mvPred);
    }

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[2].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[2].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[2] = mv;
        pMV[3] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs8x4Top(Ipp32s iListNum,

void H264SegmentDecoderMultiThreaded::ReconstructMVs8x4Left(Ipp32s iListNum,
                                                            Ipp32s iRowNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    {
        H264DecoderBlockLocation mbAddrC;

        if (2 != iRowNum)
            mbAddrC = m_cur_mb.CurrentBlockNeighbours.mbs_left[iRowNum - 1];
        else
        {
            mbAddrC.mb_num = m_CurMBAddr;
            mbAddrC.block_num = 6;
        }
        ReconstructMVPredictorLeftBlock(iListNum, iRowNum, mbAddrC, &mvPred);
    }

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[iRowNum * 4].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[iRowNum * 4].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[iRowNum * 4 + 0] = mv;
        pMV[iRowNum * 4 + 1] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs8x4Left(Ipp32s iListNum,

void H264SegmentDecoderMultiThreaded::ReconstructMVs8x4Internal(Ipp32s iListNum,
                                                                Ipp32s iBlockNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    ReconstructMVPredictorInternalBlock(iListNum, iBlockNum, iBlockNum - 5, &mvPred);

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[iBlockNum].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[iBlockNum].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[iBlockNum + 0] = mv;
        pMV[iBlockNum + 1] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs8x4Internal(Ipp32s iListNum,

void H264SegmentDecoderMultiThreaded::ReconstructMVs4x8External(Ipp32s iListNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    {
        H264DecoderBlockLocation mbAddrC;

        mbAddrC = m_cur_mb.CurrentBlockNeighbours.mb_above;
        mbAddrC.block_num += 1;
        ReconstructMVPredictorExternalBlock(iListNum, mbAddrC, &mvPred);
    }

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[0].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[0].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[0] = mv;
        pMV[4] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs4x8External(Ipp32s iListNum)

void H264SegmentDecoderMultiThreaded::ReconstructMVs4x8Top(Ipp32s iListNum,
                                                           Ipp32s iColumnNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    {
        H264DecoderBlockLocation mbAddrC;

        if (3 == iColumnNum)
            mbAddrC = m_cur_mb.CurrentBlockNeighbours.mb_above_right;
        else
        {
            mbAddrC = m_cur_mb.CurrentBlockNeighbours.mb_above;
            mbAddrC.block_num += iColumnNum + 1;
        }
        ReconstructMVPredictorTopBlock(iListNum, iColumnNum, mbAddrC, &mvPred);
    }

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[iColumnNum].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[iColumnNum].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[iColumnNum + 0] = mv;
        pMV[iColumnNum + 4] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs4x8Top(Ipp32s iListNum,

void H264SegmentDecoderMultiThreaded::ReconstructMVs4x8Left(Ipp32s iListNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    ReconstructMVPredictorLeftBlockFewCheckRef(iListNum, 2, &mvPred);

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[8].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[8].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[8] = mv;
        pMV[12] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs4x8LeftFewCheckRef(Ipp32s iListNum,

void H264SegmentDecoderMultiThreaded::ReconstructMVs4x8Internal(Ipp32s iListNum,
                                                                Ipp32s iBlockNum,
                                                                Ipp32s iAddrC)
{
    H264DecoderMotionVector mvPred;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    ReconstructMVPredictorInternalBlock(iListNum, iBlockNum, iAddrC, &mvPred);

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[iBlockNum].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[iBlockNum].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[iBlockNum + 0] = mv;
        pMV[iBlockNum + 4] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs4x8Internal(Ipp32s iListNum,

void H264SegmentDecoderMultiThreaded::ReconstructMVs4x4External(Ipp32s iListNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderBlockLocation mbAddrC;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    mbAddrC = m_cur_mb.CurrentBlockNeighbours.mb_above;
    mbAddrC.block_num += 1;
    ReconstructMVPredictorExternalBlock(iListNum, mbAddrC, &mvPred);

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector
        mv.mvx = (Ipp16s) (mvPred.mvx + pMVd[0].mvx);
        mv.mvy = (Ipp16s) (mvPred.mvy + pMVd[0].mvy);

        if (mv.mvy > m_MVDistortion[iListNum])
            m_MVDistortion[iListNum] = mv.mvy;

        pMV[0] = mv;
    }

} // void H264SegmentDecoderMultiThreaded::ReconstructMVs4x4External(Ipp32s iListNum)

void H264SegmentDecoderMultiThreaded::ReconstructMVs4x4Top(Ipp32s iListNum,
                                                           Ipp32s iColumnNum)
{
    H264DecoderMotionVector mvPred;
    H264DecoderMotionVector *pMV = m_cur_mb.MVs[iListNum]->MotionVectors;
    H264DecoderMotionVector *pMVd = m_cur_mb.MVs[iListNum + 2]->MotionVectors;

    // get the prediction
    {
        H264DecoderBlockLocation mbAddrC;

        if (3 == iColumnNum)
            mbAddrC = m_cur_mb.CurrentBlockNeighbours.mb_above_right;
        else
        {
            mbAddrC = m_cur_mb.CurrentBlockNeighbours.mb_above;
            mbAddrC.block_num += iColumnNum + 1;
        }
        ReconstructMVPredictorTopBlock(iListNum, iColumnNum, mbAddrC, &mvPred);
    }

#ifdef __ICL
    __assume_aligned(pMV, 16);
    __assume_aligned(pMVd, 16);
#endif // __ICL

    {
        H264DecoderMotionVector mv;

        // calculate new vector

⌨️ 快捷键说明

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