AJA NTV2 SDK  17.1.1.1245
NTV2 SDK 17.1.1.1245
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 inFirstActiveLine)
819  : numLines (inNumLines),
820  numPixels (inNumPixels),
821  linePitch (inLinePitch),
822  firstActiveLine (inFirstActiveLine),
823  mStandard (NTV2_STANDARD_INVALID),
824  mVideoFormat (NTV2_FORMAT_UNKNOWN),
825  mPixelFormat (NTV2_FBF_INVALID),
826  mVancMode (NTV2_VANCMODE_INVALID),
827  mNumPlanes (1),
828  mFrameGeometry (NTV2_FG_INVALID)
829 {
830  mLinePitch[0] = inLinePitch * 4; // mLinePitch is in bytes, inLinePitch is in 32-bit longwords
831  mLinePitch[1] = mLinePitch[2] = mLinePitch[3] = 0;
832 }
833 
834 
836 {
837  numLines = 0;
838  numPixels = 0;
839  linePitch = 0;
840  firstActiveLine = 0;
841  mStandard = NTV2_STANDARD_INVALID;
842  mVideoFormat = NTV2_FORMAT_UNKNOWN;
843  mPixelFormat = NTV2_FBF_INVALID;
844  mVancMode = NTV2_VANCMODE_INVALID;
845  mLinePitch[0] = mLinePitch[1] = mLinePitch[2] = mLinePitch[3] = 0;
846  mNumPlanes = 0;
847  mFrameGeometry = NTV2_FG_INVALID;
848  mNumBitsLuma = mNumBitsChroma = mNumBitsAlpha = 0;
849 }
850 
852 {
853  ULWord bytes(0);
854  UWord plane(0);
855  do
856  {
857  bytes += GetTotalRasterBytes(plane);
858  } while (++plane < GetNumPlanes());
859  return bytes;
860 }
861 
863 {
864  static const ULWord s4K(0x00001000), s64K(0x00010000);
865  ULWord result(GetTotalBytes()), pageSizeBytes(inPageSizeBytes);
866  if (inPageSizeBytes != s4K)
867  { // Ensure power-of-2...
868  pageSizeBytes = s64K; // start at 64K
869  do
870  {
871  if (pageSizeBytes & inPageSizeBytes)
872  break; // exit at MSB
873  pageSizeBytes >>= 1;
874  } while (pageSizeBytes > s4K); // 4K minimum
875  }
876  if (result % pageSizeBytes)
877  result = ((result / pageSizeBytes) + 1) * pageSizeBytes;
878  return result;
879 }
880 
882 {
883  if (inPlaneIndex0 >= mNumPlanes)
884  return 0; // no such plane!
885  switch (mPixelFormat)
886  {
891  return inPlaneIndex0 ? 2 : 1;
892  default:
893  break;
894  }
895  return 1; // Defaults to 1
896 }
897 
899 {
900  if (NTV2_IS_VALID_VIDEO_FORMAT(mVideoFormat))
901  return NTV2_IS_2K_1080_VIDEO_FORMAT(mVideoFormat);
902  else if (NTV2_IS_VALID_STANDARD(mStandard))
903  return NTV2_IS_2K1080_STANDARD(mStandard);
904  return false;
905 }
906 
907 
909 {
910  return numLines == inRHS.numLines && numPixels == inRHS.numPixels
911  && mNumPlanes == inRHS.mNumPlanes && firstActiveLine == inRHS.firstActiveLine
912  && mLinePitch[0] == inRHS.mLinePitch[0];
913 }
914 
915 
916 string NTV2FormatDescriptor::PlaneToString (const UWord inPlaneIndex0) const
917 {
918  static string emptyString;
919  if (NTV2_IS_VALID_FRAME_BUFFER_FORMAT(mPixelFormat) && inPlaneIndex0 < GetNumPlanes())
920  return gPlaneLabels[mPixelFormat][inPlaneIndex0];
921  return emptyString;
922 }
923 
924 
926 {
927  if (!IsPlanar())
928  return inByteOffset < GetTotalRasterBytes() ? 0 : 0xFFFF;
929 
930  ULWord byteOffset (0);
931  UWord plane (0);
932  do
933  {
934  byteOffset += GetTotalRasterBytes(plane);
935  if (inByteOffset < byteOffset)
936  return plane;
937  } while (++plane < GetNumPlanes());
938  return 0xFFFF;
939 }
940 
941 
943 {
944  const UWord origPlane (ByteOffsetToPlane(inByteOffset));
945  if (origPlane == 0xFFFF)
946  return 0xFFFF;
947  ULWord byteOffsetToStartOfPlane (0);
948  UWord plane (origPlane);
949  while (plane)
950  byteOffsetToStartOfPlane += GetTotalRasterBytes(--plane);
951  NTV2_ASSERT(inByteOffset >= byteOffsetToStartOfPlane);
952  const ULWord lineOffset ((inByteOffset - byteOffsetToStartOfPlane) / GetBytesPerRow(origPlane));
953  return UWord(lineOffset);
954 }
955 
956 
958 {
959  if (!IsValid())
960  return false;
961  UWord plane (ByteOffsetToPlane(inByteOffset));
962  if (plane >= GetNumPlanes())
963  return false;
964  if (plane > 0)
965  inByteOffset -= GetTotalRasterBytes(0);
966  if (plane > 1)
967  inByteOffset -= GetTotalRasterBytes(1);
968  return (inByteOffset % GetBytesPerRow(plane)) == 0;
969 }
970 
971 bool NTV2FormatDescriptor::GetRowBuffer (const NTV2Buffer & inFrameBuffer, NTV2Buffer & inOutRowBuffer, const ULWord inRowIndex0, const UWord inPlaneIndex0) const
972 {
973  inOutRowBuffer.Deallocate();
974  if (inRowIndex0 >= numLines)
975  return false; // Bad row index
976  if (inPlaneIndex0 >= mNumPlanes)
977  return false; // Bad plane index
978  if (inFrameBuffer.IsNULL())
979  return false; // NULL/empty frame buffer
980 
981  ULWord byteOffset(0); // Set byteOffset to start of desired plane
982  if (inPlaneIndex0 > 0)
983  byteOffset += GetTotalRasterBytes(0);
984  if (inPlaneIndex0 > 1)
985  byteOffset += GetTotalRasterBytes(1);
986  if (inPlaneIndex0 > 2)
987  byteOffset += GetTotalRasterBytes(2);
988 
989  ULWord bytesPerRow(GetBytesPerRow(inPlaneIndex0));
990  byteOffset += inRowIndex0 * bytesPerRow; // Add offset to start of requested line
991  if (byteOffset+bytesPerRow > inFrameBuffer.GetByteCount())
992  return false; // Past end of frame buffer
993 
994  return inOutRowBuffer.Set(inFrameBuffer.GetHostAddress(byteOffset), bytesPerRow);
995 }
996 
997 const void * NTV2FormatDescriptor::GetRowAddress (const void * pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0) const
998 {
999  if (inRowIndex0 >= numLines)
1000  return AJA_NULL;
1001  if (inPlaneIndex0 >= mNumPlanes)
1002  return AJA_NULL;
1003  if (!pInStartAddress)
1004  return AJA_NULL;
1005 
1006  const UByte * pStart (AsConstUBytePtr(pInStartAddress));
1007  NTV2_ASSERT(pStart);
1008  if (inPlaneIndex0 > 0)
1009  pStart += GetTotalRasterBytes(0);
1010  if (inPlaneIndex0 > 1)
1011  pStart += GetTotalRasterBytes(1);
1012  if (inPlaneIndex0 > 2)
1013  pStart += GetTotalRasterBytes(2);
1014  return pStart + inRowIndex0 * GetBytesPerRow(inPlaneIndex0);
1015 }
1016 
1017 
1018 void * NTV2FormatDescriptor::GetWriteableRowAddress (void * pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0) const
1019 {
1020  if (inRowIndex0 >= numLines)
1021  return AJA_NULL;
1022  if (inPlaneIndex0 >= mNumPlanes)
1023  return AJA_NULL;
1024 
1025  UByte * pStart (AsUBytePtr(pInStartAddress));
1026  if (inPlaneIndex0 > 0)
1027  pStart += GetTotalRasterBytes(0);
1028  if (inPlaneIndex0 > 1)
1029  pStart += GetTotalRasterBytes(1);
1030  if (inPlaneIndex0 > 2)
1031  pStart += GetTotalRasterBytes(2);
1032  return pStart + inRowIndex0 * GetBytesPerRow(inPlaneIndex0);
1033 }
1034 
1035 
1036 ULWord NTV2FormatDescriptor::RasterLineToByteOffset (const ULWord inRowIndex0, const UWord inPlaneIndex0) const
1037 {
1038  if (inRowIndex0 >= numLines)
1039  return 0xFFFFFFFF;
1040  if (inPlaneIndex0 >= mNumPlanes)
1041  return 0xFFFFFFFF;
1042 
1043  ULWord offset (0);
1044  if (inPlaneIndex0 > 0)
1045  offset += GetTotalRasterBytes(0);
1046  if (inPlaneIndex0 > 1)
1047  offset += GetTotalRasterBytes(1);
1048  if (inPlaneIndex0 > 2)
1049  offset += GetTotalRasterBytes(2);
1050  return offset + inRowIndex0 * GetBytesPerRow(inPlaneIndex0);
1051 }
1052 
1053 
1054 bool NTV2FormatDescriptor::GetFirstChangedRow (const void * pInStartAddress1, const void * pInStartAddress2, ULWord & outFirstChangedRowNum) const
1055 {
1056  outFirstChangedRowNum = 0xFFFFFFFF;
1057  if (!pInStartAddress1)
1058  return false; // NULL start address 1
1059  if (!pInStartAddress2)
1060  return false; // NULL start address 2
1061  if (pInStartAddress1 == pInStartAddress2)
1062  return false; // same start addresses
1063  if (!IsValid())
1064  return false; // invalid
1065 
1066  UWord plane (0);
1067  do
1068  {
1069  for (outFirstChangedRowNum = 0; outFirstChangedRowNum < GetFullRasterHeight(); outFirstChangedRowNum++)
1070  if (::memcmp(GetRowAddress(AsConstUBytePtr(pInStartAddress1), outFirstChangedRowNum, plane), GetRowAddress(pInStartAddress2, outFirstChangedRowNum, plane), GetBytesPerRow(plane)))
1071  return true; // CHANGE FOUND -- Success!
1072  } while (++plane < GetNumPlanes());
1073  outFirstChangedRowNum = 0xFFFFFFFF; // NO CHANGES FOUND
1074  return true; // Success
1075 }
1076 
1077 
1078 bool NTV2FormatDescriptor::GetChangedLines (NTV2RasterLineOffsets & outDiffs, const void * pInBuffer1, const void * pInBuffer2, const ULWord inMaxLines) const
1079 {
1080  outDiffs.clear ();
1081  if (!IsValid())
1082  return false; // Invalid format descriptor
1083  if (!pInBuffer1 || !pInBuffer2)
1084  return false; // NULL or empty buffers
1085 
1086  const UByte * pStartAddress1 (AsConstUBytePtr(pInBuffer1));
1087  const UByte * pStartAddress2 (AsConstUBytePtr(pInBuffer2));
1088 
1089  if (!GetRowAddress (pStartAddress1, GetFullRasterHeight() - 1))
1090  return false; // buffer too small to fetch given rowOffset
1091  if (pInBuffer1 == pInBuffer2)
1092  return true; // Same buffer -- no diffs (success!)
1093  ULWord maxLines (inMaxLines ? inMaxLines : GetFullRasterHeight());
1094  if (maxLines > GetFullRasterHeight())
1095  maxLines = GetFullRasterHeight(); // Clamp maxLines to full raster height
1096 
1097  UWord plane (0);
1098  do
1099  {
1100  for (ULWord rowOffset(0); rowOffset < maxLines; rowOffset++)
1101  if (::memcmp(GetRowAddress(pStartAddress1, rowOffset, plane), GetRowAddress(pStartAddress2, rowOffset, plane), GetBytesPerRow(plane)))
1102  outDiffs.push_back(rowOffset);
1103  } while (++plane < GetNumPlanes());
1104  return true;
1105 }
1106 
1107 
1108 ostream & NTV2FormatDescriptor::Print (ostream & oss, const bool inDetailed) const
1109 {
1110  UWord plane (0);
1111  if (!IsValid ())
1112  oss << "INVALID: ";
1113  oss << "lines=" << DEC(GetFullRasterHeight())
1114  << " px/line=" << DEC(GetRasterWidth());
1115  do
1116  {
1117  if (IsPlanar())
1118  oss << " PL" << plane << ":";
1119  oss << " bytes/line=" << DEC(GetBytesPerRow(plane));
1120  } while (++plane < GetNumPlanes());
1121  if (firstActiveLine)
1122  oss << " 1stAct=" << DEC(firstActiveLine);
1123  if (inDetailed)
1124  {
1125  plane = 0;
1126  if (IsPlanar())
1127  do
1128  {
1129  oss << " PL" << plane << " bytes=" << xHEX0N(GetTotalRasterBytes(plane),8);
1130  } while (++plane < GetNumPlanes());
1131  else
1132  oss << " bytes=" << xHEX0N(GetTotalRasterBytes(),8);
1133  if (NTV2_IS_VALID_VIDEO_FORMAT(mVideoFormat))
1134  oss << " " << ::NTV2VideoFormatToString(mVideoFormat);
1135  else
1136  oss << " " << ::NTV2StandardToString(mStandard) << (Is2KFormat() ? " 2K" : "");
1137  if (NTV2_IS_VANCMODE_ON(mVancMode))
1138  oss << (NTV2_IS_VANCMODE_TALLER(mVancMode) ? " TallerVANC" : " TallVANC");
1139  if (NTV2_IS_VALID_FRAME_BUFFER_FORMAT(mPixelFormat))
1140  oss << " " << ::NTV2FrameBufferFormatToString(mPixelFormat);
1141  if (IsRGB())
1142  oss << " bitsC" << DEC(UWord(GetNumBitsChroma()));
1143  else
1144  oss << " bitsY" << DEC(UWord(GetNumBitsLuma()));
1145  if (HasAlpha())
1146  oss << "A" << DEC(UWord(GetNumBitsAlpha()));
1147  }
1148  return oss;
1149 }
1150 
1151 
1152 // SMPTE LINE NUMBERS:
1153 
1154 // NTV2_VANCMODE_OFF 1080i 720p 525i 625i 1080p 2K 2K1080p 2K1080i 3840x2160p 4096x2160p 3840HFR 4096HFR 7680x4320 8192x4320
1155 static const ULWord LineNumbersF1 [] = { 21, 26, 21, 23, 42, 211, 42, 21, 42, 42, 42, 42, 42, 42, 0 };
1156 static const ULWord LineNumbersF2 [] = { 584, 27, 283, 336, 43, 1201, 43, 584, 43, 43, 43, 43, 43, 43, 0 };
1157 // NTV2_VANCMODE_TALL
1158 static const ULWord LineNumbersF1t [] = { 5, 6, 10, 12, 10, 211, 10, 5, 10, 10, 10, 10, 10, 10, 0 };
1159 static const ULWord LineNumbersF2t [] = { 568, 7, 272, 325, 11, 1201, 11, 568, 11, 11, 11, 11, 11, 11, 0 };
1160 // NTV2_VANCMODE_TALLER
1161 static const ULWord LineNumbersF1tt [] = { 4, 6, 7, 5, 8, 211, 8, 4, 8, 8, 8, 8, 8, 8, 0 };
1162 static const ULWord LineNumbersF2tt [] = { 567, 7, 269, 318, 9, 1201, 9, 567, 9, 9, 9, 9, 9, 9, 0 };
1163 
1164 static const ULWord LineNumbersF1Last[] = { 560, 745, 263, 310, 1121, 0, 1121, 0, 2201, 2201, 2201, 2201, 4361, 4361, 0 };
1165 static const ULWord LineNumbersF2Last[] = { 1123, 745, 525, 623, 1121, 0, 1121, 0, 0, 0, 0, 0, 0, 0, 0 };
1166 
1167 
1168 bool NTV2FormatDescriptor::GetSMPTELineNumber (const ULWord inLineOffset, ULWord & outSMPTELine, bool & outIsField2) const
1169 {
1170  outIsField2 = false;
1171  outSMPTELine = 0;
1172  if (!IsValid())
1173  return false;
1174  if (!NTV2_IS_VALID_STANDARD(mStandard))
1175  return false;
1176  if (!NTV2_IS_VALID_VANCMODE(mVancMode))
1177  return false;
1178  if (inLineOffset >= GetFullRasterHeight())
1179  return false;
1180 
1181  const bool is525i (mStandard == NTV2_STANDARD_525);
1182  if (!NTV2_IS_PROGRESSIVE_STANDARD(mStandard))
1183  outIsField2 = (inLineOffset & 1) ? !is525i : is525i;
1184 
1185  const ULWord divisor (NTV2_IS_PROGRESSIVE_STANDARD(mStandard) ? 1 : 2);
1186  ULWord smpteLine (0);
1187 
1188  switch (mVancMode)
1189  {
1190  case NTV2_VANCMODE_OFF: smpteLine = outIsField2 ? LineNumbersF2[mStandard] : LineNumbersF1[mStandard]; break;
1191  case NTV2_VANCMODE_TALL: smpteLine = outIsField2 ? LineNumbersF2t[mStandard] : LineNumbersF1t[mStandard]; break;
1192  case NTV2_VANCMODE_TALLER: smpteLine = outIsField2 ? LineNumbersF2tt[mStandard] : LineNumbersF1tt[mStandard]; break;
1193  default: break;
1194  }
1195  outSMPTELine = inLineOffset/divisor + smpteLine;
1196  return true;
1197 }
1198 
1199 
1200 bool NTV2FormatDescriptor::GetLineOffsetFromSMPTELine (const ULWord inSMPTELine, ULWord & outLineOffset) const
1201 {
1202  outLineOffset = 0xFFFFFFFF;
1203  if (!IsValid())
1204  return false;
1205  if (!NTV2_IS_VALID_STANDARD(mStandard))
1206  return false;
1207  if (!NTV2_IS_VALID_VANCMODE(mVancMode))
1208  return false;
1209 
1210  ULWord firstF1Line(0), firstF2Line(0);
1211  const ULWord lastF1Line (LineNumbersF1Last[mStandard]);
1212  const ULWord lastF2Line (LineNumbersF2Last[mStandard]);
1213  const ULWord is525i (mStandard == NTV2_STANDARD_525 ? 1 : 0);
1214  const ULWord not525i (mStandard != NTV2_STANDARD_525 ? 1 : 0);
1215 
1216  switch (mVancMode)
1217  {
1218  case NTV2_VANCMODE_OFF: firstF1Line = LineNumbersF1[mStandard]; firstF2Line = LineNumbersF2[mStandard]; break;
1219  case NTV2_VANCMODE_TALL: firstF1Line = LineNumbersF1t[mStandard]; firstF2Line = LineNumbersF2t[mStandard]; break;
1220  case NTV2_VANCMODE_TALLER: firstF1Line = LineNumbersF1tt[mStandard]; firstF2Line = LineNumbersF2tt[mStandard]; break;
1221  case NTV2_VANCMODE_INVALID: return false;
1222  }
1223  if (inSMPTELine < firstF1Line)
1224  return false; // Above first line in FB raster
1225  if (NTV2_IS_PROGRESSIVE_STANDARD(mStandard) && lastF1Line && inSMPTELine > lastF1Line)
1226  return false; // Past last line
1227  if (!NTV2_IS_PROGRESSIVE_STANDARD(mStandard) && lastF1Line && inSMPTELine < firstF2Line && inSMPTELine > lastF1Line)
1228  return false; // In the void past end of F1 and above F2 first line
1229  if (!NTV2_IS_PROGRESSIVE_STANDARD(mStandard) && lastF2Line && inSMPTELine > lastF2Line)
1230  return false; // Past last line
1231 
1232  if (NTV2_IS_PROGRESSIVE_STANDARD(mStandard))
1233  outLineOffset = inSMPTELine - firstF1Line;
1234  else if (inSMPTELine >= firstF2Line)
1235  outLineOffset = (inSMPTELine - firstF2Line) * 2 + not525i;
1236  else
1237  outLineOffset = (inSMPTELine - firstF1Line) * 2 + is525i;
1238  return outLineOffset < GetFullRasterHeight();
1239 }
1240 
1241 
1242 ostream & NTV2FormatDescriptor::PrintSMPTELineNumber (ostream & inOutStream, const ULWord inLineOffset, const bool inForTextMode) const
1243 {
1244  ULWord smpteLine (0);
1245  bool isF2 (false);
1246  if (GetSMPTELineNumber (inLineOffset, smpteLine, isF2))
1247  {
1248  if (!NTV2_IS_PROGRESSIVE_STANDARD (mStandard))
1249  inOutStream << "F" << (isF2 ? "2" : "1") << (inForTextMode ? "" : " ");
1250  if (inForTextMode)
1251  inOutStream << "L" << DEC0N(smpteLine,4);
1252  else
1253  inOutStream << "L" << DEC(smpteLine); // (inLineOffset/divisor + smpteLine);
1254  }
1255  return inOutStream;
1256 }
1257 
1259 {
1260  return NTV2FrameDimensions (GetRasterWidth(), GetRasterHeight(false));
1261 }
1262 
1264 {
1265  return NTV2FrameDimensions (GetRasterWidth(), GetRasterHeight(true));
1266 }
1267 
1268 
1270 {
1271  if (IsValid())
1272  { // Full visible raster
1274  if (inIsSource)
1275  return inSegmentInfo.setSourceOffset(GetBytesPerRow() * GetFirstActiveLine())
1277  else
1278  return inSegmentInfo.setDestOffset(GetBytesPerRow() * GetFirstActiveLine())
1280  }
1281  inSegmentInfo = NTV2SegmentedXferInfo();
1282  return inSegmentInfo;
1283 }
1284 
1285 
1286 // Q: WHY IS NTV2SmpteLineNumber's CONSTRUCTOR & GetLastLine IMPLEMENTATION HERE?
1287 // A: TO USE THE SAME LineNumbersF1/LineNumbersF2 TABLES (above)
1288 
1290 {
1291  NTV2_ASSERT (inStandard < sizeof(LineNumbersF1) / sizeof(ULWord));
1292  *this = NTV2SmpteLineNumber (LineNumbersF1[inStandard], LineNumbersF2[inStandard], inStandard != NTV2_STANDARD_525, inStandard);
1293 }
1294 
1295 
1297 {
1298  if (!NTV2_IS_VALID_FIELD(inRasterFieldID))
1299  return 0;
1300 
1301  if (inRasterFieldID == NTV2_FIELD0)
1302  return firstFieldTop ? LineNumbersF1Last[mStandard] : LineNumbersF2Last[mStandard];
1303  else
1304  return firstFieldTop ? LineNumbersF2Last[mStandard] : LineNumbersF1Last[mStandard];
1305 }
1306 
1307 
1308 ostream & NTV2PrintRasterLineOffsets(const NTV2RasterLineOffsets & inObj, ostream & inOutStream)
1309 {
1310  NTV2StringList pieces;
1311  NTV2RasterLineOffsetsConstIter iter (inObj.begin());
1312  ULWord current (0xFFFFFFFF);
1313  ULWord previous (0xFFFFFFFF);
1314  ULWord first (0xFFFFFFFF);
1315  ULWord last (0xFFFFFFFF);
1316 
1317  #if 0
1318  // Verify sorted ascending...
1319  current = 0;
1320  while (iter != inObj.end())
1321  {
1322  NTV2_ASSERT (current < previous);
1323  previous = current;
1324  }
1325  iter = inObj.begin();
1326  #endif // _DEBUG
1327 
1328  while (iter != inObj.end())
1329  {
1330  current = *iter;
1331  if (previous == 0xFFFFFFFF)
1332  previous = first = last = current; // First time -- always start new sequence
1333  else if (current == (previous + 1))
1334  last = previous = current; // Continue sequence
1335  else if (current == previous)
1336  ;
1337  else
1338  {
1339  ostringstream oss;
1340  if (first == last)
1341  oss << first;
1342  else
1343  oss << first << "-" << last;
1344  pieces.push_back (oss.str ());
1345 
1346  first = last = previous = current; // Start new sequence...
1347  } // else sequence break
1348  ++iter;
1349  }
1350 
1351  if (first != 0xFFFFFFFF && last != 0xFFFFFFFF)
1352  {
1353  ostringstream oss;
1354  if (first == last)
1355  oss << first;
1356  else
1357  oss << first << "-" << last;
1358  pieces.push_back (oss.str ());
1359  }
1360 
1361  for (NTV2StringListConstIter it (pieces.begin()); ; )
1362  {
1363  inOutStream << *it;
1364  if (++it != pieces.end())
1365  inOutStream << ",";
1366  else
1367  break;
1368  }
1369  return inOutStream;
1370 }
LineNumbersF1Last
static const ULWord LineNumbersF1Last[]
Definition: ntv2formatdescriptor.cpp:1164
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:237
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:5903
NTV2FormatDescriptor::GetBytesPerRow
ULWord GetBytesPerRow(const UWord inPlaneIndex0=0) const
Definition: ntv2formatdescriptor.h:140
HD_NUMCOMPONENTPIXELS_2K
#define HD_NUMCOMPONENTPIXELS_2K
Definition: videoutilities.h:15
NTV2_FBF_NUMFRAMEBUFFERFORMATS
@ NTV2_FBF_NUMFRAMEBUFFERFORMATS
Definition: ntv2enums.h:244
NTV2_IS_VANCMODE_TALLER
#define NTV2_IS_VANCMODE_TALLER(__v__)
Definition: ntv2enums.h:3726
NTV2_NUM_STANDARDS
@ NTV2_NUM_STANDARDS
Definition: ntv2enums.h:171
NTV2_FBF_10BIT_YCBCR_420PL2
@ NTV2_FBF_10BIT_YCBCR_420PL2
10-Bit 4:2:0 2-Plane YCbCr
Definition: ntv2enums.h:239
NTV2SegmentedXferInfo::setSegmentCount
NTV2SegmentedXferInfo & setSegmentCount(const ULWord inNumSegments)
Sets my segment count.
Definition: ntv2publicinterface.h:5841
NTV2FormatDescriptor::GetVideoWriteSize
ULWord GetVideoWriteSize(ULWord inPageSize=4096UL) const
Definition: ntv2formatdescriptor.cpp:862
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:161
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:5866
NTV2FrameDimensions
Describes the horizontal and vertical size dimensions of a raster, bitmap, frame or image.
Definition: ntv2publicinterface.h:5658
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:255
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:997
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:1269
NTV2SegmentedXferInfo::setSourcePitch
NTV2SegmentedXferInfo & setSourcePitch(const ULWord inPitch)
Sets my source pitch.
Definition: ntv2publicinterface.h:5874
NTV2Buffer
A generic user-space buffer object that has an address and a length. Used most often to share an arbi...
Definition: ntv2publicinterface.h:5993
NTV2SmpteLineNumber::GetLastLine
ULWord GetLastLine(const NTV2FieldID inRasterFieldID=NTV2_FIELD0) const
Definition: ntv2formatdescriptor.cpp:1296
NTV2_IS_2K1080_STANDARD
#define NTV2_IS_2K1080_STANDARD(__s__)
Definition: ntv2enums.h:197
NTV2Buffer::GetByteCount
ULWord GetByteCount(void) const
Definition: ntv2publicinterface.h:6066
NTV2_STANDARD_INVALID
@ NTV2_STANDARD_INVALID
Definition: ntv2enums.h:173
NTV2_ASSERT
#define NTV2_ASSERT(_expr_)
Definition: ajatypes.h:506
NTV2FormatDescriptor::IsAtLineStart
bool IsAtLineStart(ULWord inByteOffset) const
Definition: ntv2formatdescriptor.cpp:957
NTV2_STANDARD_1080
@ NTV2_STANDARD_1080
Identifies SMPTE HD 1080i or 1080psf.
Definition: ntv2enums.h:155
NTV2_STANDARD_625
@ NTV2_STANDARD_625
Identifies SMPTE SD 625i.
Definition: ntv2enums.h:158
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:5849
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:361
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:1664
NTV2FormatDescriptor::linePitch
ULWord linePitch
Number of 32-bit words per line. Shadows mLinePitch[0] * sizeof(ULWord).
Definition: ntv2formatdescriptor.h:350
NTV2FormatDescriptor::Is2KFormat
bool Is2KFormat(void) const
Definition: ntv2formatdescriptor.cpp:898
DEC0N
#define DEC0N(__x__, __n__)
Definition: ntv2publicinterface.h:5607
NTV2FormatDescriptor::GetRasterHeight
ULWord GetRasterHeight(const bool inVisibleOnly=false) const
Definition: ntv2formatdescriptor.h:170
NTV2FieldID
NTV2FieldID
These values are used to identify fields for interlaced video. See Field/Frame Interrupts and CNTV2Ca...
Definition: ntv2enums.h:1785
NTV2_FBF_INVALID
@ NTV2_FBF_INVALID
Definition: ntv2enums.h:245
NTV2FrameBufferFormat
NTV2FrameBufferFormat
Identifies a particular video frame buffer format. See Device Frame Buffer Formats for details.
Definition: ntv2enums.h:207
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:971
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:726
NTV2SmpteLineNumber::NTV2SmpteLineNumber
NTV2SmpteLineNumber(const NTV2Standard inStandard=NTV2_STANDARD_INVALID)
Constructs me from a given NTV2Standard.
Definition: ntv2formatdescriptor.cpp:1289
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:1200
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:1787
LineNumbersF1
static const ULWord LineNumbersF1[]
Definition: ntv2formatdescriptor.cpp:1155
LineNumbersF2Last
static const ULWord LineNumbersF2Last[]
Definition: ntv2formatdescriptor.cpp:1165
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:5732
NTV2_FBF_8BIT_YCBCR_420PL2
@ NTV2_FBF_8BIT_YCBCR_420PL2
8-Bit 4:2:0 2-Plane YCbCr
Definition: ntv2enums.h:241
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:908
NTV2FormatDescriptor::numPixels
ULWord numPixels
Width – total number of pixels per line.
Definition: ntv2formatdescriptor.h:349
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:3719
NTV2Standard
NTV2Standard
Identifies a particular video standard.
Definition: ntv2enums.h:153
NTV2_VANCMODE_OFF
@ NTV2_VANCMODE_OFF
This identifies the mode in which there are no VANC lines in the frame buffer.
Definition: ntv2enums.h:3718
NTV2Buffer::IsNULL
bool IsNULL(void) const
Definition: ntv2publicinterface.h:6088
RGB48LINEPITCH_3840
#define RGB48LINEPITCH_3840
Definition: ntv2videodefines.h:116
ULWord
uint32_t ULWord
Definition: ajatypes.h:253
NUMACTIVELINES_525
#define NUMACTIVELINES_525
Definition: ntv2videodefines.h:41
NTV2FormatDescriptor::numLines
ULWord numLines
Height – total number of lines.
Definition: ntv2formatdescriptor.h:348
HD_NUMACTIVELINES_720
#define HD_NUMACTIVELINES_720
Definition: ntv2videodefines.h:56
NTV2FormatDescriptor::GetTotalBytes
ULWord GetTotalBytes(void) const
Definition: ntv2formatdescriptor.cpp:851
AJA_FD_NOTSUPPORTED
#define AJA_FD_NOTSUPPORTED
Definition: ntv2formatdescriptor.cpp:21
NTV2_IS_VALID_STANDARD
#define NTV2_IS_VALID_STANDARD(__s__)
Definition: ntv2enums.h:176
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:881
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:1161
RGB12PLINEPITCH_1080
#define RGB12PLINEPITCH_1080
Definition: ntv2videodefines.h:124
NTV2StandardToString
std::string NTV2StandardToString(const NTV2Standard inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6914
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:1054
NTV2FormatDescriptor::GetFirstActiveLine
ULWord GetFirstActiveLine(void) const
Definition: ntv2formatdescriptor.h:180
NTV2_STANDARD_1080p
@ NTV2_STANDARD_1080p
Identifies SMPTE HD 1080p.
Definition: ntv2enums.h:159
UWord
uint16_t UWord
Definition: ajatypes.h:251
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:1242
NTV2SegmentedXferInfo::setDestPitch
NTV2SegmentedXferInfo & setDestPitch(const ULWord inPitch)
Sets my destination pitch.
Definition: ntv2publicinterface.h:5910
NTV2_IS_VANCMODE_ON
#define NTV2_IS_VANCMODE_ON(__v__)
Definition: ntv2enums.h:3727
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:6750
NTV2FormatDescriptor::GetFullRasterDimensions
NTV2FrameDimensions GetFullRasterDimensions(void) const
Definition: ntv2formatdescriptor.cpp:1258
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:240
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:1134
AsConstUBytePtr
#define AsConstUBytePtr(_x_)
Definition: ntv2formatdescriptor.cpp:24
NTV2VANCMode
NTV2VANCMode
These enum values identify the available VANC modes.
Definition: ntv2enums.h:3716
NTV2FormatDescriptor::GetTotalRasterBytes
ULWord GetTotalRasterBytes(const UWord inPlaneIndex0=0) const
Definition: ntv2formatdescriptor.h:114
LineNumbersF2
static const ULWord LineNumbersF2[]
Definition: ntv2formatdescriptor.cpp:1156
AJA_NULL
#define AJA_NULL
Definition: ajatypes.h:197
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:3721
NTV2FormatDescriptor::PlaneToString
std::string PlaneToString(const UWord inPlaneIndex0) const
Definition: ntv2formatdescriptor.cpp:916
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:1078
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:351
NTV2Buffer::GetHostAddress
void * GetHostAddress(const ULWord inByteOffset, const bool inFromEnd=false) const
Definition: ntv2publicinterface.cpp:1686
RGB12PLINEPITCH_625
#define RGB12PLINEPITCH_625
Definition: ntv2videodefines.h:122
NTV2SegmentedXferInfo::setElementLength
NTV2SegmentedXferInfo & setElementLength(const ULWord inBytesPerElement)
Sets my element length.
Definition: ntv2publicinterface.h:5925
RGB48LINEPITCH_625
#define RGB48LINEPITCH_625
Definition: ntv2videodefines.h:112
ntv2formatdescriptor.h
Declares the NTV2FormatDescriptor class.
NTV2_FORMAT_UNKNOWN
@ NTV2_FORMAT_UNKNOWN
Definition: ntv2enums.h:498
gPlaneLabels
static const string gPlaneLabels[NTV2_FBF_NUMFRAMEBUFFERFORMATS][4]
Definition: ntv2formatdescriptor.cpp:28
NTV2_STANDARD_2K
@ NTV2_STANDARD_2K
Definition: ntv2enums.h:160
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:3720
DEC
#define DEC(__x__)
Definition: ntv2publicinterface.h:5605
RGB48LINEPITCH_720
#define RGB48LINEPITCH_720
Definition: ntv2videodefines.h:113
UByte
uint8_t UByte
Definition: ajatypes.h:248
NTV2FormatDescriptor::GetWriteableRowAddress
void * GetWriteableRowAddress(void *pInStartAddress, const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const
Definition: ntv2formatdescriptor.cpp:1018
NTV2_STANDARD_525
@ NTV2_STANDARD_525
Identifies SMPTE SD 525i.
Definition: ntv2enums.h:157
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:1108
RGB24LINEPITCH_7680
#define RGB24LINEPITCH_7680
Definition: ntv2videodefines.h:108
NTV2FrameBufferFormatToString
std::string NTV2FrameBufferFormatToString(const NTV2FrameBufferFormat inValue, const bool inForRetailDisplay=false)
Definition: ntv2utils.cpp:6940
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:238
RGB48LINEPITCH_1080
#define RGB48LINEPITCH_1080
Definition: ntv2videodefines.h:114
NTV2_STANDARD_2Kx1080i
@ NTV2_STANDARD_2Kx1080i
Identifies SMPTE HD 2K1080psf.
Definition: ntv2enums.h:162
NTV2_IS_VALID_FIELD
#define NTV2_IS_VALID_FIELD(__x__)
Definition: ntv2enums.h:1792
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:221
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:156
NTV2PrintRasterLineOffsets
ostream & NTV2PrintRasterLineOffsets(const NTV2RasterLineOffsets &inObj, ostream &inOutStream)
Definition: ntv2formatdescriptor.cpp:1308
NTV2FormatDescriptor::RasterLineToByteOffset
ULWord RasterLineToByteOffset(const ULWord inRowIndex0, const UWord inPlaneIndex0=0) const
Definition: ntv2formatdescriptor.cpp:1036
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:242
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:835
NTV2StringListConstIter
NTV2StringList::const_iterator NTV2StringListConstIter
Definition: ntv2utils.h:1136
LineNumbersF2t
static const ULWord LineNumbersF2t[]
Definition: ntv2formatdescriptor.cpp:1159
LineNumbersF2tt
static const ULWord LineNumbersF2tt[]
Definition: ntv2formatdescriptor.cpp:1162
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:234
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:942
NTV2_IS_VALID_FRAME_BUFFER_FORMAT
#define NTV2_IS_VALID_FRAME_BUFFER_FORMAT(__s__)
Definition: ntv2enums.h:251
RGB12PLINEPITCH_720
#define RGB12PLINEPITCH_720
Definition: ntv2videodefines.h:123
xHEX0N
#define xHEX0N(__x__, __n__)
Definition: ntv2publicinterface.h:5604
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:873
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:3724
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:1263
NTV2FormatDescriptor::GetFullRasterHeight
ULWord GetFullRasterHeight(void) const
Definition: ntv2formatdescriptor.h:175
NTV2FormatDescriptor::IsValid
bool IsValid(void) const
Definition: ntv2formatdescriptor.h:94
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:1168
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:688
RGB24LINEPITCH_2048
#define RGB24LINEPITCH_2048
Definition: ntv2videodefines.h:105
NTV2_IS_PROGRESSIVE_STANDARD
#define NTV2_IS_PROGRESSIVE_STANDARD(__s__)
Definition: ntv2enums.h:177
NTV2FormatDescriptor::ByteOffsetToPlane
UWord ByteOffsetToPlane(const ULWord inByteOffset) const
Definition: ntv2formatdescriptor.cpp:925
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:1614
LineNumbersF1t
static const ULWord LineNumbersF1t[]
Definition: ntv2formatdescriptor.cpp:1158