📄 fmjpeg_avcodec.h
字号:
#ifndef __FMJPEG_AVCODEC_h #define __FMJPEG_AVCODEC_h#define FMJPEG_IOCTL_DECODE_INIT 0x5170#define FMJPEG_IOCTL_DECODE_CREATE 0x5171#define FMJPEG_IOCTL_DECODE_READ_HEADER 0x5172#define FMJPEG_IOCTL_DECODE_FRAME 0x5173#define FMJPEG_IOCTL_DECODE_DESTROY 0x5174#define FMJPEG_IOCTL_GET_BS_CONTEXT 0x5175#define FMJPEG_IOCTL_FREE_BS_CONTEXT 0x5176#define FMJPEG_IOCTL_DECODE_ONE 0x5178#define FMJPEG_IOCTL_ALLOC_YUV 0x5179#define FMJPEG_IOCTL_ENCODE_INIT 0x5181#define FMJPEG_IOCTL_ENCODE_CREATE 0x5182#define FMJPEG_IOCTL_ENCODE_GET_BITSTREAM 0x5183#define FMJPEG_IOCTL_ENCODE_FRAME 0x5184#define FMJPEG_IOCTL_ENCODE_DESTROY 0x5185#define FMJPEG_IOCTL_ENCODE_INIT_ENCODE 0x5186#define FMJPEG_IOCTL_ENCODE_ONE 0x5187#define FMJPEG_IOCTL_ENCODE_MD_INFO 0x5188#define FMJPEG_IOCTL_GET_JPG_BUF 0x5189#define FMJPEG_IOCTL_FREE_JPG_BUF 0x5190#define FMJPEG_IOCTL_ENCODE_ALARM 0x5191#define FMJPEG_IOCTL_ENCODE_FWRITE 0x5192#define FMJPEG_IOCTL_ENCODE_FLAG 0x5193#define FMJPEG_IOCTL_ENCODE_DEVBUF 0x5194/** * By using typedef to create a type name for DMA memory allocation function. * And user can allocate memory on a specified alignment memory * by using the parameter align_size. * * @param size is the bytes to allocate. * @param align_size is the alignment value which must be power of 2. * @param reserved_size is the specifed cache line. * @param phy_ptr is used to return the physical address of allocated aligned memory block. * @return return a void pointer to virtual address of the allocated memory block. * @see FJPEG_DEC_PARAM * @see DMA_FREE_PTR */typedef void *(* DMA_MALLOC_PTR)(unsigned int size,unsigned char align_size,unsigned char reserved_size, void ** phy_ptr);typedef void *(* MALLOC_PTR)(unsigned int size, unsigned char align_size, unsigned char reserved_size);/** * By using typedef to create a type name for DMA memory free function. * And user can use this type of function to free a block of memory that * was allocated by the DMA_MALLOC_PTR type of function. * * @param virt_ptr is a pointer to the memory block with virtual address that was returned * previously by the type of DMA_MALLOC_PTR function. * @param phy_ptr is a pointer to the memory block with physical address that was returned * previously by the type of DMA_MALLOC_PTR function. * @return return void. * @see FJPEG_DEC_PARAM * @see DMA_MALLOC_PTR */typedef void (* DMA_FREE_PTR)(void * virt_ptr, void * phy_ptr);typedef void (* FREE_PTR)(void * virt_ptr);/// The Faraday JPEG Decoder Parameters Structure./** * While creating jpeg decoder object by using FJpegDecCreate() operation, FJPEG_DEC_PARAM * pointer is served as FJpegDecCreate()'s parameter to internally initialize related JPEG decoder * object settings. The data member pu32BaseAddr and pu8BitstreamAddr must be set before * invoking the FJpegDecCreate() operation.\n * * This data structure is also used for FJpegDecDecode() operation where the data member * u8NumComponents and pu8YUVAddr must be set before invoking the FJpegDecDecode() operation. * * * See @ref jpeg_decoder_ops_grp \n * @see FJpegDecCreate * */typedef struct { /// The base address of hardware core. unsigned int *pu32BaseAddr; /**< User can use this variable to set the base * address of hardware core. * * @see pu8BitstreamAddr */ /// The input bitstream buffer physical address while decoding the jpeg bitstream. unsigned char *pu8BitstreamAddr; /**< To set input bitstream buffer's physical address.\n * This bitstream buffer was provided by user and used for JPEG decoder while * decoding JPEG bitstream.\n * <B>N.B.</B> : the input bitstream buffer address must be <B>physical address</B> with <B>4-byte aligned</B>. * * @see pu32BaseAddr */ /// The number of components in the decoding YUV image. unsigned char u8NumComponents; /**< This variable shows the number of components in the decoding * image, which is also extracted from 'SOF' marker directly. * The color space used for these components is <B>YCbCr</B>. * If only one component is used, the component will be <B>Y</B> only. * * @see pu8YUVAddr */ /// The base physical address for output YUV buffer. unsigned char *pu8YUVAddr[3]; /**< To set input YUV frame buffer's base physical address.\n * <B>N.B.</B> : the address must be physical address with <B>8-byte aligned</B>. * * @see u8NumComponents */ unsigned int frame_width; unsigned int frame_hight; unsigned char * bs_buffer_virt; unsigned char * bs_buffer_phy; unsigned char * buf; unsigned int buf_size; /// The function pointer to user-defined DMA memory allocation function. DMA_MALLOC_PTR pfnDmaMalloc; /**< This variable contains the function pointer to the user-defined * DMA malloc function since under OS environment, our hardware device * may need the physical address instead of virtual address. * * @see pfnDmaFree * @see DMA_MALLOC_PTR * @see DMA_FREE_PTR */ /// The function pointer to user-defined DMA free allocation function. DMA_FREE_PTR pfnDmaFree; /**< This variable contains the function pointer to the user-defined * DMA free function since under OS environment, our hardware device * may need the physical address instead of virtual address. * * @see pfnDmaFree * @see DMA_MALLOC_PTR * @see DMA_FREE_PTR */ MALLOC_PTR pfnMalloc; FREE_PTR pfnFree; unsigned char u32CacheAlign; unsigned int picturesize; unsigned int static_jpg; /* display one picture */ int output_width; int output_height; //int uv_size;} FJPEG_DEC_PARAM;/// The Faraday JPEG Decoder Result Image Descriptor (YCbCr)./** * After reading the jpeg header , some side informations about the decoded YUV image * were generated and reflected within FJPEG_DEC_RESULT structure after * calling FJpegDecReadHeader() operation. \n * * @see FJpegDecReadHeader * */typedef struct { /// The image width in pixels. unsigned int u32ImageWidth; /**< This member variable indicates the actual image width after * JPEG decoding, which is extracted from 'SOF' marker directly. */ /// The image height in pixels. unsigned int u32ImageHeight; /**< This member variable indicates the actual image height after * JPEG decoding, which is extracted from 'SOF' marker directly. */ /// The number of components in the decoding image. unsigned char u8NumComponents; /**< This variable shows the number of components in the decoding * image, which is also extracted from 'SOF' marker directly. * The color space used for these components is <B>YCbCr</B>. * If only one component is used, the component will be <B>Y</B> only. */ /// The array of structures to describe each component information about decoded image. struct { /// The horizontal sampling frequency of this component. unsigned char m_u8HSamplingFrequency; /**< horizontal sampling frequency factor (1..4) for this component.*/ /// The vertical sampling frequency of this component. unsigned char m_u8VSamplingFrequency; /**< vertical sampling frequency factor (1..4) for this component. */ // The address where this component is stored. //unsigned char *m_pComponent; /**< the address where this component is stored */ /// This component's width in pixels. unsigned int m_u32ComponentWidth; /**< this component horizontal sample width in pixels */ /// This component's height in pixels. unsigned int m_u32ComponentHeight; /**< this component's vertical sample width in pixels */ /// This component's total size in bytes = (m_u32ComponentWidth * m_u32ComponentHeight). unsigned int m_u32ComponentTotalSize; /**< this component's total size in bytes , which is equal to (m_u32ComponentWidth * m_u32ComponentHeight) */ } rgComponentInfo[3]; /**< * According to JFIF standard, the color space is restricted to one or three components. \n * For three components, <B>YCbCr</B> is used. \n
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -