From: <dsa...@us...> - 2003-11-23 22:17:38
|
Update of /cvsroot/openh323/pwlib/src/ptlib/common In directory sc8-pr-cvs1:/tmp/cvs-serv1077 Modified Files: vconvert.cxx videoio.cxx Log Message: Added YUV420P to BGR24 and BGR32 conversion. Index: vconvert.cxx =================================================================== RCS file: /cvsroot/openh323/pwlib/src/ptlib/common/vconvert.cxx,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** vconvert.cxx 14 Jun 2003 02:57:36 -0000 1.34 --- vconvert.cxx 23 Nov 2003 22:17:35 -0000 1.35 *************** *** 27,30 **** --- 27,33 ---- * * $Log$ + * Revision 1.35 2003/11/23 22:17:35 dsandras + * Added YUV420P to BGR24 and BGR32 conversion. + * * Revision 1.34 2003/06/14 02:57:36 rjongbloed * REmoved redundent parameter, grey scale does not have rgb increment! *************** *** 163,166 **** --- 166,170 ---- PSYNONYM_COLOUR_CONVERTER(BGR24F, BGR24F); PSYNONYM_COLOUR_CONVERTER(RGB32, RGB32); + PSYNONYM_COLOUR_CONVERTER(BGR32, BGR32); PSYNONYM_COLOUR_CONVERTER(RGB32F, RGB32F); PSYNONYM_COLOUR_CONVERTER(YUV411P,YUV411P); *************** *** 202,206 **** BYTE * yuv, unsigned rgbIncrement, ! BOOL flipVertical ) const; void RGBtoYUV420PWithResize( --- 206,211 ---- BYTE * yuv, unsigned rgbIncrement, ! BOOL flipVertical, ! BOOL flipBR ) const; void RGBtoYUV420PWithResize( *************** *** 208,212 **** BYTE * yuv, unsigned rgbIncrement, ! BOOL flipVertical ) const; BOOL RGBtoYUV420P( --- 213,218 ---- BYTE * yuv, unsigned rgbIncrement, ! BOOL flipVertical, ! BOOL flipBR ) const; BOOL RGBtoYUV420P( *************** *** 215,219 **** PINDEX * bytesReturned, unsigned rgbIncrement, ! BOOL flipVertical ) const; BOOL YUV420PtoRGB( --- 221,226 ---- PINDEX * bytesReturned, unsigned rgbIncrement, ! BOOL flipVertical, ! BOOL flipBR ) const; BOOL YUV420PtoRGB( *************** *** 533,537 **** BYTE * yuv, unsigned rgbIncrement, ! BOOL flip) const { const unsigned planeSize = srcFrameWidth*srcFrameHeight; --- 540,545 ---- BYTE * yuv, unsigned rgbIncrement, ! BOOL flip, ! BOOL flipBR) const { const unsigned planeSize = srcFrameWidth*srcFrameHeight; *************** *** 553,560 **** for (unsigned x = 0; x < srcFrameWidth; x+=2) { ! rgbtoy(rgbIndex[0], rgbIndex[1], rgbIndex[2],*yline); rgbIndex += rgbIncrement; yline++; ! rgbtoyuv(rgbIndex[0], rgbIndex[1], rgbIndex[2],*yline, *uline, *vline); rgbIndex += rgbIncrement; yline++; --- 561,584 ---- for (unsigned x = 0; x < srcFrameWidth; x+=2) { ! if (!flipBR) { ! ! rgbtoy(rgbIndex[0], rgbIndex[1], rgbIndex[2],*yline); ! } ! else { ! ! rgbtoy(rgbIndex[2], rgbIndex[1], rgbIndex[0],*yline); ! } ! rgbIndex += rgbIncrement; yline++; ! if (!flipBR) { ! ! rgbtoyuv(rgbIndex[0], rgbIndex[1], rgbIndex[2],*yline, *uline, *vline); ! } ! else { ! ! rgbtoyuv(rgbIndex[2], rgbIndex[1], rgbIndex[0],*yline, *uline, *vline); ! } ! rgbIndex += rgbIncrement; yline++; *************** *** 571,575 **** BYTE * yuv, unsigned rgbIncrement, ! BOOL flip) const { int planeSize = dstFrameWidth*dstFrameHeight; --- 595,600 ---- BYTE * yuv, unsigned rgbIncrement, ! BOOL flip, ! BOOL flipBR) const { int planeSize = dstFrameWidth*dstFrameHeight; *************** *** 595,604 **** rgbIndex = rgb + (srcFrameWidth*(min_height-1-y)*rgbIncrement); ! for (unsigned x = 0; x < min_width; x+=2) ! { ! rgbtoy(rgbIndex[0], rgbIndex[1], rgbIndex[2],*yline); rgbIndex += rgbIncrement; yline++; ! rgbtoyuv(rgbIndex[0], rgbIndex[1], rgbIndex[2],*yline, *uline, *vline); rgbIndex += rgbIncrement; yline++; --- 620,641 ---- rgbIndex = rgb + (srcFrameWidth*(min_height-1-y)*rgbIncrement); ! for (unsigned x = 0; x < min_width; x+=2) { ! if (!flipBR) { ! rgbtoy(rgbIndex[0], rgbIndex[1], rgbIndex[2],*yline); ! } ! else { ! rgbtoy(rgbIndex[2], rgbIndex[1], rgbIndex[0],*yline); ! } rgbIndex += rgbIncrement; yline++; ! if (!flipBR) { ! ! rgbtoyuv(rgbIndex[0], rgbIndex[1], rgbIndex[2],*yline, *uline, *vline); ! } ! else { ! ! rgbtoyuv(rgbIndex[2], rgbIndex[1], rgbIndex[0],*yline, *uline, *vline); ! } ! rgbIndex += rgbIncrement; yline++; *************** *** 637,641 **** PINDEX * bytesReturned, unsigned rgbIncrement, ! BOOL flip) const { if (rgb == yuv) --- 674,679 ---- PINDEX * bytesReturned, unsigned rgbIncrement, ! BOOL flip, ! BOOL flipBR) const { if (rgb == yuv) *************** *** 643,649 **** if ((srcFrameWidth == dstFrameWidth) && (srcFrameHeight == dstFrameHeight)) ! RGBtoYUV420PSameSize(rgb, yuv, rgbIncrement, flip); else ! RGBtoYUV420PWithResize(rgb, yuv, rgbIncrement, flip); if (bytesReturned != NULL) --- 681,687 ---- if ((srcFrameWidth == dstFrameWidth) && (srcFrameHeight == dstFrameHeight)) ! RGBtoYUV420PSameSize(rgb, yuv, rgbIncrement, flip, flipBR); else ! RGBtoYUV420PWithResize(rgb, yuv, rgbIncrement, flip, flipBR); if (bytesReturned != NULL) *************** *** 662,666 **** PSTANDARD_COLOUR_CONVERTER(RGB24,YUV420P) { ! return RGBtoYUV420P(srcFrameBuffer, dstFrameBuffer, bytesReturned, 3, doVFlip); } --- 700,710 ---- PSTANDARD_COLOUR_CONVERTER(RGB24,YUV420P) { ! return RGBtoYUV420P(srcFrameBuffer, dstFrameBuffer, bytesReturned, 3, doVFlip, FALSE); ! } ! ! ! PSTANDARD_COLOUR_CONVERTER(BGR24,YUV420P) ! { ! return RGBtoYUV420P(srcFrameBuffer, dstFrameBuffer, bytesReturned, 3, doVFlip, TRUE); } *************** *** 668,672 **** PSTANDARD_COLOUR_CONVERTER(RGB32,YUV420P) { ! return RGBtoYUV420P(srcFrameBuffer, dstFrameBuffer, bytesReturned, 4, doVFlip); } --- 712,722 ---- PSTANDARD_COLOUR_CONVERTER(RGB32,YUV420P) { ! return RGBtoYUV420P(srcFrameBuffer, dstFrameBuffer, bytesReturned, 4, doVFlip, FALSE); ! } ! ! ! PSTANDARD_COLOUR_CONVERTER(BGR32,YUV420P) ! { ! return RGBtoYUV420P(srcFrameBuffer, dstFrameBuffer, bytesReturned, 4, doVFlip, TRUE); } *************** *** 674,678 **** PSTANDARD_COLOUR_CONVERTER(RGB24F,YUV420P) { ! return RGBtoYUV420P(srcFrameBuffer, dstFrameBuffer, bytesReturned, 3, doVFlip); } --- 724,728 ---- PSTANDARD_COLOUR_CONVERTER(RGB24F,YUV420P) { ! return RGBtoYUV420P(srcFrameBuffer, dstFrameBuffer, bytesReturned, 3, doVFlip, FALSE); } *************** *** 686,690 **** PSTANDARD_COLOUR_CONVERTER(RGB32F,YUV420P) { ! return RGBtoYUV420P(srcFrameBuffer, dstFrameBuffer, bytesReturned, 4, doVFlip); } --- 736,740 ---- PSTANDARD_COLOUR_CONVERTER(RGB32F,YUV420P) { ! return RGBtoYUV420P(srcFrameBuffer, dstFrameBuffer, bytesReturned, 4, doVFlip, FALSE); } *************** *** 938,941 **** --- 988,996 ---- { return YUV420PtoRGB(srcFrameBuffer, dstFrameBuffer, bytesReturned, 4, doVFlip, FALSE); + } + + PSTANDARD_COLOUR_CONVERTER(YUV420P,BGR32) + { + return YUV420PtoRGB(srcFrameBuffer, dstFrameBuffer, bytesReturned, 4, doVFlip, TRUE); } Index: videoio.cxx =================================================================== RCS file: /cvsroot/openh323/pwlib/src/ptlib/common/videoio.cxx,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** videoio.cxx 19 Nov 2003 04:30:15 -0000 1.42 --- videoio.cxx 23 Nov 2003 22:17:35 -0000 1.43 *************** *** 25,28 **** --- 25,31 ---- * * $Log$ + * Revision 1.43 2003/11/23 22:17:35 dsandras + * Added YUV420P to BGR24 and BGR32 conversion. + * * Revision 1.42 2003/11/19 04:30:15 csoutheren * Changed to support video output plugins *************** *** 391,394 **** --- 394,398 ---- { "BGR24F", 24 }, { "RGB32", 32 }, + { "BGR32", 32 }, { "RGB32F", 32 }, { "YUV422", 16 }, |