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

📄 sup.h

📁 C语言编写的监控中心终端程序。基于GPRS上传收发数据功能
💻 H
字号:
#ifndef __SUP_H
#define	__SUP_H

#if 0
typedef struct
{
    BYTE		Y, CB, CR, BL;
}   t_CLUT;

typedef struct
{
    BYTE		CB, CR, Y, BL;
}   t_CLUTv1;

typedef struct
{
    BYTE		CB, CR, Y, BL;
}   t_CLUTv2;

//
//	t_SUP_HDR_svcd
//
//	SVCD/CVD format
//
typedef struct
{
    UINT16		TL_X;			// 0
    UINT16		TL_Y;			// 2
    UINT16		BR_X;			// 4
    UINT16		BR_Y;			// 6
    t_CLUTv1		CLUT_PR[4];		// 8-1f
    UINT16		HL0_TL_X;		// 20
    UINT16		HL0_TL_Y;		// 22
    UINT16		HL0_BR_X;		// 24
    UINT16		HL0_BR_Y;		// 26
    t_CLUTv1		CLUT_HL0[4];		// 28-3f
    UINT16		HL1_TL_X;		// 40
    UINT16		HL1_TL_Y;		// 42
    UINT16		HL1_BR_X;		// 44
    UINT16		HL1_BR_Y;		// 46
    t_CLUTv1		CLUT_HL1[4];		// 48-5f

    UINT16		BLINK;			// 60-61
    UINT16		TLINK;			// 62-63
}   t_SUP_HDR_svcd;

//
//	t_SUP_HDR_dvd
//
//	DVD format (different with SVCD/CVD)
//
typedef struct
{
//  sub-picture decoder hardware table (dvd-mode)
    UINT16		TL_X;			// 0
    UINT16		TL_Y;			// 2
    UINT16		BR_X;			// 4
    UINT16		BR_Y;			// 6
    UINT16		PR_PALETTE;		// 8 EM2[15:12] EM1[11:8] PN[7:4] BG[3:0]
    UINT16		PR_CONTRAST;		// a EM2[15:12] EM1[11:8] PN[7:4] BG[3:0]
    t_CLUTv2		CLUT[16];		// c - 4d
    UINT16		BLINK;			// 4c
    UINT16		TLINK;			// 4e
}   t_SUP_HDR_dvd;

typedef struct
{
    union
    {
	t_SUP_HDR_svcd	svcd;
	t_SUP_HDR_dvd	dvd;
    }	reg;

//  sub-picture decoder internal variables.
    UINT32		pts;			// 50 SPH reference PTS
    UINT16		spu_sa;			// 54 SPH start address (not header)
    UINT16		dcsqt_sa;		// 56 DCSQ start address
    BYTE		SUP_STATE;		// 58
}   t_SUP_REGION;

//
//	sub-picture decoder state
//
#define	SPD_HEADER_NULL		0xffff

//
//	DCCMD
//
#define	DCCMD_FSTA_DSP		0x00
#define	DCCMD_STA_DSP		0x01
#define	DCCMD_STP_DSP		0x02
#define	DCCMD_SET_COLOR		0x03
#define	DCCMD_SET_CONTR		0x04
#define	DCCMD_SET_DAREA		0x05
#define	DCCMD_SET_DSPXA		0x06
#define	DCCMD_CHG_COLCON	0x07
#define	DCCMD_CMD_END		0xFF

//
//	SUPCMD
//	svcd style command
//
#define	SUPCMD_TIME		0x00
#define	SUPCMD_REGION		0x01
#define	SUPCMD_SET_COLOR	0x02
#define	SUPCMD_SET_BLEND	0x03
#define	SUPCMD_FIELD_PTR	0x04
#define	SUPCMD_HL_REGION	0x05

//
//	SPD functions
//
void			sup_init();
int			do_sup_header(void);
int			do_sup_body(void);


#if 0
/*
**	WHITE	0xeb	0x80	0x80
**	YELLOW	0xa2	0x8e	0x2c
**	CYAN	0x83	0x2c	0x9c
**	GREEN	0x70	0x3a	0x48
**	MAGENTA	0x54	0xc6	0xb8
**	RED	0x41	0xd4	0x64
**	BLUE	0x23	0x72	0xd4
**	BLACK	0x10	0x80	0x80
*/
const t_CLUTv2		clut_def[16] = {
// cb-cr-y-xx
    {0x80, 0x80, 0x10, 0x00},
    {0x80, 0x80, 0xeb, 0x00},
    {0x2c, 0x8e, 0xa2, 0x00},
    {0x9c, 0x2c, 0x83, 0x00},
    {0x48, 0x3a, 0x70, 0x00},
    {0xb8, 0xc6, 0x54, 0x00},
    {0x64, 0xd4, 0x41, 0x00},
    {0xd4, 0x72, 0x23, 0x00},
    {0x80, 0x80, 0x40, 0x00},
    {0x80, 0x80, 0x6b, 0x00},
    {0x2c, 0x8e, 0x52, 0x00},
    {0x9c, 0x2c, 0x43, 0x00},
    {0x48, 0x3a, 0x38, 0x00},
    {0xb8, 0xc6, 0x2a, 0x00},
    {0x64, 0xd4, 0x21, 0x00},
    {0xd4, 0x72, 0x13, 0x00},
};
#endif
#endif

#endif	__SUP_H

⌨️ 快捷键说明

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