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

📄 umc_vc1_deblock.cpp

📁 audio-video-codecs.rar语音编解码器
💻 CPP
📖 第 1 页 / 共 2 页
字号:
                {
                    /* Historical reasons of VC-1 implementation */
                    /* Historical fix for 4x4 blocks */
                    if (pL->blkType==VC1_BLK_INTER4X4 && LSBP)
                        LSBP = 0xF;
                    if (_pnBlk->blkType==VC1_BLK_INTER4X4 && RSBP)
                        RSBP = 0xF;
                }
                Edge_ext = LSBP | (RSBP>>1);
                Edge_ext = ( ((Edge_ext&4)>>1) + (Edge_ext&1));
            }
        }
        else
            Edge_ext  = 0;

        if ((_pBlk->blkType==VC1_BLK_INTER4X8) || (_pBlk->blkType==VC1_BLK_INTER4X4))
        {
            if ((SBP & 8) || (SBP & 4))
                Edge_int |= 2;
            if ((SBP & 2) || (SBP & 1))
                Edge_int |= 1;
        }
    _own_FilterDeblockingChroma_VerEdge_VC1(pUUpLBlock + 8, Pquant,Pitch, deblock_table_2[Edge_ext]);
    _own_FilterDeblockingChroma_VerEdge_VC1(pUUpLBlock + 4, Pquant,Pitch, deblock_table_2[Edge_int]);
}

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

    Ipp32s HeightMB   = pContext->DeblockInfo.HeightMB;
    VC1MB* m_CurrMB = pContext->m_pCurrMB;

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



    Ipp32s flag_ver = 0;

    /* Deblock horizontal edges */
    for (curY=0; curY<HeightMB-1; curY++)
    {
        for (curX=0; curX<WidthMB; curX++)
        {
            flag_ver = 0;
            /* Top luma blocks */
            _own_FilterDeblockingLuma_HorEdge_VC1((m_CurrMB->currYPlane+8*YPitch), PQuant, YPitch,flag_ver);

            /* Bottom Luma blocks */
            _own_FilterDeblockingLuma_HorEdge_VC1((m_CurrMB->currYPlane+YPitch*16),
                                              PQuant,YPitch,flag_ver);

            /* Horizontal deblock Cb */
            _own_FilterDeblockingChroma_HorEdge_VC1((m_CurrMB->currUPlane+8*UPitch),
                                                PQuant,UPitch,flag_ver);
            /* Horizontal deblock Cr */
            _own_FilterDeblockingChroma_HorEdge_VC1((m_CurrMB->currVPlane+8*VPitch),
                                                PQuant,VPitch,flag_ver);

            ++m_CurrMB;
        }
    }
    if (pContext->DeblockInfo.is_last_deblock)
    {
    for (curX=0; curX<WidthMB; curX++)
    {
        flag_ver =0;
        /* Top luma blocks */
        _own_FilterDeblockingLuma_HorEdge_VC1((m_CurrMB->currYPlane+8*YPitch), PQuant, YPitch,flag_ver);
        ++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++)
        {
            flag_ver =0;
            _own_FilterDeblockingLuma_VerEdge_VC1((m_CurrMB->currYPlane+8), PQuant,YPitch,flag_ver);

            /* Bottom Luma blocks */
            _own_FilterDeblockingLuma_VerEdge_VC1((m_CurrMB->currYPlane+16),PQuant,YPitch,flag_ver);
            //flag_ver = IPPVC_EDGE_HALF_2;
            /* Vertical deblock Cb */
            _own_FilterDeblockingChroma_VerEdge_VC1(m_CurrMB->currUPlane+8,PQuant,UPitch,flag_ver);
            /* Vertical deblock Cr */
            _own_FilterDeblockingChroma_VerEdge_VC1(m_CurrMB->currVPlane+8,PQuant,VPitch,flag_ver);
            ++m_CurrMB;
         }
        flag_ver =0;
        _own_FilterDeblockingLuma_VerEdge_VC1((m_CurrMB->currYPlane+8), PQuant,YPitch,flag_ver);
        ++m_CurrMB;
    }


}

void Deblocking_ProgressivePpicture(VC1Context* pContext)
{
    Ipp32s WidthMB =  pContext->m_seqLayerHeader->widthMB;
    Ipp32s HeightMB   = pContext->DeblockInfo.HeightMB;
    Ipp32s curX, curY;
    Ipp32s PQuant = pContext->m_picLayerHeader->PQUANT;
    VC1MB* m_CurrMB = pContext->m_pCurrMB;

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

    LFilterType type = static_cast<LFilterType>(pContext->m_seqLayerHeader->PROFILE);
    LFilterType type_current = type;
    LFilterType type_current_next = type;

    if (VC1_PROFILE_MAIN == type)
    {
        if ((pContext->m_MBs[0].mbType == VC1_MB_INTRA) || (pContext->m_MBs[0].m_pBlocks[0].blkType > VC1_BLK_INTER))
        {
            type              = LFilterMainPInterFrame;
            type_current      = LFilterMainPInterFrame;
            type_current_next = LFilterMainPInterFrame;
        }
    }

    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);
            if ((m_CurrMB->mbType&VC1_MB_4MV_INTER) == VC1_MB_4MV_INTER)
                type_current =  LFilterMainPFrame;

            HorizontalDeblockingLumaP(m_CurrMB->currYPlane,PQuant,YPitch,m_CurrMB,m_CurrMB,type_current);

            if (((m_CurrMB+WidthMB)->mbType&VC1_MB_4MV_INTER) == VC1_MB_4MV_INTER)
                type_current_next =  LFilterMainPFrame;

            HorizontalDeblockingLumaP(m_CurrMB->currYPlane+YPitch*8,PQuant,YPitch,m_CurrMB,m_CurrMB+WidthMB,type_current_next);


            HorizontalDeblockingChromaP(m_CurrMB->currUPlane,
                                        PQuant,
                                        UPitch,
                                        &m_CurrMB->m_pBlocks[4],
                                        &(m_CurrMB+WidthMB)->m_pBlocks[4],
                                        type_current_next);

            HorizontalDeblockingChromaP(m_CurrMB->currVPlane,
                                         PQuant,
                                         VPitch,
                                         &m_CurrMB->m_pBlocks[5],
                                         &(m_CurrMB+WidthMB)->m_pBlocks[5],
                                         type_current_next);

            type_current      = type;
            type_current_next = type;
            m_CurrMB++;
        }
    }
    if (pContext->DeblockInfo.is_last_deblock)
    {
        for (curX=0; curX<WidthMB; curX++)
    {
        if ((m_CurrMB->mbType&VC1_MB_4MV_INTER) == VC1_MB_4MV_INTER)
            type_current =  LFilterMainPFrame;

        HorizontalDeblockingLumaP(m_CurrMB->currYPlane,PQuant,YPitch,m_CurrMB,m_CurrMB,type_current);
        HorizontalDeblockingLumaP(m_CurrMB->currYPlane+YPitch*8,PQuant,YPitch,m_CurrMB,NULL,type_current_next);

        HorizontalDeblockingChromaP(m_CurrMB->currUPlane,
            PQuant,
            UPitch,
            &m_CurrMB->m_pBlocks[4],
            NULL,
            type_current_next);

        HorizontalDeblockingChromaP(m_CurrMB->currVPlane,
            PQuant,
            VPitch,
            &m_CurrMB->m_pBlocks[5],
            NULL,
            type_current_next);
        type_current      = type;
        type_current_next = type;
        m_CurrMB++;
    }

    } else
        HeightMB -=1;

    m_CurrMB -= WidthMB*HeightMB;


    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);
            if ((m_CurrMB->mbType&VC1_MB_4MV_INTER) == VC1_MB_4MV_INTER)
                type_current =  LFilterMainPFrame;

            VerticalDeblockingLumaP(m_CurrMB->currYPlane,
                PQuant,
                YPitch,
                m_CurrMB,
                m_CurrMB,
                type_current);


            if (((m_CurrMB+1)->mbType&VC1_MB_4MV_INTER) == VC1_MB_4MV_INTER)
                type_current_next =  LFilterMainPFrame;

            VerticalDeblockingLumaP((m_CurrMB->currYPlane+8),
                PQuant,
                YPitch,
                m_CurrMB,
                m_CurrMB+1,
                type_current_next);

            VerticalDeblockingChromaP(m_CurrMB->currUPlane,
                PQuant,
                UPitch,
                &m_CurrMB->m_pBlocks[4],
                &(m_CurrMB+1)->m_pBlocks[4],
                type_current_next);

            VerticalDeblockingChromaP(m_CurrMB->currVPlane,
                PQuant,
                VPitch,
                &m_CurrMB->m_pBlocks[5],
                &(m_CurrMB+1)->m_pBlocks[5],
                type_current_next);

            type_current      = type;
            type_current_next = type;
            ++m_CurrMB;

        }

        if ((m_CurrMB->mbType&VC1_MB_4MV_INTER) == VC1_MB_4MV_INTER)
            type_current =  LFilterMainPFrame;

        VerticalDeblockingLumaP(m_CurrMB->currYPlane,
            PQuant,
            YPitch,
            m_CurrMB,
            m_CurrMB,
            type_current);
         VerticalDeblockingLumaP((m_CurrMB->currYPlane+8),
            PQuant,
            YPitch,
            m_CurrMB,
            NULL,
            type_current_next);
        VerticalDeblockingChromaP((m_CurrMB->currUPlane),
            PQuant,
            UPitch,
            &m_CurrMB->m_pBlocks[4],
            NULL,
            type_current_next);
        VerticalDeblockingChromaP((m_CurrMB->currVPlane),
            PQuant,VPitch,
            &m_CurrMB->m_pBlocks[5],
            NULL,
            type_current_next);
        type_current      = type;
        type_current_next = type;
        ++m_CurrMB;
    }

}
#endif //UMC_ENABLE_VC1_VIDEO_DECODER

⌨️ 快捷键说明

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