📄 headdefine.h
字号:
#include <iostream.h>
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <malloc.h>
#define LONG_PI 2147483648 //The second power of 31.
#define SHORT_PI 256 //The second power of 16.
#define SHORT_PI_CORDIC 65536 //The second power of 16.
#define BACK_BIT (31-8)
#define PI 3.141592653589793
#define Z_LENGTH_N 1445
#define NTSC
//#define PAL
//#define SECAM
#define FS 27000000 // sample frequency
#ifdef NTSC
#define FLAG 0
#define H_LENGTH 1716 // 1716 samples every line
#define C_LENGTH 1428 // 1428 samples every line for Y and C data
#define H_NUMBER_ACTIVE 480
#define N_FRAME 1 // frame numbers
#define LINES_FRAME 525 // 525 lines per frame
#define H_NUMBER (LINES_FRAME * N_FRAME) // line numbers to simulate
#define BURST_POSITION (144 - 1) // the 144th sample is the start of burst in every line
#define BURST_START_LINE1 (10 - 1) // burst starts from the 10th line of filed 1
#define BURST_END_LINE1 (262 - 1) // burst ends from the 262th line of filed 1
#define BURST_START_LINE2 (273 - 1) // burst starts from the 273th line of filed 2
#define BURST_END_LINE2 (525 - 1) // burst starts from the 525th line of filed 2
#define VIDEO_START_LINE1 (23 - 1) // video signal starts from the 23th line of filed 1
#define VIDEO_END_LINE1 (262 - 1) // video signal ends from the 262th line of filed 1
#define VIDEO_START_LINE2 (286 - 1) // video signal starts from the 286th line of filed 2
#define VIDEO_END_LINE2 (525 - 1) // video signal starts from the 10th line of filed 2
#define VIDEO_START (250 - 1) // video signal starts from 250th sample in every line
#define VIDEO_END (1677 - 1) // video signal ends from 1677th sample in every line
#define SUM_H_NUMBER_ACTIVE (H_NUMBER_ACTIVE * N_FRAME) // totle line number
//variants for PLL
#define FO (3579545.06 - 500) // color carrier frequency for NTSC +-500Hz
#define N_SUM 30 // for NTSC, there are 7.5 (3432/455) samples in a period
// accumulate the output of multiplyer in 2 periods
#define N_DP 12 // use color burst in 12 lines to detect phase one time
#endif
#ifdef PAL
#define FLAG 1
#define H_LENGTH 1728 // 1728 samples every line
/*-----------will be modified----------*/
#define C_LENGTH 1428 // 1428 samples every line for Y and C data
#define H_NUMBER_ACTIVE 480
/*-------------------------------------*/
#define N_FRAME 2 // frame numbers
#define LINES_FRAME 625 // 625 lines per frame
#define H_NUMBER (LINES_FRAME * N_FRAME) // line numbers to simulate
#define BURST_POSITION (152 - 1) // the 152th sample is the start of burst in every line
#define BURST_START_LINE1 (7 - 1) // burst starts from the 7th line of filed 1
#define BURST_END_LINE1 (309 - 1) // burst ends from the 309th line of filed 1
#define BURST_START_LINE2 (320 - 1) // burst starts from the 320th line of filed 2
#define BURST_END_LINE2 (621 - 1) // burst starts from the 621th line of filed 2
/*-----------will be modified----------*/
#define VIDEO_START_LINE1 (23 - 1) // video signal starts from the 23th line of filed 1
#define VIDEO_END_LINE1 (262 - 1) // video signal ends from the 262th line of filed 1
#define VIDEO_START_LINE2 (286 - 1) // video signal starts from the 286th line of filed 2
#define VIDEO_END_LINE2 (525 - 1) // video signal starts from the 10th line of filed 2
/*-------------------------------------*/
#define VIDEO_START (285 - 1) // video signal starts from 285th sample in every line
#define VIDEO_END (1530 - 1) // video signal ends from 1530th sample in every line
#define SUM_H_NUMBER_ACTIVE (H_NUMBER_ACTIVE * N_FRAME) // totle line number
// variants for PLL
#define FO (4433618.75 - 510) // color carrier frequency for PAL
#define N_SUM 36 // for PAL, there are 6 (1728/(1135/4+1/625)) samples in a period
#define N_DP 12 // use color burst in 12 lines to detect phase one time
// accumulate the output of multiplyer in 2 periods
#endif
#ifdef SECAM
#define FLAG 2
#define H_LENGTH ????
#define C_LENGTH ????
#endif
//(VIDEO_END_LINE1 - VIDEO_START_LINE1 + VIDEO_END_LINE2 - VIDEO_START_LINE2 + 2)
//constant for filter
//Function declaration
int intAtan2(int, int);
int intSin(unsigned long);
void intFilter(int (*)[C_LENGTH], int (*)[C_LENGTH], int, int, int *, int);
void intUVOutWrite(int *, int (*)[C_LENGTH], int (*)[C_LENGTH], int,int);
float atan2Cordic(float, float);
int intAtan2Cordic(int, int);
double sinCordic(double);
int intSinCordic(unsigned long);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -