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

📄 umc_h264_bitstream.h

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 H
📖 第 1 页 / 共 2 页
字号:
{    DYNAMIC_CAST_DECL_BASE(H264Bitstream)public:        H264Bitstream       (Ipp8u* const   pb,                             const Ipp32u   maxsize);        H264Bitstream       ();        ~H264Bitstream      ();protected:        Ipp32u* m_pbs;      // m_pbs points to the current position of the buffer.        Ipp32s m_bitOffset; // Indicates the bit position (0 to 31) in the byte pointed by m_pbs./*#if defined (ARM) || defined (_ARM_)        unsigned short* m_tblCoeffToken[4];        unsigned short* m_tblRunBefore [16];        unsigned short* m_tblTotalZeros[16];        unsigned short* m_tblTotalZerosCR[4];#else   //  defined (ARM) || defined (_ARM_)*/        IppVCHuffmanSpec_32s*   m_tblCoeffToken[4];        IppVCHuffmanSpec_32s*   m_tblRunBefore [16];        IppVCHuffmanSpec_32s*   m_tblTotalZeros[16];        IppVCHuffmanSpec_32s*   m_tblTotalZerosCR[4];//#endif   //  defined (ARM) || defined (_ARM_)        Status InitTables();        Status FreeTables();        Ipp32u*  m_pbsBase;  // m_pbsBase points to the first byte of the buffer.        Ipp32u m_maxBsSize; // Maximum buffer size in bytes.private:    Status GetVUIParam(H264SeqParamSet *sps);    Status GetHRDParam(H264SeqParamSet *sps);        Ipp32u*          m_pbsRBSPBase;  // Points to beginning of previous                                        // "Raw Byte Sequence Payload"public:    Status    AdvanceToNextSCP();    void ResetBitStream_CABAC(void);    void Load16Bits_CABAC(void);    long ReadBits_CABAC(long lNum);    void TerminateDecode_CABAC();    void AlignPointerRight();    long ReadBit_CABAC(void)    {        long lResult;        ippiGetBits1(m_pbs, m_bitOffset, lResult);        return lResult;    } //long H264Bitstream::ReadBits_CABAC(long lNum)    // Initialize CABAC decoding engine    void InitializeDecodingEngine_CABAC(void);    // Initialize CABAC context(s) in intra slices    void InitializeContextVariablesIntra_CABAC(long SliceQPy);    // Initialize CABAC context(s) in inter slices    void InitializeContextVariablesInter_CABAC(long SliceQPy, long cabac_init_idc);    // Calculate residual block    long ResidualBlock4x4_CABAC(short int *coeffLevel, long ctxBlockCat,bool field_decoding_flag);    // Decode block coefficient value nimus one    long DecodeCoeffAbsLevelMinus1_CABAC(long ctxIdxOffset, long &numDecodAbsLevelEq1, long &numDecodAbsLevelGt1);    // Decode syntax element using fixed length decoding    // Decode single bin from stream    long DecodeSingleBin_CABAC(long ctxIdx);    // Decode single bin using bypass decoding    long DecodeBypass_CABAC(void);    // Decode end symbol    long DecodeSymbolEnd_CABAC(void);    CABAC_CONTEXT context_array[460];                       // (CABAC_CONTEXT []) array of cabac context(s)    long int m_lcodIRange;                                      // (long) arithmetic decoding engine variable    long int m_lcodIOffset;                                     // (long) arithmetic decoding engine variable/*    long m_nRegister;    long m_nReadyBits;*/        void            Reset( Ipp8u* const pb, const Ipp32u maxsize);        void            Reset( Ipp8u* const pb, Ipp32s offset, const Ipp32u maxsize);        Ipp32s            GetSCP();        Status          GetNALUnitType( NAL_Unit_Type &uNALUnitType,                                        Ipp8u &uNALStorageIDC);        Status          GetSequenceParamSet(H264SeqParamSet *sps);        Status          GetPictureParamSetPart1(H264PicParamSet *pps);        Status          GetPictureParamSetPart2(H264PicParamSet  *pps,const H264SeqParamSet *sps);        Status          GetPictureParamSet( H264PicParamSet *pps, Ipp8u pic_order_cnt_type);        Status          GetPictureDelimiter( Ipp32u& PicCodType);        Status          ReadFillerData();        void            RollbackCurrentNALU();        Status          GetSliceHeaderPart1( H264SliceHeader *hdr, bool bIsSearch);        Status          GetSliceHeaderPart2(H264SliceHeader *hdr,       // slice header read goes here                                            PredWeightTable *pPredWeight_L0, // L0 weight table goes here                                            PredWeightTable *pPredWeight_L1, // L1 weight table goes here                                            RefPicListReorderInfo *pReorderInfo_L0,                                            RefPicListReorderInfo *pReorderInfo_L1,                                            AdaptiveMarkingInfo *pAdaptiveMarkingInfo,                                            const H264PicParamSet *pps,                                            bool bIsIDRSlice,                                            const H264SeqParamSet *sps,                                            Ipp32u NALRef_idc,          // from slice header NAL unit                                            bool bIsSearch);        // called during next picture search?//sei related functionspublic:        Ipp8u         ParseSEI(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);private:        Ipp8u          sei_message(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          sei_payload(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          buffering_period(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          pic_timing(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          pan_scan_rect(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          filler_payload(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          user_data_registered_itu_t_t35(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          user_data_unregistered(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          recovery_point(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          dec_ref_pic_marking_repetition(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          spare_pic(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          scene_info(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          sub_seq_info(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          sub_seq_layer_characteristics(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          sub_seq_characteristics(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          full_frame_freeze(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          full_frame_freeze_release(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          full_frame_snapshot(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          progressive_refinement_segment_start(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          progressive_refinement_segment_end(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          motion_constrained_slice_group_set(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          reserved_sei_message(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);        Ipp8u          unparsed_sei_message(H264SeqParamSet *sps,Ipp8u current_sps,H264SEIPayLoad *spl);public:        Status  GetCAVLCInfoLuma  ( Ipp32u uVLCSelect,      // N, obtained from num coeffs of above/left blocks                                        Ipp16s uMaxNumCoeff,                                        Ipp16s &uNumCoeff,                                        Ipp16s  *&pPosCoefbuf,                                        Ipp8u field_flag,Ipp8s hp_4x4_block_index);        Status  GetCAVLCInfoChroma  (Ipp16s &sNumCoeff,                                        Ipp16s  *&pPosCoefbuf);     // buffer to return up to 16        // Obtains current position of the buffer pointer.  This is only        // used to maintain the bitstream state when calling an assembly        // routine that accesses the bitstream.        void    GetState    (Ipp8u** pbs, Ipp32u* bitOffset);        // Advances buffer pointer with given number of bits.  This is only        // used to maintain the bitstream state when calling an assembly        // routine that accesses the bitstream.        void    UpdateState ( const Ipp32u  nbits);        Ipp32s  GetVLCElement(bool bIsSigned);  // Read one VLC signed or unsigned value from bitstream        Ipp32u  GetBits     (const Ipp32u nbits);   // Reads bits from buffer.        Ipp32u  Get1Bit     ();                     // Reads one bit from the buffer.        bool    SearchBits  ( const Ipp32u  nbits,// Searches for a code with known number of bits.                              const Ipp32u  code,                              const Ipp32u  lookahead);        bool    NextBit     ();        void   DiscardZeroPadding();        size_t BytesDecoded();        size_t BytesDecodedRoundOff();        // Set current decoding position        void SetDecodedBytes(size_t);};} // end namespace UMC#endif // __UMC_H264_BITSTREAM_H_

⌨️ 快捷键说明

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