16 if (!pSrc2vuyLine || !pDstv210Line || !inNumPixels)
19 for (
UWord inputCount = 0, outputCount = 0; inputCount < (inNumPixels * 2); outputCount += 4, inputCount += 12)
34 if (!pInSrcLine_2vuy || !pOutDstLine_yuy2 || !inNumPixels)
37 const UWord* pSrc =
reinterpret_cast<const UWord*
>(pInSrcLine_2vuy);
38 UWord* pDst = pOutDstLine_yuy2;
40 for (
UWord pixIndex(0); pixIndex < inNumPixels; pixIndex++)
51 if (!pSrcv210Line || !pDst2vuyLine || !inNumPixels)
54 for (
ULWord sampleCount = 0, dataCount = 0; sampleCount < (inNumPixels * 2); sampleCount += 3, dataCount++)
56 const UByte * pByte (
reinterpret_cast<const UByte*
>(&pSrcv210Line[dataCount]));
59 pDst2vuyLine[sampleCount ] = ((pByte[1] & 0x03) << 6) + (pByte[0] >> 2);
60 pDst2vuyLine[sampleCount + 1] = ((pByte[2] & 0x0F) << 4) + (pByte[1] >> 4);
61 pDst2vuyLine[sampleCount + 2] = ((pByte[3] & 0x3F) << 2) + (pByte[2] >> 6);
71 const ULWord * pInSrcLine (
reinterpret_cast<const ULWord*
>(pInSrcLine_v210));
72 outDstLine2vuy.clear();
73 if (!pInSrcLine || !inNumPixels)
76 outDstLine2vuy.reserve(inNumPixels * 2);
77 for (
ULWord sampleCount = 0, dataCount = 0; sampleCount < (inNumPixels * 2); sampleCount += 3, dataCount++)
79 const UByte * pByte (
reinterpret_cast<const UByte*
>(&pInSrcLine[dataCount]));
82 outDstLine2vuy.push_back(
UByte((pByte[1] & 0x03) << 6) | (pByte[0] >> 2));
83 outDstLine2vuy.push_back(
UByte((pByte[2] & 0x0F) << 4) | (pByte[1] >> 4));
84 outDstLine2vuy.push_back(
UByte((pByte[3] & 0x3F) << 2) | (pByte[2] >> 6));
92 if (!pInSrcLine_8bitABGR || !pOutDstLine_10BitABGR || !inNumPixels)
95 const ULWord* pSrc =
reinterpret_cast<const ULWord*
>(pInSrcLine_8bitABGR);
96 ULWord* pDst =
reinterpret_cast< ULWord*
>(pOutDstLine_10BitABGR);
98 for (
ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
100 *pDst = ((*pSrc & 0x000000FF) << 2) |
101 ((*pSrc & 0x0000FF00) << 4) |
102 ((*pSrc & 0x00FF0000) << 6) |
103 ((*pSrc & 0xC0000000) );
112 if (!pInSrcLine_8bitABGR || !pOutDstLine_10BitDPX || !inNumPixels)
115 const ULWord* pSrc =
reinterpret_cast<const ULWord*
>(pInSrcLine_8bitABGR);
116 ULWord* pDst =
reinterpret_cast< ULWord*
>(pOutDstLine_10BitDPX);
118 for (
ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
120 *pDst = ((*pSrc & 0x000000FF) ) +
121 ((*pSrc & 0x0000FC00) >> 2) + ((*pSrc & 0x00000300) << 14) +
122 ((*pSrc & 0x00F00000) >> 4) + ((*pSrc & 0x000F0000) << 12);
131 if (!pInSrcLine_8bitABGR || !pOutDstLine_10BitDPXLE || !inNumPixels)
134 const ULWord* pSrc =
reinterpret_cast<const ULWord*
>(pInSrcLine_8bitABGR);
135 ULWord* pDst =
reinterpret_cast< ULWord*
>(pOutDstLine_10BitDPXLE);
137 for (
ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
139 *pDst = ((*pSrc & 0x000000FF) << 24) |
140 ((*pSrc & 0x0000FF00) << 6) |
141 ((*pSrc & 0x00FF0000) >> 12);
150 if (!pInSrcLine_8bitABGR || !pOutDstLine_24BitRGB || !inNumPixels)
153 const UByte* pSrc =
reinterpret_cast<const UByte*
>(pInSrcLine_8bitABGR);
154 UByte* pDst =
reinterpret_cast<UByte*
>(pOutDstLine_24BitRGB);
156 for (
ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
169 if (!pInSrcLine_8bitABGR || !pOutDstLine_24BitBGR || !inNumPixels)
172 const UByte* pSrc =
reinterpret_cast<const UByte*
>(pInSrcLine_8bitABGR);
173 UByte* pDst =
reinterpret_cast<UByte*
>(pOutDstLine_24BitBGR);
175 for (
ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
177 UByte r(*pSrc++), g(*pSrc++), b(*pSrc++);
189 if (!pInSrcLine_8bitABGR || !pOutDstLine_48BitRGB || !inNumPixels)
192 const UByte* pSrc =
reinterpret_cast<const UByte*
>(pInSrcLine_8bitABGR);
193 UByte* pDst =
reinterpret_cast<UByte*
>(pOutDstLine_48BitRGB);
195 for (
ULWord pixCount = 0; pixCount < inNumPixels; pixCount++)
197 UByte r(*pSrc++), g(*pSrc++), b(*pSrc++);
216 UByte *pYCbCr = &YCbCrLine[(startPixel&~1)*2];
218 for (
LWord pixel = 0; pixel < numPixels; pixel++ )
232 *pYCbCr++ = YCbCr.
cb;
234 *pYCbCr++ = YCbCr.
cr;
250 UWord *pYCbCr = &YCbCrLine[(startPixel&~1)*2];
252 for (
LWord pixel = 0; pixel < numPixels; pixel++ )
266 *pYCbCr++ = YCbCr.
cb;
268 *pYCbCr++ = YCbCr.
cr;
287 ycbcrPixel.
Alpha = 0;
288 UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
292 Cb1 = *ycbcrBuffer++;
294 Cr1 = *ycbcrBuffer++;
295 for (
ULWord count = 0; count < numPixels; count+=2 )
302 if (fUseSMPTERange) {
308 if (fUseSMPTERange) {
315 ycbcrPixel.
y = *ycbcrBuffer++;
318 Cb2 = *ycbcrBuffer++;
320 Cr2 = *ycbcrBuffer++;
323 ycbcrPixel.
cb = (
UByte)((Cb1+Cb2)/2);
324 ycbcrPixel.
cr = (
UByte)((Cr1+Cr2)/2);
326 if (fUseSMPTERange) {
332 if (fUseSMPTERange) {
356 UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
360 Cb1 = *ycbcrBuffer++;
362 Cr1 = *ycbcrBuffer++;
363 for (
ULWord count = 0; count < numPixels; count+=2 )
372 if (fUseSMPTERange) {
378 if (fUseSMPTERange) {
385 ycbcrPixel.
y = *ycbcrBuffer++;
389 if ( (count + 2 ) >= numPixels )
397 Cb2 = *ycbcrBuffer++;
399 Cr2 = *ycbcrBuffer++;
402 ycbcrPixel.
cb = (
UWord)((Cb1+Cb2)/2);
403 ycbcrPixel.
cr = (
UWord)((Cr1+Cr2)/2);
405 if (fUseSMPTERange) {
411 if (fUseSMPTERange) {
434 for (
ULWord pixel=0; pixel<numPixels; pixel++ )
440 rgbLineBuffer->
Red = R;
441 rgbLineBuffer->
Green = G;
442 rgbLineBuffer->
Blue = B;
458 for (
ULWord pixel=0; pixel<numPixels; pixel++ )
464 bgrLineBuffer->
Blue = B;
465 bgrLineBuffer->
Green = G;
466 bgrLineBuffer->
Red = R;
482 UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
486 Cb1 = *ycbcrBuffer++;
488 Cr1 = *ycbcrBuffer++;
489 for (
ULWord count = 0; count < numPixels; count+=2 )
496 if (fUseSMPTERange) {
502 if (fUseSMPTERange) {
509 ycbcrPixel.
y = *ycbcrBuffer++;
513 if ( (count + 2 ) >= numPixels )
521 Cb2 = *ycbcrBuffer++;
523 Cr2 = *ycbcrBuffer++;
526 ycbcrPixel.
cb = (
UWord)((Cb1+Cb2)/2);
527 ycbcrPixel.
cr = (
UWord)((Cr1+Cr2)/2);
529 if (fUseSMPTERange) {
535 if (fUseSMPTERange) {
552 ULWord * pOutYCbCrABuffer,
555 for (
ULWord count(0); count < inNumPixels; count++)
558 value |= (
ULWord(*pInYCbCrBuffer++)<<10);
559 value |= *pInYCbCrBuffer++;
560 pOutYCbCrABuffer[count] = value;
571 for (
ULWord count(0); count < inNumPixels; count++)
573 *pOutRGB10Buffer = (
ULWord(pInRGBA8Buffer->
Blue)<<22) +
587 for (
ULWord i(0); i < inNumPixels; i++)
589 pOutRGBA10Buffer[i].
Blue = (pInRGBA8Buffer[i].
Blue<<2);
590 pOutRGBA10Buffer[i].
Green = (pInRGBA8Buffer[i].
Green<<2);
591 pOutRGBA10Buffer[i].
Red = (pInRGBA8Buffer[i].
Red<<2);
592 pOutRGBA10Buffer[i].
Alpha = (pInRGBA8Buffer[i].
Alpha<<2);
602 UByte * ycbcr8BitBuffer,
605 for (
ULWord pixel=0;pixel<numPixels*2;pixel++)
607 ycbcr8BitBuffer[pixel] = ycbcr10BitBuffer[pixel]>>2;
616 for (
ULWord pixel=0;pixel<numPixels*2;pixel+=4)
618 UByte Cb = ycbcrBuffer[pixel];
619 UByte Y1 = ycbcrBuffer[pixel+1];
620 UByte Cr = ycbcrBuffer[pixel+2];
621 UByte Y2 = ycbcrBuffer[pixel+3];
622 ycbcrBuffer[pixel] = Y1;
623 ycbcrBuffer[pixel+1] = Cb;
624 ycbcrBuffer[pixel+2] = Y2;
625 ycbcrBuffer[pixel+3] = Cr;
632 for (
ULWord pixel=0;pixel<numPixels*4;pixel+=4)
634 UByte B = rgbaBuffer[pixel];
635 UByte G = rgbaBuffer[pixel+1];
636 UByte R = rgbaBuffer[pixel+2];
637 UByte A = rgbaBuffer[pixel+3];
638 rgbaBuffer[pixel] = A;
639 rgbaBuffer[pixel+1] = R;
640 rgbaBuffer[pixel+2] = G;
641 rgbaBuffer[pixel+3] = B;
648 for (
ULWord pixel=0;pixel<numPixels*4;pixel+=4)
650 UByte B = rgbaBuffer[pixel];
651 UByte G = rgbaBuffer[pixel+1];
652 UByte R = rgbaBuffer[pixel+2];
653 UByte A = rgbaBuffer[pixel+3];
654 rgbaBuffer[pixel] = R;
655 rgbaBuffer[pixel+1] = G;
656 rgbaBuffer[pixel+2] = B;
657 rgbaBuffer[pixel+3] = A;
664 for (
ULWord pixel=0;pixel<numPixels*4;pixel+=4)
666 UByte B = rgbaLineBuffer[pixel];
667 UByte G = rgbaLineBuffer[pixel+1];
668 UByte R = rgbaLineBuffer[pixel+2];
669 *rgbLineBuffer++ = R;
670 *rgbLineBuffer++ = G;
671 *rgbLineBuffer++ = B;
679 for (
ULWord pixel=0;pixel<numPixels*4;pixel+=4)
686 *rgbLineBuffer++ = R;
687 *rgbLineBuffer++ = G;
688 *rgbLineBuffer++ = B;
694 for (
ULWord pixel=0;pixel<numPixels;pixel++)
698 UWord R = rgbaLineBuffer[pixel].
Red;
699 *rgbLineBuffer++ = R;
700 *rgbLineBuffer++ = G;
701 *rgbLineBuffer++ = B;
707 for (
ULWord pixel=0;pixel<numPixels;pixel+=8)
709 for(
ULWord i = 0;i<8;i+=2)
711 UWord R = rgbaLineBuffer[pixel+i].
Red;
714 *rgbLineBuffer++ = (R & 0xFF00)>>8;
715 *rgbLineBuffer++ = (((R & 0x00F0)) | ((G & 0xF000)>>12));
716 *rgbLineBuffer++ = (G & 0x0FF0)>>4;
717 *rgbLineBuffer++ = (B & 0xFF00)>>8;
718 R = rgbaLineBuffer[pixel+i+1].
Red;
719 *rgbLineBuffer++ = (((B & 0x00F0)) | ((R & 0xF000)>>12));
720 *rgbLineBuffer++ = (R & 0x0FF0)>>4;
721 G = rgbaLineBuffer[pixel+i+1].
Green;
722 B = rgbaLineBuffer[pixel+i+1].
Blue;
723 *rgbLineBuffer++ = (G & 0xFF00)>>8;
724 *rgbLineBuffer++ = (((G & 0x00F0)) | ((B & 0xF000)>>12));
725 *rgbLineBuffer++ = (B & 0x0FF0)>>4;
733 for (
ULWord pixel = 0; pixel < inNumPixels * 4; pixel += 4)
735 UByte B = pInRGBALineBuffer[pixel];
736 UByte G = pInRGBALineBuffer[pixel+1];
737 UByte R = pInRGBALineBuffer[pixel+2];
738 *pOutRGBLineBuffer++ = B;
739 *pOutRGBLineBuffer++ = G;
740 *pOutRGBLineBuffer++ = R;
748 ULWord* outputBuffer(
reinterpret_cast<ULWord*
>(pBuffer));
749 for (
ULWord pixel(0); pixel < inNumPixels; pixel++)
751 const ULWord Red (pBuffer[pixel].Red);
752 const ULWord Green (pBuffer[pixel].Green);
753 const ULWord Blue (pBuffer[pixel].Blue);
754 outputBuffer[pixel] = (Blue<<20) + (Green<<10) + Red;
763 ULWord * pOutputBuffer (
reinterpret_cast<ULWord*
>(pBuffer));
764 for (
ULWord pixel(0); pixel < inNumPixels; pixel++)
766 const ULWord Red (pBuffer[pixel].Red);
767 const ULWord Green (pBuffer[pixel].Green);
768 const ULWord Blue (pBuffer[pixel].Blue);
769 const ULWord value ((Red << 22) + (Green << 12) + (Blue << 2));
771 pOutputBuffer[pixel] = ((value&0xFF)<<24) + (((value>>8)&0xFF)<<16) + (((value>>16)&0xFF)<<8) + ((value>>24)&0xFF);
773 pOutputBuffer[pixel] = value;
782 ULWord * pOutputBuffer (
reinterpret_cast<ULWord*
>(pBuffer));
783 for (
ULWord pixel(0); pixel < inNumPixels; pixel++)
785 const ULWord Red (pBuffer[pixel].Red);
786 const ULWord Green (pBuffer[pixel].Green);
787 const ULWord Blue (pBuffer[pixel].Blue);
788 ULWord value = (((Red>>2)&0xFF)<<16) + (((Green>>2)&0xFF)<<8) + ((Blue>>2)&0xFF);
789 value |= ((Red&0x3)<<28) + ((Green&0x3)<<26) + ((Blue&0x3)<<24);
791 pOutputBuffer[pixel] = value;
857 UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
861 Cb1 = *ycbcrBuffer++;
863 Cr1 = *ycbcrBuffer++;
864 for (
ULWord count = 0; count < numPixels; count+=2 )
871 if (fUseSMPTERange) {
876 rgbaBuffer[count].
Red = (rgbaBuffer[count].
Red) << 6;
877 rgbaBuffer[count].
Green = (rgbaBuffer[count].
Green) << 6;
878 rgbaBuffer[count].
Blue = (rgbaBuffer[count].
Blue) << 6;
880 if (fUseSMPTERange) {
885 rgbaBuffer[count].
Red = (rgbaBuffer[count].
Red) << 6;
886 rgbaBuffer[count].
Green = (rgbaBuffer[count].
Green) << 6;
887 rgbaBuffer[count].
Blue = (rgbaBuffer[count].
Blue) << 6;
891 ycbcrPixel.
y = *ycbcrBuffer++;
895 if ( (count + 2 ) >= numPixels )
903 Cb2 = *ycbcrBuffer++;
905 Cr2 = *ycbcrBuffer++;
908 ycbcrPixel.
cb = (
UWord)((Cb1+Cb2)/2);
909 ycbcrPixel.
cr = (
UWord)((Cr1+Cr2)/2);
911 if (fUseSMPTERange) {
916 rgbaBuffer[count+1].
Red = (rgbaBuffer[count+1].
Red) << 6;
917 rgbaBuffer[count+1].
Green = (rgbaBuffer[count+1].
Green) << 6;
918 rgbaBuffer[count+1].
Blue = (rgbaBuffer[count+1].
Blue) << 6;
920 if (fUseSMPTERange) {
925 rgbaBuffer[count+1].
Red = (rgbaBuffer[count+1].
Red) << 6;
926 rgbaBuffer[count+1].
Green = (rgbaBuffer[count+1].
Green) << 6;
927 rgbaBuffer[count+1].
Blue = (rgbaBuffer[count+1].
Blue) << 6;