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

📄 umc_vc1_smoothing_adv.cpp

📁 audio-video-codecs.rar语音编解码器
💻 CPP
📖 第 1 页 / 共 3 页
字号:
                    CurrBlock  += 8*8*6;
                    pCurrMB++;

                    CurrFieldFlag = (pCurrMB->FIELDTX)<<1 | pCurrMB->FIELDTX;
                    LeftCurrFieldFlag |= pCurrMB->FIELDTX;

                    YPlane = pCurrMB->currYPlane;
                    UPlane = pCurrMB->currUPlane;
                    VPlane = pCurrMB->currVPlane;

                    CurrOverlap    = pCurrMB->Overlap;
                    LeftOverlap    = (pCurrMB - 1)->Overlap;

                    //UpYrow = pContext->SmoothingInfo->SmoothUpperYRows[i-1];
                    //UpUrow = pContext->SmoothingInfo->SmoothUpperURows[i-1];
                    //UpVrow = pContext->SmoothingInfo->SmoothUpperVRows[i-1];

                    //LUMA

                    if(CurrOverlap)
                    {
                        //internal vertical smoothing
                        _own_ippiSmoothingLuma_VerEdge_VC1_16s8u_C1R(CurrBlock + 6,  VC1_PIXEL_IN_LUMA*2,
                                                                    CurrBlock + 8,  VC1_PIXEL_IN_LUMA*2,
                                                                    YPlane + 8,     YPitch,
                                                                    CurrFieldFlag,  EdgeDisabledFlag);
                    }

                    if(LeftOverlap)
                    {
                        if(CurrOverlap)
                        {
                            //left boundary vertical smoothing
                            _own_ippiSmoothingLuma_VerEdge_VC1_16s8u_C1R(CurrBlock - 8*8*6 + 14,  VC1_PIXEL_IN_LUMA*2,
                                                                        CurrBlock,               VC1_PIXEL_IN_LUMA*2,
                                                                        YPlane,                  YPitch,
                                                                        LeftCurrFieldFlag,       EdgeDisabledFlag);
                            //CHROMA
                            //U vertical smoothing
                            _own_ippiSmoothingChroma_VerEdge_VC1_16s8u_C1R(CurrBlock - 8*8*2 + 6, VC1_PIXEL_IN_CHROMA*2,
                                                                        CurrBlock + 8*8*4,     VC1_PIXEL_IN_CHROMA*2,
                                                                        UPlane,                UPitch);

                            //V vertical smoothing
                            _own_ippiSmoothingChroma_VerEdge_VC1_16s8u_C1R(CurrBlock - 8*8 + 6, VC1_PIXEL_IN_CHROMA*2,
                                                                        CurrBlock +  8*8*5,  VC1_PIXEL_IN_CHROMA*2,
                                                                            VPlane,             VPitch);
                        }


                        if(pContext->m_picLayerHeader->FCM != VC1_FrameInterlace)
                        {
                            //left MB internal horizontal edge
                            _own_ippiSmoothingLuma_HorEdge_VC1_16s8u_C1R(CurrBlock - 8*8*4 - 32,   VC1_PIXEL_IN_LUMA*2,
                                                                        CurrBlock - 8*8*4,        VC1_PIXEL_IN_LUMA*2,
                                                                        YPlane - 16 + 8*YPitch,   YPitch,
                                                                        EdgeDisabledFlag);
                        }
                   }


                    //copy last two srings of Left macroblock to SmoothUpperRows
                    //ippsCopy_16s(CurrBlock - 64*2 - 32, pContext->SmoothingInfo->SmoothUpperYRows[i - 1], 32);
                    //ippsCopy_16s(CurrBlock - 64 - 16, pContext->SmoothingInfo->SmoothUpperURows[i - 1], 16);
                    //ippsCopy_16s(CurrBlock - 16,  pContext->SmoothingInfo->SmoothUpperVRows[i -1], 16);
                }

                //RIGHT MB
                //UpYrow = pContext->SmoothingInfo->SmoothUpperYRows[Width - 1];
                //UpUrow = pContext->SmoothingInfo->SmoothUpperURows[Width - 1];
                //UpVrow = pContext->SmoothingInfo->SmoothUpperVRows[Width - 1];


                if(CurrOverlap && (pContext->m_picLayerHeader->FCM != VC1_FrameInterlace))
                {
                    //MB internal horizontal edge
                    _own_ippiSmoothingLuma_HorEdge_VC1_16s8u_C1R(CurrBlock + 8*8*2 - 32,  VC1_PIXEL_IN_LUMA*2,
                                                                CurrBlock + 8*8*2,       VC1_PIXEL_IN_LUMA*2,
                                                                YPlane + 8*YPitch,       YPitch,
                                                                EdgeDisabledFlag);
                }

                //copy last two srings of Left macroblock to SmoothUpperRows
                //ippsCopy_16s(CurrBlock + 64*4 - 32, pContext->SmoothingInfo->SmoothUpperYRows[Width - 1], 32);
                //ippsCopy_16s(CurrBlock + 64*5 - 16, pContext->SmoothingInfo->SmoothUpperURows[Width - 1], 16);
                //ippsCopy_16s(CurrBlock + 64*6 - 16, pContext->SmoothingInfo->SmoothUpperVRows[Width - 1], 16);

                CurrBlock  += 8*8*6;
                pCurrMB++;

                YPlane = pCurrMB->currYPlane;
                UPlane = pCurrMB->currUPlane;
                VPlane = pCurrMB->currVPlane;

                CurrOverlap    = pCurrMB->Overlap;
                LeftOverlap    = (pCurrMB - 1)->Overlap;
                //TopLeftOverlap = (pCurrMB - Width - 1)->Overlap;
                //TopOverlap     = (pCurrMB - Width)->Overlap;
            }
        }
    }
}

void Smoothing_P_Adv(VC1Context* pContext, Ipp32s Height)
{
    if(pContext->m_seqLayerHeader->OVERLAP == 0)
        return;

    {
        VC1MB* pCurrMB = pContext->m_pCurrMB;
        Ipp32s notTop = VC1_IS_NO_TOP_MB(pCurrMB->LeftTopRightPositionFlag);
        Ipp32s Width = pContext->m_seqLayerHeader->widthMB;
        Ipp32u EdgeDisabledFlag = 0;

        Ipp32u CurrFieldFlag = (pCurrMB->FIELDTX)<<1 | pCurrMB->FIELDTX;
        Ipp32u LeftCurrFieldFlag = 0;

        Ipp16s* CurrBlock = pContext->m_pBlock;
        Ipp8u* YPlane = pCurrMB->currYPlane;
        Ipp8u* UPlane = pCurrMB->currUPlane;
        Ipp8u* VPlane = pCurrMB->currVPlane;

        Ipp32s YPitch = pCurrMB->currYPitch;
        Ipp32s UPitch = pCurrMB->currUPitch;
        Ipp32s VPitch = pCurrMB->currVPitch;
        Ipp32s LeftIntra;
        Ipp32s TopLeftIntra;
        Ipp32s TopIntra;
        Ipp32s CurrIntra = pCurrMB->IntraFlag*pCurrMB->Overlap;

        Ipp32s i, j;
        //Ipp16s* UpYrow;
        //Ipp16s* UpUrow;
        //Ipp16s* UpVrow;

        for (j = 0; j< Height; j++)
        {
            notTop = VC1_IS_NO_TOP_MB(pCurrMB->LeftTopRightPositionFlag);

            if(notTop)
            {
                if(CurrIntra)
                {
                    //first block in row
                    CurrFieldFlag = (pCurrMB->FIELDTX)<<1 | pCurrMB->FIELDTX;


                    //internal vertical smoothing
                    EdgeDisabledFlag = (VC1_EDGE_MB(CurrIntra,VC1_BLOCKS_0_1_INTRA) * (IPPVC_EDGE_HALF_1))
                                      |(VC1_EDGE_MB(CurrIntra,VC1_BLOCKS_2_3_INTRA) * (IPPVC_EDGE_HALF_2));

                    if(EdgeDisabledFlag)
                        _own_ippiSmoothingLuma_VerEdge_VC1_16s8u_C1R(CurrBlock + 6, VC1_PIXEL_IN_LUMA*2,
                                                                    CurrBlock + 8, VC1_PIXEL_IN_LUMA*2,
                                                                    YPlane    + 8, YPitch,
                                                                    CurrFieldFlag, EdgeDisabledFlag);
                }

                for (i = 1; i < Width; i++)
                {
                    LeftCurrFieldFlag = pCurrMB->FIELDTX<<1;

                    CurrBlock  += 8*8*6;
                    pCurrMB++;

                    YPlane = pCurrMB->currYPlane;
                    UPlane = pCurrMB->currUPlane;
                    VPlane = pCurrMB->currVPlane;

                    //UpYrow = pContext->SmoothingInfo->SmoothUpperYRows[i-1];
                    //UpUrow = pContext->SmoothingInfo->SmoothUpperURows[i-1];
                    //UpVrow = pContext->SmoothingInfo->SmoothUpperVRows[i-1];

                    CurrIntra    = (pCurrMB)->IntraFlag*pCurrMB->Overlap;
                    LeftIntra    = (pCurrMB - 1)->IntraFlag*(pCurrMB - 1)->Overlap;
                    TopLeftIntra = (pCurrMB - Width - 1)->IntraFlag*(pCurrMB - Width - 1)->Overlap;

                    CurrFieldFlag = (pCurrMB->FIELDTX)<<1 | pCurrMB->FIELDTX;
                    LeftCurrFieldFlag |= pCurrMB->FIELDTX;

                    if(CurrIntra)
                    {

                        //////////////////////////////
                        //internal vertical smoothing
                        EdgeDisabledFlag = (VC1_EDGE_MB(CurrIntra,VC1_BLOCKS_0_1_INTRA) * (IPPVC_EDGE_HALF_1))
                                        |(VC1_EDGE_MB(CurrIntra,VC1_BLOCKS_2_3_INTRA) * (IPPVC_EDGE_HALF_2));

                        if(EdgeDisabledFlag)
                            _own_ippiSmoothingLuma_VerEdge_VC1_16s8u_C1R(CurrBlock + 6,       VC1_PIXEL_IN_LUMA*2,
                                                                    CurrBlock + 8,        VC1_PIXEL_IN_LUMA*2,
                                                                    YPlane+8,             YPitch,
                                                                    CurrFieldFlag,        EdgeDisabledFlag);

                        if(LeftIntra)
                        {
                            //////////////////////////////////
                            //LUMA left boundary vertical smoothing
                            EdgeDisabledFlag =(((VC1_EDGE_MB(CurrIntra,VC1_BLOCK_0_INTRA)) && (VC1_EDGE_MB(LeftIntra, VC1_BLOCK_1_INTRA)))
                                *(IPPVC_EDGE_HALF_1))|
                                (((VC1_EDGE_MB(CurrIntra,VC1_BLOCK_2_INTRA)) && (VC1_EDGE_MB(LeftIntra, VC1_BLOCK_3_INTRA)))
                                *(IPPVC_EDGE_HALF_2));

                            if(EdgeDisabledFlag)
                            _own_ippiSmoothingLuma_VerEdge_VC1_16s8u_C1R(CurrBlock - 8*8*6+14, VC1_PIXEL_IN_LUMA*2,
                                                                        CurrBlock,            VC1_PIXEL_IN_LUMA*2,
                                                                        YPlane,               YPitch,
                                                                        LeftCurrFieldFlag,    EdgeDisabledFlag);
                        }

                        if(((LeftIntra & VC1_BLOCK_4_INTRA) == VC1_BLOCK_4_INTRA) && ((CurrIntra & VC1_BLOCK_4_INTRA) == VC1_BLOCK_4_INTRA))
                        {
                            ///////////////////////
                            //U vertical smoothing
                            _own_ippiSmoothingChroma_VerEdge_VC1_16s8u_C1R(CurrBlock - 8*8*2 + 6, VC1_PIXEL_IN_CHROMA*2,
                                                                        CurrBlock + 8*8*4,     VC1_PIXEL_IN_CHROMA*2,
                                                                        UPlane,                UPitch);

                            ///////////////////////
                            //V vertical smoothing
                            _own_ippiSmoothingChroma_VerEdge_VC1_16s8u_C1R(CurrBlock - 8*8 + 6, VC1_PIXEL_IN_CHROMA*2,
                                                                        CurrBlock + 8*8*5,   VC1_PIXEL_IN_CHROMA*2,
                                                                        VPlane,              VPitch);
                        }
                    }



                    if(LeftIntra && (pContext->m_picLayerHeader->FCM != VC1_FrameInterlace))
                    {
                        ////////////////////////////////
                        //left MB Upper horizontal edge
                        EdgeDisabledFlag =(((VC1_EDGE_MB(TopLeftIntra,VC1_BLOCK_2_INTRA)) && (VC1_EDGE_MB(LeftIntra, VC1_BLOCK_0_INTRA)))
                            *(IPPVC_EDGE_HALF_1))|
                            (((VC1_EDGE_MB(TopLeftIntra,VC1_BLOCK_3_INTRA)) && (VC1_EDGE_MB(LeftIntra, VC1_BLOCK_1_INTRA)))
                            *(IPPVC_EDGE_HALF_2));

⌨️ 快捷键说明

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