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

📄 umc_vc1_dec_ppic_adv.cpp

📁 audio-video-codecs.rar语音编解码器
💻 CPP
📖 第 1 页 / 共 3 页
字号:
                    {
                        is_bottom = 1;
                        //bottom in case "both field"
                    // VM_ASSERT(0);
                        //Luma scale
                        VC1_GET_BITS(6, LUMSCALE);
                        //Luma shift
                        VC1_GET_BITS(6, LUMSHIFT);

                        STATISTICS_START_TIME(m_timeStatistics->intensity_StartTime);
                        FillTablesForIntensityCompensation_Adv(pContext, LUMSCALE,LUMSHIFT,
                                            1,index_bottom);
                    STATISTICS_END_TIME(m_timeStatistics->intensity_StartTime,
                                    m_timeStatistics->intensity_EndTime,
                                    m_timeStatistics->intensity_TotalTime);
                    }

                    pContext->m_frmBuff.m_pFrames[index_top].m_bIsExpanded = 0;

            //#ifdef DXVA_SIM
                picLayerHeader->MVMODE2 = picLayerHeader->MVMODE;
            //#endif
                }
            }
    }
    else
    {
        //MVMODE VLC    Mode
        //1             1 MV
        //01            Mixed MV
        //001           1 MV Half-pel
        //0000          1 MV Half-pel bilinear
        //0001          Intensity Compensation
        Ipp32s bit_count = 1;
        VC1_GET_BITS(1, picLayerHeader->MVMODE);
        while((picLayerHeader->MVMODE == 0) && (bit_count < 4))
        {
            VC1_GET_BITS(1, picLayerHeader->MVMODE);
            bit_count++;
        }
        if (bit_count < 4)
            picLayerHeader->MVMODE = VC1_LUT_SET(bit_count,bc_lut_2);
        else
            if(picLayerHeader->MVMODE == 0)
                picLayerHeader->MVMODE = VC1_MVMODE_HPELBI_1MV;
            else
            {
                pContext->m_bIntensityCompensation = 1;
                picLayerHeader->MVMODE = VC1_MVMODE_INTENSCOMP;
                {
                    Ipp32u is_bottom = 0;
                    Ipp32u is_top    = 0;
                    Ipp32s index_bottom = pContext->m_frmBuff.m_iPrevIndex;
                    Ipp32s index_top = pContext->m_frmBuff.m_iPrevIndex;

                    Ipp32s bit_count = 1;
                    VC1_GET_BITS(1, picLayerHeader->MVMODE);
                    while((picLayerHeader->MVMODE == 0) && (bit_count < 3))
                    {
                        VC1_GET_BITS(1, picLayerHeader->MVMODE);
                        bit_count++;
                    }
                    if (bit_count < 3)
                        picLayerHeader->MVMODE = VC1_LUT_SET(bit_count,bc_lut_4);
                    else
                        if(picLayerHeader->MVMODE == 0)
                            picLayerHeader->MVMODE = VC1_MVMODE_HPELBI_1MV;
                        else
                            picLayerHeader->MVMODE = VC1_MVMODE_HPEL_1MV;

                    if (picLayerHeader->CurrField)
                    {
                        pContext->m_bNeedToUseCompBuffer = 1;
                        if (picLayerHeader->BottomField)
                            index_top = pContext->m_frmBuff.m_iCurrIndex;
                        else
                            index_bottom = pContext->m_frmBuff.m_iCurrIndex;
                    }

                    //INTCOMPFIELD
                    VC1_GET_BITS(1, picLayerHeader->INTCOMFIELD);
                    if(picLayerHeader->INTCOMFIELD == 1)
                    {
                        //1
                        picLayerHeader->INTCOMFIELD = VC1_INTCOMP_BOTH_FIELD;
                    }
                    else
                    {
                        VC1_GET_BITS(1, picLayerHeader->INTCOMFIELD);
                        if(picLayerHeader->INTCOMFIELD == 1)
                        {
                            //01
                            picLayerHeader->INTCOMFIELD = VC1_INTCOMP_BOTTOM_FIELD;
                        }
                        else
                        {
                            //00
                            picLayerHeader->INTCOMFIELD = VC1_INTCOMP_TOP_FIELD;
                        }
                    }

                    if(VC1_IS_INT_TOP_FIELD(picLayerHeader->INTCOMFIELD))
                    {
                        is_top    = 1;
                        //top
                        //Luma scale
                        VC1_GET_BITS(6, LUMSCALE);
                        //Luma shift
                        VC1_GET_BITS(6, LUMSHIFT);
                        STATISTICS_START_TIME(m_timeStatistics->intensity_StartTime);
                        FillTablesForIntensityCompensation_Adv(pContext, LUMSCALE,LUMSHIFT,
                            0,index_top);

                        STATISTICS_END_TIME(m_timeStatistics->intensity_StartTime,
                                    m_timeStatistics->intensity_EndTime,
                                    m_timeStatistics->intensity_TotalTime);
                    }

                    if(VC1_IS_INT_BOTTOM_FIELD(picLayerHeader->INTCOMFIELD) )
                    {
                        is_bottom = 1;
                        //bottom in case "both field"
                    // VM_ASSERT(0);
                        //Luma scale
                        VC1_GET_BITS(6, LUMSCALE);
                        //Luma shift
                        VC1_GET_BITS(6, LUMSHIFT);

                        STATISTICS_START_TIME(m_timeStatistics->intensity_StartTime);
                        FillTablesForIntensityCompensation_Adv(pContext, LUMSCALE,LUMSHIFT,
                                            1,index_bottom);
                    STATISTICS_END_TIME(m_timeStatistics->intensity_StartTime,
                                    m_timeStatistics->intensity_EndTime,
                                    m_timeStatistics->intensity_TotalTime);
                    }

                    //pContext->m_frmBuff.m_pFrames[index_top].m_bIsExpanded = 0;

                    //if (is_top)
                    //{
                    //    if (index_top == pContext->m_frmBuff.m_iCurrIndex || pContext->typeOfPreviousFrame == VC1_FieldInterlace)
                    //        ExpandFrame_Field(pContext, &pContext->m_frmBuff.m_pFrames[index_top],0);
                    //    else
                    //    {
                    //        if ((pContext->typeOfPreviousFrame != VC1_FieldInterlace))
                    //            ExpandIntens_table[pContext->typeOfPreviousFrame](pContext, &pContext->m_frmBuff.m_pFrames[index_top]);
                    //        else
                    //            ExpandFrame_Field(pContext, &pContext->m_frmBuff.m_pFrames[index_top],0);
                    //    }
                    //}
                    //pContext->m_frmBuff.m_pFrames[index_bottom].m_bIsExpanded = 0;

                    //if (is_bottom)
                    //{
                    //    if (index_bottom == pContext->m_frmBuff.m_iCurrIndex || pContext->typeOfPreviousFrame == VC1_FieldInterlace)
                    //        ExpandFrame_Field(pContext, &pContext->m_frmBuff.m_pFrames[index_bottom],1);
                    //    else
                    //    {
                    //        if ((pContext->typeOfPreviousFrame != VC1_FieldInterlace))
                    //            ExpandIntens_table[pContext->typeOfPreviousFrame](pContext, &pContext->m_frmBuff.m_pFrames[index_bottom]);
                    //        else
                    //            ExpandFrame_Field(pContext, &pContext->m_frmBuff.m_pFrames[index_bottom],1);
                    //    }
                    //}

            //#ifdef DXVA_SIM
                picLayerHeader->MVMODE2 = picLayerHeader->MVMODE;
            //#endif
                }
            }
    }

    //motion vector table
    VC1_GET_BITS(3, picLayerHeader->MBMODETAB);       //MBMODETAB
    ChooseMBModeInterlaceField(pContext, picLayerHeader->MBMODETAB);

    //motion vector table
    if(picLayerHeader->NUMREF)
    {
        VC1_GET_BITS(3, picLayerHeader->MVTAB);       //MVTAB
        picLayerHeader->m_pCurrMVDifftbl =  pContext->m_vlcTbl->MV_INTERLACE_TABLES[picLayerHeader->MVTAB]; //MVTAB
    }
    else
    {
        VC1_GET_BITS(2, picLayerHeader->MVTAB);       //MVTAB
        picLayerHeader->m_pCurrMVDifftbl =  pContext->m_vlcTbl->MV_INTERLACE_TABLES[8 + picLayerHeader->MVTAB]; //MVTAB
    }

    //coded block pattern table
    VC1_GET_BITS(3, picLayerHeader->CBPTAB);       //CBPTAB
    picLayerHeader->m_pCurrCBPCYtbl = pContext->m_vlcTbl->CBPCY_PB_INTERLACE_TABLES[picLayerHeader->CBPTAB]; //CBPTAB

    if(picLayerHeader->MVMODE == VC1_MVMODE_MIXED_MV)
    {
        VC1_GET_BITS(2, picLayerHeader->MV4BPTAB)        //MV4BPTAB;
        picLayerHeader->m_pMV4BP = pContext->m_vlcTbl->MV4BP_TABLES[picLayerHeader->MV4BPTAB];
    }

    vc1Res = VOPDQuant(pContext);

    if(seqLayerHeader->VSTRANSFORM == 1)
    {
        //macroblock - level transform type flag
        VC1_GET_BITS(1, picLayerHeader->TTMBF);

        if(picLayerHeader->TTMBF)
        {
            //frame-level transform type
            VC1_GET_BITS(2, picLayerHeader->TTFRM_ORIG);
            picLayerHeader->TTFRM = 1 << picLayerHeader->TTFRM_ORIG;
        }
        else
            picLayerHeader->TTFRM = VC1_BLK_INTER;
    }
    else
    {
        picLayerHeader->TTFRM = VC1_BLK_INTER8X8;
    }

    //frame-level transform AC Coding set index
    VC1_GET_BITS(1, picLayerHeader->TRANSACFRM);//TRANSACFRM
    if(picLayerHeader->TRANSACFRM == 1)
    {
        VC1_GET_BITS(1, picLayerHeader->TRANSACFRM);
        picLayerHeader->TRANSACFRM++;
    }
     ChooseACTable(picLayerHeader, picLayerHeader->TRANSACFRM, picLayerHeader->TRANSACFRM);//TRANSACFRM

    VC1_GET_BITS(1, picLayerHeader->TRANSDCTAB);       //TRANSDCTAB
    ChooseDCTable(pContext, picLayerHeader->TRANSDCTAB);       //TRANSDCTAB

   return vc1Res;
}

VC1Status Decode_InterlaceFieldPpicture_Adv(VC1Context* pContext)
{
    Ipp32s i, j;
    VC1Status vc1Res = VC1_OK;
    VC1SingletonMB* sMB = pContext->m_pSingleMB;

    DecodeFieldHeaderParams_InterlaceFieldPpicture_Adv(pContext);

    for(i = 0; i < sMB->widthMB; i++)
    {
        for(j = 0; j < (sMB->heightMB/2);j++)
        {
            vc1Res = MBLayer_Field_InterlacedPpicture(pContext);
            if(vc1Res != VC1_OK)
            {
                VM_ASSERT(0);
                break;
            }

            //VM_Debug::GetInstance().vm_debug_frame(-1,VC1_POSITION,VM_STRING("Macroblock Type: %d\n"), pContext->m_pCurrMB->mbType);
            sMB->m_currMBXpos++;
            pContext->m_pBlock += 8*8*6;

            pContext->m_pCurrMB++;
            pContext->CurrDC++;
        }
        sMB->m_currMBXpos = 0;
        sMB->m_currMBYpos++;
        sMB->slice_currMBYpos++;
    }

    if ((pContext->m_seqLayerHeader->LOOPFILTER))
    {
        Ipp32u deblock_offset = 0;
        if (!pContext->DeblockInfo.is_last_deblock)
            deblock_offset = 1;

        pContext->DeblockInfo.start_pos = pContext->DeblockInfo.start_pos+pContext->DeblockInfo.HeightMB-deblock_offset;
        pContext->DeblockInfo.HeightMB = sMB->slice_currMBYpos+1;

        pContext->DeblockInfo.is_last_deblock = 1;

        STATISTICS_START_TIME(m_timeStatistics->deblocking_StartTime);

        Deblocking_ProgressivePpicture_Adv(pContext);

        STATISTICS_END_TIME(m_timeStatistics->deblocking_StartTime,
                            m_timeStatistics->deblocking_EndTime,
                            m_timeStatistics->deblocking_TotalTime);
    }

    pContext->m_picLayerHeader->is_slice = 0;

    return vc1Res;
}

#endif //UMC_ENABLE_VC1_VIDEO_DECODER

⌨️ 快捷键说明

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