📄 tccvrend.h
字号:
#ifndef __TCCVREND_INCLUDED__
#define __TCCVREND_INCLUDED__
//#define M2MSCALER_CLOCKCONTROL
#ifdef M2MSCALER_CLOCKCONTROL
#include "../Common/TCC78xRegStructure.h"
#endif
#include "../Common/shared.h"
#include <windows.h>
#include "VrendModeFlag.h"
//#define LCD_HSIZE 480
//#define LCD_VSIZE 272
typedef struct _tStRendererType{
unsigned char *pFrame;
int nWidth;
int nHeight;
int nType;
int nHeightOffset;
int nWidthOffset;
} tStRendererType;
typedef struct _tLcdInterface{
unsigned int LCTRL;// *(volatile unsigned long *)0xB0000000 // W, LCD Control Register
unsigned int LBC;// *(volatile unsigned long *)0xB0000004 // W, LCD Background Color Register
unsigned int LCLKDIV;// *(volatile unsigned long *)0xB0000008 // W, LCD Clock Divider Register
unsigned int LHTIME1;// *(volatile unsigned long *)0xB000000C // W, LCD Horizontal Timing Register 1
unsigned int LHTIME2;// *(volatile unsigned long *)0xB0000010 // W, LCD Horizontal Timing Register 2
unsigned int LVTIME1;// *(volatile unsigned long *)0xB0000014 // W, LCD Vertical Timing Register 1
unsigned int LVTIME2;// *(volatile unsigned long *)0xB0000018 // W, LCD Vertical Timing Register 2
unsigned int LVTIME3;// *(volatile unsigned long *)0xB000001C // W, LCD Vertical Timing Register 3
unsigned int LVTIME4;// *(volatile unsigned long *)0xB0000020 // W, LCD Vertical Timing Register 4
unsigned int LLUTR;// *(volatile unsigned long *)0xB0000024 // W, LCD Lookup Register for Red
unsigned int LLUTG;// *(volatile unsigned long *)0xB0000028 // W, LCD Lookup Register for Green
unsigned int LLUTB;// *(volatile unsigned long *)0xB000002C // W, LCD Lookup Register for Blue
unsigned int LDP7L;// *(volatile unsigned long *)0xB0000030 // W, LCD Modulo 7 Dithering Pattern (Low)
unsigned int LDP7H;// *(volatile unsigned long *)0xB0000034 // W, LCD Modulo 7 Dithering Pattern (High)
unsigned int LDP5;// *(volatile unsigned long *)0xB0000038 // W, LCD Modulo 5 Dithering Pattern Register
unsigned int LDP4;// *(volatile unsigned long *)0xB000003C // W, LCD Modulo 4 Dithering Pattern Register
unsigned int LDP3;// *(volatile unsigned long *)0xB0000040 // W, LCD 3-bit Dithering Pattern Register
unsigned int LCP1;// *(volatile unsigned long *)0xB0000044 // W, LCD Clipping Register 1
unsigned int LCP2;// *(volatile unsigned long *)0xB0000048 // W, LCD Clipping Register 2
unsigned int LK1;// *(volatile unsigned long *)0xB000004C // W, LCD Keying Register 1
unsigned int LK2;// *(volatile unsigned long *)0xB0000050 // W, LCD Keying Register 2
unsigned int LKM1;// *(volatile unsigned long *)0xB0000054 // W, LCD Keying Mask Register 1
unsigned int LKM2;// *(volatile unsigned long *)0xB0000058 // W, LCD Keying Mask Register 2
unsigned int LDS;// *(volatile unsigned long *)0xB000005C // W, LCD Display Size Register
unsigned int LSTATUS;// *(volatile unsigned long *)0xB0000060 // R/Clr, LCD Status Register
unsigned int LIM;// *(volatile unsigned long *)0xB0000064 // W, LCD Interrupt Register
unsigned int LI0C;// *(volatile unsigned long *)0xB0000068 // W, LCD Image 0 Control Register
unsigned int LI0P;// *(volatile unsigned long *)0xB000006C // W, LCD Image 0 Position Register
unsigned int LI0S;// *(volatile unsigned long *)0xB0000070 // W, LCD Image 0 Size Register
unsigned int LI0BA0;// *(volatile unsigned long *)0xB0000074 // W, LCD Image 0 Base Address 0 Register
unsigned int LI0CA;// *(volatile unsigned long *)0xB0000078 // W, LCD Image 0 Current Address Register
unsigned int LI0BA1;// *(volatile unsigned long *)0xB000007C // W, LCD Image 0 Base Address 1 Register
unsigned int LI0BA2;// *(volatile unsigned long *)0xB0000080 // W, LCD Image 0 Base Address 2 Register
unsigned int LI0O;// *(volatile unsigned long *)0xB0000084 // W, LCD Image 0 Offset Register
unsigned int LI0SCALE;// *(volatile unsigned long *)0xB0000088 // W, LCD Image 0 Scale Ratio
unsigned int LI1C;// *(volatile unsigned long *)0xB000008C // W, LCD Image 1 Control Register
unsigned int LI1P;// *(volatile unsigned long *)0xB0000090 // W, LCD Image 1 Position Register
unsigned int LI1S;// *(volatile unsigned long *)0xB0000094 // W, LCD Image 1 Size Register
unsigned int LI1BA0;// *(volatile unsigned long *)0xB0000098 // W, LCD Image 1 Base Address 0 Register
unsigned int LI1CA;// *(volatile unsigned long *)0xB000009C // W, LCD Image 1 Current Address Register
unsigned int NOTDEFINED1;//
unsigned int NOTDEFINED2;//
unsigned int LI1O;// *(volatile unsigned long *)0xB00000A8 // W, LCD Image 1 Offset Register
unsigned int LI1SCALE;// *(volatile unsigned long *)0xB00000AC // W, LCD Image 1 Scale Ratio
unsigned int LI2C;// *(volatile unsigned long *)0xB00000B0 // W, LCD Image 2 Control Register
unsigned int LI2P;// *(volatile unsigned long *)0xB00000B4 // W, LCD Image 2 Position Register
unsigned int LI2S;// *(volatile unsigned long *)0xB00000B8 // W, LCD Image 2 Size Register
unsigned int LI2BA0;// *(volatile unsigned long *)0xB00000BC // W, LCD Image 2 Base Address 0 Register
unsigned int LI2CA;// *(volatile unsigned long *)0xB00000C0 // W, LCD Image 2 Current Address Register
unsigned int NOTDEFINED3;//
unsigned int NOTDEFINED4;//
unsigned int LI2O;// *(volatile unsigned long *)0xB00000CC // W, LCD Image 2 Offset Register
unsigned int LI2SCALE;// *(volatile unsigned long *)0xB00000D0 // W, LCD Image 2 Scale Ratio
unsigned int DLCTRL;// *(volatile unsigned long *)0xB000000D4 // W, Dual LCD Control
unsigned int NOTDEFINED5;// D8
unsigned int DLCSA0;// *(volatile unsigned long *)0xB00000DC // W, Dual LCD Configuration Start Address 0
unsigned int DLCSA1;// *(volatile unsigned long *)0xB00000E0 // W, Dual LCD Configuration Start Address 1
unsigned int Y2RP0 ;// *(volatile unsigned long *)0xB00000E4 // W, YCbCr to RGB Conversion Parameter 0
unsigned int Y2RP1 ;// *(volatile unsigned long *)0xB00000E8 // W, YCbCr to RGB Conversion Parameter 1
unsigned int NOTDEFINED6;// EC
unsigned int LCDLUT;// *(volatile unsigned long *)0xB0000C00 // W, LCD Lookup Table}
}tLcdInterface;
#define TCCPREVIEW_ENABLE
#ifdef TCCPREVIEW_ENABLE
typedef enum
{
TCC_PREVIEW_MODE_OFF,
TCC_PREVIEW_MODE_ON,
TCC_PREVIEW_MODE_DONE
} TCC_PREVIEW_MODE;
#endif
// Forward declarations
class CVideoRenderer
{
public:
// Constructor and destructor
CVideoRenderer();
~CVideoRenderer();
BOOL GetModeFlag(VrenderModeFlag* flag);
BOOL SetModeFlag(VrenderModeFlag flag);
BOOL SetAVSync(BOOL AVSync);
BOOL DoRenderSample(tStRendererType *pRendertp);
void EnableLayer0();
void DisableLayer0();
int CInitRegister(void);
int VirtualAlloc_Init(void);
void VirtualAlloc_Free(void);
void WriteFrame(unsigned char *pFrame ,int nWidth, int nHeight, int nType, int nHeightOffset, int nWidthOffset);
void TCC_VideoScale(U8 * pSrcBase, U16 nSrcWidth, U16 nSrcHeight, U8 nSrcType, U32 nSrcOffsetY, U8 * pDstBase,
U16 nDstWidth, U16 nDstHeight, U8 nDstType, U32 nDstOffsetY, volatile MSC_REG * sMSC, U8 nHeightOffset,U8 nWidthOffset);
public:
DWORD m_nScreenHeight;
DWORD m_nScreenWidth;
U32 m_nDstSizeH, m_nDstSizeV;
U32 m_nTop,m_nLeft;
U32 m_nDstBaseY;
U32 m_nRegTemp;
BOOL misEVEN;
DWORD m_pScalerMem1; // SCALER1 Phyisical Memory Address
DWORD m_pScalerMem2; // SCALER2 Phyisical Memory Address
volatile sSHAREDMEM *pSHARED;
volatile MSC_REG *sMSC;
tLcdInterface *pLcdINF;
volatile unsigned int Bak_LCTRL;
volatile unsigned int Bak_LI0C;
volatile unsigned int Bak_LCLKDIV;
VrenderModeFlag m_flag;
BOOL m_bAVSync;
#ifdef M2MSCALER_CLOCKCONTROL
volatile TCC78xCKCReg* pCKCREG;
#endif
}; // CVideoRenderer
#endif //__TCCVREND_INCLUDED__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -