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

📄 vde_types.h

📁 SAMSUNG 5009的源代码
💻 H
字号:
/******************************************************************************
 *   Filename    : VDE_types.h
 *   Start       : 2005.1.18
 *   By          : Inseo Han
 *   Contact     : ishan@samsung.com
 *   Description : 
 ******************************************************************************
 */ 

#ifndef _VDE_TYPES_H_
#define _VDE_TYPES_H_

#include "VDE_api.h"

#ifdef __cplusplus
extern "C" {
#endif

/* <<< @: 5010-xxx.HS SEO 060126 : merge source (vm-->vmmpvd) */
/* Block concealment type */
#define VDE_NO_BLACK_CONCEAL					0  
#define VDE_SW_BLACK_CONCEAL					1
#define VDE_HW_BLACK_CONCEAL					2


#if _USE_5005
#define _VDE_CONCEAL_TYPE	VDE_HW_BLACK_CONCEAL
#else
#define _VDE_CONCEAL_TYPE	VDE_SW_BLACK_CONCEAL
#endif

#if _API_CAP_GLB_SLOW_REVERSE
#define _VDE_NEW_SLOW_REVERSE			1
#else
#define _VDE_NEW_SLOW_REVERSE			0
#endif

/* <<< @: 5010-xxx.HS SEO 060126 : merge source (vm-->vmmpvd) */
/******************************************************
 *       The modulo unit of the PTS of 90kHz
 *****************************************************/
#define VDE_PTS_REMAIN_UNIT	100	

/******************************************************
 *       The valid picture size
 *****************************************************/
#define VDE_VALID_HOR_SIZE_MIN	16
#define VDE_VALID_VERT_SIZE_MIN	16
#if _SUPPORT_HD_DIVX_VIDEO
#define VDE_VALID_HOR_SIZE_MAX	960
#else
#define VDE_VALID_HOR_SIZE_MAX	720
#endif
#if _4FRAME_800x608_ON
#define VDE_VALID_VERT_SIZE_MAX	608
#else
#define VDE_VALID_VERT_SIZE_MAX	576
#endif

/******************************************************
 *       VDE Errors
 *****************************************************/
typedef enum {
	VDE_ERR_NONE = 0,
	VDE_ERR_NOT_ATTACHED,
	VDE_ERR_ABORTED,
	VDE_ERR_PARSE,
	VDE_ERR_NO_CMD_RDY,	/* Not yet finished */
	VDE_ERR_DEC,
	VDE_ERR_TIMEOUT,
	VDE_ERR_UNDERFLOW,
	VDE_ERR_OUTBUF
} VDE_Error_et;


/******************************************************
 *       Pulldown flag state
 *****************************************************/
typedef enum {
	VDE_PD_INIT,		/* Set after new GOP */
	VDE_PD_READY1,	/* Likely to be pulldown after two more pic */
	VDE_PD_READY2,	/* Likely to be pulldown after one more pic */
	VDE_PD_SET,		/* Pulldown source */
	VDE_PD_NONE		/* No pulldown source */
} VDE_Pulldown_et;

/******************************************************
 *       PTS information structure for PTS management
 *****************************************************/
typedef struct {
	UINT		gop_id;
	UINT 		temp_ref;
	GenPtm_st 	end_pts;
	UINT 		end_pts_remain;
} VDE_PicPts_st;

typedef struct {
	VDE_PicPts_st		i_pic;
	VDE_PicPts_st		prev_pic;
} VDE_PtsInfo_st;

/******************************************************
 *       VDE Video header structures
 *****************************************************/
typedef struct
{
	UINT hor_size;		/* source horizontal size */
	UINT vert_size;		/* source vertical size */
	UINT seq_ext;
	UCHAR mpeg_mode;
	UCHAR frame_rate_code;
	UINT bit_rate_val;
	BOOL fixed_vop_rate;
	UINT fixed_vop_time_increment;
	UINT vop_time_increment_resolution;
	UINT updated_current_msec;
	UINT updated_divx_index;
} VDE_SeqHd_st;

typedef struct {
	VDE_SeqHd_st hd;

	/* Extra information */
	UINT field_duration;
	UINT field_duration_remain;
} VDE_SeqInfo_st;

/* GOP layer information */
typedef struct {
	BOOL closed_gop;
	BYTE1 time_code_hours;
	BYTE1 time_code_minutes;
	BYTE1 time_code_seconds;
} VDE_GopHd_st;

#if _API_CAP_GLB_MPVD_FRAME_MODE /* corrected by _DALE_KIM_MPVD */
typedef struct {
	BYTE1 days;
	BYTE1 hours;
	BYTE1 minutes;
	BYTE1 seconds;
	//BYTE1 pictures;	// For MPEG-1 and -2 only
} VDE_TimeCode_st;

typedef struct {
	BOOL haveSeenFirstTimeCode;
	VDE_TimeCode_st cur_GOP_time_code;
	UINT tc_secs_base;
	//BYTE1 tc_pictures_base;
	UINT total_secs_since_last_time_code;
	ULLONG total_ticks_since_last_time_code;
} VDE_Time_st;
#endif

typedef struct {
	VDE_GopHd_st hd;

	/* Extra information */
	/* Added for PTS management */
	UINT gop_id;
#if _API_CAP_GLB_MPVD_FRAME_MODE /* corrected by _DALE_KIM_MPVD */
	VDE_TimeCode_st time_code;
#endif
} VDE_GopInfo_st;

/* Picture layer information */
typedef struct
{
	/* Header information in a picture layer */
	UCHAR pic_type;
	UINT temp_ref;

	/* Picture coding extention stored in rMP12_PIC_COD_EX_1R */
	UINT pic_cod_ext_1r;
	/* Picture coding extention stored in rPIC_H1 */
	UINT pic_cod_ext_h1;

	/* Header information of a picture display extention */
	UCHAR num_of_fcentre_offset;  
	UINT frame_centre_h_v_1;
	UINT frame_centre_h_v_2;
	UINT frame_centre_h_v_3;

	UCHAR pic_struc;
	UINT vop_time_increment;
	UINT module_time_base;
}VDE_PicHd_st;

typedef struct {
	VDE_PicHd_st hd;

	/* Extra information */
	UINT offset;
	/* Added for PTS management */
	UINT gop_id;
	GenPtm_st pts;
	UINT field_duration;
	UINT field_duration_remain;	
/* <<< @: 5010-xxx.HS SEO 060126 : merge source (vm-->vmmpvd) */
	/* For pull-down state */

	VDE_Pulldown_et pulldown_state;	
/* <<< @: 5010-xxx.HS SEO 060126 : merge source (vm-->vmmpvd) */
/*  total_num_of_chunks = num_of_reference_pictures + num_of_not_coded_pictures + num_of_null_pictures */	
	UINT total_num_of_chunks;
} VDE_PicInfo_st;


typedef enum {
	VDE_STATE_GET_INBUF_PREP,
	VDE_STATE_PARSE_PREP,
	VDE_STATE_GET_OUTBUF_PREP,	
	VDE_STATE_DEC_PIC_PREP,
	VDE_STATE_CHECK_EOS_PREP,
	VDE_STATE_WAIT_INBUF_PREP,
	VDE_STATE_WAIT_OUTBUF_PREP,
	VDE_STATE_GET_INBUF,
	VDE_STATE_PARSE,
	VDE_STATE_GET_OUTBUF,	
	VDE_STATE_DEC_PIC,
	VDE_STATE_CHECK_EOS,
	VDE_STATE_WAIT_INBUF,
	VDE_STATE_WAIT_OUTBUF,
	VDE_STATE_STOP,
	VDE_STATE_LAST_PIC,
	VDE_STATE_WAIT_OUTBUF_FOR_LAST_PIC,
#if _API_CAP_GLB_SLOW_REVERSE
#if _VDE_NEW_SLOW_REVERSE
	VDE_SR_STATE_GET_INBUF,
	VDE_SR_STATE_WAIT_INBUF,
	VDE_SR_STATE_COUNT_REF,
	VDE_SR_STATE_START_GET_TWO_REFS,
	VDE_SR_STATE_PARSE_REF,
	VDE_SR_STATE_GET_REF_OUTBUF,
	VDE_SR_STATE_WAIT_REF_OUTBUF,
	VDE_SR_STATE_DEC_REF,
	VDE_SR_STATE_COUNT_B,
	VDE_SR_STATE_START_B_GROUP,
	VDE_SR_STATE_PARSE_B,
	VDE_SR_STATE_GET_B_OUTBUF,
	VDE_SR_STATE_WAIT_B_OUTBUF,
	VDE_SR_STATE_DEC_B,
	VDE_SR_STATE_END_B_GROUP,
	VDE_SR_STATE_VOBU_END,
	VDE_SR_STATE_LAST_PIC,
	VDE_SR_STATE_WAIT_OUTBUF_FOR_LAST_PIC,
#else 
	VDE_SR_STATE_GET_INBUF,
	VDE_SR_STATE_WAIT_INBUF,
	VDE_SR_STATE_GET_OUTBUF,
	VDE_SR_STATE_WAIT_OUTBUF,
	VDE_SR_STATE_GET_OUTBUF_LAST_GOP,
	VDE_SR_STATE_WAIT_OUTBUF_LAST_GOP,
	VDE_SR_STATE_DEC_REF_PIC,
	VDE_SR_STATE_DEC_B_PIC,
	VDE_SR_STATE_DEC_LAST_GOP,
	VDE_SR_STATE_COUNT_PREV_GOP_REF_PIC,
	VDE_SR_STATE_COUNT_PREV_GOP_B_PIC,
	VDE_SR_STATE_PARSE_PREV_GOP_REF_PIC,
	VDE_SR_STATE_PARSE_PREV_GOP_B_PIC,
	VDE_SR_STATE_PARSE_LAST_GOP_REF_PIC,
	VDE_SR_STATE_PARSE_LAST_GOP_B_PIC,
	VDE_SR_STATE_END_PREV_VBV,
	VDE_SR_STATE_COUNT_GOP_NUM,
#endif	
#endif
	VDE_STATE_END
} VDE_State_et;

typedef enum {
	/* The first field of the field structure picture */
	VDE_PIC_FIRST_FIELD,
	/* The second field of the field structure picture */
	VDE_PIC_SEC_FIELD,
	/* The frame structure picture */
	VDE_PIC_FRAME
} VDE_PicState_et;

typedef struct {
	BOOL seq_hd_found;
	BOOL b_pic_pending;
	BOOL find_i_pic;
	BOOL skip_b_pic;
#if _APP_CAP_FUNC_DIVX_PRECISE_TIMESEARCH
	BOOL skip_pic;
#endif	
	BOOL normal_from_trick;	/* TRUE, if play from I pic only trick play */
	BOOL skip_happen;	/* TRUE, if picture is not put to output filled list */
	BOOL play_mem;		/* TRUE, if PlayMem */
	SH_PlayFrameMode_et dec_mode;
#if _APP_CAP_FUNC_MMP_TRICK_PLAY_WITHOUT_IDX
	SH_PlayFrameMode_et disp_mode;
#endif
	BOOL one_dec_per_unit;
	BOOL aborted;
	BOOL seq_end;
	BOOL dec_end;		/* TRUE, if all the video data is decoded */
	/* For field structure handling */
	UINT prev_temp_ref;
	UCHAR prev_pic_type;	/* For field structure handling (20060316,ishan) */
	UINT prev_gop_id;
	VDE_PicState_et pic_state;
	/* Decoding information */
	VDE_Pulldown_et	pulldown_state;	
	VDE_Error_et		error;	/* Last error happened */
#if _API_CAP_GLB_MPVD_FRAME_MODE /* corrected by _DALE_KIM_MPVD */
    UINT total_secs_since_last_time_code;
    ULONG total_ticks_since_last_time_code;
#endif
/* Inserted By InSeo.Han */
#if _USE_NEW_VIDEO_TRICK
	BOOL is_dec_per_unit;
	BOOL high_bitrate_video;
#endif

	/* TRUE if scrambled VCD disc is loaded */
	BOOL is_scrambled_vcd_stream;

/*		Updated by Cheongwoo.lee, 20060116 */
	BOOL invalid_seq_hd;	/* TRUE if invalid size seq_hd found (20050731,ishan) */

#if 0//(_VDE_CONCEAL_TYPE != VDE_NO_BLACK_CONCEAL)	
	BOOL	new_seq;	/* TRUE if the new seq is to decode */
#else
/* <<< @: 5010-xxx.HS SEO 060126 : merge source (vm-->vmmpvd) */

#if (_VDE_CONCEAL_TYPE != VDE_NO_BLACK_CONCEAL)	
	BOOL	new_seq;	/* TRUE if the new seq is to decode */
#endif

/* <<< @: 5010-xxx.HS SEO 060126 : merge source (vm-->vmmpvd) */
#endif
/*		Updated by Cheongwoo.lee, 20060116 */

	BOOL abort_and_underflow;
} VDE_Flag_st;

typedef struct {
	BM_FILLEDLIST 	filled_list;
	BM_NODE * 		pBuf;
	
	GenPtm_st		stream_pts;
	UINT			unit_id;
} VDE_Input_st;


typedef struct {
	BM_FILLEDLIST 	*pFilled_list;
	/* Stream header information */
	VDE_SeqInfo_st	seq_info;
	VDE_SeqInfo_st	seq_info_backup;
	VDE_GopInfo_st	gop_info;
	VDE_PicInfo_st	pic_info;
	VDE_PicInfo_st 	pic_info_ref1;
	VDE_PicInfo_st 	pic_info_ref2;
	/* Decoding output buffer */
	BM_NODE 		*pBuf_temp;		/* temporary outbuf pointer */
	BM_NODE 		*pBuf_ref1;
	BM_NODE 		*pBuf_ref2;
#if _APP_CAP_FUNC_DIVX_PRECISE_TIMESEARCH
	UINT			cur_video_pts;
#endif
} VDE_Output_st;

#if _API_CAP_GLB_SLOW_REVERSE
#if _VDE_NEW_SLOW_REVERSE
typedef struct {
	BOOL			slow_reverse_started;
	BOOL			input_read_out;
	BOOL			discard_cur_inbuf;
	UINT			num_ref;
	UINT			num_ref_decoded;
	UINT			num_b;
	UINT			num_b_handled;
	UINT			addr_start_b;
	BOOL			handle_inbuf_prev;
	BM_NODE * 		pInbuf_cur;
	BM_NODE *		pInbuf_prev;

	UINT			current_pts;
	VDE_PicState_et	prev_pic_state;
} VDE_SlowReverseInfo_st;
#else
typedef struct {
	BOOL			SlowReversePlay;
	BOOL			last_gop_decoded;
	BOOL			ref_pic_num_counted;
	BOOL			first_vbv_buffer;
	BOOL			start_pts_notified;
	BOOL			end_pts_notified;
	UINT			current_pts;
	UINT			start_pts;
	BM_NODE * 		pBuf_latest_VBV;
	BM_NODE * 		pBuf_previous_VBV;
	UINT			num_P;
	UINT			num_decoded_P;
	UINT 			num_B;
	UINT 			B_ptr[5];
	VDE_State_et		prev_vde_state;
}VDE_SlowReverse_Info_st;
#endif
#endif
/******************************************************
 *       VDE message types
 *****************************************************/
 typedef enum {
 	VDE_CTRL_INIT,
	VDE_CTRL_START,
	VDE_CTRL_INBUF_FILLED_PREP,
	VDE_CTRL_INBUF_FILLED,
	VDE_CTRL_OUTBUF_AVAIL,
	VDE_CTRL_STOP, 
	VDE_CTRL_PLAY_MEM
} VDE_CtrlCmd_et;

typedef struct {
	VDE_Decoder_et	decoder_type;
} VDE_InitParam_st;

typedef struct {
	BOOL play_logo;
} VDE_PlayParam_st;

typedef union {
	VDE_InitParam_st init;
	VDE_PlayParam_st play;
} VDE_Param_st;

typedef struct {
	VDE_CtrlCmd_et	 msg_id;
	VDE_Param_st param;
} VDE_Msg_st;



/******************************************************
 *       Video decoder core functions
 *****************************************************/
typedef VDE_Error_et (*VDE_CORE_FUNC)(void *pIn, void *pOut);

typedef struct {
	UINT start_addr;
	UINT end_addr;
	BOOL need_flush;
} VdeSetInputInParam_st;

typedef struct {
	UINT pic_type;
	UINT top_addr;
	UINT bot_addr;
/* <<< @: 5010-xxx.HS SEO 060126 : merge source (vm-->vmmpvd) */
	BOOL new_seq;
/* <<< @: 5010-xxx.HS SEO 060126 : merge source (vm-->vmmpvd) */
} VdeSetOutputInParam_st;

typedef struct {
	BOOL seq_hd_found;
	BOOL gop_hd_found;
	
	VDE_SeqHd_st *pSeq_hd;
	VDE_GopHd_st *pGop_hd;
	VDE_PicHd_st *pPic_hd;

/*  num_of_start_codes : num of start codes found in the vdeParse() */	
	UINT num_of_start_codes;
} VdeParseOutParam_st;

/* Decoder core function pointer */
typedef struct {
	VDE_CORE_FUNC	pre_init;
	VDE_CORE_FUNC	deinit;
	VDE_CORE_FUNC	init;
	VDE_CORE_FUNC	set_input;
	VDE_CORE_FUNC	set_output;
	VDE_CORE_FUNC	parse;
	VDE_CORE_FUNC	dec_pic;
	VDE_CORE_FUNC	abort;
	VDE_CORE_FUNC	end_with_seq_end;
	VDE_CORE_FUNC	set_seq_hd;
	VDE_CORE_FUNC	end_wait;
} VDE_CoreFunc_st;

//<<< KSH@5010 050901 deleted
#ifdef __cplusplus
}
#endif


#endif

⌨️ 快捷键说明

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