📄 glodef.h
字号:
#ifndef _GLODEF_H
#define _GLODEF_H
#ifdef MAIN
#define GLOBAL(a, b) a b;
#else
#define GLOBAL(a, b) extern a b;
#endif
typedef struct
{
short x;
short y;
unsigned short COD;
unsigned short Mode;
}MotionVector;
/*#define mmax(a, b) ((a) > (b) ? (a) : (b))
#define mmin(a, b) ((a) < (b) ? (a) : (b))
#define sign(a) ((a) < 0 ? -1 : 1)
*/
/* define address for FIFO Read/WRite in CE3 */
#define FIFO_ADDR 0x300C000 /*define FIFO ADDR FOR CE3*/
#define MB_LINE_Y_ADDR 0x8000be00 /* 64 * 6 * 22 = 8448 = 2100h for YUV in which Y = 1600h*/
#define MB_LINE_UV_ADDR 0x80009d00 /* 64 * 1 * 22 = 1408 = 580h */
#define MB_PREV_ADDR 0x80009b80 /* len = 300h in Byte , */
#define MB_DIFF_ADDR 0x80009800 /* size = 8 x 8 x 6 x 2= 768 byte,0x300,align to word add 80h for IDCT*/
#define MV_ADDR 0x80009750 /* len = 8 * 22 = b0h*/
#define BIT_ADDR_4 0x80008000
#define BIT_ADDR_3 0x80007800
#define BIT_ADDR_2 0x80007000
#define BIT_ADDR_1 0x80006800 /* Each Bit buffer = 4K bits, for 1M bits/s transfer, flash one buffer use 4.1 ms , process one frame */
/* definitions for H263 coding */
#define PSC 1
#define PSC_LENGTH 17 // not including the following 5 zeroes
#define ESCAPE 7167
#define PCT_INTRA 0
#define PCT_INTER 1
#define PCT_IPB 2
#define PCT_B 3
#define PCT_EI 4
#define PCT_EP 5
#define PCT_PB 6
#define SF_SQCIF 1 /* 001 */
#define SF_QCIF 2 /* 010 */
#define SF_CIF 3 /* 011 */
#define SF_4CIF 4 /* 100 */
#define SF_16CIF 5 /* 101 */
#define SF_CUSTOM 6 /* 110 */
#define SF_EPTYPE 7 /* 111 Extended PTYPE */
#define MODE_INTER 0
#define MODE_INTER_Q 1
#define MODE_INTER4V 2
#define MODE_INTRA 3
#define MODE_INTRA_Q 4
#define MODE_INTER4V_Q 5
/* define vars for decoding */
#define SE_CODE 31
typedef struct
{
unsigned short source_format;
unsigned short MB_lines;
unsigned short MB_pels;
unsigned short Lines;
unsigned short Pels;
unsigned short Cpels;
unsigned short Clines;
unsigned short picture_coding_type;
unsigned short unrestricted_mv_mode;
unsigned short syntax_arith_coding;
unsigned short adv_pred_mode;
unsigned short PB;
unsigned short QP;
unsigned short PEI;
unsigned short RTYPE;
short D_QP;
}Str_Pict;
typedef struct
{
unsigned char * pReadBit;/* next Byte to be read */
unsigned char In_buf[12];
short In_cnt;
unsigned short Bit_cnt;
short * Block[6];
} Base;
GLOBAL(Base , MB_Base)
GLOBAL(Str_Pict,Pict)
GLOBAL(unsigned int, nDecodeNum)
GLOBAL(unsigned char, DMA_Status)
/* 0 0 0 0
DMA0 DMA1 DMA2 DMA3
DMA n = "0", DMA is ending ="1" Runing */
GLOBAL(unsigned char, Decode_Status)
GLOBAL(unsigned int, DMA3_trans_cnt)
/* 0 0 0 0 0
VideoOut_OK Bit1_RECV_OK Bit2_RECV_OK Bit3_RECV_OK Bit4_RECV_OK
VideoOut_OK = "0": VideoOut not ready = "1" : ready
Bitn_RECV_OK = "0": recv to BIT_ADDR_n is not ending , ="1": ending
*/
#define DECODE_0_Y 0x2100000
#define DECODE_0_UV 0x2118c00
#define DECODE_1_Y 0x2125200
#define DECODE_1_UV 0x213de00
#define DISPLAY 0x2000000
#define DISPLAY2 0x2031800
GLOBAL(unsigned char *, pDecode_Curr_Y)
GLOBAL(unsigned char *, pDecode_Curr_UV)
GLOBAL(unsigned char *, pDecode_Prev_Y)
GLOBAL(unsigned char *, pDecode_Prev_UV)
GLOBAL(unsigned char *, pDisplay)
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -