📄 fmpeg4_avcodec.h
字号:
/* fmpeg4_avcodec.h (same with driver definition fmpeg4.h) */#ifndef _FMPEG4_AVCODEC_H_#define _FMPEG4_AVCODEC_H_#define FMPEG4_IOCTL_DECODE_INIT 0x4170#define FMPEG4_IOCTL_DECODE_FRAME 0x4172#define FMPEG4_IOCTL_ENCODE_INIT 0x4173#define FMPEG4_IOCTL_ENCODE_FRAME 0x4175#define FMPEG4_IOCTL_ENCODE_INFO 0x4176#define FMPEG4_IOCTL_GET_DEBUG_TIMER 0x4180#define FMPEG4_IOCTL_GET_JPG_BUF 0x4181#define FMPEG4_IOCTL_FREE_JPG_BUF 0x4182#define FMPEG4_IOCTL_ENCODE_FLAG 0x4183#define FMPEG4_IOCTL_SET_INTER_QUANT 0x4184#define FMPEG4_IOCTL_SET_INTRA_QUANT 0x4185typedef struct AVFrame { /* * pointer to the picture planes. * this might be different from the first allocated byte * - encoding: * - decoding: */ uint8_t *data[4]; uint8_t *data_phy[4]; int linesize[4]; /* * pointer to the first allocated byte of the picture. can be used in get_buffer/release_buffer * this isnt used by lavc unless the default get/release_buffer() is used * - encoding: * - decoding: */ uint8_t *base[4]; /* * 1 -> keyframe, 0-> not * - encoding: set by lavc * - decoding: set by lavc */ int key_frame; /* * picture type of the frame, see ?_TYPE below. * - encoding: set by lavc for coded_picture (and set by user for input) * - decoding: set by lavc */ int pict_type; /* * presentation timestamp in micro seconds (time when frame should be shown to user) * if 0 then the frame_rate will be used as reference * - encoding: MUST be set by user * - decoding: set by lavc */ int64_t pts; /* * picture number in bitstream order. * - encoding: set by * - decoding: set by lavc */ int coded_picture_number; /* * picture number in display order. * - encoding: set by * - decoding: set by lavc */ int display_picture_number; /* * quality (between 1 (good) and 31 (bad)) * - encoding: set by lavc for coded_picture (and set by user for input) * - decoding: set by lavc */ float quality; /* * buffer age (1->was last buffer and dint change, 2->..., ...). * set to something large if the buffer has not been used yet * - encoding: unused * - decoding: MUST be set by get_buffer() */ int age; /* * is this picture used as reference\ * - encoding: unused\ * - decoding: set by lavc (before get_buffer() call))\ */ int reference; /* * QP table * - encoding: unused\ * - decoding: set by lavc\ */ int8_t *qscale_table; /* * QP store stride\ * - encoding: unused\ * - decoding: set by lavc\ */ int qstride; /* * mbskip_table[mb]>=1 if MB didnt change\ * stride= mb_width = (width+15)>>4\ * - encoding: unused\ * - decoding: set by lavc\ */ uint8_t *mbskip_table; /* * for some private data of the user\ * - encoding: unused\ * - decoding: set by user\ */ void *opaque; /* * error\ * - encoding: set by lavc if flags&CODEC_FLAG_PSNR\ * - decoding: unused\ */ uint64_t error[4]; /* * type of the buffer (to keep track of who has to dealloc data[*])\ * - encoding: set by the one who allocs it\ * - decoding: set by the one who allocs it\ * Note: user allocated (direct rendering) & internal buffers can not coexist currently\ */ int type; /* * when decoding, this signal how much the picture must be delayed.\ * extra_delay = repeat_pict / (2*fps)\ * - encoding: unused\ * - decoding: set by lavc\ */ int repeat_pict; int qscale_type;} AVFrame;typedef struct video_profile{ unsigned int bit_rate; unsigned int width; //length per dma buffer unsigned int height; unsigned int framerate; unsigned int frame_rate_base; unsigned int gop_size; unsigned int qmax; unsigned int qmin; unsigned int quant; unsigned int enable_4mv; AVFrame *coded_frame;}video_profile;typedef struct fmpeg4_parm{ unsigned int input_va_y; //input Y VA address or RGB address unsigned int input_va_u; //input U VA address unsigned int input_va_v; //input V VA address unsigned int output_va_y; //output Y VA address or RGB address unsigned int output_va_u; //output U VA address unsigned int output_va_v; //output V VA ddress unsigned int got_picture; unsigned int length;}fmpeg4_parm_t;typedef struct{ unsigned int u32API_version; unsigned int *pu32BaseAddr; void * pvSemaphore; unsigned int u32MaxWidth; unsigned int u32MaxHeight; unsigned int u32BSBufSize; unsigned char * pu8FrameBaseAddr_phy; // output frame buffer, must 8 bytes align. unsigned char * pu8FrameBaseAddr_U_phy; // frame buffer (U) if output format is yuv420, must 8 bytes align. unsigned char * pu8FrameBaseAddr_V_phy; // frame buffer (V) if output format is yuv420, must 8 bytes align. unsigned int u32FrameWidth; // output frame width, no matter decoded image size // "set to 0", means equal to decoded image width unsigned int u32FrameHeight; // output frame height, no matter decoded image size // "set to 0", means equal to decoded image height unsigned int u32CacheAlign; unsigned char * pu8ReConFrameCur_phy; // physical address. buffer for current reconstruct frame. unsigned char * pu8ReConFrameCur; // virtual address. // Don't care when pfnDmaMalloc != NULL // 8 Byte boundary // byte size = ((width + 15)/16) x ((height + 15)/16) x 256 x 1.5 unsigned char * pu8ReConFrameRef_phy; // physical address. buffer for reference reconstruct frame. unsigned char * pu8ReConFrameRef; // virtual address. // Don't care when pfnDmaMalloc != NULL // 8 Byte boundary // byte size = ((width + 15)/16) x ((height + 15)/16) x 256 x 1.5 unsigned short * pu16ACDC_phy; // physical address. buffer for ACDC predictor unsigned short * pu16ACDC; // virtual address. // Don't care when pfnDmaMalloc != NULL // 8 Byte boundary // byte size = ((width + 15)/16) x 64 unsigned char * pu8BitStream_phy; // physical address. buffer for bitstream unsigned char * pu8BitStream; // virtual address. // Don't care when pfnDmaMalloc != NULL // byte size = u32BSBufSize#if 0 DMA_MALLOC_PTR_dec pfnDmaMalloc; // "set to NULL", means the 4 above buffers will be prepared enternallly
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -