AJA NTV2 SDK  17.5.0.1242
NTV2 SDK 17.5.0.1242
ntv2formatdescriptor.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
7 #include "ntv2formatdescriptor.h"
8 #include "ntv2utils.h"
9 #if defined(AJALinux)
10  #include <string.h> // For memset
11  #include <stdint.h>
12 #endif
13 #include <sstream>
14 #include <iomanip>
15 
16 
17 using namespace std;
18 
19 #define AJA_FD_BEGIN NTV2FormatDescriptor (
20 #define AJA_FD_END 0)
21 #define AJA_FD_NOTSUPPORTED NTV2FormatDescriptor ()
22 #define AJA_FD_TBD NTV2FormatDescriptor ()
23 
24 #define AsConstUBytePtr(_x_) reinterpret_cast<const UByte*>(_x_)
25 #define AsUBytePtr(_x_) reinterpret_cast<UByte*>(_x_)
26 
27 
29 {
30  /* NTV2_FBF_10BIT_YCBCR */ {"YCbCr", "", "", ""},
31  /* NTV2_FBF_8BIT_YCBCR */ {"YCbCr", "", "", ""},
32  /* NTV2_FBF_ARGB */ {"ARGB", "", "", ""},
33  /* NTV2_FBF_RGBA */ {"RGBA", "", "", ""},
34  /* NTV2_FBF_10BIT_RGB */ {"RGB", "", "", ""},
35  /* NTV2_FBF_8BIT_YCBCR_YUY2 */ {"YCbCr", "", "", ""},
36  /* NTV2_FBF_ABGR */ {"ABGR", "", "", ""},
37  /* NTV2_FBF_10BIT_DPX */ {"", "", "", ""},
38  /* NTV2_FBF_10BIT_YCBCR_DPX */ {"YCbCr", "", "", ""},
39  /* NTV2_FBF_8BIT_DVCPRO */ {"", "", "", ""},
40  /* NTV2_FBF_8BIT_YCBCR_420PL3 */ {"Y", "Cb", "Cr", ""},
41  /* NTV2_FBF_8BIT_HDV */ {"", "", "", ""},
42  /* NTV2_FBF_24BIT_RGB */ {"RGB", "", "", ""},
43  /* NTV2_FBF_24BIT_BGR */ {"BGR", "", "", ""},
44  /* NTV2_FBF_10BIT_YCBCRA */ {"YCbCrA", "", "", ""},
45  /* NTV2_FBF_10BIT_DPX_LE */ {"", "", "", ""},
46  /* NTV2_FBF_48BIT_RGB */ {"RGB", "", "", ""},
47  /* NTV2_FBF_12BIT_RGB_PACKED */ {"RGB", "", "", ""},
48  /* NTV2_FBF_PRORES_DVCPRO */ {"", "", "", ""},
49  /* NTV2_FBF_PRORES_HDV */ {"", "", "", ""},
50  /* NTV2_FBF_10BIT_RGB_PACKED */ {"RGB", "", "", ""},
51  /* NTV2_FBF_10BIT_ARGB */ {"ARGB", "", "", ""},
52  /* NTV2_FBF_16BIT_ARGB */ {"ARGB", "", "", ""},
53  /* NTV2_FBF_8BIT_YCBCR_422PL3 */ {"Y", "Cb", "Cr", ""},
54  /* NTV2_FBF_10BIT_RAW_RGB */ {"RGB", "", "", ""},
55  /* NTV2_FBF_10BIT_RAW_YCBCR */ {"YCbCr", "", "", ""},
56  /* NTV2_FBF_10BIT_YCBCR_420PL3_LE */ {"Y", "Cb", "Cr", ""},
57  /* NTV2_FBF_10BIT_YCBCR_422PL3_LE */ {"Y", "Cb", "Cr", ""},
58  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ {"Y", "CbCr", "", ""},
59  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ {"Y", "CbCr", "", ""},
60  /* NTV2_FBF_8BIT_YCBCR_420PL2 */ {"Y", "CbCr", "", ""},
61  /* NTV2_FBF_8BIT_YCBCR_422PL2 */ {"Y", "CbCr", "", ""}
62 };
63 
64 
66 { // Luma Chroma Alpha
67  /* NTV2_FBF_10BIT_YCBCR */ {10, 10, 0},
68  /* NTV2_FBF_8BIT_YCBCR */ {8, 8, 0},
69  /* NTV2_FBF_ARGB */ {0, 8, 8},
70  /* NTV2_FBF_RGBA */ {0, 8, 8},
71  /* NTV2_FBF_10BIT_RGB */ {0, 10, 2},
72  /* NTV2_FBF_8BIT_YCBCR_YUY2 */ {8, 8, 0},
73  /* NTV2_FBF_ABGR */ {0, 8, 8},
74  /* NTV2_FBF_10BIT_DPX */ {0, 10, 0},
75  /* NTV2_FBF_10BIT_YCBCR_DPX */ {10, 10, 0},
76  /* NTV2_FBF_8BIT_DVCPRO */ {0, 0, 0}, // Lossy
77  /* NTV2_FBF_8BIT_YCBCR_420PL3 */ {8, 8, 0},
78  /* NTV2_FBF_8BIT_HDV */ {0, 0, 0}, // Lossy
79  /* NTV2_FBF_24BIT_RGB */ {0, 8, 0},
80  /* NTV2_FBF_24BIT_BGR */ {0, 8, 0},
81  /* NTV2_FBF_10BIT_YCBCRA */ {0, 0, 0}, // Unused
82  /* NTV2_FBF_10BIT_DPX_LE */ {0, 10, 0},
83  /* NTV2_FBF_48BIT_RGB */ {0, 16, 0},
84  /* NTV2_FBF_12BIT_RGB_PACKED */ {0, 12, 0},
85  /* NTV2_FBF_PRORES_DVCPRO */ {0, 0, 0}, // Unused
86  /* NTV2_FBF_PRORES_HDV */ {0, 0, 0}, // Unused
87  /* NTV2_FBF_10BIT_RGB_PACKED */ {0, 0, 0}, // Unused
88  /* NTV2_FBF_10BIT_ARGB */ {0, 0, 0}, // Unused
89  /* NTV2_FBF_16BIT_ARGB */ {0, 0, 0}, // Unused
90  /* NTV2_FBF_8BIT_YCBCR_422PL3 */ {8, 8, 0},
91  /* NTV2_FBF_10BIT_RAW_RGB */ {0, 10, 0},
92  /* NTV2_FBF_10BIT_RAW_YCBCR */ {10, 10, 0},
93  /* NTV2_FBF_10BIT_YCBCR_420PL3_LE */ {10, 10, 0},
94  /* NTV2_FBF_10BIT_YCBCR_422PL3_LE */ {10, 10, 0},
95  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ {10, 10, 0},
96  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ {10, 10, 0},
97  /* NTV2_FBF_8BIT_YCBCR_420PL2 */ {8, 8, 0},
98  /* NTV2_FBF_8BIT_YCBCR_422PL2 */ {8, 8, 0}
99 };
100 
101 
103 {
104  {
123  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
124  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
129  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_NOTSUPPORTED,
130  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_NOTSUPPORTED,
133  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_1080, HD_NUMCOMPONENTPIXELS_1080, HD_NUMCOMPONENTPIXELS_1080*5/16, AJA_FD_END, // Supported in SDK 16.0
134  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_1080, HD_NUMCOMPONENTPIXELS_1080, HD_NUMCOMPONENTPIXELS_1080*5/16, AJA_FD_END, // Supported in SDK 16.0
137  },
138  {
157  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
158  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
163  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_NOTSUPPORTED,
164  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_NOTSUPPORTED,
167  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_720, HD_NUMCOMPONENTPIXELS_720, HD_NUMCOMPONENTPIXELS_720*5/16, AJA_FD_END, // Supported in SDK 16.0
168  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_720, HD_NUMCOMPONENTPIXELS_720, HD_NUMCOMPONENTPIXELS_720*5/16, AJA_FD_END, // Supported in SDK 16.0
171  },
172  {
182  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
183  /* NTV2_FBF_8BIT_YCBCR_420PL3 */ AJA_FD_BEGIN 480, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS/4, AJA_FD_END,
184  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
191  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
192  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
196  /* NTV2_FBF_8BIT_YCBCR_422PL3 */ AJA_FD_BEGIN 480, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS/4, AJA_FD_END,
197  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_NOTSUPPORTED,
198  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_NOTSUPPORTED,
199  /* NTV2_FBF_10BIT_YCBCR_420PL3_LE */ AJA_FD_BEGIN 480, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS/2, AJA_FD_END,
200  /* NTV2_FBF_10BIT_YCBCR_422PL3_LE */ AJA_FD_BEGIN 480, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS/2, AJA_FD_END,
201  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN 480, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS*5/16, AJA_FD_END, // Supported in SDK 16.0
202  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN 480, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS*5/16, AJA_FD_END, // Supported in SDK 16.0
203  /* NTV2_FBF_8BIT_YCBCR_420PL2 */ AJA_FD_BEGIN 480, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS/4, AJA_FD_END,
204  /* NTV2_FBF_8BIT_YCBCR_422PL2 */ AJA_FD_BEGIN 480, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS/4, AJA_FD_END
205  },
206  {
216  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
218  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
225  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
226  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
231  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_NOTSUPPORTED,
232  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_NOTSUPPORTED,
233  /* NTV2_FBF_10BIT_YCBCR_420PL3_LE */ AJA_FD_BEGIN NUMACTIVELINES_625, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS/2, AJA_FD_END,
234  /* NTV2_FBF_10BIT_YCBCR_422PL3_LE */ AJA_FD_BEGIN NUMACTIVELINES_625, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS/2, AJA_FD_END,
235  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN NUMACTIVELINES_625, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS*5/16, AJA_FD_END, // Supported in SDK 16.0
236  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN NUMACTIVELINES_625, NUMCOMPONENTPIXELS, NUMCOMPONENTPIXELS*5/16, AJA_FD_END, // Supported in SDK 16.0
239  },
240  {
259  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
260  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
269  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_1080, HD_NUMCOMPONENTPIXELS_1080, HD_NUMCOMPONENTPIXELS_1080*5/16, AJA_FD_END, // Supported in SDK 16.0
270  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_1080, HD_NUMCOMPONENTPIXELS_1080, HD_NUMCOMPONENTPIXELS_1080*5/16, AJA_FD_END, // Supported in SDK 16.0
273  },
274  {
284  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
286  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
293  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
294  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
303  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_2K, HD_NUMCOMPONENTPIXELS_2K, HD_NUMCOMPONENTPIXELS_2K*5/16, AJA_FD_END, // Supported in SDK 16.0
304  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_2K, HD_NUMCOMPONENTPIXELS_2K, HD_NUMCOMPONENTPIXELS_2K*5/16, AJA_FD_END, // Supported in SDK 16.0
307  },
308  {
318  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
320  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
327  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
328  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
333  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_NOTSUPPORTED,
334  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_NOTSUPPORTED,
337  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_1080, HD_NUMCOMPONENTPIXELS_2K, HD_NUMCOMPONENTPIXELS_2K*5/16, AJA_FD_END, // Supported in SDK 16.0
338  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_1080, HD_NUMCOMPONENTPIXELS_2K, HD_NUMCOMPONENTPIXELS_2K*5/16, AJA_FD_END, // Supported in SDK 16.0
341  },
342  {
352  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
354  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
361  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
362  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
367  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_NOTSUPPORTED,
368  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_NOTSUPPORTED,
371  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_1080, HD_NUMCOMPONENTPIXELS_2K, HD_NUMCOMPONENTPIXELS_2K*5/16, AJA_FD_END, // Supported in SDK 16.0
372  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMACTIVELINES_1080, HD_NUMCOMPONENTPIXELS_2K, HD_NUMCOMPONENTPIXELS_2K*5/16, AJA_FD_END, // Supported in SDK 16.0
375  },
376  {
386  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
388  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
395  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
396  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
401  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_TBD,
402  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_TBD,
405  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_QUADHD, HD_NUMCOMPONENTPIXELS_QUADHD*5/16, AJA_FD_END, // Supported in SDK 16.0
406  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_QUADHD, HD_NUMCOMPONENTPIXELS_QUADHD*5/16, AJA_FD_END, // Supported in SDK 16.0
409  },
410  {
420  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
422  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
429  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
430  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
435  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_TBD,
436  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_TBD,
439  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_4K, HD_NUMCOMPONENTPIXELS_4K*5/16, AJA_FD_END, // Supported in SDK 16.0
440  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_4K, HD_NUMCOMPONENTPIXELS_4K*5/16, AJA_FD_END, // Supported in SDK 16.0
443  },
444  {
454  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
456  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
463  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
464  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
469  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_TBD,
470  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_TBD,
473  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_QUADHD, HD_NUMCOMPONENTPIXELS_QUADHD*5/16, AJA_FD_END, // Supported in SDK 16.0
474  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_QUADHD, HD_NUMCOMPONENTPIXELS_QUADHD*5/16, AJA_FD_END, // Supported in SDK 16.0
477  },
478  {
488  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
490  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
497  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
498  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
503  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_TBD,
504  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_TBD,
507  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_4K, HD_NUMCOMPONENTPIXELS_4K*5/16, AJA_FD_END, // Supported in SDK 16.0
508  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_4K, HD_NUMCOMPONENTPIXELS_4K*5/16, AJA_FD_END, // Supported in SDK 16.0
511  },
512  {
522  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
524  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
531  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
532  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
537  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_TBD,
538  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_TBD,
541  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN FD_NUMLINES_8K, FD_NUMCOMPONENTPIXELS_UHD2, FD_NUMCOMPONENTPIXELS_UHD2*5/16, AJA_FD_END, // Supported in SDK 16.0
542  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN FD_NUMLINES_8K, FD_NUMCOMPONENTPIXELS_UHD2, FD_NUMCOMPONENTPIXELS_UHD2*5/16, AJA_FD_END, // Supported in SDK 16.0
545  },
546  {
556  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
558  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
565  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
566  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
571  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_TBD,
572  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_TBD,
575  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN FD_NUMLINES_8K, FD_NUMCOMPONENTPIXELS_8K, FD_NUMCOMPONENTPIXELS_8K*5/16, AJA_FD_END, // Supported in SDK 16.0
576  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN FD_NUMLINES_8K, FD_NUMCOMPONENTPIXELS_8K, FD_NUMCOMPONENTPIXELS_8K*5/16, AJA_FD_END, // Supported in SDK 16.0
579  },
580  {
590  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
592  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
599  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
600  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
605  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_TBD,
606  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_TBD,
609  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_QUADHD, HD_NUMCOMPONENTPIXELS_QUADHD*5/16, AJA_FD_END, // Supported in SDK 16.0
610  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_QUADHD, HD_NUMCOMPONENTPIXELS_QUADHD*5/16, AJA_FD_END, // Supported in SDK 16.0
613  },
614  {
624  /* NTV2_FBF_8BIT_DVCPRO */ AJA_FD_NOTSUPPORTED,
626  /* NTV2_FBF_8BIT_HDV */ AJA_FD_NOTSUPPORTED,
633  /* NTV2_FBF_PRORES_DVCPRO */ AJA_FD_NOTSUPPORTED,
634  /* NTV2_FBF_PRORES_HDV */ AJA_FD_NOTSUPPORTED,
639  /* NTV2_FBF_10BIT_RAW_RGB */ AJA_FD_TBD,
640  /* NTV2_FBF_10BIT_RAW_YCBCR */ AJA_FD_TBD,
643  /* NTV2_FBF_10BIT_YCBCR_420PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_4K, HD_NUMCOMPONENTPIXELS_4K*5/16, AJA_FD_END, // Supported in SDK 16.0
644  /* NTV2_FBF_10BIT_YCBCR_422PL2 */ AJA_FD_BEGIN HD_NUMLINES_4K, HD_NUMCOMPONENTPIXELS_4K, HD_NUMCOMPONENTPIXELS_4K*5/16, AJA_FD_END, // Supported in SDK 16.0
647  }
648 }; // formatDescriptorTable
649 
650 
652  const NTV2FrameBufferFormat inFrameBufferFormat,
653  const NTV2VANCMode inVancMode)
654 {
655  MakeInvalid ();
656  if (!NTV2_IS_VALID_STANDARD(inStandard))
657  return; // bad standard
658  if (!NTV2_IS_VALID_FRAME_BUFFER_FORMAT(inFrameBufferFormat))
659  return; // bad FBF
660  if (!NTV2_IS_VALID_VANCMODE(inVancMode))
661  return; // bad Vanc mode
662  if (NTV2_IS_FBF_PLANAR(inFrameBufferFormat) && NTV2_IS_VANCMODE_ON(inVancMode))
663  return; // can't do VANC mode for planar formats
664 
665  // The 'formatDescriptorTable' handles everything but VANC...
666  const NTV2FormatDescriptor & result (formatDescriptorTable[inStandard][inFrameBufferFormat]);
667  *this = result;
668 
669  mStandard = inStandard;
670  mPixelFormat = inFrameBufferFormat;
671  mVancMode = inVancMode;
672  mFrameGeometry = ::GetVANCFrameGeometry(::GetGeometryFromStandard(mStandard), mVancMode);
673  mNumBitsLuma = gBitsPerComponent[mPixelFormat][0];
674  mNumBitsChroma = gBitsPerComponent[mPixelFormat][1];
675  mNumBitsAlpha = gBitsPerComponent[mPixelFormat][2];
676 
677  // Account for VANC...
678  if (NTV2_IS_VANCMODE_ON(inVancMode))
679  {
680  const ULWord numActiveLines (numLines);
681  switch (inStandard)
682  {
685  case NTV2_STANDARD_1080:
686  case NTV2_STANDARD_1080p: numLines = NTV2_IS_VANCMODE_TALLER(inVancMode) ? 1114 : 1112; break;
687 
688  case NTV2_STANDARD_720: numLines = 740; break;
689 
690  case NTV2_STANDARD_525: numLines = NTV2_IS_VANCMODE_TALLER(inVancMode) ? 514 : 508; break;
691 
692  case NTV2_STANDARD_625: numLines = NTV2_IS_VANCMODE_TALLER(inVancMode) ? 612 : 598; break;
693 
694  case NTV2_STANDARD_2K: numLines = 1588; break;
695 
696  default: numLines = numActiveLines; break;
697  }
698  firstActiveLine = numLines - numActiveLines;
699  }
700 
701  if (numLines && NTV2_IS_FBF_PLANAR(inFrameBufferFormat))
702  FinalizePlanar();
703 
704 } // construct from NTV2Standard & NTV2VANCMode
705 
706 
707 void NTV2FormatDescriptor::FinalizePlanar (void)
708 {
709  NTV2_ASSERT(NTV2_IS_FBF_PLANAR(mPixelFormat));
710  NTV2_ASSERT(numLines);
711  switch (mPixelFormat)
712  {
717  {
718  mNumPlanes = 2;
719  mLinePitch[0] = linePitch * 4;
720  mLinePitch[1] = linePitch * 4;
721  break;
722  }
723 
726  {
727  mNumPlanes = 3;
728  mLinePitch[0] = numPixels;
729  const ULWord lumaRasterBytes (numLines * numPixels);
730  ULWord chromaRasterBytes (lumaRasterBytes / 2);
731  if (lumaRasterBytes % 4)
732  {MakeInvalid(); break;}
733  mLinePitch[1] = mLinePitch[2] = chromaRasterBytes / numLines; // For HD1080p: 1920 px/line ==> 1920/4 ==> 480 bytes/line
734  if (chromaRasterBytes % numLines)
735  MakeInvalid();
736  break;
737  }
738 
741  {
742  mNumPlanes = 3;
743  mLinePitch[0] = numPixels * sizeof(uint16_t); // Y is 2-bytes per pixel // 1080p: 1920 x 2 ==> 3840 bytes per line)
744  const ULWord lumaRasterBytes (numLines * mLinePitch[0]); // 1080p: 1080 * 3840 ==> 4,147,200 bytes (0x003F4800)
745  ULWord chromaRasterBytes (lumaRasterBytes / 2); // 422 1080p: 2,073,600 bytes (0x001FA400)
746  mLinePitch[1] = mLinePitch[2] = chromaRasterBytes / numLines; // 422 1080p: 1920 bytes/line (0x780)
747  if (chromaRasterBytes % numLines) // 420 1080p: 960 bytes/line (0x3C0)
748  MakeInvalid();
749  break;
750  }
751 
752  default: MakeInvalid(); break;
753  }
754 }
755 
757  const NTV2FrameBufferFormat inFrameBufferFormat,
758  const NTV2VANCMode inVancMode)
759 {
760  MakeInvalid ();
761  const NTV2Standard inStandard (::GetNTV2StandardFromVideoFormat (inVideoFormat));
762  if (!NTV2_IS_VALID_STANDARD(inStandard))
763  return; // bad standard
764  if (!NTV2_IS_VALID_FRAME_BUFFER_FORMAT(inFrameBufferFormat))
765  return; // bad FBF
766  if (!NTV2_IS_VALID_VANCMODE(inVancMode))
767  return; // bad Vanc mode
768 // In SDK 16.0, some experimental Corvid88 firmware can do this now:
769 // if (NTV2_IS_FBF_PLANAR(inFrameBufferFormat) && NTV2_IS_VANCMODE_ON(inVancMode))
770 // return; // can't do VANC mode for planar formats
771 
772  *this = formatDescriptorTable[inStandard][inFrameBufferFormat]; // The 'formatDescriptorTable' handles everything but VANC
773 
774  mVideoFormat = inVideoFormat;
775  mStandard = inStandard;
776  mPixelFormat = inFrameBufferFormat;
777  mVancMode = inVancMode;
778  mFrameGeometry = ::GetVANCFrameGeometry(::GetNTV2FrameGeometryFromVideoFormat(mVideoFormat), mVancMode);
779  mNumBitsLuma = gBitsPerComponent[mPixelFormat][0];
780  mNumBitsChroma = gBitsPerComponent[mPixelFormat][1];
781  mNumBitsAlpha = gBitsPerComponent[mPixelFormat][2];
782 
783  // Account for VANC...
784  if (NTV2_IS_VANCMODE_ON(inVancMode))
785  {
786  const ULWord numActiveLines (numLines);
787  switch (inStandard)
788  {
791  case NTV2_STANDARD_1080:
792  case NTV2_STANDARD_1080p: numLines = NTV2_IS_VANCMODE_TALLER(inVancMode) ? 1114 : 1112; break;
793 
794  case NTV2_STANDARD_720: numLines = 740; break;
795 
796  case NTV2_STANDARD_525: numLines = NTV2_IS_VANCMODE_TALLER(inVancMode) ? 514 : 508; break;
797 
798  case NTV2_STANDARD_625: numLines = NTV2_IS_VANCMODE_TALLER(inVancMode) ? 612 : 598; break;
799 
800  case NTV2_STANDARD_2K: numLines = 1588; break;
801 
802  default: numLines = numActiveLines; break;
803  }
804  firstActiveLine = numLines - numActiveLines;
805  }
806  if (NTV2_IS_FBF_PLANAR (inFrameBufferFormat))
807  FinalizePlanar();
808 
809 } // construct from NTV2VideoFormat & NTV2VANCMode
810 
811 
813 {
814  MakeInvalid ();
815 }
816 
817 
818 NTV2FormatDescriptor::NTV2FormatDescriptor (const ULWord inNumLines, const ULWord inNumPixels, const ULWord inLinePitch, const ULWord in1stActiveLine,
819  const UByte inNumLumaBits, const UByte inNumChromaBits, const UByte inNumAlphaBits)
820  : numLines (inNumLines),
821  numPixels (inNumPixels),
822  linePitch (inLinePitch),
823  firstActiveLine (in1stActiveLine),
824  mStandard (NTV2_STANDARD_INVALID),
825  mVideoFormat (NTV2_FORMAT_UNKNOWN),
826  mPixelFormat (NTV2_FBF_INVALID),
827  mVancMode (NTV2_VANCMODE_INVALID),
828  mNumPlanes (1),
829  mFrameGeometry (NTV2_FG_INVALID),
830  mNumBitsLuma (inNumLumaBits),
831  mNumBitsChroma (inNumChromaBits),
832  mNumBitsAlpha (inNumAlphaBits)
833 {
834  mLinePitch[0] = inLinePitch * 4; // mLinePitch is in bytes, inLinePitch is in 32-bit longwords
835  mLinePitch[1] = mLinePitch[2] = mLinePitch[3] = 0;
836 }
837 
838 
840 {
841  numLines = 0;
842  numPixels = 0;
843  linePitch = 0;
844  firstActiveLine = 0;
845  mStandard = NTV2_STANDARD_INVALID;
846  mVideoFormat = NTV2_FORMAT_UNKNOWN;
847  mPixelFormat = NTV2_FBF_INVALID;
848  mVancMode = NTV2_VANCMODE_INVALID;
849  mLinePitch[0] = mLinePitch[1] = mLinePitch[2] = mLinePitch[3] = 0;
850  mNumPlanes = 0;
851  mFrameGeometry = NTV2_FG_INVALID;
852  mNumBitsLuma = mNumBitsChroma = mNumBitsAlpha = 0;
853 }
854 
856 {
857  ULWord bytes(0);
858  UWord plane(0);
859  do
860  {
861  bytes += GetTotalRasterBytes(plane);
862  } while (++plane < GetNumPlanes());
863  return bytes;
864 }
865 
867 {
868  static const ULWord s4K(0x00001000), s64K(0x00010000);
869  ULWord result(GetTotalBytes()), pageSizeBytes(inPageSizeBytes);
870  if (inPageSizeBytes != s4K)
871  { // Ensure power-of-2...
872  pageSizeBytes = s64K; // start at 64K
873  do
874  {
875  if (pageSizeBytes & inPageSizeBytes)
876  break; // exit at MSB
877  pageSizeBytes >>= 1;
878  } while (pageSizeBytes > s4K); // 4K minimum
879  }
880  if (result % pageSizeBytes)
881  result = ((result / pageSizeBytes) + 1) * pageSizeBytes;
882  return result;
883 }
884 
886 {
887  if (inPlaneIndex0 >= mNumPlanes)
888  return 0; // no such plane!
889  switch (mPixelFormat)
890  {
895  return inPlaneIndex0 ? 2 : 1;
896  default:
897  break;
898  }
899  return 1; // Defaults to 1
900 }
901 
903 {
904  if (NTV2_IS_VALID_VIDEO_FORMAT(mVideoFormat))
905  return NTV2_IS_2K_1080_VIDEO_FORMAT(mVideoFormat);
906  else if (NTV2_IS_VALID_STANDARD(mStandard))
907  return NTV2_IS_2K1080_STANDARD(mStandard);
908  return false;
909 }
910 
911 
913 {
914  return numLines == inRHS.numLines && numPixels == inRHS.numPixels
915  && mNumPlanes == inRHS.mNumPlanes && firstActiveLine == inRHS.firstActiveLine
916  && mLinePitch[0] == inRHS.mLinePitch[0];
917 }
918 
919 
920 string NTV2FormatDescriptor::PlaneToString (const UWord inPlaneIndex0) const
921 {
922  static string emptyString;
923  if (NTV2_IS_VALID_FRAME_BUFFER_FORMAT(mPixelFormat) && inPlaneIndex0 < GetNumPlanes())
924  return gPlaneLabels[mPixelFormat][inPlaneIndex0];
925  return emptyString;
926 }
927 
928 
930 {
931  if (!IsPlanar())
932  return inByteOffset < GetTotalRasterBytes() ? 0 : 0xFFFF;
933 
934  ULWord byteOffset (0);
935  UWord plane (0);
936  do
937  {
938  byteOffset += GetTotalRasterBytes(plane);
939  if (inByteOffset < byteOffset)
940  return plane;
941  } while (++plane < GetNumPlanes());
942  return 0xFFFF;
943 }
944 
945 
947 {
948  const UWord origPlane (ByteOffsetToPlane(inByteOffset));
949  if (origPlane == 0xFFFF)
950  return 0xFFFF;
951  ULWord byteOffsetToStartOfPlane (0);
952  UWord plane (origPlane);
953  while (plane)
954  byteOffsetToStartOfPlane += GetTotalRasterBytes(--plane);
955  NTV2_ASSERT(inByteOffset >= byteOffsetToStartOfPlane);
956  const ULWord lineOffset ((inByteOffset - byteOffsetToStartOfPlane) / GetBytesPerRow(origPlane));
957  return UWord(lineOffset);
958 }
959 
960 
962 {
963  if (!IsValid())
964  return false;
965  UWord plane (ByteOffsetToPlane(inByteOffset));
966  if (plane >= GetNumPlanes())
967  return false;
968  if (plane > 0)
969  inByteOffset -= GetTotalRasterBytes(0);
970  if (plane > 1)
971  inByteOffset -= GetTotalRasterBytes(1);
972  return (inByteOffset % GetBytesPerRow(plane)) == 0;
973 }
974 
975 bool NTV2FormatDescriptor::GetRowBuffer (const NTV2Buffer & inFrameBuffer, NTV2Buffer & inOutRowBuffer, const ULWord inRowIndex0, const UWord inPlaneIndex0) const
976 {
977  inOutRowBuffer.Deallocate();
978  if (inRowIndex0 >= numLines)
979  return false; // Bad row index
980  if (inPlaneIndex0 >= mNumPlanes)
981  return false; // Bad plane index
982  if (inFrameBuffer.IsNULL())
983  return false; // NULL/empty frame buffer
984 
985  ULWord byteOffset(0); // Set byteOffset to start of desired plane
986  if (inPlaneIndex0 > 0)
987  byteOffset += GetTotalRasterBytes(0);
988  if (inPlaneIndex0 > 1)
989  byteOffset += GetTotalRasterBytes(1);
990  if (inPlaneIndex0 > 2)
991  byteOffset += GetTotalRasterBytes(2);
992 
993  ULWord bytesPerRow(GetBytesPerRow(inPlaneIndex0));
994  byteOffset += inRowIndex0 * bytesPerRow; // Add offset to start of requested line
995  if (byteOffset+bytesPerRow > inFrameBuffer.GetByteCount())
996  return false; // Past end of frame buffer
997 
998  return inOutRowBuffer.Set(inFrameBuffer.GetHostAddress(byteOffset), bytesPerRow);
999 }
1000 
1001 const void * NTV2FormatDescriptor::GetRowAddress (const void * pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0) const
1002 {
1003  if (inRowIndex0 >= numLines)
1004  return AJA_NULL;
1005  if (inPlaneIndex0 >= mNumPlanes)
1006  return AJA_NULL;
1007  if (!pInStartAddress)
1008  return AJA_NULL;
1009 
1010  const UByte * pStart (AsConstUBytePtr(pInStartAddress));
1011  NTV2_ASSERT(pStart);
1012  if (inPlaneIndex0 > 0)
1013  pStart += GetTotalRasterBytes(0);
1014  if (inPlaneIndex0 > 1)
1015  pStart += GetTotalRasterBytes(1);
1016  if (inPlaneIndex0 > 2)
1017  pStart += GetTotalRasterBytes(2);
1018  return pStart + inRowIndex0 * GetBytesPerRow(inPlaneIndex0);
1019 }
1020 
1021 
1022 void * NTV2FormatDescriptor::GetWriteableRowAddress (void * pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0) const
1023 {
1024  if (inRowIndex0 >= numLines)
1025  return AJA_NULL;
1026  if (inPlaneIndex0 >= mNumPlanes)
1027  return AJA_NULL;
1028 
1029  UByte * pStart (AsUBytePtr(pInStartAddress));
1030  if (inPlaneIndex0 > 0)
1031  pStart += GetTotalRasterBytes(0);
1032  if (inPlaneIndex0 > 1)
1033  pStart += GetTotalRasterBytes(1);
1034  if (inPlaneIndex0 > 2)
1035  pStart += GetTotalRasterBytes(2);
1036  return pStart + inRowIndex0 * GetBytesPerRow(inPlaneIndex0);
1037 }
1038 
1039 
1040 ULWord NTV2FormatDescriptor::RasterLineToByteOffset (const ULWord inRowIndex0, const UWord inPlaneIndex0) const
1041 {
1042  if (inRowIndex0 >= numLines)
1043  return 0xFFFFFFFF;
1044  if (inPlaneIndex0 >= mNumPlanes)
1045  return 0xFFFFFFFF;
1046 
1047  ULWord offset (0);
1048  if (inPlaneIndex0 > 0)
1049  offset += GetTotalRasterBytes(0);
1050  if (inPlaneIndex0 > 1)
1051  offset += GetTotalRasterBytes(1);
1052  if (inPlaneIndex0 > 2)
1053  offset += GetTotalRasterBytes(2);
1054  return offset + inRowIndex0 * GetBytesPerRow(inPlaneIndex0);
1055 }
1056 
1057 
1058 bool NTV2FormatDescriptor::GetFirstChangedRow (const void * pInStartAddress1, const void * pInStartAddress2, ULWord & outFirstChangedRowNum) const
1059 {
1060  outFirstChangedRowNum = 0xFFFFFFFF;
1061  if (!pInStartAddress1)
1062  return false; // NULL start address 1
1063  if (!pInStartAddress2)
1064  return false; // NULL start address 2
1065  if (pInStartAddress1 == pInStartAddress2)
1066  return false; // same start addresses
1067  if (!IsValid())
1068  return false; // invalid
1069 
1070  UWord plane (0);
1071  do
1072  {
1073  for (outFirstChangedRowNum = 0; outFirstChangedRowNum < GetFullRasterHeight(); outFirstChangedRowNum++)
1074  if (::memcmp(GetRowAddress(AsConstUBytePtr(pInStartAddress1), outFirstChangedRowNum, plane), GetRowAddress(pInStartAddress2, outFirstChangedRowNum, plane), GetBytesPerRow(plane)))
1075  return true; // CHANGE FOUND -- Success!
1076  } while (++plane < GetNumPlanes());
1077  outFirstChangedRowNum = 0xFFFFFFFF; // NO CHANGES FOUND
1078  return true; // Success
1079 }
1080 
1081 
1082 bool NTV2FormatDescriptor::GetChangedLines (NTV2RasterLineOffsets & outDiffs, const void * pInBuffer1, const void * pInBuffer2, const ULWord inMaxLines) const
1083 {
1084  outDiffs.clear ();
1085  if (!IsValid())
1086  return false; // Invalid format descriptor
1087  if (!pInBuffer1 || !pInBuffer2)
1088  return false; // NULL or empty buffers
1089 
1090  const UByte * pStartAddress1 (AsConstUBytePtr(pInBuffer1));
1091  const UByte * pStartAddress2 (AsConstUBytePtr(pInBuffer2));
1092 
1093  if (!GetRowAddress (pStartAddress1, GetFullRasterHeight() - 1))
1094  return false; // buffer too small to fetch given rowOffset
1095  if (pInBuffer1 == pInBuffer2)
1096  return true; // Same buffer -- no diffs (success!)
1097  ULWord maxLines (inMaxLines ? inMaxLines : GetFullRasterHeight());
1098  if (maxLines > GetFullRasterHeight())
1099  maxLines = GetFullRasterHeight(); // Clamp maxLines to full raster height
1100 
1101  UWord plane (0);
1102  do
1103  {
1104  for (ULWord rowOffset(0); rowOffset < maxLines; rowOffset++)
1105  if (::memcmp(GetRowAddress(pStartAddress1, rowOffset, plane), GetRowAddress(pStartAddress2, rowOffset, plane), GetBytesPerRow(plane)))
1106  outDiffs.push_back(rowOffset);
1107  } while (++plane < GetNumPlanes());
1108  return true;
1109 }
1110 
1111 
1112 ostream & NTV2FormatDescriptor::Print (ostream & oss, const bool inDetailed) const
1113 {
1114  UWord plane (0);
1115  if (!IsValid ())
1116  oss << "INVALID: ";
1117  oss << "lines=" << DEC(GetFullRasterHeight())
1118  << " px/line=" << DEC(GetRasterWidth());
1119  do
1120  {
1121  if (IsPlanar())
1122  oss << " PL" << plane << ":";
1123  oss << " bytes/line=" << DEC(GetBytesPerRow(plane));
1124  } while (++plane < GetNumPlanes());
1125  if (firstActiveLine)
1126  oss << " 1stAct=" << DEC(firstActiveLine);
1127  if (inDetailed)
1128  {
1129  plane = 0;
1130  if (IsPlanar())
1131  do
1132  {
1133  oss << " PL" << plane << " bytes=" << xHEX0N(GetTotalRasterBytes(plane),8);
1134  } while (++plane < GetNumPlanes());
1135  else
1136  oss << " bytes=" << xHEX0N(GetTotalRasterBytes(),8);
1137  if (NTV2_IS_VALID_VIDEO_FORMAT(mVideoFormat))
1138  oss << " " << ::NTV2VideoFormatToString(mVideoFormat);
1139  else
1140  oss << " " << ::NTV2StandardToString(mStandard) << (Is2KFormat() ? " 2K" : "");
1141  if (NTV2_IS_VANCMODE_ON(mVancMode))
1142  oss << (NTV2_IS_VANCMODE_TALLER(mVancMode) ? " TallerVANC" : " TallVANC");
1143  if (NTV2_IS_VALID_FRAME_BUFFER_FORMAT(mPixelFormat))
1144  oss << " " << ::NTV2FrameBufferFormatToString(mPixelFormat);
1145  if (IsRGB())
1146  oss << " bitsC" << DEC(UWord(GetNumBitsChroma()));
1147  else
1148  oss << " bitsY" << DEC(UWord(GetNumBitsLuma()));
1149  if (HasAlpha())
1150  oss << "A" << DEC(UWord(GetNumBitsAlpha()));
1151  }
1152  return oss;
1153 }
1154 
1155 
1156 // SMPTE LINE NUMBERS:
1157 
1158 // NTV2_VANCMODE_OFF 1080i 720p 525i 625i 1080p 2K 2K1080p 2K1080i 3840x2160p 4096x2160p 3840HFR 4096HFR 7680x4320 8192x4320
1159 static const ULWord LineNumbersF1 [] = { 21, 26, 21, 23, 42, 211, 42, 21, 42, 42, 42, 42, 42, 42, 0 };
1160 static const ULWord LineNumbersF2 [] = { 584, 27, 283, 336, 43, 1201, 43, 584, 43, 43, 43, 43, 43, 43, 0 };
1161 // NTV2_VANCMODE_TALL
1162 static const ULWord LineNumbersF1t [] = { 5, 6, 10, 12, 10, 211, 10, 5, 10, 10, 10, 10, 10, 10, 0 };
1163 static const ULWord LineNumbersF2t [] = { 568, 7, 272, 325, 11, 1201, 11, 568, 11, 11, 11, 11, 11, 11, 0 };
1164 // NTV2_VANCMODE_TALLER
1165 static const ULWord LineNumbersF1tt [] = { 4, 6, 7, 5, 8, 211, 8, 4, 8, 8, 8, 8, 8, 8, 0 };
1166 static const ULWord LineNumbersF2tt [] = { 567, 7, 269, 318, 9, 1201, 9, 567, 9, 9, 9, 9, 9, 9, 0 };
1167 
1168 static const ULWord LineNumbersF1Last[] = { 560, 745, 263, 310, 1121, 0, 1121, 0, 2201, 2201, 2201, 2201, 4361, 4361, 0 };
1169 static const ULWord LineNumbersF2Last[] = { 1123, 745, 525, 623, 1121, 0, 1121, 0, 0, 0, 0, 0, 0, 0, 0 };
1170 
1171 
1172 bool NTV2FormatDescriptor::GetSMPTELineNumber (const ULWord inLineOffset, ULWord & outSMPTELine, bool & outIsField2) const
1173 {
1174  outIsField2 = false;
1175  outSMPTELine = 0;
1176  if (!IsValid())
1177  return false;
1178  if (!NTV2_IS_VALID_STANDARD(mStandard))
1179  return false;
1180  if (!NTV2_IS_VALID_VANCMODE(mVancMode))
1181  return false;
1182  if (inLineOffset >= GetFullRasterHeight())
1183  return false;
1184 
1185  const bool is525i (mStandard == NTV2_STANDARD_525);
1186  if (!NTV2_IS_PROGRESSIVE_STANDARD(mStandard))
1187  outIsField2 = (inLineOffset & 1) ? !is525i : is525i;
1188 
1189  const ULWord divisor (NTV2_IS_PROGRESSIVE_STANDARD(mStandard) ? 1 : 2);
1190  ULWord smpteLine (0);
1191 
1192  switch (mVancMode)
1193  {
1194  case NTV2_VANCMODE_OFF: smpteLine = outIsField2 ? LineNumbersF2[mStandard] : LineNumbersF1[mStandard]; break;
1195  case NTV2_VANCMODE_TALL: smpteLine = outIsField2 ? LineNumbersF2t[mStandard] : LineNumbersF1t[mStandard]; break;
1196  case NTV2_VANCMODE_TALLER: smpteLine = outIsField2 ? LineNumbersF2tt[mStandard] : LineNumbersF1tt[mStandard]; break;
1197  default: break;
1198  }
1199  outSMPTELine = inLineOffset/divisor + smpteLine;
1200  return true;
1201 }
1202 
1203 
1204 bool NTV2FormatDescriptor::GetLineOffsetFromSMPTELine (const ULWord inSMPTELine, ULWord & outLineOffset) const
1205 {
1206  outLineOffset = 0xFFFFFFFF;
1207  if (!IsValid())
1208  return false;
1209  if (!NTV2_IS_VALID_STANDARD(mStandard))
1210  return false;
1211  if (!NTV2_IS_VALID_VANCMODE(mVancMode))
1212  return false;
1213 
1214  ULWord firstF1Line(0), firstF2Line(0);
1215  const ULWord lastF1Line (LineNumbersF1Last[mStandard]);
1216  const ULWord lastF2Line (LineNumbersF2Last[mStandard]);
1217  const ULWord is525i (mStandard == NTV2_STANDARD_525 ? 1 : 0);
1218  const ULWord not525i (mStandard != NTV2_STANDARD_525 ? 1 : 0);
1219 
1220  switch (mVancMode)
1221  {
1222  case NTV2_VANCMODE_OFF: firstF1Line = LineNumbersF1[mStandard]; firstF2Line = LineNumbersF2[mStandard]; break;
1223  case NTV2_VANCMODE_TALL: firstF1Line = LineNumbersF1t[mStandard]; firstF2Line = LineNumbersF2t[mStandard]; break;
1224  case NTV2_VANCMODE_TALLER: firstF1Line = LineNumbersF1tt[mStandard]; firstF2Line = LineNumbersF2tt[mStandard]; break;
1225  case NTV2_VANCMODE_INVALID: return false;
1226  }
1227  if (inSMPTELine < firstF1Line)
1228  return false; // Above first line in FB raster
1229  if (NTV2_IS_PROGRESSIVE_STANDARD(mStandard) && lastF1Line && inSMPTELine > lastF1Line)
1230  return false; // Past last line
1231  if (!NTV2_IS_PROGRESSIVE_STANDARD(mStandard) && lastF1Line && inSMPTELine < firstF2Line && inSMPTELine > lastF1Line)
1232  return false; // In the void past end of F1 and above F2 first line
1233  if (!NTV2_IS_PROGRESSIVE_STANDARD(mStandard) && lastF2Line && inSMPTELine > lastF2Line)
1234  return false; // Past last line
1235 
1236  if (NTV2_IS_PROGRESSIVE_STANDARD(mStandard))
1237  outLineOffset = inSMPTELine - firstF1Line;
1238  else if (inSMPTELine >= firstF2Line)
1239  outLineOffset = (inSMPTELine - firstF2Line) * 2 + not525i;
1240  else
1241  outLineOffset = (inSMPTELine - firstF1Line) * 2 + is525i;
1242  return outLineOffset < GetFullRasterHeight();
1243 }
1244 
1245 
1246 ostream & NTV2FormatDescriptor::PrintSMPTELineNumber (ostream & inOutStream, const ULWord inLineOffset, const bool inForTextMode) const
1247 {
1248  ULWord smpteLine (0);
1249  bool isF2 (false);
1250  if (GetSMPTELineNumber (inLineOffset, smpteLine, isF2))
1251  {
1252  if (!NTV2_IS_PROGRESSIVE_STANDARD (mStandard))
1253  inOutStream << "F" << (isF2 ? "2" : "1") << (inForTextMode ? "" : " ");
1254  if (inForTextMode)
1255  inOutStream << "L" << DEC0N(smpteLine,4);
1256  else
1257  inOutStream << "L" << DEC(smpteLine); // (inLineOffset/divisor + smpteLine);
1258  }
1259  return inOutStream;
1260 }
1261 
1263 {
1264  return NTV2FrameDimensions (GetRasterWidth(), GetRasterHeight(false));
1265 }
1266 
1268 {
1269  return NTV2FrameDimensions (GetRasterWidth(), GetRasterHeight(true));
1270 }
1271 
1272 
1274 {
1275  if (IsValid())
1276  { // Full visible raster
1278  if (inIsSource)
1279  return inSegmentInfo.setSourceOffset(GetBytesPerRow() * GetFirstActiveLine())
1281  else
1282  return inSegmentInfo.setDestOffset(GetBytesPerRow() * GetFirstActiveLine())
1284  }
1285  inSegmentInfo = NTV2SegmentedXferInfo();
1286  return inSegmentInfo;
1287 }
1288 
1289 
1290 // Q: WHY IS NTV2SmpteLineNumber's CONSTRUCTOR & GetLastLine IMPLEMENTATION HERE?
1291 // A: TO USE THE SAME LineNumbersF1/LineNumbersF2 TABLES (above)
1292 
1294 {
1295  NTV2_ASSERT (inStandard < sizeof(LineNumbersF1) / sizeof(ULWord));
1296  *this = NTV2SmpteLineNumber (LineNumbersF1[inStandard], LineNumbersF2[inStandard], inStandard != NTV2_STANDARD_525, inStandard);
1297 }
1298 
1299 
1301 {
1302  if (!NTV2_IS_VALID_FIELD(inRasterFieldID))
1303  return 0;
1304 
1305  if (inRasterFieldID == NTV2_FIELD0)
1306  return firstFieldTop ? LineNumbersF1Last[mStandard] : LineNumbersF2Last[mStandard];
1307  else
1308  return firstFieldTop ? LineNumbersF2Last[mStandard] : LineNumbersF1Last[mStandard];
1309 }
1310 
1311 
1312 ostream & NTV2PrintRasterLineOffsets(const NTV2RasterLineOffsets & inObj, ostream & inOutStream)
1313 {
1314  NTV2StringList pieces;
1315  NTV2RasterLineOffsetsConstIter iter (inObj.begin());
1316  ULWord current (0xFFFFFFFF);
1317  ULWord previous (0xFFFFFFFF);
1318  ULWord first (0xFFFFFFFF);
1319  ULWord last (0xFFFFFFFF);
1320 
1321  #if 0
1322  // Verify sorted ascending...
1323  current = 0;
1324  while (iter != inObj.end())
1325  {
1326  NTV2_ASSERT (current < previous);
1327  previous = current;
1328  }
1329  iter = inObj.begin();
1330  #endif // _DEBUG
1331 
1332  while (iter != inObj.end())
1333  {
1334  current = *iter;
1335  if (previous == 0xFFFFFFFF)
1336  previous = first = last = current; // First time -- always start new sequence
1337  else if (current == (previous + 1))
1338  last = previous = current; // Continue sequence
1339  else if (current == previous)
1340  ;
1341  else
1342  {
1343  ostringstream oss;
1344  if (first == last)
1345  oss << first;
1346  else
1347  oss << first << "-" << last;
1348  pieces.push_back (oss.str ());
1349 
1350  first = last = previous = current; // Start new sequence...
1351  } // else sequence break
1352  ++iter;
1353  }
1354 
1355  if (first != 0xFFFFFFFF && last != 0xFFFFFFFF)
1356  {
1357  ostringstream oss;
1358  if (first == last)
1359  oss << first;
1360  else
1361  oss << first << "-" << last;
1362  pieces.push_back (oss.str ());
1363  }
1364 
1365  for (NTV2StringListConstIter it (pieces.begin()); ; )
1366  {
1367  inOutStream << *it;
1368  if (++it != pieces.end())
1369  inOutStream << ",";
1370  else
1371  break;
1372  }
1373  return inOutStream;
1374 }
LineNumbersF1Last
static const ULWord LineNumbersF1Last[]
Definition: ntv2formatdescriptor.cpp:1168
NTV2_FBF_10BIT_YCBCR_420PL3_LE
@ NTV2_FBF_10BIT_YCBCR_420PL3_LE
See 3-Plane 10-Bit YCbCr 4:2:0 ('I420_10LE' a.k.a. 'YUV-P420-L10').
Definition: ntv2enums.h:240
HD_NUMCOMPONENTPIXELS_1080_DVCPRO
#define HD_NUMCOMPONENTPIXELS_1080_DVCPRO
Definition: ntv2videodefines.h:77
NTV2SegmentedXferInfo::setDestOffset
NTV2SegmentedXferInfo & setDestOffset(const ULWord inOffset)
Sets my destination offset.
Definition: ntv2publicinterface.h:5906
NTV2FormatDescriptor::GetBytesPerRow
ULWord GetBytesPerRow(const UWord inPlaneIndex0=0) const
Definition: ntv2formatdescriptor.h:146
HD_NUMCOMPONENTPIXELS_2K
#define HD_NUMCOMPONENTPIXELS_2K
Definition: videoutilities.h:15
NTV2_FBF_NUMFRAMEBUFFERFORMATS
@ NTV2_FBF_NUMFRAMEBUFFERFORMATS
Definition: ntv2enums.h:247
NTV2_IS_VANCMODE_TALLER
#define NTV2_IS_VANCMODE_TALLER(__v__)
Definition: ntv2enums.h:3760
NTV2_NUM_STANDARDS
@ NTV2_NUM_STANDARDS
Definition: ntv2enums.h:174
NTV2_FBF_10BIT_YCBCR_420PL2
@ NTV2_FBF_10BIT_YCBCR_420PL2
10-Bit 4:2:0 2-Plane YCbCr
Definition: ntv2enums.h:242
NTV2SegmentedXferInfo::setSegmentCount
NTV2SegmentedXferInfo & setSegmentCount(const ULWord inNumSegments)
Sets my segment count.
Definition: ntv2publicinterface.h:5836
NTV2FormatDescriptor::GetVideoWriteSize
ULWord GetVideoWriteSize(ULWord inPageSize=4096UL) const
Definition: ntv2formatdescriptor.cpp:866
HD_NUMCOMPONENTPIXELS_720_DVCPRO
#define HD_NUMCOMPONENTPIXELS_720_DVCPRO
Definition: ntv2videodefines.h:76
RGB12PLINEPITCH_3840
#define RGB12PLINEPITCH_3840
Definition: ntv2videodefines.h:126
RGB48LINEPITCH_7680
#define RGB48LINEPITCH_7680
Definition: ntv2videodefines.h:118
FD_NUMLINES_8K
#define FD_NUMLINES_8K
Definition: ntv2videodefines.h:62
NTV2_STANDARD_2Kx1080p
@ NTV2_STANDARD_2Kx1080p
Identifies SMPTE HD 2K1080p.
Definition: ntv2enums.h:164
RGB12PLINEPITCH_525
#define RGB12PLINEPITCH_525
Definition: ntv2videodefines.h:121
HD_YCBCRLINEPITCH_1080
#define HD_YCBCRLINEPITCH_1080
Definition: ntv2videodefines.h:87
NTV2SegmentedXferInfo::setSourceOffset
NTV2SegmentedXferInfo & setSourceOffset(const ULWord inOffset)
Sets my source offset.
Definition: ntv2publicinterface.h:5861
NTV2FrameDimensions
Describes the horizontal and vertical size dimensions of a raster, bitmap, frame or image.
Definition: ntv2publicinterface.h:5659
AJA_FD_TBD
#define AJA_FD_TBD
Definition: ntv2formatdescriptor.cpp:22
NTV2FormatDescriptor
Describes a video frame for a given video standard or format and pixel format, including the total nu...
Definition: ntv2formatdescriptor.h:41
NTV2_IS_FBF_PLANAR
#define NTV2_IS_FBF_PLANAR(__s__)
Definition: ntv2enums.h:258
HD_YCBCRLINEPITCH_1080_DVCPRO
#define HD_YCBCRLINEPITCH_1080_DVCPRO
Definition: ntv2videodefines.h:95
NTV2FormatDescriptor::GetRowAddress
const void * GetRowAddress(const void *pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const
Definition: ntv2formatdescriptor.cpp:1001
RGB12PLINEPITCH_4096
#define RGB12PLINEPITCH_4096
Definition: ntv2videodefines.h:127
GetNTV2FrameGeometryFromVideoFormat
NTV2FrameGeometry GetNTV2FrameGeometryFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:2545
NTV2FormatDescriptor::GetSegmentedXferInfo
NTV2SegmentedXferInfo & GetSegmentedXferInfo(NTV2SegmentedXferInfo &inSegmentInfo, const bool inIsSource=true) const
Sets the given NTV2SegmentedXferInfo to match my raster, as a source or destination.
Definition: ntv2formatdescriptor.cpp:1273
NTV2SegmentedXferInfo::setSourcePitch
NTV2SegmentedXferInfo & setSourcePitch(const ULWord inPitch)
Sets my source pitch.
Definition: ntv2publicinterface.h:5869
NTV2Buffer
A generic user-space buffer object that has an address and a length. Used most often to share an arbi...
Definition: ntv2publicinterface.h:6022
NTV2SmpteLineNumber::GetLastLine
ULWord GetLastLine(const NTV2FieldID inRasterFieldID=NTV2_FIELD0) const
Definition: ntv2formatdescriptor.cpp:1300
NTV2_IS_2K1080_STANDARD
#define NTV2_IS_2K1080_STANDARD(__s__)
Definition: ntv2enums.h:200
NTV2Buffer::GetByteCount
ULWord GetByteCount(void) const
Definition: ntv2publicinterface.h:6096
NTV2_STANDARD_INVALID
@ NTV2_STANDARD_INVALID
Definition: ntv2enums.h:176
NTV2_ASSERT
#define NTV2_ASSERT(_expr_)
Definition: ajatypes.h:508
NTV2FormatDescriptor::IsAtLineStart
bool IsAtLineStart(ULWord inByteOffset) const
Definition: ntv2formatdescriptor.cpp:961
NTV2_STANDARD_1080
@ NTV2_STANDARD_1080
Identifies SMPTE HD 1080i or 1080psf.
Definition: ntv2enums.h:158
NTV2_STANDARD_625
@ NTV2_STANDARD_625
Identifies SMPTE SD 625i.
Definition: ntv2enums.h:161
FD_YCBCRLINEPITCH_UHD2
#define FD_YCBCRLINEPITCH_UHD2
Definition: ntv2videodefines.h:91
NTV2SegmentedXferInfo::setSegmentLength
NTV2SegmentedXferInfo & setSegmentLength(const ULWord inNumElements)
Sets my segment length.
Definition: ntv2publicinterface.h:5844
RGB24LINEPITCH_625
#define RGB24LINEPITCH_625
Definition: ntv2videodefines.h:52
HD_NUMACTIVELINES_2K
#define HD_NUMACTIVELINES_2K
Definition: ntv2videodefines.h:58
RGB12PLINEPITCH_8192
#define RGB12PLINEPITCH_8192
Definition: ntv2videodefines.h:129
NTV2_FG_INVALID
@ NTV2_FG_INVALID
Definition: ntv2enums.h:364
RGB12PLINEPITCH_7680
#define RGB12PLINEPITCH_7680
Definition: ntv2videodefines.h:128
NTV2Buffer::Deallocate
bool Deallocate(void)
Deallocates my user-space storage (if I own it – i.e. from a prior call to Allocate).
Definition: ntv2publicinterface.cpp:1681
NTV2FormatDescriptor::linePitch
ULWord linePitch
Number of 32-bit words per line – shadows mLinePitch[0] / sizeof(ULWord)
Definition: ntv2formatdescriptor.h:356
NTV2FormatDescriptor::Is2KFormat
bool Is2KFormat(void) const
Definition: ntv2formatdescriptor.cpp:902
DEC0N
#define DEC0N(__x__, __n__)
Definition: ntv2publicinterface.h:5608
NTV2FormatDescriptor::GetRasterHeight
ULWord GetRasterHeight(const bool inVisibleOnly=false) const
Definition: ntv2formatdescriptor.h:176
NTV2FieldID
NTV2FieldID
These values are used to identify fields for interlaced video. See Field/Frame Interrupts and CNTV2Ca...
Definition: ntv2enums.h:1815
NTV2_FBF_INVALID
@ NTV2_FBF_INVALID
Definition: ntv2enums.h:248
NTV2FrameBufferFormat
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
Definition: ntv2enums.h:210
NTV2FormatDescriptor::GetRowBuffer
bool GetRowBuffer(const NTV2Buffer &inFrameBuffer, NTV2Buffer &inOutRowBuffer, const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const
Answers with an NTV2Buffer that describes the given row (and plane) given the NTV2Buffer that describ...
Definition: ntv2formatdescriptor.cpp:975
GetVANCFrameGeometry
NTV2FrameGeometry GetVANCFrameGeometry(const NTV2FrameGeometry inFrameGeometry, const NTV2VANCMode inVancMode)
Definition: ntv2utils.cpp:3803
NTV2_IS_2K_1080_VIDEO_FORMAT
#define NTV2_IS_2K_1080_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:749
NTV2SmpteLineNumber::NTV2SmpteLineNumber
NTV2SmpteLineNumber(const NTV2Standard inStandard=NTV2_STANDARD_INVALID)
Constructs me from a given NTV2Standard.
Definition: ntv2formatdescriptor.cpp:1293
NTV2FormatDescriptor::GetLineOffsetFromSMPTELine
bool GetLineOffsetFromSMPTELine(const ULWord inSMPTELine, ULWord &outLineOffset) const
Answers with the equivalent line offset into the raster I describe for the given SMPTE line number.
Definition: ntv2formatdescriptor.cpp:1204
NTV2_FIELD0
@ NTV2_FIELD0
Identifies the first field in time for an interlaced video frame, or the first and only field in a pr...
Definition: ntv2enums.h:1817
LineNumbersF1
static const ULWord LineNumbersF1[]
Definition: ntv2formatdescriptor.cpp:1159
LineNumbersF2Last
static const ULWord LineNumbersF2Last[]
Definition: ntv2formatdescriptor.cpp:1169
HD_YCBCRLINEPITCH_2K
#define HD_YCBCRLINEPITCH_2K
Definition: ntv2videodefines.h:88
RGB24LINEPITCH_720
#define RGB24LINEPITCH_720
Definition: ntv2videodefines.h:103
NTV2SegmentedXferInfo
Describes a segmented data transfer (copy or move) from a source memory location to a destination loc...
Definition: ntv2publicinterface.h:5728
NTV2_FBF_8BIT_YCBCR_420PL2
@ NTV2_FBF_8BIT_YCBCR_420PL2
8-Bit 4:2:0 2-Plane YCbCr
Definition: ntv2enums.h:244
RGB48LINEPITCH_8192
#define RGB48LINEPITCH_8192
Definition: ntv2videodefines.h:119
HD_YCBCRLINEPITCH_720
#define HD_YCBCRLINEPITCH_720
Definition: ntv2videodefines.h:86
NTV2FormatDescriptor::operator==
bool operator==(const NTV2FormatDescriptor &inRHS) const
Definition: ntv2formatdescriptor.cpp:912
NTV2FormatDescriptor::numPixels
ULWord numPixels
Width – total number of pixels per line.
Definition: ntv2formatdescriptor.h:355
HD_NUMLINES_4K
#define HD_NUMLINES_4K
Definition: ntv2videodefines.h:61
NTV2_VANCMODE_TALL
@ NTV2_VANCMODE_TALL
This identifies the "tall" mode in which there are some VANC lines in the frame buffer.
Definition: ntv2enums.h:3753
NTV2Standard
NTV2Standard
Identifies a particular video standard.
Definition: ntv2enums.h:156
NTV2_VANCMODE_OFF
@ NTV2_VANCMODE_OFF
This identifies the mode in which there are no VANC lines in the frame buffer.
Definition: ntv2enums.h:3752
NTV2Buffer::IsNULL
bool IsNULL(void) const
Definition: ntv2publicinterface.h:6118
RGB48LINEPITCH_3840
#define RGB48LINEPITCH_3840
Definition: ntv2videodefines.h:116
ULWord
uint32_t ULWord
Definition: ajatypes.h:255
NUMACTIVELINES_525
#define NUMACTIVELINES_525
Definition: ntv2videodefines.h:41
NTV2FormatDescriptor::numLines
ULWord numLines
Height – total number of lines.
Definition: ntv2formatdescriptor.h:354
HD_NUMACTIVELINES_720
#define HD_NUMACTIVELINES_720
Definition: ntv2videodefines.h:56
NTV2FormatDescriptor::GetTotalBytes
ULWord GetTotalBytes(void) const
Definition: ntv2formatdescriptor.cpp:855
AJA_FD_NOTSUPPORTED
#define AJA_FD_NOTSUPPORTED
Definition: ntv2formatdescriptor.cpp:21
NTV2_IS_VALID_STANDARD
#define NTV2_IS_VALID_STANDARD(__s__)
Definition: ntv2enums.h:179
AsUBytePtr
#define AsUBytePtr(_x_)
Definition: ntv2formatdescriptor.cpp:25
NUMACTIVELINES_625
#define NUMACTIVELINES_625
Definition: ntv2videodefines.h:42
FD_NUMCOMPONENTPIXELS_UHD2
#define FD_NUMCOMPONENTPIXELS_UHD2
Definition: ntv2videodefines.h:73
NTV2FormatDescriptor::GetVerticalSampleRatio
ULWord GetVerticalSampleRatio(const UWord inPlaneIndex0=0) const
Definition: ntv2formatdescriptor.cpp:885
RGB48LINEPITCH_2048
#define RGB48LINEPITCH_2048
Definition: ntv2videodefines.h:115
RGB24LINEPITCH_3840
#define RGB24LINEPITCH_3840
Definition: ntv2videodefines.h:106
LineNumbersF1tt
static const ULWord LineNumbersF1tt[]
Definition: ntv2formatdescriptor.cpp:1165
RGB12PLINEPITCH_1080
#define RGB12PLINEPITCH_1080
Definition: ntv2videodefines.h:124
NTV2StandardToString
std::string NTV2StandardToString(const NTV2Standard inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6957
HD_NUMCOMPONENTPIXELS_QUADHD
#define HD_NUMCOMPONENTPIXELS_QUADHD
Definition: ntv2videodefines.h:71
RGB24LINEPITCH_8192
#define RGB24LINEPITCH_8192
Definition: ntv2videodefines.h:109
NTV2FormatDescriptor::GetFirstChangedRow
bool GetFirstChangedRow(const void *pInStartAddress1, const void *pInStartAddress2, ULWord &outFirstChangedRowNum) const
Compares two buffers line-by-line (using my description of the buffer contents).
Definition: ntv2formatdescriptor.cpp:1058
NTV2FormatDescriptor::GetFirstActiveLine
ULWord GetFirstActiveLine(void) const
Definition: ntv2formatdescriptor.h:186
NTV2_STANDARD_1080p
@ NTV2_STANDARD_1080p
Identifies SMPTE HD 1080p.
Definition: ntv2enums.h:162
UWord
uint16_t UWord
Definition: ajatypes.h:253
NTV2FormatDescriptor::PrintSMPTELineNumber
std::ostream & PrintSMPTELineNumber(std::ostream &inOutStream, const ULWord inLineOffset, const bool inForTextMode=false) const
Writes the given frame buffer line offset as a formatted SMPTE line number into the given output stre...
Definition: ntv2formatdescriptor.cpp:1246
NTV2SegmentedXferInfo::setDestPitch
NTV2SegmentedXferInfo & setDestPitch(const ULWord inPitch)
Sets my destination pitch.
Definition: ntv2publicinterface.h:5913
NTV2_IS_VANCMODE_ON
#define NTV2_IS_VANCMODE_ON(__v__)
Definition: ntv2enums.h:3761
AJA_FD_END
#define AJA_FD_END
Definition: ntv2formatdescriptor.cpp:20
AJA_FD_BEGIN
#define AJA_FD_BEGIN
Definition: ntv2formatdescriptor.cpp:19
ntv2utils.h
Declares numerous NTV2 utility functions.
NTV2VideoFormatToString
std::string NTV2VideoFormatToString(const NTV2VideoFormat inValue, const bool inUseFrameRate=false)
Definition: ntv2utils.cpp:6793
NTV2FormatDescriptor::GetFullRasterDimensions
NTV2FrameDimensions GetFullRasterDimensions(void) const
Definition: ntv2formatdescriptor.cpp:1262
FD_NUMCOMPONENTPIXELS_8K
#define FD_NUMCOMPONENTPIXELS_8K
Definition: ntv2videodefines.h:74
NTV2_FBF_10BIT_YCBCR_422PL2
@ NTV2_FBF_10BIT_YCBCR_422PL2
10-Bit 4:2:2 2-Plane YCbCr
Definition: ntv2enums.h:243
HD_YCBCRLINEPITCH_720_HDV
#define HD_YCBCRLINEPITCH_720_HDV
Definition: ntv2videodefines.h:100
RGB48LINEPITCH_525
#define RGB48LINEPITCH_525
Definition: ntv2videodefines.h:111
NTV2StringList
std::vector< std::string > NTV2StringList
Definition: ntv2utils.h:1143
AsConstUBytePtr
#define AsConstUBytePtr(_x_)
Definition: ntv2formatdescriptor.cpp:24
NTV2VANCMode
NTV2VANCMode
These enum values identify the available VANC modes.
Definition: ntv2enums.h:3750
NTV2FormatDescriptor::GetTotalRasterBytes
ULWord GetTotalRasterBytes(const UWord inPlaneIndex0=0) const
Definition: ntv2formatdescriptor.h:120
LineNumbersF2
static const ULWord LineNumbersF2[]
Definition: ntv2formatdescriptor.cpp:1160
AJA_NULL
#define AJA_NULL
Definition: ajatypes.h:199
NTV2RasterLineOffsets
std::vector< ULWord > NTV2RasterLineOffsets
An ordered sequence of zero-based line offsets into a frame buffer.
Definition: ntv2formatdescriptor.h:23
RGB48LINEPITCH_4096
#define RGB48LINEPITCH_4096
Definition: ntv2videodefines.h:117
NTV2_VANCMODE_INVALID
@ NTV2_VANCMODE_INVALID
This identifies the invalid (unspecified, uninitialized) VANC mode.
Definition: ntv2enums.h:3755
NTV2FormatDescriptor::PlaneToString
std::string PlaneToString(const UWord inPlaneIndex0) const
Definition: ntv2formatdescriptor.cpp:920
HD_YCBCRLINEPITCH_1080_HDV
#define HD_YCBCRLINEPITCH_1080_HDV
Definition: ntv2videodefines.h:101
NTV2FormatDescriptor::GetChangedLines
bool GetChangedLines(NTV2RasterLineOffsets &outDiffs, const void *pInBuffer1, const void *pInBuffer2, const ULWord inMaxLines=0) const
Compares two buffers line-by-line (using my description of the buffer contents).
Definition: ntv2formatdescriptor.cpp:1082
HD_NUMCOMPONENTPIXELS_720_HDV
#define HD_NUMCOMPONENTPIXELS_720_HDV
Definition: ntv2videodefines.h:82
NTV2FormatDescriptor::firstActiveLine
ULWord firstActiveLine
First active line of video (0 if NTV2_VANCMODE_OFF)
Definition: ntv2formatdescriptor.h:357
NTV2Buffer::GetHostAddress
void * GetHostAddress(const ULWord inByteOffset, const bool inFromEnd=false) const
Definition: ntv2publicinterface.cpp:1703
RGB12PLINEPITCH_625
#define RGB12PLINEPITCH_625
Definition: ntv2videodefines.h:122
NTV2SegmentedXferInfo::setElementLength
NTV2SegmentedXferInfo & setElementLength(const ULWord inBytesPerElement)
Sets my element length.
Definition: ntv2publicinterface.h:5941
RGB48LINEPITCH_625
#define RGB48LINEPITCH_625
Definition: ntv2videodefines.h:112
ntv2formatdescriptor.h
Declares the NTV2FormatDescriptor class.
NTV2_FORMAT_UNKNOWN
@ NTV2_FORMAT_UNKNOWN
Definition: ntv2enums.h:521
gPlaneLabels
static const string gPlaneLabels[NTV2_FBF_NUMFRAMEBUFFERFORMATS][4]
Definition: ntv2formatdescriptor.cpp:28
NTV2_STANDARD_2K
@ NTV2_STANDARD_2K
Definition: ntv2enums.h:163
NTV2_VANCMODE_TALLER
@ NTV2_VANCMODE_TALLER
This identifies the mode in which there are some + extra VANC lines in the frame buffer.
Definition: ntv2enums.h:3754
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5606
RGB48LINEPITCH_720
#define RGB48LINEPITCH_720
Definition: ntv2videodefines.h:113
UByte
uint8_t UByte
Definition: ajatypes.h:250
NTV2FormatDescriptor::GetWriteableRowAddress
void * GetWriteableRowAddress(void *pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const
Definition: ntv2formatdescriptor.cpp:1022
NTV2_STANDARD_525
@ NTV2_STANDARD_525
Identifies SMPTE SD 525i.
Definition: ntv2enums.h:160
NTV2FormatDescriptor::Print
std::ostream & Print(std::ostream &inOutStream, const bool inDetailed=true) const
Writes a human-readable description of me into the given output stream.
Definition: ntv2formatdescriptor.cpp:1112
RGB24LINEPITCH_7680
#define RGB24LINEPITCH_7680
Definition: ntv2videodefines.h:108
NTV2FrameBufferFormatToString
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6983
gBitsPerComponent
static const uint8_t gBitsPerComponent[NTV2_FBF_NUMFRAMEBUFFERFORMATS][3]
Definition: ntv2formatdescriptor.cpp:65
HD_YCBCRLINEPITCH_720_DVCPRO
#define HD_YCBCRLINEPITCH_720_DVCPRO
Definition: ntv2videodefines.h:94
YCBCRLINEPITCH_SD
#define YCBCRLINEPITCH_SD
Definition: ntv2videodefines.h:48
std
Definition: json.hpp:5362
NTV2_FBF_10BIT_YCBCR_422PL3_LE
@ NTV2_FBF_10BIT_YCBCR_422PL3_LE
See 3-Plane 10-Bit YCbCr 4:2:2 ('I422_10LE' a.k.a. 'YUV-P-L10').
Definition: ntv2enums.h:241
RGB48LINEPITCH_1080
#define RGB48LINEPITCH_1080
Definition: ntv2videodefines.h:114
NTV2_STANDARD_2Kx1080i
@ NTV2_STANDARD_2Kx1080i
Identifies SMPTE HD 2K1080psf.
Definition: ntv2enums.h:165
NTV2_IS_VALID_FIELD
#define NTV2_IS_VALID_FIELD(__x__)
Definition: ntv2enums.h:1822
RGB24LINEPITCH_4096
#define RGB24LINEPITCH_4096
Definition: ntv2videodefines.h:107
NTV2VideoFormat
enum _NTV2VideoFormat NTV2VideoFormat
Identifies a particular video format.
NTV2_FBF_8BIT_YCBCR_420PL3
@ NTV2_FBF_8BIT_YCBCR_420PL3
See 3-Plane 8-Bit YCbCr 4:2:0 ('I420' a.k.a. 'YUV-P420').
Definition: ntv2enums.h:224
HD_NUMCOMPONENTPIXELS_1080
#define HD_NUMCOMPONENTPIXELS_1080
Definition: videoutilities.h:17
GetGeometryFromStandard
NTV2FrameGeometry GetGeometryFromStandard(const NTV2Standard inStandard)
Definition: ntv2utils.cpp:3967
NTV2_STANDARD_720
@ NTV2_STANDARD_720
Identifies SMPTE HD 720p.
Definition: ntv2enums.h:159
NTV2PrintRasterLineOffsets
ostream & NTV2PrintRasterLineOffsets(const NTV2RasterLineOffsets &inObj, ostream &inOutStream)
Definition: ntv2formatdescriptor.cpp:1312
NTV2FormatDescriptor::RasterLineToByteOffset
ULWord RasterLineToByteOffset(const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const
Definition: ntv2formatdescriptor.cpp:1040
HD_NUMCOMPONENTPIXELS_720
#define HD_NUMCOMPONENTPIXELS_720
Definition: ntv2videodefines.h:67
NTV2_FBF_8BIT_YCBCR_422PL2
@ NTV2_FBF_8BIT_YCBCR_422PL2
8-Bit 4:2:2 2-Plane YCbCr
Definition: ntv2enums.h:245
HD_YCBCRLINEPITCH_3840
#define HD_YCBCRLINEPITCH_3840
Definition: ntv2videodefines.h:89
NTV2FormatDescriptor::MakeInvalid
void MakeInvalid(void)
Resets me into an invalid (NULL) state.
Definition: ntv2formatdescriptor.cpp:839
NTV2StringListConstIter
NTV2StringList::const_iterator NTV2StringListConstIter
Definition: ntv2utils.h:1145
LineNumbersF2t
static const ULWord LineNumbersF2t[]
Definition: ntv2formatdescriptor.cpp:1163
LineNumbersF2tt
static const ULWord LineNumbersF2tt[]
Definition: ntv2formatdescriptor.cpp:1166
formatDescriptorTable
const static NTV2FormatDescriptor formatDescriptorTable[NTV2_NUM_STANDARDS][NTV2_FBF_NUMFRAMEBUFFERFORMATS]
Definition: ntv2formatdescriptor.cpp:102
RGB12PLINEPITCH_2048
#define RGB12PLINEPITCH_2048
Definition: ntv2videodefines.h:125
GetNTV2StandardFromVideoFormat
NTV2Standard GetNTV2StandardFromVideoFormat(const NTV2VideoFormat inVideoFormat)
Definition: ntv2utils.cpp:2277
NTV2_FBF_8BIT_YCBCR_422PL3
@ NTV2_FBF_8BIT_YCBCR_422PL3
See 3-Plane 8-Bit YCbCr 4:2:2 (Weitek 'Y42B' a.k.a. 'YUV-P8').
Definition: ntv2enums.h:237
HD_YCBCRLINEPITCH_4K
#define HD_YCBCRLINEPITCH_4K
Definition: ntv2videodefines.h:90
HD_NUMCOMPONENTPIXELS_4K
#define HD_NUMCOMPONENTPIXELS_4K
Definition: ntv2videodefines.h:72
NTV2FormatDescriptor::ByteOffsetToRasterLine
UWord ByteOffsetToRasterLine(const ULWord inByteOffset) const
Definition: ntv2formatdescriptor.cpp:946
NTV2_IS_VALID_FRAME_BUFFER_FORMAT
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
Definition: ntv2enums.h:254
RGB12PLINEPITCH_720
#define RGB12PLINEPITCH_720
Definition: ntv2videodefines.h:123
xHEX0N
#define xHEX0N(__x__, __n__)
Definition: ntv2publicinterface.h:5605
NTV2FormatDescriptor::NTV2FormatDescriptor
NTV2FormatDescriptor()
My default constructor initializes me in an "invalid" state.
Definition: ntv2formatdescriptor.cpp:812
NTV2SmpteLineNumber::firstFieldTop
bool firstFieldTop
True if the first field on the wire is the top-most field in the raster (field dominance)
Definition: ntv2utils.h:881
HD_NUMCOMPONENTPIXELS_1080_HDV
#define HD_NUMCOMPONENTPIXELS_1080_HDV
Definition: ntv2videodefines.h:83
NTV2_IS_VALID_VANCMODE
#define NTV2_IS_VALID_VANCMODE(__v__)
Definition: ntv2enums.h:3758
NUMCOMPONENTPIXELS
#define NUMCOMPONENTPIXELS
Definition: ntv2videodefines.h:47
FD_YCBCRLINEPITCH_8K
#define FD_YCBCRLINEPITCH_8K
Definition: ntv2videodefines.h:92
RGB24LINEPITCH_1080
#define RGB24LINEPITCH_1080
Definition: ntv2videodefines.h:104
NTV2RasterLineOffsetsConstIter
NTV2RasterLineOffsets::const_iterator NTV2RasterLineOffsetsConstIter
A handy const iterator into an NTV2RasterLineOffsets.
Definition: ntv2formatdescriptor.h:24
NTV2FormatDescriptor::GetVisibleRasterDimensions
NTV2FrameDimensions GetVisibleRasterDimensions(void) const
Definition: ntv2formatdescriptor.cpp:1267
NTV2FormatDescriptor::GetFullRasterHeight
ULWord GetFullRasterHeight(void) const
Definition: ntv2formatdescriptor.h:181
NTV2FormatDescriptor::IsValid
bool IsValid(void) const
Definition: ntv2formatdescriptor.h:100
RGB24LINEPITCH_525
#define RGB24LINEPITCH_525
Definition: ntv2videodefines.h:51
NTV2FormatDescriptor::GetSMPTELineNumber
bool GetSMPTELineNumber(const ULWord inLineOffset, ULWord &outSMPTELine, bool &outIsField2) const
Answers with the equivalent SMPTE line number for the given line offset into the frame buffer I descr...
Definition: ntv2formatdescriptor.cpp:1172
HD_NUMACTIVELINES_1080
#define HD_NUMACTIVELINES_1080
Definition: ntv2videodefines.h:57
NTV2_IS_VALID_VIDEO_FORMAT
#define NTV2_IS_VALID_VIDEO_FORMAT(__f__)
Definition: ntv2enums.h:711
RGB24LINEPITCH_2048
#define RGB24LINEPITCH_2048
Definition: ntv2videodefines.h:105
NTV2_IS_PROGRESSIVE_STANDARD
#define NTV2_IS_PROGRESSIVE_STANDARD(__s__)
Definition: ntv2enums.h:180
NTV2FormatDescriptor::ByteOffsetToPlane
UWord ByteOffsetToPlane(const ULWord inByteOffset) const
Definition: ntv2formatdescriptor.cpp:929
NTV2Buffer::Set
bool Set(const void *pInUserPointer, const size_t inByteCount)
Sets (or resets) me from a client-supplied address and size.
Definition: ntv2publicinterface.cpp:1631
LineNumbersF1t
static const ULWord LineNumbersF1t[]
Definition: ntv2formatdescriptor.cpp:1162