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

📄 umc_h264_dec.h

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 H
📖 第 1 页 / 共 5 页
字号:
                    return PicOrderCnt(index,force)*2+FrameNumWrap()*534+FrameNum()*878+PicNum(index,force)*14                        +RefPicListResetCount(index,force);#else                    Ipp32s ret = static_cast <Ipp32s>((Ipp32s)this);                    return ret+index;#endif                }                void        setPicOrderCnt(Ipp32s PicOrderCnt, int index) {m_PicOrderCnt[index] = PicOrderCnt;};                bool        isLongTermRef(Ipp8s WhichField)                {                    if (m_PictureStructureForRef>=FRM_STRUCTURE)                        return m_isLongTermRef[0] && m_isLongTermRef[1];                    else                        return m_isLongTermRef[WhichField];                };                Ipp8u    isLongTermRef()                {                    return m_isLongTermRef[0] + m_isLongTermRef[1]*2;                };                void        SetisLongTermRef(Ipp8s WhichField)                {                    if (m_PictureStructureForRef>=FRM_STRUCTURE)                        m_isLongTermRef[0] = m_isLongTermRef[1] = true;                    else                        m_isLongTermRef[WhichField] = true;                }                void        unSetisShortTermRef(Ipp8u WhichField)                {                    if (m_PictureStructureForRef>=FRM_STRUCTURE)                    {                        m_isShortTermRef[0] = m_isShortTermRef[1] = false;                    }                    else                        m_isShortTermRef[WhichField] = false;                }                void        unSetisLongTermRef(Ipp8u WhichField)                {                    if (m_PictureStructureForRef>=FRM_STRUCTURE)                    {                        m_isLongTermRef[0] = m_isLongTermRef[1] = false;                    }                    else                        m_isLongTermRef[WhichField] = false;                }                Ipp32s      LongTermPicNum(Ipp8u f,Ipp8u force=0)                {                    if ((m_PictureStructureForRef>=FRM_STRUCTURE && force==0) || force==3)                    {                        return MIN(m_LongTermPicNum[0],m_LongTermPicNum[1]);                    }                    else if (force==2)                    {                        if (isLongTermRef(0) && isLongTermRef(1)) return MIN(m_LongTermPicNum[0],m_LongTermPicNum[1]);                        else if (isShortTermRef(0)) return m_LongTermPicNum[0];                        else return m_LongTermPicNum[0];                    }                    return m_LongTermPicNum[f];                }                void        setLongTermPicNum(Ipp32s LongTermPicNum,Ipp8u f) {m_LongTermPicNum[f] = LongTermPicNum;}                void        UpdateLongTermPicNum(Ipp8u CurrPicStruct);                void        IncreaseRefPicListResetCount(Ipp8u f)                {                    /*if (m_PictureStructureForRef>=FRM_STRUCTURE)                    {                        m_RefPicListResetCount[0]++;                        m_RefPicListResetCount[1]++;                    }                    else*/                        m_RefPicListResetCount[f]++;                }                void        InitRefPicListResetCount(Ipp8u f)                {                    if (m_PictureStructureForRef>=FRM_STRUCTURE)                        m_RefPicListResetCount[0]=m_RefPicListResetCount[1]=0;                    else                        m_RefPicListResetCount[f]=0;                }                Ipp32s      RefPicListResetCount(Ipp8u f,Ipp8u force=0)                {                    if ((m_PictureStructureForRef>=FRM_STRUCTURE && force==0)|| force==3)                        return MAX(m_RefPicListResetCount[0],m_RefPicListResetCount[1]);                    else                        return m_RefPicListResetCount[f];                }                Ipp8s           GetNumberByParity(Ipp8s parity)                {                    if (parity==-1) return -1;                    if (m_bottom_field_flag[0]==parity) return 0;                    if (m_bottom_field_flag[1]==parity) return 1;                    VM_ASSERT(m_PictureStructureForRef>=FRM_STRUCTURE);                    return 0;                }                bool                        m_bIsIDRPic;                   // Read from slice NAL unit of current picture. True indicates the                   // picture contains only I or SI slice types.                Ipp16u                      m_num_slice_start;                //start slice index of 2nd field                    // Buffer (within m_pParsedFrameData) used to store information for                    // each MB in the bitstream.                // Struct containing list 0 and list 1 reference picture lists for one slice.                // Length is plus 1 to provide for null termination.                struct H264H264DecoderRefPicListStruct                {                    H264DecoderFrame    *m_RefPicList[MAX_NUM_REF_FRAMES+1];                    Ipp8s           m_Prediction[MAX_NUM_REF_FRAMES+1];                };                struct H264DecoderRefPicList                {                    H264H264DecoderRefPicListStruct m_RefPicListL0;                    H264H264DecoderRefPicListStruct m_RefPicListL1;                };    // H264DecoderRefPicList                H264DecoderRefPicList    *m_pRefPicList;                    // Buffer (within m_pParsedFrameData) used to store reference                    // picture lists generated while decoding the frame. Contains                    // a pair of lists (list 0, list 1) for each slice.                //////////////////////////////////////////////////////////////////////////////                // GetRefPicList                // Returns pointer to start of specified ref pic list.                //////////////////////////////////////////////////////////////////////////////                H264H264DecoderRefPicListStruct* GetRefPicList(Ipp32u SliceNum, Ipp32u List)                {                    H264DecoderFrame::H264H264DecoderRefPicListStruct *pList;                    if (List)                        pList = &m_pRefPicList[SliceNum].m_RefPicListL1;                    else                        pList = &m_pRefPicList[SliceNum].m_RefPicListL0;                    return pList;                }    // RefPicList                    // Returns pointer to start of specified ref pic list.                Ipp8u                 *m_pParsedFrameData;                Ipp8u                 *m_pParsedFrameDataNew;            // This points to a huge, monolithic buffer that contains data            // derived from parsing the current frame.  It contains motion            // vectors,  MB info, reference indices, and slice info for the            // current frame, among other things. When B slices are used it            // contains L0 and L1 motion vectors and reference indices.        sDimensions              m_paddedParsedFrameDataSize;            // m_pParsedFrameData's allocated size is remembered so that a            // re-allocation is done only if size requirements exceed the            // existing allocation.            // m_paddedParsedFrameDataSize contains the image dimensions,            // rounded up to a multiple of 16, that were used.        Status                  allocateParsedFrameData                                        (                                        const sDimensions&                                        );            // Reallocate m_pParsedFrameData, if necessary, and initialize the            // various pointers that point into it.        void                        deallocateParsedFrameData();        };// The H264DecoderFrameList class implements a doubly-linked list of// H264DecoderFrame objects.  It uses the m_pPreviousFrame and m_pFutureFrame// members of the H264DecoderFrame class to implement the links.        class H264DecoderFrameList        {        private:                // m_pHead points to the first element in the list, and m_pTail                // points to the last.  m_pHead->previous() and m_pTail->future()                // are both NULL.                H264DecoderFrame               *m_pHead;                H264DecoderFrame               *m_pTail;                H264DecoderFrame               *m_pCurrent;        public:                                H264DecoderFrameList() { m_pHead = m_pTail = m_pCurrent = 0; }        virtual                ~H264DecoderFrameList();                H264DecoderFrame   *head() { return m_pHead; }                H264DecoderFrame   *tail() { return m_pTail; }                bool            isEmpty() { return !m_pHead; }                H264DecoderFrame   *detachHead();    // Detach the first frame and return a pointer to it,                                                // or return NULL if the list is empty.                void            append(H264DecoderFrame *pFrame);                    // Append the given frame to our tail                void            insertList(H264DecoderFrameList &src);                    // Move the given list to the beginning of our list.                void            destroy(){};                H264DecoderFrame   *findNextDisposable(void);                    // Search through the list for the next disposable frame to decode into                void            insertAtCurrent(H264DecoderFrame *pFrame);                    // Inserts a frame immediately after the position pointed to by m_pCurrent                void            resetCurrent(void) { m_pCurrent = m_pTail; }                    // Resets the position of the current to the tail. This allows                    // us to start "before" the head when we wrap around.                void            setCurrent(H264DecoderFrame *pFrame) { m_pCurrent = pFrame; }                    // Set the position of the current to pFrame                void            removeAllRef();                    // Mark all frames as not used as reference frames.                void            IncreaseRefPicListResetCount(H264DecoderFrame *ExcludeFrame);                    // Mark all frames as not used as reference frames.                void            freeOldestShortTermRef();                    // Mark the oldest short-term reference frame as not used.                void            freeShortTermRef(Ipp32s PicNum);                    // Mark the short-term reference frame with specified PicNum                    // as not used                void            freeLongTermRef(Ipp32s LongTermPicNum);                    // Mark the long-term reference frame with specified LongTermPicNum                    // as not used                void            freeLongTermRefIdx(Ipp32s LongTermFrameIdx);                    // Mark the long-term reference frame with specified LongTermFrameIdx                    // as not used                void            freeOldLongTermRef(Ipp32s MaxLongTermFrameIdx);                    // Mark any long-term reference frame with LongTermFrameIdx greater                    // than MaxLongTermFrameIdx as not used.                void            changeSTtoLTRef(Ipp32s PicNum, Ipp32s LongTermFrameIdx);                    // Mark the short-term reference frame with                    // specified PicNum as long-term with specified long term idx.                void            countActiveRefs(Ipp32u &NumShortTerm, Ipp32u &NumLongTerm);                    // Return number of active short and long term reference frames.                H264DecoderFrame   *findOldestDisplayable();                    // Search through the list for the oldest displayable frame.                Ipp32s                countNumDisplayable();                    // Return number of displayable frames.                void            removeAllDisplayable();                    // Mark all frames as not displayable.        };        // Slice data struct used by  decoder for maintaining slice-level        // data for a picture.

⌨️ 快捷键说明

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