📄 mv_dec.h
字号:
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_UD_TYPE
PACKAGE: MV_DEC
DESCRIPTION:
Define the Type of User Data application wants to retrieve.
It's used in the MV_DEC_enable_user_data() and
MV_DEC_disable_user_data() APIs.
DEFINITION:
*/
typedef unsigned short MV_DEC_UD_TYPE;
#define MV_DEC_NO_UD (0x0000)
#define MV_DEC_SEQ_UD (0x0001)
#define MV_DEC_GOP_UD (0x0002)
#define MV_DEC_PICT_UD (0x0004)
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_UD_DATA
PACKAGE: MV_DEC
DESCRIPTION:
Represents one byte.
DEFINITION:
*/
typedef unsigned char MV_DEC_UD_DATA;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_UD_SIZE
PACKAGE: MV_DEC
DESCRIPTION:
Size in units of MV_DEC_UD_DATA.
DEFINITION:
*/
typedef unsigned long MV_DEC_UD_SIZE;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_WIN_WIDTH
PACKAGE: MV_DEC
DESCRIPTION:
Window width in display pixels.
DEFINITION:
*/
typedef unsigned short MV_DEC_WIN_WIDTH;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_WIN_HEIGTH
PACKAGE: MV_DEC
DESCRIPTION:
Window height in display lines.
DEFINITION:
*/
typedef unsigned short MV_DEC_WIN_HEIGHT;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_CTR_OFF_HOR
PACKAGE: MV_DEC
DESCRIPTION:
Window horizontal center offset in 1/16th display pixels.
NOTES:
This is a signed value.
DEFINITION:
*/
typedef short MV_DEC_CTR_OFF_HOR;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_CTR_OFF_VER
PACKAGE: MV_DEC
DESCRIPTION:
Window vertical center offset in 1/16th display lines.
NOTES:
This is a signed value.
DEFINITION:
*/
typedef short MV_DEC_CTR_OFF_VER;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_ASPECT_RATIO
PACKAGE: MV_DEC
DESCRIPTION:
Sequence aspect ratio.
DEFINITION:
*/
typedef enum MV_DEC_ASPECT_RATIO_ENUM {
MV_DEC_ASPECT_RATIO_FORBIDDEN = 0,
MV_DEC_ASPECT_RATIO_SQUARE,
MV_DEC_ASPECT_RATIO_4_TO_3,
MV_DEC_ASPECT_RATIO_16_TO_9,
MV_DEC_ASPECT_RATIO_2P21_TO_1
} MV_DEC_ASPECT_RATIO;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_FRAME_RATE
PACKAGE: MV_DEC
DESCRIPTION:
Sequence frame rate.
DEFINITION:
*/
typedef enum MV_DEC_FRAME_RATE_ENUM {
MV_DEC_FRAME_RATE_FORBIDDEN = 0,
MV_DEC_FRAME_RATE_23P9,
MV_DEC_FRAME_RATE_24,
MV_DEC_FRAME_RATE_25,
MV_DEC_FRAME_RATE_29P9,
MV_DEC_FRAME_RATE_30,
MV_DEC_FRAME_RATE_50,
MV_DEC_FRAME_RATE_59P9,
MV_DEC_FRAME_RATE_60
} MV_DEC_FRAME_RATE;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_SEQ_INFO
PACKAGE: MV_DEC
DESCRIPTION:
Structure to hold sequence informations.
DEFINITION:
*/
typedef struct MV_DEC_SEQ_INFO_STRUCT {
MV_DEC_WIN_WIDTH seq_width; /* Sequence width in pixels */
MV_DEC_WIN_HEIGHT seq_height; /* Sequence height in pixels */
MV_DEC_ASPECT_RATIO aspect_ratio; /* Sequence aspect ratio */
MV_DEC_FRAME_RATE frame_rate; /* Sequence frame rate */
} MV_DEC_SEQ_INFO;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_PICT_INFO
PACKAGE: MV_DEC
DESCRIPTION:
Structure to hold picture informations.
DEFINITION:
*/
typedef struct MV_DEC_PICT_INFO_STRUCT {
MV_DEC_WIN_WIDTH coded_win_width; /* Sequence width in pixels */
MV_DEC_WIN_HEIGHT coded_win_height; /* Sequence height in pixels */
MV_DEC_WIN_WIDTH disp_win_width; /* Window width in pixels */
MV_DEC_WIN_HEIGHT disp_win_height; /* Window height in pixels */
MV_DEC_CTR_OFF_HOR centre_off_hor; /* Centre hor offset in 1/16*/
MV_DEC_CTR_OFF_VER centre_off_ver; /* Centre ver offset in 1/16*/
MV_DEC_TEMPORAL_REFERENCE temp_ref; /* Temporal reference */
MV_DEC_PICTURE_CODING_TYPE pict_coding_type; /* coding_type */
void * pict_y_odd_buf_addr; /* luma odd start addr */
void * pict_y_even_buf_addr;/* luma even start addr */
void * pict_c_odd_buf_addr; /* chroma odd start addr */
void * pict_c_even_buf_addr;/* chroma even start addr */
MV_DEC_WIN_WIDTH pitch; /* line memory storing alignement in pixels*/
MV_DEC_DTS pict_dts; /* dts of the picture for synchronization */
MV_DEC_DTS pict_pts; /* pts of the picture for synchronization */
MV_DEC_TOP_FIELD_FIRST_FLAG top_field_first; /* top_field_first flag */
} MV_DEC_PICT_INFO;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_MEM_SIZE
PACKAGE: MV_DEC
DESCRIPTION:
Memory buffer size (in bytes).
DEFINITION:
*/
typedef unsigned long MV_DEC_MEM_SIZE;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/* ITEM NAME: MV_DEC_BUFFERS
PACKAGE: MV_DEC
DESCRIPTION:
It represents the memory buffers that are required by the package, but
created by the application.
This structure is passed to the package during initialization
(to MV_DEC_init()).
It contains :
- SDRAM base address and its size
- Frames store addresses (FS0 -> FS3)(offset % beginning of SDRAM)
- user data buffer address (offset % beginning of SDRAM) and its size
This structure is also returned by MV_DEC_bufuse(), in which
size fields contains the required buffer sizes (to be created by the
application) and the pointer fields contain their alignment constraints
by means of a mask: (trailing) zero bits in the mask must also be zero in
the pointer value that is later passed to MV_DEC_init().
For instance, 0xFFFFFC00 denotes 32-bit alignment.
DEFINITION:
*/
typedef struct MV_DEC_BUFFERS_STRUCT {
void *SDRAM_base_addr;
MV_DEC_MEM_SIZE SDRAM_base_size;
void *FS0_y_odd_buf_addr;
MV_DEC_MEM_SIZE FS0_y_odd_buf_size;
void *FS0_y_even_buf_addr;
MV_DEC_MEM_SIZE FS0_y_even_buf_size;
void *FS0_c_odd_buf_addr;
MV_DEC_MEM_SIZE FS0_c_odd_buf_size;
void *FS0_c_even_buf_addr;
MV_DEC_MEM_SIZE FS0_c_even_buf_size;
void *FS1_y_odd_buf_addr;
MV_DEC_MEM_SIZE FS1_y_odd_buf_size;
void *FS1_y_even_buf_addr;
MV_DEC_MEM_SIZE FS1_y_even_buf_size;
void *FS1_c_odd_buf_addr;
MV_DEC_MEM_SIZE FS1_c_odd_buf_size;
void *FS1_c_even_buf_addr;
MV_DEC_MEM_SIZE FS1_c_even_buf_size;
void *FS2_y_odd_buf_addr;
MV_DEC_MEM_SIZE FS2_y_odd_buf_size;
void *FS2_y_even_buf_addr;
MV_DEC_MEM_SIZE FS2_y_even_buf_size;
void *FS2_c_odd_buf_addr;
MV_DEC_MEM_SIZE FS2_c_odd_buf_size;
void *FS2_c_even_buf_addr;
MV_DEC_MEM_SIZE FS2_c_even_buf_size;
void *FS3_y_odd_buf_addr;
MV_DEC_MEM_SIZE FS3_y_odd_buf_size;
void *FS3_y_even_buf_addr;
MV_DEC_MEM_SIZE FS3_y_even_buf_size;
void *FS3_c_odd_buf_addr;
MV_DEC_MEM_SIZE FS3_c_odd_buf_size;
void *FS3_c_even_buf_addr;
MV_DEC_MEM_SIZE FS3_c_even_buf_size;
void * ud_buf_addr;
MV_DEC_MEM_SIZE ud_buf_size;
void * seq_hdr_buf_addr;
MV_DEC_MEM_SIZE seq_hdr_buf_size;
} MV_DEC_BUFFERS;
/*EMP=======================================================================*/
/*MDP=======================================================================*/
/*
ITEM NAME: MV_DEC_BUFCFG
PACKAGE: MV_DEC
DESCRIPTION:
Structure used by application to configure MV_DEC package by defining :
- size of user data buffer in bytes
- window width in display pixels
- window height in display lines
- memory mapping
- decoding to display paremeter
- buffer zone format enabled or disabled
DEFINITION:
*/
typedef struct
{
MV_DEC_MEM_SIZE ud_buf_size;
MV_DEC_MEM_SIZE seq_hdr_buf_size;
MV_DEC_WIN_WIDTH max_hor_dec_picture;
MV_DEC_WIN_HEIGHT max_ver_dec_picture;
MV_DEC_FS_MEMORY_MAPPING fs_memory_mapping;
MV_DEC_TO_DISP dec_to_disp;
MV_DEC_STANDARD tv_standard;
unsigned long threshold_error_param;
} MV_DEC_BUFCFG;
/*EMP=======================================================================*/
/*==========================================================================*/
/* G L O B A L D A T A R E F E R E N C E S */
/*==========================================================================*/
/*==========================================================================*/
/* G L O B A L F U N C T I O N P R O T O T Y P E S */
/*==========================================================================*/
/*EMPF======================================================================*/
/*MPF=======================================================================*/
/*
FUNCTION NAME: MV_DEC_bufuse
PACKAGE: DEC
SCOPE: PLATEFORM
DESCRIPTION:
Depending on some (run-time) configuration parameters, the sizes (and
alignments) of the buffers required by the package are computed.
With this information the application can allocate these buffers and pass
them to the package upon initialization.
It's up to application to set following parameters as input:
- in_bufcfg_ptr->max_hor_dec_picture:
in pixels
- in_bufcfg_ptr->max_ver_dec_picture:
in pixels
- in_bufcfg_ptr->fs_memory_mapping :
MV_DEC_FS_MAPPING_2_6
MV_DEC_FS_MAPPING_3_0
MV_DEC_FS_MAPPING_4_0
- in_bufcfg_ptr->ud_buf_size:
size of User Data buffer in bytes
- in_bufcfg_ptr->dec_to_disp:
1
2
PRECONDITIONS:
This function may be called before MV_DEC_init().
POSTCONDITIONS:
CALLING SEQUENCE:
*/
extern void
MV_DEC_bufuse(
MV_DEC_BUFCFG * in_bufcfg_ptr, /* In: run-time config. parameters */
MV_DEC_BUFFERS * ou_bufuse_ptr /* Out: required sizes and alignment */
);
/*EMP=======================================================================*/
/*MPF=======================================================================*/
/*
FUNCTION NAME: MV_DEC_init
PACKAGE: DEC
SCOPE: PLATEFORM
DESCRIPTION:
This function initializes the video decoding package.
It claims all resources needed by the package and subsequently sets it
to its default state as specified for the MV_DEC_set_defaults() function.
The required buffers are passed as parameters.
This function must be called before any other function of the MV_DEC
package (except MV_DEC_bufuse())
!!! MV_DEC_init must be called before MV_INP_init
PRECONDITIONS:
This function may be called after MV_DEC_bufuse().
POSTCONDITIONS:
The drivers are set in the same mode than after call to
MV_DEC_set_defaults(). Video Decoder is in state
MV_DEC_DECODING_STATE_READY
CALLING SEQUENCE:
*/
extern void
MV_DEC_init(
MV_DEC_BUFFERS * in_buffers_ptr /* In: application allocated buffers */
);
/*EMP=======================================================================*/
/*MPF=======================================================================*/
/*
FUNCTION NAME: MV_DEC_set_defaults
PACKAGE: MV_DEC
SCOPE: PLATFORM
DESCRIPTION:
Sets the video decoding package to its default settings.
All status variables are reset to its init values.
PRECONDITIONS:
None
POSTCONDITIONS:
Video Decoder is in state MV_DEC_DECODING_STATE_READY
CALLING SEQUENCE:
*/
extern void
MV_DEC_set_defaults(
void
);
/*EMP=======================================================================*/
/*MPF=======================================================================*/
/*
FUNCTION NAME: MV_DEC_term
PACKAGE: DEC
SCOPE: PLATEFORM
DESCRIPTION:
Deinitialise the video decoding package.
Frees all resources allocated by MV_DEC_init call.
PRECONDITIONS:
None
POSTCONDITIONS:
After calling to this API, only MV_DEC_bufuse() and MV_IDEC_init()
can be called.
Video Decoder is in state MV_DEC_DECODING_STATE_IDLE
CALLING SEQUENCE:
*/
extern void
MV_DEC_term(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -