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 UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
291 Cb1 = *ycbcrBuffer++;
293 Cr1 = *ycbcrBuffer++;
294 for (
ULWord count = 0; count < numPixels; count+=2 )
301 if (fUseSMPTERange) {
307 if (fUseSMPTERange) {
314 ycbcrPixel.
y = *ycbcrBuffer++;
317 Cb2 = *ycbcrBuffer++;
319 Cr2 = *ycbcrBuffer++;
322 ycbcrPixel.
cb = (
UByte)((Cb1+Cb2)/2);
323 ycbcrPixel.
cr = (
UByte)((Cr1+Cr2)/2);
325 if (fUseSMPTERange) {
331 if (fUseSMPTERange) {
355 UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
359 Cb1 = *ycbcrBuffer++;
361 Cr1 = *ycbcrBuffer++;
362 for (
ULWord count = 0; count < numPixels; count+=2 )
371 if (fUseSMPTERange) {
377 if (fUseSMPTERange) {
384 ycbcrPixel.
y = *ycbcrBuffer++;
388 if ( (count + 2 ) >= numPixels )
396 Cb2 = *ycbcrBuffer++;
398 Cr2 = *ycbcrBuffer++;
401 ycbcrPixel.
cb = (
UWord)((Cb1+Cb2)/2);
402 ycbcrPixel.
cr = (
UWord)((Cr1+Cr2)/2);
404 if (fUseSMPTERange) {
410 if (fUseSMPTERange) {
433 for (
ULWord pixel=0; pixel<numPixels; pixel++ )
439 rgbLineBuffer->
Red = R;
440 rgbLineBuffer->
Green = G;
441 rgbLineBuffer->
Blue = B;
457 for (
ULWord pixel=0; pixel<numPixels; pixel++ )
463 bgrLineBuffer->
Blue = B;
464 bgrLineBuffer->
Green = G;
465 bgrLineBuffer->
Red = R;
481 UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
485 Cb1 = *ycbcrBuffer++;
487 Cr1 = *ycbcrBuffer++;
488 for (
ULWord count = 0; count < numPixels; count+=2 )
495 if (fUseSMPTERange) {
501 if (fUseSMPTERange) {
508 ycbcrPixel.
y = *ycbcrBuffer++;
512 if ( (count + 2 ) >= numPixels )
520 Cb2 = *ycbcrBuffer++;
522 Cr2 = *ycbcrBuffer++;
525 ycbcrPixel.
cb = (
UWord)((Cb1+Cb2)/2);
526 ycbcrPixel.
cr = (
UWord)((Cr1+Cr2)/2);
528 if (fUseSMPTERange) {
534 if (fUseSMPTERange) {
551 ULWord * pOutYCbCrABuffer,
554 for (
ULWord count(0); count < inNumPixels; count++)
557 value |= (
ULWord(*pInYCbCrBuffer++)<<10);
558 value |= *pInYCbCrBuffer++;
559 pOutYCbCrABuffer[count] = value;
570 for (
ULWord count(0); count < inNumPixels; count++)
572 *pOutRGB10Buffer = (
ULWord(pInRGBA8Buffer->
Blue)<<22) +
586 for (
ULWord i(0); i < inNumPixels; i++)
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);
601 UByte * ycbcr8BitBuffer,
604 for (
ULWord pixel=0;pixel<numPixels*2;pixel++)
606 ycbcr8BitBuffer[pixel] = ycbcr10BitBuffer[pixel]>>2;
615 for (
ULWord pixel=0;pixel<numPixels*2;pixel+=4)
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;
631 for (
ULWord pixel=0;pixel<numPixels*4;pixel+=4)
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;
647 for (
ULWord pixel=0;pixel<numPixels*4;pixel+=4)
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;
663 for (
ULWord pixel=0;pixel<numPixels*4;pixel+=4)
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;
678 for (
ULWord pixel=0;pixel<numPixels*4;pixel+=4)
685 *rgbLineBuffer++ = R;
686 *rgbLineBuffer++ = G;
687 *rgbLineBuffer++ = B;
693 for (
ULWord pixel=0;pixel<numPixels;pixel++)
697 UWord R = rgbaLineBuffer[pixel].
Red;
698 *rgbLineBuffer++ = R;
699 *rgbLineBuffer++ = G;
700 *rgbLineBuffer++ = B;
706 for (
ULWord pixel=0;pixel<numPixels;pixel+=8)
708 for(
ULWord i = 0;i<8;i+=2)
710 UWord R = rgbaLineBuffer[pixel+i].
Red;
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;
732 for (
ULWord pixel = 0; pixel < inNumPixels * 4; pixel += 4)
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;
747 ULWord* outputBuffer(
reinterpret_cast<ULWord*
>(pBuffer));
748 for (
ULWord pixel(0); pixel < inNumPixels; pixel++)
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;
762 ULWord * pOutputBuffer (
reinterpret_cast<ULWord*
>(pBuffer));
763 for (
ULWord pixel(0); pixel < inNumPixels; pixel++)
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));
770 pOutputBuffer[pixel] = ((value&0xFF)<<24) + (((value>>8)&0xFF)<<16) + (((value>>16)&0xFF)<<8) + ((value>>24)&0xFF);
772 pOutputBuffer[pixel] = value;
781 ULWord * pOutputBuffer (
reinterpret_cast<ULWord*
>(pBuffer));
782 for (
ULWord pixel(0); pixel < inNumPixels; pixel++)
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);
790 pOutputBuffer[pixel] = value;
856 UWord Cb1,Y1,Cr1,Cb2,Y2,Cr2;
860 Cb1 = *ycbcrBuffer++;
862 Cr1 = *ycbcrBuffer++;
863 for (
ULWord count = 0; count < numPixels; count+=2 )
870 if (fUseSMPTERange) {
875 rgbaBuffer[count].
Red = (rgbaBuffer[count].
Red) << 6;
876 rgbaBuffer[count].
Green = (rgbaBuffer[count].
Green) << 6;
877 rgbaBuffer[count].
Blue = (rgbaBuffer[count].
Blue) << 6;
879 if (fUseSMPTERange) {
884 rgbaBuffer[count].
Red = (rgbaBuffer[count].
Red) << 6;
885 rgbaBuffer[count].
Green = (rgbaBuffer[count].
Green) << 6;
886 rgbaBuffer[count].
Blue = (rgbaBuffer[count].
Blue) << 6;
890 ycbcrPixel.
y = *ycbcrBuffer++;
894 if ( (count + 2 ) >= numPixels )
902 Cb2 = *ycbcrBuffer++;
904 Cr2 = *ycbcrBuffer++;
907 ycbcrPixel.
cb = (
UWord)((Cb1+Cb2)/2);
908 ycbcrPixel.
cr = (
UWord)((Cr1+Cr2)/2);
910 if (fUseSMPTERange) {
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;
919 if (fUseSMPTERange) {
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;