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

📄 h263.h

📁 这是在PCA下的基于IPP库示例代码例子,在网上下了IPP的库之后,设置相关参数就可以编译该代码.
💻 H
📖 第 1 页 / 共 2 页
字号:
  int  scalability_type;} h263_PictureFormat;/* Video Object Plane with short header Info */typedef struct _h263_VideoPictureH263 {    int         temporal_reference;    int         split_screen_indicator;    int         document_camera_indicator;    int         full_picture_freeze_release;    int         picture_coding_type;    int         plusptype;    int         prev_temporal_reference;    h263_PTYPEmodes    modes;    h263_OPPTYPEmodes  oppmodes;    h263_PictureFormat format;    int width;    int height;    int MacroBlockPerRow;    int MacroBlockPerCol;    /* plusptype fields  */    int         ufep;    int         PCF;    int         prev_PCF;    int         rtype;    int         CPM;    int         PSBI;    int         PAR_code;    int         PAR_width;    int         PAR_height;    int         pic_quant;    int         gob_number;    int         num_gobs_in_pic;    int         RowsPerGOB;    int         quant_scale;    int         GSBI;    int         GFID;    int         clock_conversion_code;    int         clock_divisor;    int         prev_clock_conversion_code;    int         prev_clock_divisor;    int         ext_temporal_reference;    int         unlimited_UMV;    int         sliceSubmodes; /* bit 1 - Rectangular slices; bit 2 - Arbitrary slice ordering */    int         enh_layer_num;    int         ref_layer_num;    int         RPSflags;    int         pred_temp_ref;    int         temporal_reference_B;    int         dbquant;    int         wda;    IppMotionVector warpParams[4];    int         fillMode;    int         fillColor[3];} h263_VideoPicture;typedef struct _h263_EnhancedLayer {  h263_Frame    c_Frame;  h263_Frame    r_Frame;  h263_Frame    n_Frame;  h263_Frame    *l_Frame;  /* reference frame from the lower reference layer */  h263_Frame    *v_Frame;  /* frame for output */  h263_Frame    a_Frame;   /* aux frame used in resampling */  IppMotionVector warpParams[4];} h263_EnhancedLayer;/* Video Sequence Info */typedef struct _h263_VideoSequence {    h263_Frame              cFrame;       /* current */    h263_Frame              rFrame;       /* reference in past */    h263_Frame              nFrame;       /* B-parts of PB-frames / B-frames */    h263_Frame              bFrame;       /* B-frames */    h263_Frame              aFrame;       /* aux frame used in resampling */    h263_Frame              *vFrame;      /* frame for display */    h263_Frame              *refFrame;    /* ptr to reference frame, used in resampling */    h263_VideoPicture       VideoPicture;    h263_OPPTYPEmodes       oppmodes[H263_MAX_ENH_LAYERS + 1];  /* layers 1(base)-15 */    h263_PictureFormat      format[H263_MAX_ENH_LAYERS + 1];    int                     prev_pic_type[H263_MAX_ENH_LAYERS + 1];    int                     ref_layer_num[H263_MAX_ENH_LAYERS + 1] ;    int                     ref_layer_num_b[H263_MAX_ENH_LAYERS + 1];    h263_EnhancedLayer      *enhLayers[H263_MAX_ENH_LAYERS];    h263_MacroBlock         *MBinfo;    int                     num_of_MBs;    int                     frameCount;    int                     frameInterval;    int                     frameScale;    int                     picture_time_increment_resolution;    int                     PicIndex;    h263_IntraPredBuff      IntraPredBuff;    Ipp8u                   GOBboundary[72]; /* max mbPerCol */    IppMotionVector         *Bmv; /* motion vector predictors (forw and back) in B-frames */    IppMotionVector warpParams[4];    int             fillMode;    int             fillColor[3];    /*  h263_DataPartMacroBlock*     DataPartBuff; */    int                     Ppics_to_show;    int                     Bpics_to_show;    /* for B-Frame direct mode */    int                      TRB, TRD;    /* time increment of past and future frame for B-frame */    Ipp64s                  rTime, nTime;    /* Picture global time */    Ipp64s                  pic_time, pic_time_pb;    Ipp64s                  ref_pic_time, prevP_pic_time;    int                     ref_temporal_reference, prevP_temporal_reference;    h263_Statistic           Statistic;} h263_VideoSequence;#ifdef _OMP_KARABAS/* MacroBlock Info for MT */typedef struct _h263_MacroBlockMT {    Ipp16s    dctCoeffs[64*6];    Ipp16s    dctCoeffs_B[64*6];    IppMotionVector mvF[4];     // PB-Frame    IppMotionVector mvB[4];     // PB-Frame    Ipp8u     lnz[12];    Ipp8u     cbpy;    Ipp8u     cbpc;    Ipp8u     bmb_type;         // PB-Frame    Ipp8u     cbpb;             // PB-Frame} h263_MacroBlockMT;#endif // _OMP_KARABAS/* Full Info */typedef struct _h263_Info {    Ipp8u*      buffer;         /* buffer header for saving H.263++ stream */    size_t      buflen;         /* total buffer length */    Ipp8u*      bufptr;         /* current frame, point to header or data */    int         bitoff;         /* mostly point to next frame header or PSC */    h263_VideoSequence    VideoSequence;#ifdef _OMP_KARABAS    h263_MacroBlockMT*  pMBinfoMT;  /* OpenMP buffer */    int         number_threads;       /* OpenMP number of threads */#endif // _OMP_KARABAS} h263_Info;/* bitstream functions */extern int        h263_RemainStream(h263_Info* pInfo);extern Ipp8u*     h263_FindStartCodePtr(h263_Info* pInfo);extern int        h263_SeekStartCodePtr(h263_Info* pInfo);/* extern int        h263_CheckResyncMarker(h263_Info* pInfo, int rml); *//* tables */typedef struct _h263_VLC1 {    Ipp8u  code;    Ipp8u  len;} h263_VLC1;extern const Ipp8u h263_cCbCrMvRound16[];extern const Ipp8s h263_dquant[];extern const Ipp8s h263_dquant_Mod[2][31];extern const Ipp8u h263_quant_c[];extern const h263_VLC1 h263_cbpy[];extern const Ipp8u h263_Pmb_type[];extern const Ipp8u h263_Pmb_cbpc[];extern const Ipp8u h263_Pmb_bits[];extern const h263_VLC1 h263_Bmb_type[];extern const h263_VLC1 h263_Bmb_cbpc[];extern const h263_VLC1 h263_EPmb_type_0[];extern const h263_VLC1 h263_EPmb_type_1[];extern const h263_VLC1 h263_EImb_type[];extern const h263_VLC1 h263_MVD_T14_1[];extern const h263_VLC1 h263_MVD_T14_2[];extern const int h263_pic_width[];extern const int h263_pic_height[];extern const int h263_mblocks_in_gob[];extern const int h263_gobs_in_pic[];// project functions//extern void       h263_Error(char *str);#define h263_Error(str)extern h263_Status h263_InitDecoder(h263_Info *pInfo, char *h263FileName);extern h263_Status h263_CloseDecoder(h263_Info *pInfo);extern h263_Status h263_InitVSeq(h263_Info *pInfo, int mbPerRow, int mbPerCol);extern h263_Status h263_FreeVSeq(h263_Info *pInfo);extern h263_Status h263_Decoder(h263_Info *pInfo);extern h263_Status h263_Parse_PictureHeader(h263_Info* pInfo);extern int h263_ParseGOBHeader(h263_Info* pInfo);extern h263_Status h263_DecodeVideoPicture(h263_Info* pInfo);#ifdef _OMP_KARABAS#ifdef _OPENMP#include <omp.h>#endifextern int h263_GetNumOfThreads(void);#endif // _OMP_KARABAS#ifndef H263_USE_INLINE_BITS_FUNCextern Ipp32u h263_ShowBits(h263_Info* pInfo, int n);extern Ipp32u h263_ShowBit(h263_Info* pInfo);extern Ipp32u h263_ShowBits9(h263_Info* pInfo, int n);extern void   h263_FlushBits(h263_Info* pInfo, int n);extern Ipp32u h263_GetBits(h263_Info* pInfo, int n);extern Ipp32u h263_GetBits9(h263_Info* pInfo, int n);extern void   h263_AlignBits(h263_Info* pInfo);extern Ipp32u h263_ShowBitsAlign(h263_Info* pInfo, int n);#else__INLINE Ipp32u h263_ShowBits(h263_Info* pInfo, int n){    Ipp8u* ptr = pInfo->bufptr;    Ipp32u tmp = (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] <<  8) | (ptr[3]);    tmp <<= pInfo->bitoff;    tmp >>= 32 - n;    return tmp;}__INLINE Ipp32u h263_ShowBit(h263_Info* pInfo){    Ipp32u tmp = pInfo->bufptr[0];    tmp >>= 7 - pInfo->bitoff;    return (tmp & 1);}__INLINE Ipp32u h263_ShowBits9(h263_Info* pInfo, int n){    Ipp8u* ptr = pInfo->bufptr;    Ipp32u tmp = (ptr[0] <<  8) | ptr[1];    tmp <<= (pInfo->bitoff + 16);    tmp >>= 32 - n;    return tmp;}__INLINE void h263_FlushBits(h263_Info* pInfo, int n){    n = n + pInfo->bitoff;    pInfo->bufptr += n >> 3;    pInfo->bitoff = n & 7;}__INLINE Ipp32u h263_GetBits(h263_Info* pInfo, int n){    Ipp8u* ptr = pInfo->bufptr;    Ipp32u tmp = (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] <<  8) | (ptr[3]);    tmp <<= pInfo->bitoff;    tmp >>= 32 - n;    n = n + pInfo->bitoff;    pInfo->bufptr += n >> 3;    pInfo->bitoff = n & 7;    return tmp;}__INLINE Ipp32u h263_GetBits9(h263_Info* pInfo, int n){    Ipp8u* ptr = pInfo->bufptr;    Ipp32u tmp = (ptr[0] <<  8) | ptr[1];    tmp <<= (pInfo->bitoff + 16);    tmp >>= 32 - n;    n = n + pInfo->bitoff;    pInfo->bufptr += n >> 3;    pInfo->bitoff = n & 7;    return tmp;}__INLINE void h263_AlignBits(h263_Info* pInfo){    if (pInfo->bitoff > 0) {        pInfo->bitoff = 0;        (pInfo->bufptr)++;    }}__INLINE Ipp32u h263_ShowBitsAlign(h263_Info* pInfo, int n){    Ipp8u* ptr = pInfo->bitoff ? (pInfo->bufptr + 1) : pInfo->bufptr;    Ipp32u tmp = (ptr[0] << 24) | (ptr[1] << 16) | (ptr[2] <<  8) | (ptr[3]);    tmp >>= 32 - n;    return tmp;}#endif // H263_USE_INLINE_BITS_FUNC__INLINE Ipp32u h263_GetBit(h263_Info* pInfo){    Ipp32u tmp = pInfo->bufptr[0];    if (pInfo->bitoff != 7) {        tmp >>= 7 - pInfo->bitoff;        pInfo->bitoff ++;    } else {        pInfo->bitoff = 0;        pInfo->bufptr ++;    }    return (tmp & 1);}__INLINE int h263_GetMarkerBit(h263_Info* pInfo) {    if (!h263_GetBit(pInfo)) {        h263_Error("Error in video_header: wrong marker bit");        return 0;    }    return 1;}#ifdef __cplusplus}#endif#endif  /* _H263_H_  */

⌨️ 快捷键说明

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