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

📄 avcodec.h

📁 wince 平台下的h264 压缩代码程序
💻 H
📖 第 1 页 / 共 5 页
字号:
extern AVCodec oggvorbis_decoder;extern AVCodec cyuv_decoder;extern AVCodec h264_decoder;extern AVCodec indeo3_decoder;extern AVCodec vp3_decoder;extern AVCodec theora_decoder;extern AVCodec amr_nb_decoder;extern AVCodec amr_nb_encoder;extern AVCodec amr_wb_encoder;extern AVCodec amr_wb_decoder;extern AVCodec aac_decoder;extern AVCodec mpeg4aac_decoder;extern AVCodec asv1_decoder;extern AVCodec asv2_decoder;extern AVCodec vcr1_decoder;extern AVCodec cljr_decoder;extern AVCodec ffv1_decoder;extern AVCodec fourxm_decoder;extern AVCodec mdec_decoder;extern AVCodec roq_decoder;extern AVCodec interplay_video_decoder;extern AVCodec xan_wc3_decoder;extern AVCodec rpza_decoder;extern AVCodec cinepak_decoder;extern AVCodec msrle_decoder;extern AVCodec msvideo1_decoder;extern AVCodec vqa_decoder;extern AVCodec idcin_decoder;extern AVCodec eightbps_decoder;extern AVCodec smc_decoder;extern AVCodec flic_decoder;extern AVCodec vmdvideo_decoder;extern AVCodec vmdaudio_decoder;extern AVCodec truemotion1_decoder;extern AVCodec mszh_decoder;extern AVCodec zlib_decoder;extern AVCodec ra_144_decoder;extern AVCodec ra_288_decoder;extern AVCodec roq_dpcm_decoder;extern AVCodec interplay_dpcm_decoder;extern AVCodec xan_dpcm_decoder;extern AVCodec qtrle_decoder;extern AVCodec flac_decoder;/* pcm codecs */#define PCM_CODEC(id, name) \extern AVCodec name ## _decoder; \extern AVCodec name ## _encoderPCM_CODEC(CODEC_ID_PCM_S16LE, pcm_s16le);PCM_CODEC(CODEC_ID_PCM_S16BE, pcm_s16be);PCM_CODEC(CODEC_ID_PCM_U16LE, pcm_u16le);PCM_CODEC(CODEC_ID_PCM_U16BE, pcm_u16be);PCM_CODEC(CODEC_ID_PCM_S8, pcm_s8);PCM_CODEC(CODEC_ID_PCM_U8, pcm_u8);PCM_CODEC(CODEC_ID_PCM_ALAW, pcm_alaw);PCM_CODEC(CODEC_ID_PCM_MULAW, pcm_mulaw);/* adpcm codecs */PCM_CODEC(CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt);PCM_CODEC(CODEC_ID_ADPCM_IMA_WAV, adpcm_ima_wav);PCM_CODEC(CODEC_ID_ADPCM_IMA_DK3, adpcm_ima_dk3);PCM_CODEC(CODEC_ID_ADPCM_IMA_DK4, adpcm_ima_dk4);PCM_CODEC(CODEC_ID_ADPCM_IMA_WS, adpcm_ima_ws);PCM_CODEC(CODEC_ID_ADPCM_SMJPEG, adpcm_ima_smjpeg);PCM_CODEC(CODEC_ID_ADPCM_MS, adpcm_ms);PCM_CODEC(CODEC_ID_ADPCM_4XM, adpcm_4xm);PCM_CODEC(CODEC_ID_ADPCM_XA, adpcm_xa);PCM_CODEC(CODEC_ID_ADPCM_ADX, adpcm_adx);PCM_CODEC(CODEC_ID_ADPCM_EA, adpcm_ea);PCM_CODEC(CODEC_ID_ADPCM_G726, adpcm_g726);#undef PCM_CODEC/* dummy raw video codec */extern AVCodec rawvideo_encoder;extern AVCodec rawvideo_decoder;/* the following codecs use external GPL libs */extern AVCodec ac3_decoder;/* resample.c */struct ReSampleContext;typedef struct ReSampleContext ReSampleContext;ReSampleContext *audio_resample_init(int output_channels, int input_channels,                                      int output_rate, int input_rate);int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples);void audio_resample_close(ReSampleContext *s);/* YUV420 format is assumed ! */struct ImgReSampleContext;typedef struct ImgReSampleContext ImgReSampleContext;ImgReSampleContext *img_resample_init(int output_width, int output_height,                                      int input_width, int input_height);ImgReSampleContext *img_resample_full_init(int owidth, int oheight,                                      int iwidth, int iheight,                                      int topBand, int bottomBand,                                      int leftBand, int rightBand,                                      int padtop, int padbottom,                                      int padleft, int padright);void img_resample(ImgReSampleContext *s,                   AVPicture *output, const AVPicture *input);void img_resample_close(ImgReSampleContext *s);/** * Allocate memory for a picture.  Call avpicture_free to free it. * * @param picture the picture to be filled in. * @param pix_fmt the format of the picture. * @param width the width of the picture. * @param height the height of the picture. * @return 0 if successful, -1 if not. */int avpicture_alloc(AVPicture *picture, int pix_fmt, int width, int height);/* Free a picture previously allocated by avpicture_alloc. */void avpicture_free(AVPicture *picture);int avpicture_fill(AVPicture *picture, uint8_t *ptr,                   int pix_fmt, int width, int height);int avpicture_layout(const AVPicture* src, int pix_fmt, int width, int height,                     unsigned char *dest, int dest_size);int avpicture_get_size(int pix_fmt, int width, int height);void avcodec_get_chroma_sub_sample(int pix_fmt, int *h_shift, int *v_shift);const char *avcodec_get_pix_fmt_name(int pix_fmt);enum PixelFormat avcodec_get_pix_fmt(const char* name);#define FF_LOSS_RESOLUTION  0x0001 /* loss due to resolution change */#define FF_LOSS_DEPTH       0x0002 /* loss due to color depth change */#define FF_LOSS_COLORSPACE  0x0004 /* loss due to color space conversion */#define FF_LOSS_ALPHA       0x0008 /* loss of alpha bits */#define FF_LOSS_COLORQUANT  0x0010 /* loss due to color quantization */#define FF_LOSS_CHROMA      0x0020 /* loss of chroma (e.g. rgb to gray conversion) */int avcodec_get_pix_fmt_loss(int dst_pix_fmt, int src_pix_fmt,                             int has_alpha);int avcodec_find_best_pix_fmt(int pix_fmt_mask, int src_pix_fmt,                              int has_alpha, int *loss_ptr);#define FF_ALPHA_TRANSP       0x0001 /* image has some totally transparent pixels */#define FF_ALPHA_SEMI_TRANSP  0x0002 /* image has some transparent pixels */int img_get_alpha_info(const AVPicture *src,		       int pix_fmt, int width, int height);/* convert among pixel formats */int img_convert(AVPicture *dst, int dst_pix_fmt,                const AVPicture *src, int pix_fmt,                 int width, int height);/* deinterlace a picture */int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,                          int pix_fmt, int width, int height);/* external high level API */extern AVCodec *first_avcodec;/* returns LIBAVCODEC_VERSION_INT constant */unsigned avcodec_version(void);/* returns LIBAVCODEC_BUILD constant */unsigned avcodec_build(void);void avcodec_init(void);void register_avcodec(AVCodec *format);AVCodec *avcodec_find_encoder(enum CodecID id);AVCodec *avcodec_find_encoder_by_name(const char *name);AVCodec *avcodec_find_decoder(enum CodecID id);AVCodec *avcodec_find_decoder_by_name(const char *name);void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);void avcodec_get_context_defaults(AVCodecContext *s);AVCodecContext *avcodec_alloc_context(void);void avcodec_get_frame_defaults(AVFrame *pic);AVFrame *avcodec_alloc_frame(void);int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);void avcodec_default_free_buffers(AVCodecContext *s);int avcodec_thread_init(AVCodecContext *s, int thread_count);void avcodec_thread_free(AVCodecContext *s);int avcodec_thread_execute(AVCodecContext *s, int (*func)(AVCodecContext *c2, void *arg2),void **arg, int *ret, int count);//FIXME func typedef/** * opens / inits the AVCodecContext. * not thread save! */int avcodec_open(AVCodecContext *avctx, AVCodec *codec);int avcodec_decode_audio(AVCodecContext *avctx, int16_t *samples,                          int *frame_size_ptr,                         uint8_t *buf, int buf_size);int avcodec_decode_video(AVCodecContext *avctx, AVFrame *picture,                          int *got_picture_ptr,                         uint8_t *buf, int buf_size);int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata,                         int *data_size_ptr,                        uint8_t *buf, int buf_size);int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size,                          const short *samples);int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size,                          const AVFrame *pict);int avcodec_close(AVCodecContext *avctx);void avcodec_register_all(void);void avcodec_flush_buffers(AVCodecContext *avctx);/* misc usefull functions *//** * returns a single letter to describe the picture type */char av_get_pict_type_char(int pict_type);/** * reduce a fraction. * this is usefull for framerate calculations * @param max the maximum allowed for dst_nom & dst_den * @return 1 if exact, 0 otherwise */int av_reduce(int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max);/** * rescale a 64bit integer. * a simple a*b/c isnt possible as it can overflow */int64_t av_rescale(int64_t a, int b, int c);/** * Interface for 0.5.0 version * * do not even think about it's usage for this moment */typedef struct {    /// compressed size used from given memory buffer    int size;    /// I/P/B frame type    int frame_type;} avc_enc_result_t;/** * Commands * order can't be changed - once it was defined */typedef enum {    // general commands    AVC_OPEN_BY_NAME = 0xACA000,    AVC_OPEN_BY_CODEC_ID,    AVC_OPEN_BY_FOURCC,    AVC_CLOSE,    AVC_FLUSH,    // pin - struct { uint8_t* src, uint_t src_size }    // pout - struct { AVPicture* img, consumed_bytes,    AVC_DECODE,    // pin - struct { AVPicture* img, uint8_t* dest, uint_t dest_size }    // pout - uint_t used_from_dest_size    AVC_ENCODE,     // query/get video commands    AVC_GET_VERSION = 0xACB000,    AVC_GET_WIDTH,    AVC_GET_HEIGHT,    AVC_GET_DELAY,    AVC_GET_QUANT_TABLE,    // ...    // query/get audio commands    AVC_GET_FRAME_SIZE = 0xABC000,    // maybe define some simple structure which    // might be passed to the user - but they can't    // contain any codec specific parts and these    // calls are usualy necessary only few times    // set video commands    AVC_SET_WIDTH = 0xACD000,    AVC_SET_HEIGHT,    // set video encoding commands    AVC_SET_FRAME_RATE = 0xACD800,    AVC_SET_QUALITY,    AVC_SET_HURRY_UP,    // set audio commands    AVC_SET_SAMPLE_RATE = 0xACE000,    AVC_SET_CHANNELS,} avc_cmd_t;/** * \param handle  allocated private structure by libavcodec *                for initialization pass NULL - will be returned pout *                user is supposed to know nothing about its structure * \param cmd     type of operation to be performed * \param pint    input parameter * \param pout    output parameter * * \returns  command status - eventually for query command it might return * integer resulting value */int avcodec(void* handle, avc_cmd_t cmd, void* pin, void* pout);/* frame parsing */typedef struct AVCodecParserContext {    void *priv_data;    struct AVCodecParser *parser;    int64_t frame_offset; /* offset of the current frame */    int64_t cur_offset; /* current offset                            (incremented by each av_parser_parse()) */    int64_t last_frame_offset; /* offset of the last frame */    /* video info */    int pict_type; /* XXX: put it back in AVCodecContext */    int repeat_pict; /* XXX: put it back in AVCodecContext */    int64_t pts;     /* pts of the current frame */    int64_t dts;     /* dts of the current frame */    /* private data */    int64_t last_pts;    int64_t last_dts;#define AV_PARSER_PTS_NB 4    int cur_frame_start_index;    int64_t cur_frame_offset[AV_PARSER_PTS_NB];    int64_t cur_frame_pts[AV_PARSER_PTS_NB];    int64_t cur_frame_dts[AV_PARSER_PTS_NB];} AVCodecParserContext;typedef struct AVCodecParser {    int codec_ids[3]; /* several codec IDs are permitted */    int priv_data_size;    int (*parser_init)(AVCodecParserContext *s);    int (*parser_parse)(AVCodecParserContext *s,                         AVCodecContext *avctx,                        uint8_t **poutbuf, int *poutbuf_size,                         const uint8_t *buf, int buf_size);    void (*parser_close)(AVCodecParserContext *s);    struct AVCodecParser *next;} AVCodecParser;extern AVCodecParser *av_first_parser;void av_register_codec_parser(AVCodecParser *parser);AVCodecParserContext *av_parser_init(int codec_id);int av_parser_parse(AVCodecParserContext *s,                     AVCodecContext *avctx,                    uint8_t **poutbuf, int *poutbuf_size,                     const uint8_t *buf, int buf_size,                    int64_t pts, int64_t dts);void av_parser_close(AVCodecParserContext *s);extern AVCodecParser mpegvideo_parser;extern AVCodecParser mpeg4video_parser;extern AVCodecParser h263_parser;extern AVCodecParser h264_parser;extern AVCodecParser mpegaudio_parser;extern AVCodecParser ac3_parser;/* memory */void *av_malloc(unsigned int size);void *av_mallocz(unsigned int size);void *av_realloc(void *ptr, unsigned int size);void av_free(void *ptr);char *av_strdup(const char *s);void av_freep(void *ptr);void *av_fast_realloc(void *ptr, unsigned int *size, unsigned int min_size);/* for static data only *//* call av_free_static to release all staticaly allocated tables */void av_free_static(void);void *av_mallocz_static(unsigned int size);/* add by bero : in adx.c */int is_adx(const unsigned char *buf,size_t bufsize);void img_copy(AVPicture *dst, const AVPicture *src,              int pix_fmt, int width, int height);/* av_log API */#include <stdarg.h>#define AV_LOG_QUIET -1#define AV_LOG_ERROR 0#define AV_LOG_INFO 1#define AV_LOG_DEBUG 2
#ifdef WINCE //av_log
extern void av_log(void*, int level, const char *fmt, ...);
#else//extern void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));#endif
extern void av_vlog(void*, int level, const char *fmt, va_list);extern int av_log_get_level(void);extern void av_log_set_level(int);extern void av_log_set_callback(void (*)(void*, int, const char*, va_list));/* endian macros */#define BE_16(x)  ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])#define BE_32(x)  ((((uint8_t*)(x))[0] << 24) | \                   (((uint8_t*)(x))[1] << 16) | \                   (((uint8_t*)(x))[2] << 8) | \                    ((uint8_t*)(x))[3])#define LE_16(x)  ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0])#define LE_32(x)  ((((uint8_t*)(x))[3] << 24) | \                   (((uint8_t*)(x))[2] << 16) | \                   (((uint8_t*)(x))[1] << 8) | \                    ((uint8_t*)(x))[0])#ifdef __cplusplus}#endif#endif /* AVCODEC_H */

⌨️ 快捷键说明

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