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

📄 vp_api.h

📁 三星ic 9980的源代码. 718版.
💻 H
📖 第 1 页 / 共 2 页
字号:
#define rVP_POLY4_C3_LH				( *(volatile UINT *) (VP_BASE + 0x160) )
#define rVP_POLY4_C3_HL				( *(volatile UINT *) (VP_BASE + 0x164) )
#define rVP_POLY4_C3_HH			( *(volatile UINT *) (VP_BASE + 0x168) )


/********************************************* 
 *   VP Shadow Register
 *********************************************/
#define rVP_FIELD_ID_S				( *(volatile UINT *) (VP_BASE + 0x16C) )
#define rVP_MODE_S					( *(volatile UINT *) (VP_BASE + 0x170) )
#define rVP_H_WIPE_S				( *(volatile UINT *) (VP_BASE + 0x174) )
#define rVP_V_WIPE_S				( *(volatile UINT *) (VP_BASE + 0x178) )
#define rVP_BLENDING_S				( *(volatile UINT *) (VP_BASE + 0x17C) )
#define rVP_IPC_THRESHOLD_S		( *(volatile UINT *) (VP_BASE + 0x180) )

#define rVP_ASV_PTR0_S				( *(volatile UINT *) (VP_BASE + 0x184) )
#define rVP_ASV_PTR1_S				( *(volatile UINT *) (VP_BASE + 0x188) )
#define rVP_PREV_PTR0_S				( *(volatile UINT *) (VP_BASE + 0x18C) )
#define rVP_PREV_PTR1_S				( *(volatile UINT *) (VP_BASE + 0x190) )
#define rVP_CURR_PTR0_S				( *(volatile UINT *) (VP_BASE + 0x194) )
#define rVP_CURR_PTR1_S				( *(volatile UINT *) (VP_BASE + 0x198) )
#define rVP_NEXT_PTR0_S				( *(volatile UINT *) (VP_BASE + 0x19C) )
#define rVP_NEXT_PTR1_S				( *(volatile UINT *) (VP_BASE + 0x1A0) )

#define rVP_PIC_WIDTH_S			( *(volatile UINT *) (VP_BASE + 0x1A4) )
#define rVP_PIC_HEIGHT_S			( *(volatile UINT *) (VP_BASE + 0x1A8) )
#define rVP_SRC_H_POSITION_S		( *(volatile UINT *) (VP_BASE + 0x1AC) )
#define rVP_SRC_V_POSITION_S		( *(volatile UINT *) (VP_BASE + 0x1B0) )
#define rVP_SRC_WIDTH_S			( *(volatile UINT *) (VP_BASE + 0x1B4) )
#define rVP_SRC_HEIGHT_S			( *(volatile UINT *) (VP_BASE + 0x1B8) )
#define rVP_DST_H_POSITION_S		( *(volatile UINT *) (VP_BASE + 0x1BC) )
#define rVP_DST_V_POSITION_S		( *(volatile UINT *) (VP_BASE + 0x1C0) )
#define rVP_DST_WIDTH_S			( *(volatile UINT *) (VP_BASE + 0x1C4) )
#define rVP_DST_HEIGHT_S			( *(volatile UINT *) (VP_BASE + 0x1C8) )
#define rVP_H_RATIO_S				( *(volatile UINT *) (VP_BASE + 0x1CC) )
#define rVP_V_RATIO_S				( *(volatile UINT *) (VP_BASE + 0x1D0) )


/********************************************* 
 *   VP Active Register 
 *********************************************/
#define rVP_PP_BYPASS				( *(volatile UINT *) (VP_BASE + 0x200) )
#define rVP_PP_THRESHOLD0			( *(volatile UINT *) (VP_BASE + 0x204) )
#define rVP_PP_THRESHOLD1			( *(volatile UINT *) (VP_BASE + 0x208) )
#define rVP_PP_SATURATION			( *(volatile UINT *) (VP_BASE + 0x20C) )
#define rVP_PP_SHARPNESS			( *(volatile UINT *) (VP_BASE + 0x210) )
#define rVP_PP_COUNT_HISTOGRAM	( *(volatile UINT *) (VP_BASE + 0x214) )

#define rVP_PP_LINE_EQ0				( *(volatile UINT *) (VP_BASE + 0x218) )
#define rVP_PP_LINE_EQ1				( *(volatile UINT *) (VP_BASE + 0x21C) )
#define rVP_PP_LINE_EQ2				( *(volatile UINT *) (VP_BASE + 0x220) )
#define rVP_PP_LINE_EQ3				( *(volatile UINT *) (VP_BASE + 0x224) )
#define rVP_PP_LINE_EQ4				( *(volatile UINT *) (VP_BASE + 0x228) )
#define rVP_PP_LINE_EQ5				( *(volatile UINT *) (VP_BASE + 0x22C) )
#define rVP_PP_LINE_EQ6				( *(volatile UINT *) (VP_BASE + 0x230) )
#define rVP_PP_LINE_EQ7				( *(volatile UINT *) (VP_BASE + 0x234) )

#define rVP_PP_HISTOGRAM0			( *(volatile UINT *) (VP_BASE + 0x238) )
#define rVP_PP_HISTOGRAM1			( *(volatile UINT *) (VP_BASE + 0x23C) )
#define rVP_PP_HISTOGRAM2			( *(volatile UINT *) (VP_BASE + 0x240) )
#define rVP_PP_HISTOGRAM3			( *(volatile UINT *) (VP_BASE + 0x244) )
#define rVP_PP_HISTOGRAM4			( *(volatile UINT *) (VP_BASE + 0x248) )
#define rVP_PP_HISTOGRAM5			( *(volatile UINT *) (VP_BASE + 0x24C) )
#define rVP_PP_HISTOGRAM6			( *(volatile UINT *) (VP_BASE + 0x250) )
#define rVP_PP_HISTOGRAM7			( *(volatile UINT *) (VP_BASE + 0x254) )


/********************************************* 
 *   VP Shadow Register
 *********************************************/
#define rVP_PP_BYPASS_S			( *(volatile UINT *) (VP_BASE + 0x258) )
#define rVP_PP_SATURATION_S		( *(volatile UINT *) (VP_BASE + 0x25C) )
#define rVP_PP_SHARPNESS_S			( *(volatile UINT *) (VP_BASE + 0x260) )
#define rVP_PP_COUNT_HISTOGRAM_S	( *(volatile UINT *) (VP_BASE + 0x264) )

#define rVP_PP_LINE_EQ0_S			( *(volatile UINT *) (VP_BASE + 0x268) )
#define rVP_PP_LINE_EQ1_S			( *(volatile UINT *) (VP_BASE + 0x26C) )
#define rVP_PP_LINE_EQ2_S			( *(volatile UINT *) (VP_BASE + 0x270) )
#define rVP_PP_LINE_EQ3_S			( *(volatile UINT *) (VP_BASE + 0x274) )
#define rVP_PP_LINE_EQ4_S			( *(volatile UINT *) (VP_BASE + 0x278) )
#define rVP_PP_LINE_EQ5_S			( *(volatile UINT *) (VP_BASE + 0x27C) )
#define rVP_PP_LINE_EQ6_S			( *(volatile UINT *) (VP_BASE + 0x280) )
#define rVP_PP_LINE_EQ7_S			( *(volatile UINT *) (VP_BASE + 0x284) )


typedef enum{
	VP_OFF,
	VP_ON	
}VP_OnOff_t;

typedef enum {
	VP_ZOOM_NONE,
	VP_ZOOM_2X,
	VP_ZOOM_4X
}VP_Zoom;


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;

typedef enum {
	/* Don't change the order and the value */
	VP_PP8_NORMAL = 0,
	VP_PP8_8_9,		/* 720 to 640 */
	VP_PP8_1_2,
	VP_PP8_1_3,
	VP_PP8_1_4
} VP_FilterPp8_t;

typedef enum {
	/* Don't change the order and the value */
	VP_PP4_NORMAL = 0,
	VP_PP4_5_6,		/* PAL to NTSC */
	VP_PP4_3_4,
	VP_PP4_1_2,
	VP_PP4_1_3,
	VP_PP4_1_4
} VP_FilterPp4_t;

typedef enum {
	VP_MODE_HIGH_NTSC,
	VP_MODE_HIGH_NTSC_TO_PAL,		
	VP_MODE_HIGH_PAL,
	VP_MODE_HIGH_PAL_TO_NTSC,	
	VP_MODE_NTSC,
	VP_MODE_NTSC_TO_PAL,	
	VP_MODE_PAL,
	VP_MODE_PAL_TO_NTSC,
	VP_MODE_LOGO_PAL,
	VP_MODE_LOGO_NTSC,
	VP_MODE_GAMECD
}VP_StdMode;

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

typedef struct {
	BOOL			bVPCompress;			/* Compress bit ON or not - 1 - for high res and 0 for low res */
	UINT			ui16PicWidth;			/* Picture Width */
	VP_Rect_t		src;						/* Picture soure param */
	VP_Rect_t		dst;						/* Picture dest param */
}VP_PropStruct;


typedef struct {
	BOOL			bVPCompress;			/* Compress bit ON or not - 1 - for high res and 0 for low res */
	VP_OnOff_t		bVPOnOff;				/* VP_ON or VP_OFF */
	UINT			ui16PicWidth;			/* Picture Width */
	VP_Rect_t		src;						/* Picture soure param */
	VP_Rect_t		dst;						/* Picture dest param */
	UINT			ulHRatio;
	UINT			ulVRatio;	
}VP_Properties;

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

 #define VP_THRES_OTHERS			148			/* 150d */
 #define VP_THRES_BOB				248			/* 250d */

 #define VP_GET_ASV_VALUE_ERROR	0xffffffff

 #define VP_SATURATION_DEFAULT	0x80
 #define VP_SATURATION_MINIMUM	0x00
 #define VP_SATURATION_MAXIMUM	0xFF
 
 /* khn, VP display pointer set macro */

#define VP_SET_CUR_PTR0(x)			WRITE32_EX((unsigned char *)& rVP_Y_PTR_H,x)
                                    
//#define VP_SET_CUR_PTR1(x)			rVP_C_PTR = x  //rVP_C_PTR_H = x>>16; rVP_C_PTR_L =x & 0xFFFF
#define VP_SET_CUR_PTR1(x)			WRITE32_EX((unsigned char *) &rVP_C_PTR_H,x)


// 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_REMAIN(x)		rVP_IPC_THRESHOLD = (((rVP_IPC_THRESHOLD) & 0xfffffffc) | (x))


/* KBA : Please use Disable interrrupts and Enable interrupts before and after setting the parameteres since I use IO_WData32() */
#define VP_SET_SRC_H_POSITION(x)		WRITE32_EX( (unsigned char * )&rVP_SRC_H_POSITION_H, (x & 0xfffffffc))	/* multiple of 4 */
#define VP_SET_DST_H_POSITION(x)		WRITE32_EX( (unsigned char * )&rVP_DST_H_POSITION_H, (x & 0xfffffffe) )	/* even only */

#define VP_SET_SRC_V_POSITION(x)		WRITE32_EX( (unsigned char * )&rVP_SRC_V_POSITION_H, (x & 0xfffffffe) )	/* even only */
#define VP_SET_DST_V_POSITION(x)		WRITE32_EX( (unsigned char * )&rVP_DST_V_POSITION_H, (x & 0xfffffffe) )	/* even only */

#define VP_SET_PIC_WIDTH(x)			WRITE32_EX( (unsigned char * )&rVP_Pic_Width_H, (x & 0xfffffff0) )	/* multiple of 16 */
#define VP_SET_PIC_HEIGHT(x)			WRITE32_EX( (unsigned char * )&rVP_Pic_Height_H, (x & 0xfffffffe) )		/* even only */

#define VP_SET_SRC_WIDTH(x)			WRITE32_EX( (unsigned char * )&rVP_SRC_WIDTH_H, (x & 0xfffffffe) )		/* even only */
#define VP_SET_SRC_HEIGHT(x) 			WRITE32_EX( (unsigned char * )&rVP_SRC_HEIGHT_H, (x & 0xfffffffe) )		/* even only */

#define VP_SET_DST_WIDTH(x)			WRITE32_EX( (unsigned char * )&rVP_DST_WIDTH_H, (x & 0xfffffffe) )	/* even only */
#define VP_SET_DST_HEIGHT(x)			WRITE32_EX( (unsigned char * )&rVP_DST_HEIGHT_H, (x & 0xfffffffe) )	/* even only */

#define VP_SET_V_RATIO(x)				WRITE32_EX( (unsigned char * )&rVP_V_RATIO_H, (x & 0xfffffffe) )	/* even only */
#define VP_SET_H_RATIO(x)				WRITE32_EX( (unsigned char * )&rVP_H_RATIO_H, (x & 0xfffffffe) )	/* even only */

/********************************************* 
 *   Functions Define
 *********************************************/
void Init_VP(BOOL);
// void DeInit_VP( void );
// void RunVCD_VP(void );
void VP_SetOnOff ( VP_OnOff_t onoff );
void VP_SetFilter (void);
void __VP_UpdateReg ( void );
void VP_SetStdMode ( VP_StdMode enMode, BOOL bImmediate );
void VP_SetZoom ( UINT uiX, UINT uiY, VP_Zoom enZoom );
void VP_UpdateVPMode ( FieldRateConv_t enFldRate, UINT16	ui16HorizSize, UINT16	ui16VertSize, BOOL bUpdateFlag );
#ifdef __cplusplus
}
#endif

#endif /* _VP_API_H_ */

⌨️ 快捷键说明

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