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

📄 vp_api.h

📁 SAMSUNG 5009的源代码
💻 H
字号:
/******************************************************************************
 *   Filename    : Vp_api.h                                                   *
 *   Start date  :                                                            *
 *   By          :                                                            *             
 *   Contact     :                                                            *
 *   Description : low level api headers.(for only high level api)            *
 *                                                                            *
 ******************************************************************************
 */
#ifndef	_VP_API_H_
#define	_VP_API_H_

#ifdef __cplusplus
extern "C" {
#endif

/********************************************* 
 *   Data types
 *********************************************/

typedef enum{
	VP_NTSC,
	VP_PAL
}VP_DisplayMode_t;

typedef enum {
	VP_SCALE_POLYPHASE,
	VP_SCALE_BILINEAR,
	VP_SCALE_DECIMATE
} VP_VerticalScaleMode_t;


#if _USE_5008 || _USE_5005 || _USE_5015
typedef enum {
	VP_SHADOW_V_SYNC,
	VP_SHADOW_H_SYNC
} VP_ShadowType_et;
#endif

#if _API_CAP_GLB_MPVD_FRAME_MODE
typedef enum{
	VP_MODE_NULL,
	VP_INTERLACE,
	VP_WEAVE,
	VP_IPC,
	VP_IPC_FIRST,
	VP_BOB,
	VP_ASV_P,
	VP_ASV_M,
	VP_ASV_H,
	VP_ASV_V,
	VP_ASV_F,
	VP_ASV_D,
	VP_ASV_P_W,
	VP_ASV_M_W,
	VP_ASV_H_W,
	VP_ASV_V_W,
	VP_ASV_F_W,
	VP_ASV_D_W
}VP_Mode_t;
#else
typedef enum{
	VP_MODE_NULL,
	VP_INTERLACE,
	VP_WEAVE,
	VP_IPC,
	VP_IPC_FIRST,
	VP_BOB,
	VP_ASV_P,
	VP_ASV_M,
	VP_ASV_H,
	VP_ASV_V,
	VP_ASV_F,
	VP_ASV_D,
	VP_ASV_P_W,
	VP_ASV_M_W,
	VP_ASV_H_W,
	VP_ASV_V_W,
	VP_ASV_F_W,
	VP_ASV_D_W
}VP_Mode_t;
#endif


typedef struct{
	UINT horizontal;
	UINT vertical;
}VP_Input_t;

typedef struct {
	SSHORT x_pos;
	SSHORT y_pos;
	SSHORT width;
	SSHORT height;
} VP_Rect_t;

typedef enum {
	VP_TOP,
	VP_BOTTOM
} VP_FieldId_t;

typedef enum {
	/* Don't change the order and the value */
	VP_PP_H_NORMAL = 0,
	VP_PP_H_8_9,		/* 720 to 640 */
	VP_PP_H_1_2,
	VP_PP_H_1_3,
	VP_PP_H_1_4
} VP_FilterPpHor_t;

typedef enum {
	/* Don't change the order and the value */
	VP_PP_V_NORMAL = 0,
	VP_PP_V_5_6,		/* PAL to NTSC */
	VP_PP_V_3_4,
	VP_PP_V_1_2,
	VP_PP_V_1_3,
	VP_PP_V_1_4
} VP_FilterPpVert_t;

typedef enum{
	VP_PP_SHARPNESS_0 = 0,
	VP_PP_SHARPNESS_1,	
	VP_PP_SHARPNESS_2,
	VP_PP_SHARPNESS_3
}VP_Pp_Sharpness_t;


typedef enum{
	VP_PP_LINEEQ_0 = 0,
	VP_PP_LINEEQ_1,
	VP_PP_LINEEQ_2,
	VP_PP_LINEEQ_3,
	VP_PP_LINEEQ_4,
	VP_PP_LINEEQ_5,
	VP_PP_LINEEQ_6,
	VP_PP_LINEEQ_7,
	VP_PP_LINEEQ_ALL
}VP_Pp_LINEEQ_t;

typedef struct {
	BYTE4 top_even;
	BYTE4 top_odd;
	BYTE4 bottom_even;
	BYTE4 bottom_odd;
} VpFramePointer_t;


/********************************************* 
 *   Define
 *********************************************/
 #define VP_NTSC_H_SIZE				0x2D0		/* 720d */
 #define VP_NTSC_V_SIZE				0xF0		/* 240d */

 #define VP_PAL_H_SIZE				0x2D0		/* 720  */
 #define VP_PAL_V_SIZE				0x120		/* 288 */

#if 1 //#if _USE_PS_ONE_PIXEL
 #define VP_THRES_OTHERS			148			/* 150d */
 #define VP_THRES_BOB				248			/* 250d */
#else
 #define VP_THRES_OTHERS			150			/* 150d */
 #define VP_THRES_BOB				250			/* 250d */
#endif

 #define VP_GET_ASV_VALUE_ERROR	0xffffffff

 #define VP_SATURATION_DEFAULT	0x80
 #define VP_SATURATION_MINIMUM	0x00
 #define VP_SATURATION_MAXIMUM	0xFF


#define VP_SET_MODE_ONLY(val)			rVP_MODE &= ~(0x1f);\
										rVP_MODE |= (val)
									
#define VP_GET_MODE_ONLY()				(rVP_MODE & 0x1f)
#define VP_GET_MODE_ONLY_SHADOW()	(rVP_MODE_S & 0x1f)
#if _APP_CAP_JPG_ASV//added by xh 20060424--------------------------------
#define VP_SET_ASV_C_PTR(x)			rVP_ASV_C_PTR = x
#define VP_SET_ASV_Y_PTR(x)			rVP_ASV_Y_PTR = x

#define VP_SET_H_WIPE(x)			rVP_H_WIPE = x
#define VP_SET_V_WIPE(x)			rVP_V_WIPE = x
#define VP_SET_BLENDING(x)			rVP_BLENDING = x

#define VP_GET_H_WIPE()				rVP_H_WIPE
#define VP_GET_V_WIPE()				rVP_V_WIPE
#define VP_GET_BLENDING()			rVP_BLENDING
#endif //-----------------------------------------------------


#define VP_SET_PRE_C_PTR(x)			rVP_PREV_C_PTR = x
#define VP_SET_PRE_Y_PTR(x)			rVP_PREV_Y_PTR = x
#define VP_SET_CUR_C_PTR(x)			rVP_CURR_C_PTR = x
#define VP_SET_CUR_Y_PTR(x)			rVP_CURR_Y_PTR = x
#define VP_SET_NEXT_C_PTR(x)		rVP_NEXT_C_PTR = x
#define VP_SET_NEXT_Y_PTR(x)		rVP_NEXT_Y_PTR = x

#define VP_GET_PRE_C_PTR()			rVP_PREV_C_PTR
#define VP_GET_PRE_Y_PTR()			rVP_PREV_Y_PTR
#define VP_GET_CUR_C_PTR()			rVP_CURR_C_PTR
#define VP_GET_CUR_Y_PTR()			rVP_CURR_Y_PTR
#define VP_GET_NEXT_C_PTR()		rVP_NEXT_C_PTR
#define VP_GET_NEXT_Y_PTR()		rVP_NEXT_Y_PTR

#define VP_HANDSHAKE(x)			rVP_FIELD_ID = (((x)<<1)|rVP_FIELD_ID&1)
 
#define VP_CURR_DMA_PTR(x)               rVP_CURR_DMA_PTR = x
 
#define VP_SET_PIC_WIDTH(x)			rVP_PIC_WIDTH = ((x) & 0xfffffff0)	/* multiple of 16 */

#if (_USE_5008) || (_USE_5005) || (_USE_5010) || (_USE_5015)||(_USE_5009)
/* 5008,5005, 5010 and other chips from now on will use the following format (20051206,ishan) */
#define VP_SET_SRC_H_POSITION(x)	rVP_SRC_H_POSITION = ((x)<<4)	/* 10.4 format  */
#else
// With the following define, there's problem when playing VCD (352*240) 
//#define VP_SET_PIC_HEIGHT(x)		rVP_PIC_HEIGHT = ((x) & 0xfffffff0)	/* multiple of 16 */

/* IPC or IPC_FIRST, x should be multiples of 8.
	Otherwise, there can be some problem when displaying the video with large motion.
	For example, "拳魂绊", "Ghost in the Shell", "浆府" have display problem
	when setting "Pan and Scan" with SRC_H_POSITION= 90.
	VP mode can be changed between IPC and WEAVE in the same stream.
	In that case, if Pan and Scan is set, the center position of image is moving when VP
	mode changes.
	Therefore we fix SRC_H_POSITON to the multiple of 8 */	
//#define VP_SET_SRC_H_POSITION(x)	rVP_SRC_H_POSITION = ((x) & 0xfffffff8)	/* multiple of 8 */
#define VP_SET_SRC_H_POSITION(x)	rVP_SRC_H_POSITION = ((x) & 0xfffffffc)	/* multiple of 4 */
#endif

#define VP_SET_SRC_H_POSITION_REMAIN(x)		rVP_IPC_THRESHOLD = (((rVP_IPC_THRESHOLD) & 0xfffffffc) | (x))
#define VP_SET_SRC_H_OFFSET(x)	rVP_SRC_H_POSITION = ( (rVP_SRC_H_POSITION & 0xffff) | (x << 16) )	 // Sunto 051102 : _SUPPORT_HD_DIVX_VIDEO
#define VP_SET_PIC_HEIGHT(x)		rVP_PIC_HEIGHT = ((x) & 0xfffffffe)	/* even only */
#define VP_SET_SRC_WIDTH(x)			rVP_SRC_WIDTH = ((x) & 0xfffffffe)	/* even only */
#define VP_SET_SRC_HEIGHT(x) 		rVP_SRC_HEIGHT = ((x) & 0xfffffffe)	/* even only */
#define VP_SET_DST_H_POSITION(x)	rVP_DST_H_POSITION = ((x) & 0xfffffffe)	/* even only */
#define VP_SET_DST_V_POSITION(x)	rVP_DST_V_POSITION = ((x) & 0xfffffffe)	/* even only */
#define VP_SET_DST_WIDTH(x)			rVP_DST_WIDTH = ((x) & 0xfffffffe)	/* even only */
#define VP_SET_DST_HEIGHT(x)		rVP_DST_HEIGHT = ((x) & 0xfffffffe)	/* even only */




/********************************************* 
 *   VP mode state in case of auto VP mode
 *********************************************/
 #define VS_NULL				0
 #define VS_IPC					1
 #define VS_IPC_FIRST			2
 #define VS_WEAVE				3	/* Weave */
 #define VS_WEAVE_READY			4	/* Weave from IPC */
 #define VS_BOB					5	/* BOB */
 #define VS_BOB_READY			6	/* BOB from IPC */


 typedef struct {
	BOOL			show_new_pic;
	VP_FieldId_t	next_field_id;
	BYTE4			addr_odd_field;	/* The other field pointer of thenext ptr */
	BYTE4			addr_even_field;
} StepOrderInfo_t;


/********************************************* 
 *   Functions Define
 *********************************************/
VOID VP_Initial ( VOID );
VOID VP_SetOnOff ( BOOL on );
BOOL VP_GetOnOff ( VOID );
VOID VP_MatchFieldId(VOID);
VOID VP_SetFieldId (VP_FieldId_t field_id);
VP_FieldId_t VP_GetFieldId (VOID);
#if _USE_5008 || _USE_5005 || _USE_5015
VOID VP_SetShadowSyncType(VP_ShadowType_et sync_type);
#endif
#if _USE_REAL_INTERLACE
VOID VP_SetModeRaw(VP_Mode_t vp_mode);
#endif
VOID VP_SetMode(VP_Mode_t vp_mode);
VP_FieldId_t VP_GetFieldId_Shadow (VOID);
VOID VP_SetVerticalScaleMode(VP_VerticalScaleMode_t scale_mode);
#if _USE_REAL_INTERLACE
VOID VP_SetIntProgMode(S5H_VideoIntProgMode_t int_prog_mode);
VOID VP_SetB2rWaitNum(S5H_VideoIntProgMode_t int_prog_mode);
#endif
void VP_SetModeWithoutScaleChange(VP_Mode_t vp_mode);
VP_Mode_t VP_GetMode(VOID);
VP_Mode_t VP_GetModeShadow(VOID);
VOID VP_SetVideoPictureSize ( VP_Input_t *vp_input );
BOOL VP_IsProgressiveOutput (VOID);
VOID VP_GetVideoOutputMaxSize ( VP_DisplayMode_t tv_mode , 
								SSHORT *out_width, SSHORT *out_height);
VOID VP_SetVideoRatio ( VOID );
VOID VP_GetVideoRatio (USHORT *h_ratio, USHORT *v_ratio );
VOID VP_SetSrcHorPosition(SSHORT x);
BOOL VP_SetSrcVertPosition(SSHORT y);
VOID VP_CalculateScaleFactor(VP_Rect_t *src,VP_Rect_t *dst, USHORT *h_ratio, USHORT *v_ratio );
VOID VP_SetScaling(VP_Rect_t *src,VP_Rect_t *dst);
VOID VP_SetFilter (VOID);

VOID VP_PP_SetOnOff (BOOL on);
VOID VP_PP_SetSaturation (UCHAR saturation);
VOID VP_PP_SetSharpness ( VP_Pp_Sharpness_t sharp );
VOID VP_PP_SetHistogramOnOff ( BOOL on );
VOID VP_PP_GetHistogram (UINT *hist_array );
VOID VP_PP_SetAllContrast(UINT val);
VOID VP_PP_SetContrast(UCHAR slope);
VOID VP_PP_SetBrightness(SINT intercept);
VOID VP_PP_Check(VOID);

VOID VP_PolyPhaseSet(VP_FilterPpHor_t pp_hor, VP_FilterPpVert_t pp_vert);
VOID VP_SetPolyPhaseFilter(volatile UINT * p_filter_reg, CONST SCHAR * filter_coef, BYTE2 tap);

#if _SUPPORT_3D_IPC
typedef enum {
	VP_CUR_FIRST_FRAME,
	VP_CUR_SEC_FRAME
} VP_CurField_t;
#endif

VOID VP_CustomOrderFrame(UINT top_y, UINT top_c, UINT bot_y, UINT bot_c);
#if _APP_CAP_JPG_ASV//xh 20060424
VOID VP_AsvOrderFrame(UINT top_y, UINT top_c, UINT bot_y, UINT bot_c);
#endif 

#if _API_CAP_GLB_B2R_FRAME_MODE
//VOID VP_OrderField(UINT pic_type, VP_FieldId_t fid, UINT display_index);
VOID VP_OrderField(UINT pic_type, VP_FieldId_t fid, UINT fb_start_addr);
#else
#if _SUPPORT_3D_IPC
VOID VP_OrderField(VP_FieldId_t fid, UINT first_frame, UINT sec_frame, VP_CurField_t cur_frame);
#else
VOID VP_OrderField(VP_FieldId_t fid, UINT frame_addr);
#endif
#endif	// #if _API_CAP_GLB_B2R_FRAME_MODE


#ifdef __cplusplus
}
#endif

#endif /* _VP_API_H_ */

⌨️ 快捷键说明

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