AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
ntv2transcode.cpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: MIT */
8 #include "ntv2transcode.h"
9 #include "ntv2endian.h"
10 
11 using namespace std;
12 
13 
14 bool ConvertLine_2vuy_to_v210 (const UByte * pSrc2vuyLine, ULWord * pDstv210Line, const ULWord inNumPixels)
15 {
16  if (!pSrc2vuyLine || !pDstv210Line || !inNumPixels)
17  return false;
18 
19  for (UWord inputCount = 0, outputCount = 0; inputCount < (inNumPixels * 2); outputCount += 4, inputCount += 12)
20  {
21  pDstv210Line[outputCount+0] = NTV2EndianSwap32HtoL((ULWord(pSrc2vuyLine[inputCount+0]) << 2) + (ULWord(pSrc2vuyLine[inputCount+ 1]) << 12) + (ULWord(pSrc2vuyLine[inputCount+ 2]) << 22));
22  pDstv210Line[outputCount+1] = NTV2EndianSwap32HtoL((ULWord(pSrc2vuyLine[inputCount+3]) << 2) + (ULWord(pSrc2vuyLine[inputCount+ 4]) << 12) + (ULWord(pSrc2vuyLine[inputCount+ 5]) << 22));
23  pDstv210Line[outputCount+2] = NTV2EndianSwap32HtoL((ULWord(pSrc2vuyLine[inputCount+6]) << 2) + (ULWord(pSrc2vuyLine[inputCount+ 7]) << 12) + (ULWord(pSrc2vuyLine[inputCount+ 8]) << 22));
24  pDstv210Line[outputCount+3] = NTV2EndianSwap32HtoL((ULWord(pSrc2vuyLine[inputCount+9]) << 2) + (ULWord(pSrc2vuyLine[inputCount+10]) << 12) + (ULWord(pSrc2vuyLine[inputCount+11]) << 22));
25  }
26 
27  return true;
28 
29 } // ConvertLine_2vuy_to_v210
30 
31 
32 bool ConvertLine_2vuy_to_yuy2 (const UByte * pInSrcLine_2vuy, UWord * pOutDstLine_yuy2, const ULWord inNumPixels)
33 {
34  if (!pInSrcLine_2vuy || !pOutDstLine_yuy2 || !inNumPixels)
35  return false;
36 
37  const UWord* pSrc = reinterpret_cast<const UWord*>(pInSrcLine_2vuy);
38  UWord* pDst = pOutDstLine_yuy2;
39 
40  for (UWord pixIndex(0); pixIndex < inNumPixels; pixIndex++)
41  {
42  *pDst = NTV2EndianSwap16(*pSrc);
43  pDst++; pSrc++;
44  }
45  return true;
46 }
47 
48 
49 bool ConvertLine_v210_to_2vuy (const ULWord * pSrcv210Line, UByte * pDst2vuyLine, const ULWord inNumPixels)
50 {
51  if (!pSrcv210Line || !pDst2vuyLine || !inNumPixels)
52  return false;
53 
54  for (ULWord sampleCount = 0, dataCount = 0; sampleCount < (inNumPixels * 2); sampleCount += 3, dataCount++)
55  {
56  const UByte * pByte (reinterpret_cast <const UByte *> (&pSrcv210Line [dataCount]));
57 
58  // Endian-agnostic bit shifting...
59  pDst2vuyLine [sampleCount ] = ((pByte [1] & 0x03) << 6) + (pByte [0] >> 2); // High-order 8 bits
60  pDst2vuyLine [sampleCount + 1] = ((pByte [2] & 0x0F) << 4) + (pByte [1] >> 4);
61  pDst2vuyLine [sampleCount + 2] = ((pByte [3] & 0x3F) << 2) + (pByte [2] >> 6);
62  }
63 
64  return true;
65 
66 } // ConvertLine_v210_to_2vuy
67 
68 
69 bool ConvertLine_v210_to_2vuy (const void * pInSrcLine_v210, std::vector<uint8_t> & outDstLine2vuy, const ULWord inNumPixels)
70 {
71  const ULWord * pInSrcLine (reinterpret_cast<const ULWord*>(pInSrcLine_v210));
72  outDstLine2vuy.clear();
73  if (!pInSrcLine || !inNumPixels)
74  return false;
75 
76  outDstLine2vuy.reserve(inNumPixels * 2);
77  for (ULWord sampleCount = 0, dataCount = 0; sampleCount < (inNumPixels * 2); sampleCount += 3, dataCount++)
78  {
79  const UByte * pByte (reinterpret_cast <const UByte*>(&pInSrcLine[dataCount]));
80 
81  // Endian-agnostic bit shifting...
82  outDstLine2vuy.push_back(UByte((pByte[1] & 0x03) << 6) | (pByte[0] >> 2)); // High-order 8 bits
83  outDstLine2vuy.push_back(UByte((pByte[2] & 0x0F) << 4) | (pByte[1] >> 4));
84  outDstLine2vuy.push_back(UByte((pByte[3] & 0x3F) << 2) | (pByte[2] >> 6));
85  }
86  return true;
87 }
88 
89 
90 bool ConvertLine_8bitABGR_to_10bitABGR (const UByte * pInSrcLine_8bitABGR, ULWord * pOutDstLine_10BitABGR, const ULWord inNumPixels)
91 {
92  if (!pInSrcLine_8bitABGR || !pOutDstLine_10BitABGR || !inNumPixels)
93  return false;
94 
95  const ULWord* pSrc = reinterpret_cast<const ULWord*>(pInSrcLine_8bitABGR);
96  ULWord* pDst = reinterpret_cast< ULWord*>(pOutDstLine_10BitABGR);
97 
98  for (ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
99  {
100  *pDst = ((*pSrc & 0x000000FF) << 2) | // Red (move to MS 8 bits of Red component)
101  ((*pSrc & 0x0000FF00) << 4) | // Green (move to MS 8 bits of Green component)
102  ((*pSrc & 0x00FF0000) << 6) | // Blue (move to MS 8 bits of Blue component)
103  ((*pSrc & 0xC0000000) ); // Alpha (drop LS 6 bits)
104  pDst++; pSrc++;
105  }
106  return true;
107 }
108 
109 
110 bool ConvertLine_8bitABGR_to_10bitRGBDPX (const UByte * pInSrcLine_8bitABGR, ULWord * pOutDstLine_10BitDPX, const ULWord inNumPixels)
111 {
112  if (!pInSrcLine_8bitABGR || !pOutDstLine_10BitDPX || !inNumPixels)
113  return false;
114 
115  const ULWord* pSrc = reinterpret_cast<const ULWord*>(pInSrcLine_8bitABGR);
116  ULWord* pDst = reinterpret_cast< ULWord*>(pOutDstLine_10BitDPX);
117 
118  for (ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
119  {
120  *pDst = ((*pSrc & 0x000000FF) ) + // Red
121  ((*pSrc & 0x0000FC00) >> 2) + ((*pSrc & 0x00000300) << 14) + // Green
122  ((*pSrc & 0x00F00000) >> 4) + ((*pSrc & 0x000F0000) << 12); // Blue
123  pDst++; pSrc++; // Next line
124  }
125  return true;
126 }
127 
128 
129 bool ConvertLine_8bitABGR_to_10bitRGBDPXLE (const UByte * pInSrcLine_8bitABGR, ULWord * pOutDstLine_10BitDPXLE, const ULWord inNumPixels)
130 {
131  if (!pInSrcLine_8bitABGR || !pOutDstLine_10BitDPXLE || !inNumPixels)
132  return false;
133 
134  const ULWord* pSrc = reinterpret_cast<const ULWord*>(pInSrcLine_8bitABGR);
135  ULWord* pDst = reinterpret_cast< ULWord*>(pOutDstLine_10BitDPXLE);
136 
137  for (ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
138  {
139  *pDst = ((*pSrc & 0x000000FF) << 24) | // Red
140  ((*pSrc & 0x0000FF00) << 6) | // Green
141  ((*pSrc & 0x00FF0000) >> 12); // Blue
142  pDst++; pSrc++; // Next line
143  }
144  return true;
145 }
146 
147 
148 bool ConvertLine_8bitABGR_to_24bitRGB (const UByte * pInSrcLine_8bitABGR, UByte * pOutDstLine_24BitRGB, const ULWord inNumPixels)
149 {
150  if (!pInSrcLine_8bitABGR || !pOutDstLine_24BitRGB || !inNumPixels)
151  return false;
152 
153  const UByte* pSrc = reinterpret_cast<const UByte*>(pInSrcLine_8bitABGR);
154  UByte* pDst = reinterpret_cast<UByte*>(pOutDstLine_24BitRGB);
155 
156  for (ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
157  {
158  *pDst++ = *pSrc++; // Red
159  *pDst++ = *pSrc++; // Green
160  *pDst++ = *pSrc++; // Blue
161  pSrc++; // Skip over src Alpha
162  }
163  return true;
164 }
165 
166 
167 bool ConvertLine_8bitABGR_to_24bitBGR (const UByte * pInSrcLine_8bitABGR, UByte * pOutDstLine_24BitBGR, const ULWord inNumPixels)
168 {
169  if (!pInSrcLine_8bitABGR || !pOutDstLine_24BitBGR || !inNumPixels)
170  return false;
171 
172  const UByte* pSrc = reinterpret_cast<const UByte*>(pInSrcLine_8bitABGR);
173  UByte* pDst = reinterpret_cast<UByte*>(pOutDstLine_24BitBGR);
174 
175  for (ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
176  {
177  UByte r(*pSrc++), g(*pSrc++), b(*pSrc++);
178  *pDst++ = b; // Blue
179  *pDst++ = g; // Green
180  *pDst++ = r; // Red
181  pSrc++; // Skip over src Alpha
182  }
183  return true;
184 }
185 
186 
187 bool ConvertLine_8bitABGR_to_48bitRGB (const UByte * pInSrcLine_8bitABGR, ULWord * pOutDstLine_48BitRGB, const ULWord inNumPixels)
188 {
189  if (!pInSrcLine_8bitABGR || !pOutDstLine_48BitRGB || !inNumPixels)
190  return false;
191 
192  const UByte* pSrc = reinterpret_cast<const UByte*>(pInSrcLine_8bitABGR);
193  UByte* pDst = reinterpret_cast<UByte*>(pOutDstLine_48BitRGB);
194 
195  for (ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
196  {
197  UByte r(*pSrc++), g(*pSrc++), b(*pSrc++); // UByte a(*pSrc++);
198  ++pDst; *pDst++ = r;
199  ++pDst; *pDst++ = g;
200  ++pDst; *pDst++ = b;
201  pSrc++;
202  }
203  return true;
204 }
205 
206 
207 // ConvertLineToYCbCr422
208 // 8 Bit
210  UByte* YCbCrLine,
211  LWord numPixels ,
212  LWord startPixel,
213  bool fUseSDMatrix)
214 {
215  YCbCrPixel YCbCr;
216  UByte *pYCbCr = &YCbCrLine[(startPixel&~1)*2]; // startPixel needs to be even
217 
218  for ( LWord pixel = 0; pixel < numPixels; pixel++ )
219  {
220  if(fUseSDMatrix) {
221  SDConvertRGBAlphatoYCbCr(&RGBLine[pixel],&YCbCr);
222  } else {
223  HDConvertRGBAlphatoYCbCr(&RGBLine[pixel],&YCbCr);
224  }
225  if ( pixel & 0x1 )
226  {
227  // Just Y
228  *pYCbCr++ = YCbCr.y;
229  }
230  else
231  {
232  *pYCbCr++ = YCbCr.cb;
233  *pYCbCr++ = YCbCr.y;
234  *pYCbCr++ = YCbCr.cr;
235 
236  }
237 
238  }
239 
240 }
241 // ConvertLineToYCbCr422
242 // 10 Bit
244  UWord* YCbCrLine,
245  LWord numPixels ,
246  LWord startPixel,
247  bool fUseSDMatrix)
248 {
249  YCbCr10BitPixel YCbCr;
250  UWord *pYCbCr = &YCbCrLine[(startPixel&~1)*2]; // startPixel needs to be even
251 
252  for ( LWord pixel = 0; pixel < numPixels; pixel++ )
253  {
254  if(fUseSDMatrix) {
255  SDConvertRGBAlphatoYCbCr(&RGBLine[pixel],&YCbCr);
256  } else {
257  HDConvertRGBAlphatoYCbCr(&RGBLine[pixel],&YCbCr);
258  }
259  if ( pixel & 0x1 )
260  {
261  // Just Y
262  *pYCbCr++ = YCbCr.y;
263  }
264  else
265  {
266  *pYCbCr++ = YCbCr.cb;
267  *pYCbCr++ = YCbCr.y;
268  *pYCbCr++ = YCbCr.cr;
269 
270  }
271 
272  }
273 
274 }
275 
276 
277 
278 // ConvertLinetoRGB
279 // 8 Bit Version
280 void ConvertLinetoRGB(UByte * ycbcrBuffer,
281  RGBAlphaPixel * rgbaBuffer ,
282  ULWord numPixels,
283  bool fUseSDMatrix,
284  bool fUseSMPTERange)
285 {
286  YCbCrAlphaPixel ycbcrPixel;
287  UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
288 
289  // take a line(CbYCrYCbYCrY....) to RGBAlphaPixels.
290  // 2 RGBAlphaPixels at a time.
291  Cb1 = *ycbcrBuffer++;
292  Y1 = *ycbcrBuffer++;
293  Cr1 = *ycbcrBuffer++;
294  for ( ULWord count = 0; count < numPixels; count+=2 )
295  {
296  ycbcrPixel.cb = (UByte)Cb1;
297  ycbcrPixel.y = (UByte)Y1;
298  ycbcrPixel.cr = (UByte)Cr1;
299 
300  if(fUseSDMatrix) {
301  if (fUseSMPTERange) {
302  SDConvertYCbCrtoRGBSmpte(&ycbcrPixel,&rgbaBuffer[count]);
303  } else {
304  SDConvertYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count]);
305  }
306  } else {
307  if (fUseSMPTERange) {
308  HDConvertYCbCrtoRGBSmpte(&ycbcrPixel,&rgbaBuffer[count]);
309  } else {
310  HDConvertYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count]);
311  }
312  }
313  // Read lone midde Y;
314  ycbcrPixel.y = *ycbcrBuffer++;
315 
316  // Read Next full bandwidth sample
317  Cb2 = *ycbcrBuffer++;
318  Y2 = *ycbcrBuffer++;
319  Cr2 = *ycbcrBuffer++;
320 
321  // Interpolate and write Inpterpolated RGBAlphaPixel
322  ycbcrPixel.cb = (UByte)((Cb1+Cb2)/2);
323  ycbcrPixel.cr = (UByte)((Cr1+Cr2)/2);
324  if(fUseSDMatrix) {
325  if (fUseSMPTERange) {
326  SDConvertYCbCrtoRGBSmpte(&ycbcrPixel,&rgbaBuffer[count+1]);
327  } else {
328  SDConvertYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count+1]);
329  }
330  } else {
331  if (fUseSMPTERange) {
332  HDConvertYCbCrtoRGBSmpte(&ycbcrPixel,&rgbaBuffer[count+1]);
333  } else {
334  HDConvertYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count+1]);
335  }
336  }
337  // Setup for next loop
338  Cb1 = Cb2;
339  Cr1 = Cr2;
340  Y1 = Y2;
341  }
342 }
343 
344 
345 // ConvertLinetoRGB
346 // 10 Bit YCbCr 8 Bit RGB version
347 void ConvertLinetoRGB(UWord * ycbcrBuffer,
348  RGBAlphaPixel * rgbaBuffer,
349  ULWord numPixels,
350  bool fUseSDMatrix,
351  bool fUseSMPTERange,
352  bool fAlphaFromLuma)
353 {
354  YCbCr10BitAlphaPixel ycbcrPixel = {0,0,0,0};
355  UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
356 
357  // take a line(CbYCrYCbYCrY....) to RGBAlphaPixels.
358  // 2 RGBAlphaPixels at a time.
359  Cb1 = *ycbcrBuffer++;
360  Y1 = *ycbcrBuffer++;
361  Cr1 = *ycbcrBuffer++;
362  for ( ULWord count = 0; count < numPixels; count+=2 )
363  {
364  ycbcrPixel.cb = (UWord)Cb1;
365  ycbcrPixel.y = (UWord)Y1;
366  ycbcrPixel.cr = (UWord)Cr1;
367  if( fAlphaFromLuma )
368  ycbcrPixel.Alpha = (UWord)Y1/4;
369 
370  if(fUseSDMatrix) {
371  if (fUseSMPTERange) {
372  SDConvert10BitYCbCrtoRGBSmpte(&ycbcrPixel,&rgbaBuffer[count]);
373  } else {
374  SDConvert10BitYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count]);
375  }
376  } else {
377  if (fUseSMPTERange) {
378  HDConvert10BitYCbCrtoRGBSmpte(&ycbcrPixel,&rgbaBuffer[count]);
379  } else {
380  HDConvert10BitYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count]);
381  }
382  }
383  // Read lone midde Y;
384  ycbcrPixel.y = *ycbcrBuffer++;
385 
386  // Read Next full bandwidth sample
387  // unless we are at the end of a line
388  if ( (count + 2 ) >= numPixels )
389  {
390  Cb2 = (UWord)Cb1;
391  Y2 = (UWord)Y1;
392  Cr2 = (UWord)Cr1;
393  }
394  else
395  {
396  Cb2 = *ycbcrBuffer++;
397  Y2 = *ycbcrBuffer++;
398  Cr2 = *ycbcrBuffer++;
399  }
400  // Interpolate and write Inpterpolated RGBAlphaPixel
401  ycbcrPixel.cb = (UWord)((Cb1+Cb2)/2);
402  ycbcrPixel.cr = (UWord)((Cr1+Cr2)/2);
403  if(fUseSDMatrix) {
404  if (fUseSMPTERange) {
405  SDConvert10BitYCbCrtoRGBSmpte(&ycbcrPixel,&rgbaBuffer[count+1]);
406  } else {
407  SDConvert10BitYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count+1]);
408  }
409  } else {
410  if (fUseSMPTERange) {
411  HDConvert10BitYCbCrtoRGBSmpte(&ycbcrPixel,&rgbaBuffer[count+1]);
412  } else {
413  HDConvert10BitYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count+1]);
414  }
415  }
416 
417  // Setup for next loop
418  Cb1 = Cb2;
419  Cr1 = Cr2;
420  Y1 = Y2;
421 
422  }
423 }
424 
425 // ConvertRGBALineToRGB
426 // 8 bit RGBA to 8 bit RGB (RGB24)
427 AJAExport
429  ULWord numPixels)
430 {
431  RGBPixel* rgbLineBuffer = (RGBPixel*) rgbaBuffer;
432 
433  for ( ULWord pixel=0; pixel<numPixels; pixel++ )
434  {
435  UByte R = rgbaBuffer->Red;
436  UByte G = rgbaBuffer->Green;
437  UByte B = rgbaBuffer->Blue;
438 
439  rgbLineBuffer->Red = R;
440  rgbLineBuffer->Green = G;
441  rgbLineBuffer->Blue = B;
442 
443  rgbaBuffer++;
444  rgbLineBuffer++;
445  }
446 }
447 
448 // ConvertRGBALineToBGR
449 // 8 bit RGBA to 8 bit BGR (BGR24)
450 // Conversion is done into the same buffer
451 AJAExport
453  ULWord numPixels)
454 {
455  BGRPixel* bgrLineBuffer = (BGRPixel*) rgbaBuffer;
456 
457  for ( ULWord pixel=0; pixel<numPixels; pixel++ )
458  {
459  UByte B = rgbaBuffer->Blue;
460  UByte G = rgbaBuffer->Green;
461  UByte R = rgbaBuffer->Red;
462 
463  bgrLineBuffer->Blue = B;
464  bgrLineBuffer->Green = G;
465  bgrLineBuffer->Red = R;
466 
467  rgbaBuffer++;
468  bgrLineBuffer++;
469  }
470 }
471 
472 // ConvertLineto10BitRGB
473 // 10 Bit YCbCr and 10 Bit RGB Version
474 void ConvertLineto10BitRGB(UWord * ycbcrBuffer,
475  RGBAlpha10BitPixel * rgbaBuffer,
476  ULWord numPixels,
477  bool fUseSDMatrix,
478  bool fUseSMPTERange)
479 {
480  YCbCr10BitAlphaPixel ycbcrPixel = {0,0,0,0};
481  UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
482 
483  // take a line(CbYCrYCbYCrY....) to RGBAlphaPixels.
484  // 2 RGBAlphaPixels at a time.
485  Cb1 = *ycbcrBuffer++;
486  Y1 = *ycbcrBuffer++;
487  Cr1 = *ycbcrBuffer++;
488  for ( ULWord count = 0; count < numPixels; count+=2 )
489  {
490  ycbcrPixel.cb = (UWord)Cb1;
491  ycbcrPixel.y = (UWord)Y1;
492  ycbcrPixel.cr = (UWord)Cr1;
493 
494  if(fUseSDMatrix) {
495  if (fUseSMPTERange) {
496  SDConvert10BitYCbCrto10BitRGBSmpte(&ycbcrPixel,&rgbaBuffer[count]);
497  } else {
498  SDConvert10BitYCbCrto10BitRGB(&ycbcrPixel,&rgbaBuffer[count]);
499  }
500  } else {
501  if (fUseSMPTERange) {
502  HDConvert10BitYCbCrto10BitRGBSmpte(&ycbcrPixel,&rgbaBuffer[count]);
503  } else {
504  HDConvert10BitYCbCrto10BitRGB(&ycbcrPixel,&rgbaBuffer[count]);
505  }
506  }
507  // Read lone midde Y;
508  ycbcrPixel.y = *ycbcrBuffer++;
509 
510  // Read Next full bandwidth sample
511  // unless we are at the end of a line
512  if ( (count + 2 ) >= numPixels )
513  {
514  Cb2 = (UWord)Cb1;
515  Y2 = (UWord)Y1;
516  Cr2 = (UWord)Cr1;
517  }
518  else
519  {
520  Cb2 = *ycbcrBuffer++;
521  Y2 = *ycbcrBuffer++;
522  Cr2 = *ycbcrBuffer++;
523  }
524  // Interpolate and write Inpterpolated RGBAlphaPixel
525  ycbcrPixel.cb = (UWord)((Cb1+Cb2)/2);
526  ycbcrPixel.cr = (UWord)((Cr1+Cr2)/2);
527  if(fUseSDMatrix) {
528  if (fUseSMPTERange) {
529  SDConvert10BitYCbCrto10BitRGBSmpte(&ycbcrPixel,&rgbaBuffer[count+1]);
530  } else {
531  SDConvert10BitYCbCrto10BitRGB(&ycbcrPixel,&rgbaBuffer[count+1]);
532  }
533  } else {
534  if (fUseSMPTERange) {
535  HDConvert10BitYCbCrto10BitRGBSmpte(&ycbcrPixel,&rgbaBuffer[count+1]);
536  } else {
537  HDConvert10BitYCbCrto10BitRGB(&ycbcrPixel,&rgbaBuffer[count+1]);
538  }
539  }
540 
541  // Setup for next loop
542  Cb1 = Cb2;
543  Cr1 = Cr2;
544  Y1 = Y2;
545  }
546 }
547 
548 // ConvertLineto10BitYCbCrA
549 // 10 Bit YCbCr to 10 Bit YCbCrA
550 void ConvertLineto10BitYCbCrA (const UWord * pInYCbCrBuffer,
551  ULWord * pOutYCbCrABuffer,
552  const ULWord inNumPixels)
553 {
554  for (ULWord count(0); count < inNumPixels; count++)
555  {
556  ULWord value = CCIR601_10BIT_WHITE<<20; // Set Alpha to '1';
557  value |= (ULWord(*pInYCbCrBuffer++)<<10); // Cb or Cr
558  value |= *pInYCbCrBuffer++; // Y
559  pOutYCbCrABuffer[count] = value;
560  }
561 }
562 
563 // ConvertLineto10BitRGB
564 // 8 Bit RGBA to and 10 Bit RGB Packed Version
565 void ConvertLineto10BitRGB (const RGBAlphaPixel * pInRGBA8Buffer,
566  ULWord * pOutRGB10Buffer,
567  const ULWord inNumPixels)
568 
569 {
570  for (ULWord count(0); count < inNumPixels; count++)
571  {
572  *pOutRGB10Buffer = (ULWord(pInRGBA8Buffer->Blue)<<22) +
573  (ULWord(pInRGBA8Buffer->Green)<<12) +
574  (ULWord(pInRGBA8Buffer->Red)<<2);
575  pOutRGB10Buffer++;
576  pInRGBA8Buffer++;
577  }
578 }
579 
580 // ConvertRGBLineto10BitRGB
581 // 8 Bit RGB and 10 Bit RGB Version
582 void ConvertRGBLineto10BitRGB (const RGBAlphaPixel * pInRGBA8Buffer,
583  RGBAlpha10BitPixel * pOutRGBA10Buffer,
584  const ULWord inNumPixels)
585 {
586  for (ULWord i(0); i < inNumPixels; i++)
587  {
588  pOutRGBA10Buffer[i].Blue = (pInRGBA8Buffer[i].Blue<<2);
589  pOutRGBA10Buffer[i].Green = (pInRGBA8Buffer[i].Green<<2);
590  pOutRGBA10Buffer[i].Red = (pInRGBA8Buffer[i].Red<<2);
591  pOutRGBA10Buffer[i].Alpha = (pInRGBA8Buffer[i].Alpha<<2);
592  }
593 
594 }
595 
596 
597 
598 // ConvertLineto8BitYCbCr
599 // 10 Bit YCbCr to 8 Bit YCbCr
600 void ConvertLineto8BitYCbCr(UWord * ycbcr10BitBuffer,
601  UByte * ycbcr8BitBuffer,
602  ULWord numPixels)
603 {
604  for ( ULWord pixel=0;pixel<numPixels*2;pixel++)
605  {
606  ycbcr8BitBuffer[pixel] = ycbcr10BitBuffer[pixel]>>2;
607  }
608 
609 }
610 
611 // Converts UYVY(2yuv) -> YUY2(yuv2) in place
612 void Convert8BitYCbCrToYUY2(UByte * ycbcrBuffer,
613  ULWord numPixels)
614 {
615  for ( ULWord pixel=0;pixel<numPixels*2;pixel+=4)
616  {
617  UByte Cb = ycbcrBuffer[pixel];
618  UByte Y1 = ycbcrBuffer[pixel+1];
619  UByte Cr = ycbcrBuffer[pixel+2];
620  UByte Y2 = ycbcrBuffer[pixel+3];
621  ycbcrBuffer[pixel] = Y1;
622  ycbcrBuffer[pixel+1] = Cb;
623  ycbcrBuffer[pixel+2] = Y2;
624  ycbcrBuffer[pixel+3] = Cr;
625  }
626 }
627 
628 // Converts 8 Bit ARGB 8 Bit RGBA in place
629 void ConvertARGBYCbCrToRGBA(UByte* rgbaBuffer,ULWord numPixels)
630 {
631  for ( ULWord pixel=0;pixel<numPixels*4;pixel+=4)
632  {
633  UByte B = rgbaBuffer[pixel];
634  UByte G = rgbaBuffer[pixel+1];
635  UByte R = rgbaBuffer[pixel+2];
636  UByte A = rgbaBuffer[pixel+3];
637  rgbaBuffer[pixel] = A;
638  rgbaBuffer[pixel+1] = R;
639  rgbaBuffer[pixel+2] = G;
640  rgbaBuffer[pixel+3] = B;
641  }
642 }
643 
644 // Converts 8 Bit ARGB 8 Bit ABGR in place
645 void ConvertARGBYCbCrToABGR(UByte* rgbaBuffer,ULWord numPixels)
646 {
647  for ( ULWord pixel=0;pixel<numPixels*4;pixel+=4)
648  {
649  UByte B = rgbaBuffer[pixel];
650  UByte G = rgbaBuffer[pixel+1];
651  UByte R = rgbaBuffer[pixel+2];
652  UByte A = rgbaBuffer[pixel+3];
653  rgbaBuffer[pixel] = R;
654  rgbaBuffer[pixel+1] = G;
655  rgbaBuffer[pixel+2] = B;
656  rgbaBuffer[pixel+3] = A;
657  }
658 }
659 
660 // Convert 8 Bit ARGB to 8 bit RGB
661 void ConvertARGBToRGB(UByte *rgbaLineBuffer ,UByte * rgbLineBuffer,ULWord numPixels)
662 {
663  for ( ULWord pixel=0;pixel<numPixels*4;pixel+=4)
664  {
665  UByte B = rgbaLineBuffer[pixel];
666  UByte G = rgbaLineBuffer[pixel+1];
667  UByte R = rgbaLineBuffer[pixel+2];
668  *rgbLineBuffer++ = R;
669  *rgbLineBuffer++ = G;
670  *rgbLineBuffer++ = B;
671 
672  }
673 }
674 //KAM
675 // Convert 16 Bit ARGB to 16 bit RGB
676 void Convert16BitARGBTo16BitRGBEx(UWord *rgbaLineBuffer ,UWord * rgbLineBuffer,ULWord numPixels)
677 {
678  for ( ULWord pixel=0;pixel<numPixels*4;pixel+=4)
679  {
680  // TODO: is this ordering correct? seems wrong...
681  RGBAlpha16BitPixel* pixelBuffer = (RGBAlpha16BitPixel*)&(rgbaLineBuffer[pixel]);
682  UWord B = pixelBuffer->Blue;
683  UWord G = pixelBuffer->Green;
684  UWord R = pixelBuffer->Red;
685  *rgbLineBuffer++ = R;
686  *rgbLineBuffer++ = G;
687  *rgbLineBuffer++ = B;
688  }
689 }
690 // KAM
691 void Convert16BitARGBTo16BitRGB(RGBAlpha16BitPixel *rgbaLineBuffer ,UWord * rgbLineBuffer,ULWord numPixels)
692 {
693  for ( ULWord pixel=0;pixel<numPixels;pixel++)
694  {
695  UWord B = rgbaLineBuffer[pixel].Blue;
696  UWord G = rgbaLineBuffer[pixel].Green;
697  UWord R = rgbaLineBuffer[pixel].Red;
698  *rgbLineBuffer++ = R;
699  *rgbLineBuffer++ = G;
700  *rgbLineBuffer++ = B;
701  }
702 }
703 
704 void Convert16BitARGBTo12BitRGBPacked(RGBAlpha16BitPixel *rgbaLineBuffer ,UByte * rgbLineBuffer,ULWord numPixels)
705 {
706  for ( ULWord pixel=0;pixel<numPixels;pixel+=8)
707  {
708  for(ULWord i = 0;i<8;i+=2)
709  {
710  UWord R = rgbaLineBuffer[pixel+i].Red;
711  UWord G = rgbaLineBuffer[pixel+i].Green;
712  UWord B = rgbaLineBuffer[pixel+i].Blue;
713  *rgbLineBuffer++ = (R & 0xFF00)>>8;
714  *rgbLineBuffer++ = (((R & 0x00F0)) | ((G & 0xF000)>>12));
715  *rgbLineBuffer++ = (G & 0x0FF0)>>4;
716  *rgbLineBuffer++ = (B & 0xFF00)>>8;
717  R = rgbaLineBuffer[pixel+i+1].Red;
718  *rgbLineBuffer++ = (((B & 0x00F0)) | ((R & 0xF000)>>12));
719  *rgbLineBuffer++ = (R & 0x0FF0)>>4;
720  G = rgbaLineBuffer[pixel+i+1].Green;
721  B = rgbaLineBuffer[pixel+i+1].Blue;
722  *rgbLineBuffer++ = (G & 0xFF00)>>8;
723  *rgbLineBuffer++ = (((G & 0x00F0)) | ((B & 0xF000)>>12));
724  *rgbLineBuffer++ = (B & 0x0FF0)>>4;
725  }
726  }
727 }
728 
729 // Convert 8 Bit ARGB to 8 bit BGR
730 void ConvertARGBToBGR (const UByte * pInRGBALineBuffer, UByte * pOutRGBLineBuffer, const ULWord inNumPixels)
731 {
732  for (ULWord pixel = 0; pixel < inNumPixels * 4; pixel += 4)
733  {
734  UByte B = pInRGBALineBuffer[pixel];
735  UByte G = pInRGBALineBuffer[pixel+1];
736  UByte R = pInRGBALineBuffer[pixel+2];
737  *pOutRGBLineBuffer++ = B;
738  *pOutRGBLineBuffer++ = G;
739  *pOutRGBLineBuffer++ = R;
740 
741  }
742 }
743 
744 // Pack 10 Bit RGBA to 10 Bit RGB Format for our board
745 void PackRGB10BitFor10BitRGB (RGBAlpha10BitPixel* pBuffer, const ULWord inNumPixels)
746 {
747  ULWord* outputBuffer(reinterpret_cast<ULWord*>(pBuffer));
748  for (ULWord pixel(0); pixel < inNumPixels; pixel++)
749  {
750  const ULWord Red (pBuffer[pixel].Red);
751  const ULWord Green (pBuffer[pixel].Green);
752  const ULWord Blue (pBuffer[pixel].Blue);
753  outputBuffer[pixel] = (Blue<<20) + (Green<<10) + Red;
754  }
755 
756 
757 }
758 
759 // Pack 10 Bit RGBA to 10 Bit DPX Format for our board
760 void PackRGB10BitFor10BitDPX (RGBAlpha10BitPixel * pBuffer, const ULWord inNumPixels, const bool inBigEndian)
761 {
762  ULWord * pOutputBuffer (reinterpret_cast<ULWord*>(pBuffer));
763  for (ULWord pixel(0); pixel < inNumPixels; pixel++)
764  {
765  const ULWord Red (pBuffer[pixel].Red);
766  const ULWord Green (pBuffer[pixel].Green);
767  const ULWord Blue (pBuffer[pixel].Blue);
768  const ULWord value ((Red << 22) + (Green << 12) + (Blue << 2));
769  if (inBigEndian)
770  pOutputBuffer[pixel] = ((value&0xFF)<<24) + (((value>>8)&0xFF)<<16) + (((value>>16)&0xFF)<<8) + ((value>>24)&0xFF);
771  else
772  pOutputBuffer[pixel] = value;
773  }
774 
775 
776 }
777 
778 // Pack 10 Bit RGBA to NTV2_FBF_10BIT_RGB_PACKED Format for our board
779 void PackRGB10BitFor10BitRGBPacked (RGBAlpha10BitPixel * pBuffer, const ULWord inNumPixels)
780 {
781  ULWord * pOutputBuffer (reinterpret_cast<ULWord*>(pBuffer));
782  for (ULWord pixel(0); pixel < inNumPixels; pixel++)
783  {
784  const ULWord Red (pBuffer[pixel].Red);
785  const ULWord Green (pBuffer[pixel].Green);
786  const ULWord Blue (pBuffer[pixel].Blue);
787  ULWord value = (((Red>>2)&0xFF)<<16) + (((Green>>2)&0xFF)<<8) + ((Blue>>2)&0xFF);
788  value |= ((Red&0x3)<<28) + ((Green&0x3)<<26) + ((Blue&0x3)<<24);
789 
790  pOutputBuffer[pixel] = value;
791  }
792 }
793 
794 /* KAM
795 // ConvertLineto16BitRGB
796 // 16 Bit Version
797 void ConvertLineto16BitRGB(UByte * ycbcrBuffer,
798  RGBAlpha16BitPixel * rgbaBuffer,
799  ULWord numPixels,
800  bool fUseSDMatrix)
801 {
802  YCbCrAlphaPixel ycbcrPixel;
803  UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
804 
805  // take a line(CbYCrYCbYCrY....) to RGBAlpha16BitPixels.
806  // 2 RGBAlphaPixels at a time.
807  Cb1 = *ycbcrBuffer++;
808  Y1 = *ycbcrBuffer++;
809  Cr1 = *ycbcrBuffer++;
810  for ( ULWord count = 0; count < numPixels; count+=2 )
811  {
812  ycbcrPixel.cb = (UByte)Cb1;
813  ycbcrPixel.y = (UByte)Y1;
814  ycbcrPixel.cr = (UByte)Cr1;
815 // warns that ycbcrPixel is used before intilialized.?
816  if(fUseSDMatrix) {
817  SDConvertYCbCrto16BitRGB(&ycbcrPixel,&rgbaBuffer[count]);
818  } else {
819  HDConvertYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count]);
820  }
821  // Read lone midde Y;
822  ycbcrPixel.y = *ycbcrBuffer++;
823 
824  // Read Next full bandwidth sample
825  Cb2 = *ycbcrBuffer++;
826  Y2 = *ycbcrBuffer++;
827  Cr2 = *ycbcrBuffer++;
828 
829  // Interpolate and write Inpterpolated RGBAlphaPixel
830  ycbcrPixel.cb = (UByte)((Cb1+Cb2)/2);
831  ycbcrPixel.cr = (UByte)((Cr1+Cr2)/2);
832  if(fUseSDMatrix) {
833  SDConvertYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count+1]);
834  } else {
835  HDConvertYCbCrtoRGB(&ycbcrPixel,&rgbaBuffer[count+1]);
836  }
837  // Setup for next loop
838  Cb1 = Cb2;
839  Cr1 = Cr2;
840  Y1 = Y2;
841 
842  }
843 }
844 */
845 
846 // KAM - start
847 // ConvertLinetoRGB
848 // 10 Bit YCbCr 16 Bit RGB version
849 void ConvertLineto16BitRGB(UWord * ycbcrBuffer,
850  RGBAlpha16BitPixel * rgbaBuffer,
851  ULWord numPixels,
852  bool fUseSDMatrix,
853  bool fUseSMPTERange)
854 {
855  YCbCr10BitAlphaPixel ycbcrPixel = {0,0,0,0};
856  UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
857 
858  // take a line(CbYCrYCbYCrY....) to RGBAlpha16Pixels.
859  // 2 RGBAlpha16Pixels at a time.
860  Cb1 = *ycbcrBuffer++;
861  Y1 = *ycbcrBuffer++;
862  Cr1 = *ycbcrBuffer++;
863  for ( ULWord count = 0; count < numPixels; count+=2 )
864  {
865  ycbcrPixel.cb = (UWord)Cb1;
866  ycbcrPixel.y = (UWord)Y1;
867  ycbcrPixel.cr = (UWord)Cr1;
868 
869  if(fUseSDMatrix) {
870  if (fUseSMPTERange) {
871  SDConvert10BitYCbCrto10BitRGBSmpte(&ycbcrPixel,(RGBAlpha10BitPixel *)&rgbaBuffer[count]);
872  } else {
873  SDConvert10BitYCbCrto10BitRGB(&ycbcrPixel,(RGBAlpha10BitPixel *)&rgbaBuffer[count]);
874  }
875  rgbaBuffer[count].Red = (rgbaBuffer[count].Red) << 6;
876  rgbaBuffer[count].Green = (rgbaBuffer[count].Green) << 6;
877  rgbaBuffer[count].Blue = (rgbaBuffer[count].Blue) << 6;
878  } else {
879  if (fUseSMPTERange) {
880  HDConvert10BitYCbCrto10BitRGBSmpte(&ycbcrPixel,(RGBAlpha10BitPixel *)&rgbaBuffer[count]);
881  } else {
882  HDConvert10BitYCbCrto10BitRGB(&ycbcrPixel,(RGBAlpha10BitPixel *)&rgbaBuffer[count]);
883  }
884  rgbaBuffer[count].Red = (rgbaBuffer[count].Red) << 6;
885  rgbaBuffer[count].Green = (rgbaBuffer[count].Green) << 6;
886  rgbaBuffer[count].Blue = (rgbaBuffer[count].Blue) << 6;
887  }
888 
889  // Read lone midde Y;
890  ycbcrPixel.y = *ycbcrBuffer++;
891 
892  // Read Next full bandwidth sample
893  // unless we are at the end of a line
894  if ( (count + 2 ) >= numPixels )
895  {
896  Cb2 = (UWord)Cb1;
897  Y2 = (UWord)Y1;
898  Cr2 = (UWord)Cr1;
899  }
900  else
901  {
902  Cb2 = *ycbcrBuffer++;
903  Y2 = *ycbcrBuffer++;
904  Cr2 = *ycbcrBuffer++;
905  }
906  // Interpolate and write Inpterpolated RGBAlpha16Pixel
907  ycbcrPixel.cb = (UWord)((Cb1+Cb2)/2);
908  ycbcrPixel.cr = (UWord)((Cr1+Cr2)/2);
909  if(fUseSDMatrix) {
910  if (fUseSMPTERange) {
911  SDConvert10BitYCbCrto10BitRGBSmpte(&ycbcrPixel,(RGBAlpha10BitPixel *)&rgbaBuffer[count+1]);
912  } else {
913  SDConvert10BitYCbCrto10BitRGB(&ycbcrPixel,(RGBAlpha10BitPixel *)&rgbaBuffer[count+1]);
914  }
915  rgbaBuffer[count+1].Red = (rgbaBuffer[count+1].Red) << 6;
916  rgbaBuffer[count+1].Green = (rgbaBuffer[count+1].Green) << 6;
917  rgbaBuffer[count+1].Blue = (rgbaBuffer[count+1].Blue) << 6;
918  } else {
919  if (fUseSMPTERange) {
920  HDConvert10BitYCbCrto10BitRGBSmpte(&ycbcrPixel,(RGBAlpha10BitPixel *)&rgbaBuffer[count+1]);
921  } else {
922  HDConvert10BitYCbCrto10BitRGB(&ycbcrPixel,(RGBAlpha10BitPixel *)&rgbaBuffer[count+1]);
923  }
924  rgbaBuffer[count+1].Red = (rgbaBuffer[count+1].Red) << 6;
925  rgbaBuffer[count+1].Green = (rgbaBuffer[count+1].Green) << 6;
926  rgbaBuffer[count+1].Blue = (rgbaBuffer[count+1].Blue) << 6;
927  }
928 
929  // Setup for next loop
930  Cb1 = Cb2;
931  Cr1 = Cr2;
932  Y1 = Y2;
933 
934  }
935 }
936 // KAM - end
RGBPixel::Green
unsigned char Green
Definition: ntv2videodefines.h:175
HDConvertRGBAlphatoYCbCr
void HDConvertRGBAlphatoYCbCr(RGBAlphaPixel *pSource, YCbCrPixel *pTarget)
Definition: ntv2transcode.h:284
ConvertLine_8bitABGR_to_48bitRGB
bool ConvertLine_8bitABGR_to_48bitRGB(const UByte *pInSrcLine_8bitABGR, ULWord *pOutDstLine_48BitRGB, const ULWord inNumPixels)
Converts a single 8-bit ABGR raster line to 48-bit RGB (from NTV2_FBF_ABGR to NTV2_FBF_48BIT_RGB ).
Definition: ntv2transcode.cpp:187
LWord
int32_t LWord
Definition: ajatypes.h:245
RGBAlpha10BitPixel::Alpha
UWord Alpha
Definition: ntv2videodefines.h:149
ConvertLineto8BitYCbCr
void ConvertLineto8BitYCbCr(UWord *ycbcr10BitBuffer, UByte *ycbcr8BitBuffer, ULWord numPixels)
Definition: ntv2transcode.cpp:600
Convert16BitARGBTo16BitRGBEx
void Convert16BitARGBTo16BitRGBEx(UWord *rgbaLineBuffer, UWord *rgbLineBuffer, ULWord numPixels)
Definition: ntv2transcode.cpp:676
ConvertARGBYCbCrToABGR
void ConvertARGBYCbCrToABGR(UByte *rgbaBuffer, ULWord numPixels)
Definition: ntv2transcode.cpp:645
ConvertLineto10BitYCbCrA
void ConvertLineto10BitYCbCrA(const UWord *pInYCbCrBuffer, ULWord *pOutYCbCrABuffer, const ULWord inNumPixels)
Definition: ntv2transcode.cpp:550
YCbCrPixel::cb
unsigned char cb
Definition: ntv2videodefines.h:195
ntv2transcode.h
Declares a number of pixel format transcoder functions.
SDConvert10BitYCbCrtoRGB
void SDConvert10BitYCbCrtoRGB(const YCbCr10BitAlphaPixel *pSource, RGBAlphaPixel *pTarget)
Definition: ntv2transcode.h:378
RGBAlphaPixel::Alpha
unsigned char Alpha
Definition: ntv2videodefines.h:141
Convert8BitYCbCrToYUY2
void Convert8BitYCbCrToYUY2(UByte *ycbcrBuffer, ULWord numPixels)
Definition: ntv2transcode.cpp:612
RGBAlphaPixel::Red
unsigned char Red
Definition: ntv2videodefines.h:140
YCbCr10BitPixel::cb
UWord cb
Definition: ntv2videodefines.h:202
BGRPixel::Blue
unsigned char Blue
Definition: ntv2videodefines.h:180
YCbCrPixel::y
unsigned char y
Definition: ntv2videodefines.h:196
YCbCr10BitAlphaPixel::cb
UWord cb
Definition: ntv2videodefines.h:210
NTV2EndianSwap32HtoL
#define NTV2EndianSwap32HtoL(__val__)
Definition: ntv2endian.h:72
YCbCr10BitPixel::cr
UWord cr
Definition: ntv2videodefines.h:204
ntv2endian.h
Defines a number of handy byte-swapping macros.
ConvertRGBALineToRGB
void ConvertRGBALineToRGB(RGBAlphaPixel *rgbaBuffer, ULWord numPixels)
Definition: ntv2transcode.cpp:428
YCbCr10BitAlphaPixel::y
UWord y
Definition: ntv2videodefines.h:211
YCbCr10BitAlphaPixel::Alpha
UWord Alpha
Definition: ntv2videodefines.h:209
RGBAlphaPixel::Green
unsigned char Green
Definition: ntv2videodefines.h:139
HDConvertYCbCrtoRGBSmpte
void HDConvertYCbCrtoRGBSmpte(YCbCrAlphaPixel *pSource, RGBAlphaPixel *pTarget)
Definition: ntv2transcode.h:631
YCbCr10BitAlphaPixel
Definition: ntv2videodefines.h:207
ConvertARGBToBGR
void ConvertARGBToBGR(const UByte *pInRGBALineBuffer, UByte *pOutRGBLineBuffer, const ULWord inNumPixels)
Definition: ntv2transcode.cpp:730
ConvertLineToYCbCr422
void ConvertLineToYCbCr422(RGBAlphaPixel *RGBLine, UByte *YCbCrLine, LWord numPixels, LWord startPixel, bool fUseSDMatrix)
Definition: ntv2transcode.cpp:209
ConvertLineto16BitRGB
void ConvertLineto16BitRGB(UWord *ycbcrBuffer, RGBAlpha16BitPixel *rgbaBuffer, ULWord numPixels, bool fUseSDMatrix, bool fUseSMPTERange)
Definition: ntv2transcode.cpp:849
CCIR601_10BIT_WHITE
#define CCIR601_10BIT_WHITE
Definition: videoutilities.h:19
ConvertLine_8bitABGR_to_10bitABGR
bool ConvertLine_8bitABGR_to_10bitABGR(const UByte *pInSrcLine_8bitABGR, ULWord *pOutDstLine_10BitABGR, const ULWord inNumPixels)
Converts a single 8-bit ABGR raster line to 10-bit ABGR (from NTV2_FBF_ABGR to NTV2_FBF_10BIT_RGB ).
Definition: ntv2transcode.cpp:90
YCbCrPixel
Definition: ntv2videodefines.h:193
ConvertARGBYCbCrToRGBA
void ConvertARGBYCbCrToRGBA(UByte *rgbaBuffer, ULWord numPixels)
Definition: ntv2transcode.cpp:629
ConvertLine_8bitABGR_to_10bitRGBDPXLE
bool ConvertLine_8bitABGR_to_10bitRGBDPXLE(const UByte *pInSrcLine_8bitABGR, ULWord *pOutDstLine_10BitDPXLE, const ULWord inNumPixels)
Converts a single 8-bit ABGR raster line to 10-bit RGB DPX (from NTV2_FBF_ABGR to NTV2_FBF_10BIT_DPX_...
Definition: ntv2transcode.cpp:129
ConvertLine_8bitABGR_to_24bitRGB
bool ConvertLine_8bitABGR_to_24bitRGB(const UByte *pInSrcLine_8bitABGR, UByte *pOutDstLine_24BitRGB, const ULWord inNumPixels)
Converts a single 8-bit ABGR raster line to 24-bit RGB (from NTV2_FBF_ABGR to NTV2_FBF_24BIT_RGB ).
Definition: ntv2transcode.cpp:148
SDConvert10BitYCbCrto10BitRGBSmpte
void SDConvert10BitYCbCrto10BitRGBSmpte(YCbCr10BitAlphaPixel *pSource, RGBAlpha10BitPixel *pTarget)
Definition: ntv2transcode.h:686
BGRPixel
Definition: ntv2videodefines.h:179
YCbCrAlphaPixel::cb
unsigned char cb
Definition: ntv2videodefines.h:190
YCbCr10BitPixel
Definition: ntv2videodefines.h:200
Convert16BitARGBTo16BitRGB
void Convert16BitARGBTo16BitRGB(RGBAlpha16BitPixel *rgbaLineBuffer, UWord *rgbLineBuffer, ULWord numPixels)
Definition: ntv2transcode.cpp:691
ConvertLinetoRGB
void ConvertLinetoRGB(UByte *ycbcrBuffer, RGBAlphaPixel *rgbaBuffer, ULWord numPixels, bool fUseSDMatrix, bool fUseSMPTERange)
Definition: ntv2transcode.cpp:280
NTV2EndianSwap16
#define NTV2EndianSwap16(__val__)
Definition: ntv2endian.h:15
ULWord
uint32_t ULWord
Definition: ajatypes.h:246
SDConvert10BitYCbCrtoRGBSmpte
void SDConvert10BitYCbCrtoRGBSmpte(YCbCr10BitAlphaPixel *pSource, RGBAlphaPixel *pTarget)
Definition: ntv2transcode.h:604
BGRPixel::Green
unsigned char Green
Definition: ntv2videodefines.h:181
PackRGB10BitFor10BitRGB
void PackRGB10BitFor10BitRGB(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels)
Definition: ntv2transcode.cpp:745
SDConvertYCbCrtoRGBSmpte
void SDConvertYCbCrtoRGBSmpte(YCbCrAlphaPixel *pSource, RGBAlphaPixel *pTarget)
Definition: ntv2transcode.h:577
YCbCrAlphaPixel
Definition: ntv2videodefines.h:185
UWord
uint16_t UWord
Definition: ajatypes.h:244
RGBAlpha10BitPixel::Green
UWord Green
Definition: ntv2videodefines.h:147
SDConvert10BitYCbCrto10BitRGB
void SDConvert10BitYCbCrto10BitRGB(YCbCr10BitAlphaPixel *pSource, RGBAlpha10BitPixel *pTarget)
Definition: ntv2transcode.h:460
RGBAlpha16BitPixel::Red
UWord Red
Definition: ntv2videodefines.h:155
HDConvert10BitYCbCrtoRGB
void HDConvert10BitYCbCrtoRGB(const YCbCr10BitAlphaPixel *pSource, RGBAlphaPixel *pTarget)
Definition: ntv2transcode.h:432
SDConvertYCbCrtoRGB
void SDConvertYCbCrtoRGB(YCbCrAlphaPixel *pSource, RGBAlphaPixel *pTarget)
Definition: ntv2transcode.h:351
RGBPixel
Definition: ntv2videodefines.h:173
ConvertARGBToRGB
void ConvertARGBToRGB(UByte *rgbaLineBuffer, UByte *rgbLineBuffer, ULWord numPixels)
Definition: ntv2transcode.cpp:661
RGBAlpha16BitPixel::Blue
UWord Blue
Definition: ntv2videodefines.h:153
ConvertLine_2vuy_to_v210
bool ConvertLine_2vuy_to_v210(const UByte *pSrc2vuyLine, ULWord *pDstv210Line, const ULWord inNumPixels)
Converts a single 8-bit YCbCr '2vuy' raster line to 10-bit YCbCr 'v210' (from NTV2_FBF_8BIT_YCBCR to ...
Definition: ntv2transcode.cpp:14
ConvertRGBLineto10BitRGB
void ConvertRGBLineto10BitRGB(const RGBAlphaPixel *pInRGBA8Buffer, RGBAlpha10BitPixel *pOutRGBA10Buffer, const ULWord inNumPixels)
Definition: ntv2transcode.cpp:582
RGBPixel::Red
unsigned char Red
Definition: ntv2videodefines.h:174
PackRGB10BitFor10BitDPX
void PackRGB10BitFor10BitDPX(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels, const bool inBigEndian)
Definition: ntv2transcode.cpp:760
Convert16BitARGBTo12BitRGBPacked
void Convert16BitARGBTo12BitRGBPacked(RGBAlpha16BitPixel *rgbaLineBuffer, UByte *rgbLineBuffer, ULWord numPixels)
Definition: ntv2transcode.cpp:704
RGBAlpha16BitPixel
Definition: ntv2videodefines.h:152
UByte
uint8_t UByte
Definition: ajatypes.h:241
RGBAlphaPixel::Blue
unsigned char Blue
Definition: ntv2videodefines.h:138
ConvertLine_8bitABGR_to_10bitRGBDPX
bool ConvertLine_8bitABGR_to_10bitRGBDPX(const UByte *pInSrcLine_8bitABGR, ULWord *pOutDstLine_10BitDPX, const ULWord inNumPixels)
Converts a single 8-bit ABGR raster line to 10-bit RGB DPX (from NTV2_FBF_ABGR to NTV2_FBF_10BIT_DPX ...
Definition: ntv2transcode.cpp:110
YCbCr10BitAlphaPixel::cr
UWord cr
Definition: ntv2videodefines.h:212
YCbCrAlphaPixel::y
unsigned char y
Definition: ntv2videodefines.h:189
HDConvert10BitYCbCrtoRGBSmpte
void HDConvert10BitYCbCrtoRGBSmpte(YCbCr10BitAlphaPixel *pSource, RGBAlphaPixel *pTarget)
Definition: ntv2transcode.h:658
AJAExport
#define AJAExport
Definition: export.h:33
YCbCrPixel::cr
unsigned char cr
Definition: ntv2videodefines.h:197
RGBPixel::Blue
unsigned char Blue
Definition: ntv2videodefines.h:176
RGBAlpha10BitPixel::Red
UWord Red
Definition: ntv2videodefines.h:148
RGBAlpha16BitPixel::Green
UWord Green
Definition: ntv2videodefines.h:154
RGBAlpha10BitPixel::Blue
UWord Blue
Definition: ntv2videodefines.h:146
HDConvertYCbCrtoRGB
void HDConvertYCbCrtoRGB(YCbCrAlphaPixel *pSource, RGBAlphaPixel *pTarget)
Definition: ntv2transcode.h:405
PackRGB10BitFor10BitRGBPacked
void PackRGB10BitFor10BitRGBPacked(RGBAlpha10BitPixel *pBuffer, const ULWord inNumPixels)
Definition: ntv2transcode.cpp:779
YCbCrAlphaPixel::cr
unsigned char cr
Definition: ntv2videodefines.h:188
ConvertLine_v210_to_2vuy
bool ConvertLine_v210_to_2vuy(const ULWord *pSrcv210Line, UByte *pDst2vuyLine, const ULWord inNumPixels)
Converts a single 10-bit YCbCr 'v210' raster line to 8-bit YCbCr '2vuy'.
Definition: ntv2transcode.cpp:49
ConvertRGBALineToBGR
void ConvertRGBALineToBGR(RGBAlphaPixel *rgbaBuffer, ULWord numPixels)
Definition: ntv2transcode.cpp:452
ConvertLine_2vuy_to_yuy2
bool ConvertLine_2vuy_to_yuy2(const UByte *pInSrcLine_2vuy, UWord *pOutDstLine_yuy2, const ULWord inNumPixels)
Converts a single 8-bit YCbCr '2vuy' raster line to 10-bit YCbCr 'v210' (from NTV2_FBF_8BIT_YCBCR to ...
Definition: ntv2transcode.cpp:32
RGBAlpha10BitPixel
Definition: ntv2videodefines.h:145
YCbCr10BitPixel::y
UWord y
Definition: ntv2videodefines.h:203
BGRPixel::Red
unsigned char Red
Definition: ntv2videodefines.h:182
ConvertLine_8bitABGR_to_24bitBGR
bool ConvertLine_8bitABGR_to_24bitBGR(const UByte *pInSrcLine_8bitABGR, UByte *pOutDstLine_24BitBGR, const ULWord inNumPixels)
Converts a single 8-bit ABGR raster line to 24-bit BGR (from NTV2_FBF_ABGR to NTV2_FBF_24BIT_BGR ).
Definition: ntv2transcode.cpp:167
RGBAlphaPixel
Definition: ntv2videodefines.h:137
SDConvertRGBAlphatoYCbCr
void SDConvertRGBAlphatoYCbCr(RGBAlphaPixel *pSource, YCbCrPixel *pTarget)
Definition: ntv2transcode.h:262
ConvertLineto10BitRGB
void ConvertLineto10BitRGB(UWord *ycbcrBuffer, RGBAlpha10BitPixel *rgbaBuffer, ULWord numPixels, bool fUseSDMatrix, bool fUseSMPTERange)
Definition: ntv2transcode.cpp:474
HDConvert10BitYCbCrto10BitRGBSmpte
void HDConvert10BitYCbCrto10BitRGBSmpte(YCbCr10BitAlphaPixel *pSource, RGBAlpha10BitPixel *pTarget)
Definition: ntv2transcode.h:713
HDConvert10BitYCbCrto10BitRGB
void HDConvert10BitYCbCrto10BitRGB(YCbCr10BitAlphaPixel *pSource, RGBAlpha10BitPixel *pTarget)
Definition: ntv2transcode.h:487