AJA NTV2 SDK  18.0.0.2122
NTV2 SDK 18.0.0.2122
ntv2videodefines.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
7 #ifndef VIDEODEFINES_H
8 #define VIDEODEFINES_H
9 #include "ajatypes.h"
10 
11 #define PI_FLOAT (3.141592654)
12 
13 #define CCIR601_8BIT_BLACK 16
14 #define CCIR601_8BIT_WHITE 235
15 #define CCIR601_8BIT_CHROMAOFFSET 128
16 
17 #define CCIR601_10BIT_BLACK 64
18 #define CCIR601_10BIT_WHITE 940
19 #define CCIR601_10BIT_CHROMAOFFSET 512
20 
21 #define MIN_RGB_8BIT 0
22 #define MAX_RGB_8BIT 255
23 #define MIN_RGB_10BIT 0
24 #define MAX_RGB_10BIT 1023
25 #define MIN_RGB_16BIT 0 // KAM
26 #define MAX_RGB_16BIT 65535 // KAM
27 
28 // NOTE: Changed the "(__x__) < MIN_RGB_nBIT" comparisons to "(__x__) <= MIN_RGB_nBIT"
29 // in the following three macros to eliminate gcc "comparison always true" warnings
30 // when __x__ is an unsigned value.
31 #define ClipRGB_8BIT(__x__) ((__x__) > MAX_RGB_8BIT ? (MAX_RGB_8BIT) \
32  : ((__x__) <= MIN_RGB_8BIT ? (MIN_RGB_8BIT) \
33  : (__x__)))
34 #define ClipRGB_10BIT(__x__) ((__x__) > MAX_RGB_10BIT ? (MAX_RGB_10BIT) \
35  : ((__x__) <= MIN_RGB_10BIT ? (MIN_RGB_10BIT) \
36  : (__x__)))
37 #define ClipRGB_16BIT(__x__) ((__x__) > MAX_RGB_16BIT ? (MAX_RGB_16BIT) \
38  : ((__x__) <= MIN_RGB_16BIT ? (MIN_RGB_16BIT) \
39  : (__x__)))
40 
41 #define NUMACTIVELINES_525 486
42 #define NUMACTIVELINES_625 576
43 
44 #define MAXSQUAREPIXELS_525 648
45 #define MAXSQUAREPIXELS_625 768
46 
47 #define NUMCOMPONENTPIXELS 720
48 #define YCBCRLINEPITCH_SD 480 // in 32 bit words for packed 10 bit
49 #define RGBALPHALINEPITCH_625 720 // in 32 bit words no matter what framegeometry
50 #define RGBALPHALINEPITCH_525 720 // in 32 bit words no matter what framegeometry
51 #define RGB24LINEPITCH_525 (540)
52 #define RGB24LINEPITCH_625 (540)
53 
54 
55 // HD Defines
56 #define HD_NUMACTIVELINES_720 720 //duh?
57 #define HD_NUMACTIVELINES_1080 1080 // double duh?
58 #define HD_NUMACTIVELINES_2K 1556
59 #define HD_NUMLINES_2K 1588 // In actual FrameBuffer
60 #define HD_FIRSTACTIVELINE_2K (HD_NUMLINES_2K-HD_NUMACTIVELINES_2K)
61 #define HD_NUMLINES_4K 2160
62 #define FD_NUMLINES_8K 4320
63 
64 #define HD_NUMACTIVELINES_720_QREZ (HD_NUMACTIVELINES_720/2)
65 #define HD_NUMACTIVELINES_1080_QREZ (HD_NUMACTIVELINES_1080/2)
66 
67 #define HD_NUMCOMPONENTPIXELS_720 1280 // in a line
68 #define HD_NUMCOMPONENTPIXELS_1080 1920 // in a line
69 #define HD_NUMCOMPONENTPIXELS_1080_2K 2048 // in a line
70 #define HD_NUMCOMPONENTPIXELS_2K 2048 // in a line
71 #define HD_NUMCOMPONENTPIXELS_QUADHD 3840 // in a line
72 #define HD_NUMCOMPONENTPIXELS_4K 4096 // in a line
73 #define FD_NUMCOMPONENTPIXELS_UHD2 7680 // in a line
74 #define FD_NUMCOMPONENTPIXELS_8K 8192 // in a line
75 
76 #define HD_NUMCOMPONENTPIXELS_720_DVCPRO 960 // in a line
77 #define HD_NUMCOMPONENTPIXELS_1080_DVCPRO 1280 // in a line
78 
79 #define HD_NUMCOMPONENTPIXELS_720_QREZ (HD_NUMCOMPONENTPIXELS_720/2) // in a line
80 #define HD_NUMCOMPONENTPIXELS_1080_QREZ (HD_NUMCOMPONENTPIXELS_1080/2) // in a line
81 
82 #define HD_NUMCOMPONENTPIXELS_720_HDV 960 // in a line
83 #define HD_NUMCOMPONENTPIXELS_1080_HDV 1440 // in a line
84 
85 // Linepitch always in 32 bit words.
86 #define HD_YCBCRLINEPITCH_720 864 // dx*8/3/4 32 bit words for packed 10 bit
87 #define HD_YCBCRLINEPITCH_1080 1280 // ""
88 #define HD_YCBCRLINEPITCH_2K 1376 // ""
89 #define HD_YCBCRLINEPITCH_3840 2560 // ""
90 #define HD_YCBCRLINEPITCH_4K 2752 // ""
91 #define FD_YCBCRLINEPITCH_UHD2 5120 // ""
92 #define FD_YCBCRLINEPITCH_8K 5472 // ""
93 
94 #define HD_YCBCRLINEPITCH_720_DVCPRO (960*2/4) // dvcpro always 8 bit
95 #define HD_YCBCRLINEPITCH_1080_DVCPRO (1280*2/4) // dvcpro always 8 bit
96 
97 #define HD_YCBCRLINEPITCH_720_QREZ (1280/4) // in 32 bit words for packed 10 bit
98 #define HD_YCBCRLINEPITCH_1080_QREZ (1920/4) // ""
99 
100 #define HD_YCBCRLINEPITCH_720_HDV (960*2/4) // hdv always 8 bit
101 #define HD_YCBCRLINEPITCH_1080_HDV (1440*2/4) // hdv always 8 bit
102 
103 #define RGB24LINEPITCH_720 (960)
104 #define RGB24LINEPITCH_1080 (1440)
105 #define RGB24LINEPITCH_2048 (1536)
106 #define RGB24LINEPITCH_3840 (2880)
107 #define RGB24LINEPITCH_4096 (3072)
108 #define RGB24LINEPITCH_7680 (5760)
109 #define RGB24LINEPITCH_8192 (6144)
110 
111 #define RGB48LINEPITCH_525 (RGB24LINEPITCH_525*2)
112 #define RGB48LINEPITCH_625 (RGB24LINEPITCH_625*2)
113 #define RGB48LINEPITCH_720 (RGB24LINEPITCH_720*2)
114 #define RGB48LINEPITCH_1080 (RGB24LINEPITCH_1080*2)
115 #define RGB48LINEPITCH_2048 (RGB24LINEPITCH_2048*2)
116 #define RGB48LINEPITCH_3840 (RGB24LINEPITCH_3840*2)
117 #define RGB48LINEPITCH_4096 (RGB24LINEPITCH_4096*2)
118 #define RGB48LINEPITCH_7680 (RGB24LINEPITCH_7680*2)
119 #define RGB48LINEPITCH_8192 (RGB24LINEPITCH_8192*2)
120 
121 #define RGB12PLINEPITCH_525 (MAXSQUAREPIXELS_525*36/8)/4
122 #define RGB12PLINEPITCH_625 (MAXSQUAREPIXELS_625*36/8)/4
123 #define RGB12PLINEPITCH_720 (HD_NUMCOMPONENTPIXELS_720*36/8)/4
124 #define RGB12PLINEPITCH_1080 (HD_NUMCOMPONENTPIXELS_1080*36/8)/4
125 #define RGB12PLINEPITCH_2048 (HD_NUMCOMPONENTPIXELS_1080_2K*36/8)/4
126 #define RGB12PLINEPITCH_3840 (HD_NUMCOMPONENTPIXELS_QUADHD*36/8)/4
127 #define RGB12PLINEPITCH_4096 (HD_NUMCOMPONENTPIXELS_4K*36/8)/4
128 #define RGB12PLINEPITCH_7680 (FD_NUMCOMPONENTPIXELS_UHD2*36/8)/4
129 #define RGB12PLINEPITCH_8192 (FD_NUMCOMPONENTPIXELS_8K*36/8)/4
130 
131 #define PRORES_MAXBUFFERSIZE (1105920) // bytes - PAL 10bit
132 
133 // Roll Defines
134 #define HD_ROLLNUMLINES 4096
135 #define HD_ROLLNUMPIXELS 4096
136 
137 typedef struct {
138  unsigned char Blue;
139  unsigned char Green;
140  unsigned char Red;
141  unsigned char Alpha;
142 } RGBAlphaPixel;
143 
144 
145 typedef struct {
151 
152 typedef struct {
158 
159 typedef struct {
160  unsigned char Red;
161  unsigned char Green;
162  unsigned char Blue;
163  unsigned char Alpha;
165 
166 typedef struct {
172 
173 typedef struct {
174  unsigned char Red;
175  unsigned char Green;
176  unsigned char Blue;
177 } RGBPixel;
178 
179 typedef struct {
180  unsigned char Blue;
181  unsigned char Green;
182  unsigned char Red;
183 } BGRPixel;
184 
185 typedef struct
186 {
187  unsigned char Alpha;
188  unsigned char cr;
189  unsigned char y;
190  unsigned char cb;
192 
193 typedef struct
194 {
195  unsigned char cb;
196  unsigned char y;
197  unsigned char cr;
198 } YCbCrPixel;
199 
200 typedef struct
201 {
206 
207 typedef struct
208 {
214 
215 typedef struct {
216  char SigName[40];
218  short ColorDiff[NUMCOMPONENTPIXELS];
220 
221 #endif // VIDEODEFINES_H
unsigned char Red
unsigned char cr
int Fixed_
Definition: ajatypes.h:289
unsigned char Green
unsigned char Green
unsigned char Alpha
unsigned char Red
unsigned char Blue
unsigned char Green
unsigned char Blue
unsigned char Red
Declares the most fundamental data types used by NTV2. Since Windows NT was the first principal devel...
#define NUMCOMPONENTPIXELS
unsigned char cr
unsigned char y
unsigned char y
unsigned char Blue
uint16_t UWord
Definition: ajatypes.h:221
unsigned char Blue
unsigned char cb
unsigned char Alpha
unsigned char Green
unsigned char Alpha
unsigned char cb
unsigned char Red