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

📄 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_

#ifdef __cplusplus
extern "C" {
#endif

/*************************************************************
  *
  * 	Fill the corrupted MB with the black, not with the previous reference pic
  *   at the first I picture after stop.
  *
  *   This fix the problem that the part of logo is shown at the first pic
  *	when playing the scratch disc.
  *
  *   M2VD_define.h also should be changed properly.
  *   (20051021, ishan) 
  *
  *************************************************************/

/* Block concealment type */
#define VDE_NO_BLACK_CONCEAL					0  
#define VDE_SW_BLACK_CONCEAL					1
#define VDE_HW_BLACK_CONCEAL					2


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

#if _USE_VIDEO_RECOMP
/* If recomp mode is enabled, SW black conceal cannot be used.
	Added to be consistent with M2VD_define.h (20060311,ishan) */
#if (_VDE_CONCEAL_TYPE == VDE_SW_BLACK_CONCEAL)
#undef _VDE_CONCEAL_TYPE
#define _VDE_CONCEAL_TYPE	VDE_SW_BLACK_CONCEAL
#endif
#endif

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

/******************************************************
 *       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
#define VDE_VALID_HOR_SIZE_MAX	720
#define VDE_VALID_VERT_SIZE_MAX	576

/******************************************************
 *       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;

/* Added for calculating the frame rate from the stream PTS when there's no seq_hd 
	(20060217,ishan) */
typedef struct {
	UINT		gop_id;
	UINT		temp_ref;
	GenPtm_st	start_pts;
} VDE_StreamPtsInfo_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;
} 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;
} VDE_GopHd_st;

typedef struct {
	VDE_GopHd_st hd;

	/* Extra information */
	/* Added for PTS management */
	UINT gop_id;
} VDE_GopInfo_st;

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

	/* Header information of a picture coding extention */
	UINT pic_cod_ext;

	/* 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;
}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;	
	/* For pull-down state */
	VDE_Pulldown_et pulldown_state;	
} 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;

	/* (20060217,ishan) */
	BOOL seq_hd_found_after_stop;	/* TRUE if seq_hd is found at least once after stop */
	/* TRUE if the stream PTS is preferred to be used when the stream PTS is different from the calculated PTS.
 	 	This is set TRUE when the first pic PTS after skip is calculated from the different GOP
 	 	or the field duration is changed by calculating the stream PTS. */	
	BOOL use_stream_pts;	
	BOOL field_duration_obtained;	/* TRUE if field_duration is obtained from PTS */
	
#if _3FRAME_ON	
	BOOL b_pic_pending;
#endif
	BOOL find_i_pic;
	BOOL skip_b_pic;
	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;
	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;	/* For field structure handling (2006323,ishan) */
	VDE_PicState_et pic_state;
	/* Decoding information */
	VDE_Pulldown_et	pulldown_state;	
	VDE_Error_et		error;	/* Last error happened */
	BOOL	is_scrambled_vcd_stream;	/* TRUE if scrambled VCD disc is loaded */

	BOOL invalid_seq_hd;	/* TRUE if invalid size seq_hd found (20050731,ishan) */

	BOOL decoded_after_stop;

#if (_VDE_CONCEAL_TYPE != VDE_NO_BLACK_CONCEAL)	
	BOOL	new_seq;	/* TRUE if the new seq is to decode */
#endif
} 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;
} 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 {
	BOOL play_logo;
} VDE_PlayParam_st;

typedef union {
	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 struct {
	UINT start_addr;
	UINT end_addr;
	BOOL need_flush;
} VdeSetInputInParam_st;

typedef struct {
	UINT pic_type;
	UINT top_addr;
	UINT bot_addr;
	BOOL new_seq;
} 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;
} VdeParseOutParam_st;

#ifdef __cplusplus
}
#endif


#endif

⌨️ 快捷键说明

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