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

📄 umc_avs_dec_fussion_core_init.cpp

📁 audio-video-codecs.rar语音编解码器
💻 CPP
字号:
/*
//
//              INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license  agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in  accordance  with the terms of that agreement.
//    Copyright (c) 2007 Intel Corporation. All Rights Reserved.
//
//
*/

#include "umc_defs.h"
#if defined(UMC_ENABLE_AVS_VIDEO_DECODER)

#include "umc_avs_dec_fussion_core.h"
#include "umc_avs_dec_mb_info.h"

namespace UMC
{

Status AVSFussionCore::PurgeFrame(AVSFrame *pFrame)
{
    // remove all items from the frame
    pFrame->RemoveSlices(&m_FreeSlices);

    pFrame->RemoveMemoryPieces(&m_FreeMemory);

    // reset all flags
    pFrame->Reset();

    return UMC_OK;

} // Status AVSFussionCore::PurgeFrame(AVSFrame *pFrame)

Status AVSFussionCore::InitializeFrame(AVSFrame *pFrame)
{
    Status umcRes;

    pFrame->m_seqHeader = m_seqHeader;
    pFrame->m_picHeader = m_picHeader;

    // initialize the frame
    umcRes = pFrame->Init();
    if (UMC_OK != umcRes)
        return umcRes;

    // create reference list & increment
    return CreateReferenceLists(pFrame);

} // Status AVSFussionCore::InitializeFrame(AVSFrame *pFrame)

static
Ipp32s InitializeReferenceList(AVSFrame **pRefList, AVSListElement<AVSFrame> *pFrameList)
{
    Ipp32s numRefs = 0;

    // reset the reference list
    pRefList[0] = NULL;
    pRefList[1] = NULL;

    while (pFrameList)
    {
        if (pFrameList->IsReference())
        {
            pRefList[1] = pRefList[0];
            pRefList[0] = pFrameList;
            numRefs += 1;
        }

        // go to the next frame in the list
        pFrameList = pFrameList->GetNext();
    }

    return IPP_MIN(2, numRefs);

} // Ipp32s InitializeReferenceList(AVSFrame **pRefList, AVSListElement<AVSFrame> *pFrameList)

Status AVSFussionCore::CreateReferenceLists(AVSFrame *pFrame)
{
    AVSFrame *(refs[2]);

    if (AVS_I_PICTURE != pFrame->m_picHeader.PictureType)
    {
        Ipp32s numRefs;

        numRefs = InitializeReferenceList(refs, m_Frames.GetHead());
        if (0 == numRefs)
        {
            return UMC_ERR_INIT;
        }
        else if (1 == numRefs)
        {
            refs[1] = refs[0];
        }
    }
    else
    {
        refs[0] = refs[1] = 0;
    }

    pFrame->SetReferences(refs);

    return UMC_OK;

} // Status AVSFussionCore::CreateReferenceLists(AVSFrame *pFrame)

} // namespace UMC

#endif // #if defined(UMC_ENABLE_AVS_VIDEO_DECODER)

⌨️ 快捷键说明

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