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

📄 umc_vc1_deblock_adv.cpp

📁 audio-video-codecs.rar语音编解码器
💻 CPP
📖 第 1 页 / 共 4 页
字号:
                &(m_CurrMB+1)->m_pBlocks[4]);
            /* Vertical deblock Cr */
           VerticalDeblockingChromaP((m_CurrMB->currVPlane),
                PQuant,
                VPitch,
                &m_CurrMB->m_pBlocks[5],
                &(m_CurrMB+1)->m_pBlocks[5]);

            ++m_CurrMB;

        }
        /* Left luma blocks */
        VerticalDeblockingLumaP(m_CurrMB->currYPlane,
                                PQuant,
                                YPitch,
                                m_CurrMB,
                                m_CurrMB);

        /* Right Luma blocks */
        VerticalDeblockingLumaPNoLeftBlock(m_CurrMB->currYPlane+8,
                                           PQuant,
                                           YPitch,
                                           m_CurrMB);
        /* Vertical deblock Cb */
        VerticalDeblockingChromaPNoLeftBlock(m_CurrMB->currUPlane,
                                             PQuant,
                                             UPitch,
                                             &m_CurrMB->m_pBlocks[4]);
        /* Vertical deblock Cr */
        VerticalDeblockingChromaPNoLeftBlock(m_CurrMB->currVPlane,
                                             PQuant,VPitch,
                                             &m_CurrMB->m_pBlocks[5]);
        ++m_CurrMB;
    }
}



void Deblocking_InterlaceFieldBpicture_Adv(VC1Context* pContext)
{
    Ipp32s WidthMB =  pContext->m_seqLayerHeader->widthMB;
    //Ipp32s HeightMB =  pContext->m_seqLayerHeader->heightMB;
    Ipp32s curX, curY;
    Ipp32s PQuant = pContext->m_picLayerHeader->PQUANT;

    Ipp32s HeightMB   = pContext->DeblockInfo.HeightMB;
    //VC1MB* m_CurrMB = pContext->m_pCurrMB - WidthMB*(HeightMB);
    VC1MB* m_CurrMB = pContext->m_pCurrMB;

    Ipp32s YPitch = m_CurrMB->currYPitch;
    Ipp32s UPitch = m_CurrMB->currUPitch;
    Ipp32s VPitch = m_CurrMB->currVPitch;

    /* Deblock horizontal edges */
    for (curY=0; curY<HeightMB-1; curY++)
    {
        for (curX=0; curX<WidthMB; curX++)
        {
            //VM_Debug::GetInstance().vm_debug_frame(-1,VC1_MV_BBL, VM_STRING("MB number is %d MB type %d\n"), WidthMB*curY+curX, m_CurrMB->mbType);
            /* Top luma blocks */
            HorizontalDeblockingBlkB((m_CurrMB->currYPlane),
                                      PQuant,YPitch,
                                      &m_CurrMB->m_pBlocks[0]);
            HorizontalDeblockingBlkB((m_CurrMB->currYPlane+8),
                                      PQuant,YPitch,
                                      &m_CurrMB->m_pBlocks[1]);

            /* Bottom Luma blocks */
            HorizontalDeblockingBlkB((m_CurrMB->currYPlane+YPitch*8),
                PQuant,
                YPitch,
                &m_CurrMB->m_pBlocks[2]);
            HorizontalDeblockingBlkB((m_CurrMB->currYPlane+YPitch*8+8),
                PQuant,
                YPitch,
                &m_CurrMB->m_pBlocks[3]);
            /* Horizontal deblock Cb */
            HorizontalDeblockingBlkB((m_CurrMB->currUPlane),
                PQuant,
                UPitch,
                &m_CurrMB->m_pBlocks[4]);
            /* Horizontal deblock Cr */
            HorizontalDeblockingBlkB((m_CurrMB->currVPlane),
                PQuant,
                VPitch,
                &m_CurrMB->m_pBlocks[5]);
            /*  VM_Debug::GetInstance().vm_debug_frame(-1,VC1_MV_BBL,VM_STRING("Number of NZC coeffs in Macroblock =%d\n Block[0].NZC[0]=%d\n Block[0].NZC[1]=%d\n Block[0].NZC[2]=%d\n Block[0].NZC[3]=%d\n"),
            WidthMB*curY+curX,m_CurrMB->m_pBlocks[0].numCoeffs[0],m_CurrMB->m_pBlocks[0].numCoeffs[1], m_CurrMB->m_pBlocks[0].numCoeffs[2],m_CurrMB->m_pBlocks[0].numCoeffs[3]);*/
            ++m_CurrMB;
        }
    }
    if (pContext->DeblockInfo.is_last_deblock)
    {
        for (curX=0; curX<WidthMB; curX++)
        {
            /* Top luma blocks */
            HorizontalDeblockingBlkB((m_CurrMB->currYPlane),
                PQuant,
                YPitch,
                &m_CurrMB->m_pBlocks[0]);
            HorizontalDeblockingBlkB((m_CurrMB->currYPlane+8),
                PQuant,
                YPitch,
                &m_CurrMB->m_pBlocks[1]);
            HorizontalDeblockingBlkB_No_DBlock((m_CurrMB->currYPlane+YPitch*8),
                PQuant,
                YPitch,
                &m_CurrMB->m_pBlocks[2]);
            HorizontalDeblockingBlkB_No_DBlock((m_CurrMB->currYPlane+YPitch*8+8),
                PQuant,
                YPitch,
                &m_CurrMB->m_pBlocks[3]);
            /* Horizontal deblock Cb */
            HorizontalDeblockingBlkB_No_DBlock((m_CurrMB->currUPlane),
                PQuant,
                UPitch,
                &m_CurrMB->m_pBlocks[4]);
            /* Horizontal deblock Cr */
            HorizontalDeblockingBlkB_No_DBlock((m_CurrMB->currVPlane),
                PQuant,
                VPitch,
                &m_CurrMB->m_pBlocks[5]);
            ++m_CurrMB;
        }


    }
    else
        HeightMB -=1;

    m_CurrMB   -= WidthMB*(HeightMB);


    /* Deblock vertical edges */
    for (curY=0; curY<HeightMB; curY++)
    {
        for (curX=0; curX<WidthMB-1; curX++)
        {
            //VM_Debug::GetInstance().vm_debug_frame(-1,VC1_MV_BBL, VM_STRING("MB number is %d MB type %d\n"), WidthMB*curY+curX, m_CurrMB->mbType);
            /* Top luma blocks */
            VerticalDeblockingBlkB((m_CurrMB->currYPlane),
                PQuant,
                YPitch,
                &m_CurrMB->m_pBlocks[0]);
            VerticalDeblockingBlkB((m_CurrMB->currYPlane+YPitch*8),
                PQuant,
                YPitch,
                &m_CurrMB->m_pBlocks[2]);
            /* Bottom Luma blocks */
            VerticalDeblockingBlkB((m_CurrMB->currYPlane+8),
                PQuant,
                YPitch,
                &m_CurrMB->m_pBlocks[1]);
            VerticalDeblockingBlkB((m_CurrMB->currYPlane+YPitch*8+8),
                PQuant,YPitch,
                &m_CurrMB->m_pBlocks[3]);
            /* Vertical deblock Cb */
            VerticalDeblockingBlkB((m_CurrMB->currUPlane),
                PQuant,
                UPitch,
                &m_CurrMB->m_pBlocks[4]);
            /* Vertical deblock Cr */
            VerticalDeblockingBlkB((m_CurrMB->currVPlane),
                PQuant,
                VPitch,
                &m_CurrMB->m_pBlocks[5]);
            ++m_CurrMB;

        }

        /* Top luma blocks */
        VerticalDeblockingBlkB((m_CurrMB->currYPlane),
            PQuant,
            YPitch,
            &m_CurrMB->m_pBlocks[0]);
        VerticalDeblockingBlkB((m_CurrMB->currYPlane+YPitch*8),
            PQuant,
            YPitch,
            &m_CurrMB->m_pBlocks[2]);
        /* Bottom Luma blocks */
        VerticalDeblockingBlkB_No_DBlock((m_CurrMB->currYPlane+8),
            PQuant,
            YPitch,
            &m_CurrMB->m_pBlocks[1]);
        VerticalDeblockingBlkB_No_DBlock((m_CurrMB->currYPlane+YPitch*8+8),
            PQuant,
            YPitch,
            &m_CurrMB->m_pBlocks[3]);
        /* Vertical deblock Cb */
        VerticalDeblockingBlkB_No_DBlock((m_CurrMB->currUPlane),
            PQuant,
            UPitch,
            &m_CurrMB->m_pBlocks[4]);
        /* Vertical deblock Cr */
        VerticalDeblockingBlkB_No_DBlock((m_CurrMB->currVPlane),
            PQuant,VPitch,
            &m_CurrMB->m_pBlocks[5]);
        ++m_CurrMB;
    }
}


void Deblocking_InterlaceFrameIpicture_Adv(VC1Context* pContext)
{
    Ipp32s WidthMB =  pContext->m_seqLayerHeader->widthMB;
    //Ipp32s HeightMB =  pContext->m_seqLayerHeader->heightMB;
    Ipp32s curX, curY;
    Ipp32u PQuant = pContext->m_picLayerHeader->PQUANT;

    Ipp32s fieldoffset;

    Ipp32s HeightMB   = pContext->DeblockInfo.HeightMB;
    //VC1MB* m_CurrMB = pContext->m_pCurrMB - WidthMB*(HeightMB);
    VC1MB* m_CurrMB = pContext->m_pCurrMB;
    Ipp32s YPitch = m_CurrMB->currYPitch;
    Ipp32s UPitch = m_CurrMB->currUPitch;
    Ipp32s VPitch = m_CurrMB->currVPitch;

    fieldoffset = m_CurrMB->FIELDTX;

    /* Deblock horizontal edges */
    for (curY=0; curY<HeightMB-1; curY++)
    {
        for (curX=0; curX<WidthMB; curX++)
        {
            /* Top luma blocks */
            if (m_CurrMB->FIELDTX)
            {
                _own_FilterDeblockingLuma_HorEdge_VC1(m_CurrMB->currYPlane + 16*YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 0);
                /* Bottom Luma blocks */
                _own_FilterDeblockingLuma_HorEdge_VC1(m_CurrMB->currYPlane + 17*YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 0);
            }
            else
            {
               _own_FilterDeblockingLuma_HorEdge_VC1(m_CurrMB->currYPlane + 8*YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 0);
               _own_FilterDeblockingLuma_HorEdge_VC1(m_CurrMB->currYPlane + 9*YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 0);

                /* Bottom Luma blocks */

                _own_FilterDeblockingLuma_HorEdge_VC1(m_CurrMB->currYPlane + 16*YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 0);
                _own_FilterDeblockingLuma_HorEdge_VC1(m_CurrMB->currYPlane + 17*YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 0);
            }

            /* Horizontal deblock Cb */
            _own_FilterDeblockingChroma_HorEdge_VC1(m_CurrMB->currUPlane + 8*UPitch,
                                                 PQuant,
                                                 2*UPitch,
                                                 0);
            _own_FilterDeblockingChroma_HorEdge_VC1(m_CurrMB->currUPlane + 9*UPitch,
                                                 PQuant,
                                                 2*UPitch,
                                                 0);

              /* Horizontal deblock Cr */
             _own_FilterDeblockingChroma_HorEdge_VC1(m_CurrMB->currVPlane + 8*VPitch,
                                                 PQuant,
                                                 2*VPitch,
                                                 0);
             _own_FilterDeblockingChroma_HorEdge_VC1(m_CurrMB->currVPlane + 9*VPitch,
                                                 PQuant,
                                                 2*VPitch,
                                                 0);
            ++m_CurrMB;
        }
    }
    if (pContext->DeblockInfo.is_last_deblock)
    {
        for (curX=0; curX<WidthMB; curX++)
        {
            if (!m_CurrMB->FIELDTX)
            {

               _own_FilterDeblockingLuma_HorEdge_VC1(m_CurrMB->currYPlane + 8*YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 0);
               _own_FilterDeblockingLuma_HorEdge_VC1(m_CurrMB->currYPlane + 9*YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 0);
            }

           ++m_CurrMB;
        }
    }
    else
        HeightMB -=1;



    //VM_Debug::GetInstance().vm_debug_frame(-1,VC1_MV_BBL,VM_STRING("Vertical Deblock\n"));
     m_CurrMB -= WidthMB*(HeightMB);




    /* Deblock vertical edges */
    for (curY=0; curY<HeightMB; curY++)
    {
        for (curX=0; curX<WidthMB-1; curX++)
        {
            if (m_CurrMB->FIELDTX)
            {
                _own_FilterDeblockingLuma_VerEdge_VC1(m_CurrMB->currYPlane+8,
                                                 PQuant,
                                                 2*YPitch,
                                                 IPPVC_EDGE_HALF_2);
                _own_FilterDeblockingLuma_VerEdge_VC1(m_CurrMB->currYPlane+16,
                                                 PQuant,
                                                 2*YPitch,
                                                 IPPVC_EDGE_HALF_2);
                _own_FilterDeblockingLuma_VerEdge_VC1(m_CurrMB->currYPlane + 8 + YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 IPPVC_EDGE_HALF_2);
                _own_FilterDeblockingLuma_VerEdge_VC1(m_CurrMB->currYPlane + 16 + YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 IPPVC_EDGE_HALF_2);

            }
           else
            {
                _own_FilterDeblockingLuma_VerEdge_VC1(m_CurrMB->currYPlane+8,
                                                 PQuant,
                                                 2*YPitch,
                                                 IPPVC_EDGE_HALF_2);
                _own_FilterDeblockingLuma_VerEdge_VC1(m_CurrMB->currYPlane+8 + YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 IPPVC_EDGE_HALF_2);
                _own_FilterDeblockingLuma_VerEdge_VC1(m_CurrMB->currYPlane+16,
                                                 PQuant,
                                                 2*YPitch,
                                                 IPPVC_EDGE_HALF_2);
                _own_FilterDeblockingLuma_VerEdge_VC1(m_CurrMB->currYPlane+16 + YPitch,
                                                 PQuant,
                                                 2*YPitch,
                                                 IPPVC_EDGE_HALF_2);

               }



            _own_FilterDeblockingChroma_VerEdge_VC1(m_CurrMB->currUPlane+8,
                                                 PQuant,

⌨️ 快捷键说明

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