[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-video-dev
Subject: RE: [Video-dev] CR: Add missing XING color converters for
From: "Eric Hyche" <ehyche () real ! com>
Date: 2009-01-06 14:32:41
Message-ID: 008701c9700b$a2811710$e7834530$ () com
[Download RAW message or body]
Looks good.
=======================================
Eric Hyche (ehyche@real.com)
Principal Engineer
RealNetworks, Inc.
>-----Original Message-----
>From: video-dev-bounces@helixcommunity.org [mailto:video-dev-bounces@helixcommunity.org] On Behalf Of
>Greg Wright
>Sent: Monday, January 05, 2009 7:58 PM
>To: video-dev@helixcommunity.org
>Subject: [Video-dev] CR: Add missing XING color converters for non-windows platforms.
>
>XING content was not playing on non-window machines because the only
>XING color converters we had were stubbed out with this define:
>
>#if defined(_WIN32) && defined(_M_IX86) && !defined(WINCE_EMULATOR)
>
>
>The color converters themselves are straight C. They have the
>ability to use MMX on x86 platforms but a #define must be set
>first. So, these routines are actually just fine on non-windows
>platforms. If you are not on a x86 box, then they could be
>optimized, but they will work.
>
>I also cleaned up some of the code removed code we have not used
>since we overhauled the color converter (wrote new 'x' versions)
>years ago.
>
>
>tested on linux. Bob, you might want to take a quick look. For example,
>do you define USE_MMX or USE_MMX_BLENDERS? If not, it might be worth
>a look to get the performance boost.
>
>
>HEAD and 310Atlas.
>--greg.
>
>
>
>
>Index: yuv2yuv.c
>===================================================================
>RCS file: /cvsroot/video/colconverter/yuv2yuv.c,v
>retrieving revision 1.9
>diff -u -w -r1.9 yuv2yuv.c
>--- yuv2yuv.c 6 Jul 2007 20:53:51 -0000 1.9
>+++ yuv2yuv.c 6 Jan 2009 00:45:21 -0000
>@@ -3711,16 +3711,11 @@
> src_x, src_y, src_dx, src_dy);
> }
>
>-/*** from XING" converters: Will only work on Win32 with _IX86 *******************************/
>-
>-#if defined(_WIN32) && defined(_M_IX86) && !defined(WINCE_EMULATOR)
>-
> int XINGtoYV12 (unsigned char *dest_ptr, int dest_width, int dest_height,
> int dest_pitch, int dest_x, int dest_y, int dest_dx, int dest_dy,
> unsigned char *src_ptr, int src_width, int src_height, int src_pitch,
> int src_x, int src_y, int src_dx, int src_dy)
> {
>-#if 1
> unsigned char *pU = src_ptr + (src_height+15 & 0xFFF0) *src_pitch,
> *pV = pU + src_pitch/2;
>
>@@ -3728,33 +3723,6 @@
> src_ptr, pU, pV,
> src_width, src_height, src_pitch, src_pitch, src_pitch,
> src_x, src_y, src_dx, src_dy);
>-#else
>- unsigned char *pDestY = dest_ptr;
>- unsigned char *pDestV = pDestY + (dest_pitch * src_height);
>- unsigned char *pDestU = pDestY + (dest_pitch * src_height * 5 / 4);
>-
>- //XING_Opaque_Data* pData = (XING_Opaque_Data*)src_ptr;
>- UCHAR* pSrcY = src_ptr;//pData->pY;
>- UCHAR* pSrcUV = src_ptr + (src_height+15 & 0xFFF0) * src_pitch + (src_x/2 + src_y/2 *
>src_pitch);//pData->pUV;
>-
>- put_yuv_init(src_x, src_y, src_width, src_height, dest_width, dest_height);
>-
>- if (_x86_MMX_Available)
>- {
>- put_planar_mmx((DWORD)pSrcY, (DWORD)pSrcUV, (DWORD)pDestY, (DWORD)pDestU, (DWORD)pDestV,
>(DWORD)1, (DWORD)dest_pitch);
>-
>-#if defined(_M_IX86) && !defined(WINCE_EMULATOR)
>- __asm emms
>-#elif defined(_USE_MMX_BLENDERS) && !defined(WINCE_EMULATOR)
>- __asm__ __volatile__ ( "emms" );
>-#endif
>- }
>- else
>- put_planar((DWORD) 0, (LONG) pSrcY, (LONG) pSrcUV, (DWORD)0, (DWORD)dest_ptr,
>(DWORD)dest_pitch);
>-
>-
>- return 0;
>-#endif
> }
>
> int XINGtoYUY2 (unsigned char *dest_ptr, int dest_width, int dest_height,
>@@ -3762,7 +3730,6 @@
> unsigned char *src_ptr, int src_width, int src_height, int src_pitch,
> int src_x, int src_y, int src_dx, int src_dy)
> {
>-#if 1
> unsigned char *pU = src_ptr + (src_height+15 & 0xFFF0) *src_pitch,
> *pV = pU + src_pitch/2;
>
>@@ -3770,34 +3737,6 @@
> src_ptr, pU, pV,
> src_width, src_height, src_pitch, src_pitch, src_pitch,
> src_x, src_y, src_dx, src_dy);
>-#else
>-
>- unsigned char *pDestY = dest_ptr;
>- unsigned char *pDestV = pDestY + (dest_pitch * src_height);
>- unsigned char *pDestU = pDestY + (dest_pitch * src_height * 5 / 4);
>-
>- //XING_Opaque_Data* pData = (XING_Opaque_Data*)src_ptr;
>- UCHAR* pSrcY = src_ptr;//pData->pY;
>- UCHAR* pSrcUV = src_ptr + (src_height+15 & 0xFFF0) * src_pitch + (src_x/2 + src_y/2 *
>src_pitch);//pData->pUV;
>-
>- /* MessageBeep(-1); */
>-
>- put_yuv_init(src_x, src_y, src_width, src_height, dest_width, dest_height);
>-
>- if (_x86_MMX_Available)
>- {
>- put_yuy2_mmx((DWORD)pSrcY, (DWORD)pSrcUV, (DWORD)pDestY, (DWORD)pDestU, (DWORD)pDestV,
>(DWORD)1, (DWORD)dest_pitch);
>-#if defined(_M_IX86) && !defined(WINCE_EMULATOR)
>- __asm emms
>-#elif defined(_USE_MMX_BLENDERS) && !defined(WINCE_EMULATOR)
>- __asm__ __volatile__ ( "emms" );
>-#endif
>- }
>- else
>- put_yuy2((DWORD)0, (LONG) pSrcY, (LONG) pSrcUV, (DWORD)0, (DWORD)dest_ptr,
>(DWORD)dest_pitch);
>-
>- return 0;
>-#endif
> }
>
> int XINGtoUYVY (unsigned char *dest_ptr, int dest_width, int dest_height,
>@@ -3805,7 +3744,6 @@
> unsigned char *src_ptr, int src_width, int src_height, int src_pitch,
> int src_x, int src_y, int src_dx, int src_dy)
> {
>-#if 1
> unsigned char *pU = src_ptr + (src_height+15 & 0xFFF0) *src_pitch,
> *pV = pU + src_pitch/2;
>
>@@ -3813,59 +3751,7 @@
> src_ptr, pU, pV,
> src_width, src_height, src_pitch, src_pitch, src_pitch,
> src_x, src_y, src_dx, src_dy);
>-#else
>-
>- unsigned char *pDestY = dest_ptr;
>- unsigned char *pDestV = pDestY + (dest_pitch * src_height);
>- unsigned char *pDestU = pDestY + (dest_pitch * src_height * 5 / 4);
>-
>- //XING_Opaque_Data* pData = (XING_Opaque_Data*)src_ptr;
>- UCHAR* pSrcY = src_ptr;//pData->pY;
>- UCHAR* pSrcUV = src_ptr + (src_height+15 & 0xFFF0) * src_pitch + (src_x/2 + src_y/2 *
>src_pitch);//pData->pUV;
>-
>- /* MessageBox(NULL, "yuy2","",0); */
>- put_yuv_init(src_x, src_y, src_width, src_height, dest_width, dest_height);
>-
>- if (_x86_MMX_Available)
>- {
>- put_uyvy_mmx((DWORD)pSrcY, (DWORD)pSrcUV, (DWORD)pDestY, (DWORD)pDestU, (DWORD)pDestV,
>(DWORD)1, (DWORD)dest_pitch);
>-#if defined(_M_IX86) && !defined(WINCE_EMULATOR)
>- __asm emms
>-#elif defined(_USE_MMX_BLENDERS) && !defined(WINCE_EMULATOR)
>- __asm__ __volatile__ ( "emms" );
>-#endif
>- }
>- else
>- put_uyvy((DWORD)0, (LONG) pSrcY, (LONG) pSrcUV, (DWORD)0, (DWORD)dest_ptr,
>(DWORD)dest_pitch);
>-
>- return 0;
>-#endif
>-}
>-#else
>-int XINGtoYV12 (unsigned char *dest_ptr, int dest_width, int dest_height,
>- int dest_pitch, int dest_x, int dest_y, int dest_dx, int dest_dy,
>- unsigned char *src_ptr, int src_width, int src_height, int src_pitch,
>- int src_x, int src_y, int src_dx, int src_dy)
>-{
>- return 0;
>-}
>-
>-int XINGtoYUY2 (unsigned char *dest_ptr, int dest_width, int dest_height,
>- int dest_pitch, int dest_x, int dest_y, int dest_dx, int dest_dy,
>- unsigned char *src_ptr, int src_width, int src_height, int src_pitch,
>- int src_x, int src_y, int src_dx, int src_dy)
>-{
>- return 0;
>-}
>-
>-int XINGtoUYVY (unsigned char *dest_ptr, int dest_width, int dest_height,
>- int dest_pitch, int dest_x, int dest_y, int dest_dx, int dest_dy,
>- unsigned char *src_ptr, int src_width, int src_height, int src_pitch,
>- int src_x, int src_y, int src_dx, int src_dy)
>-{
>- return 0;
> }
>-#endif
>
> /*
> * Test program and demo:
>
>_______________________________________________
>Video-dev mailing list
>Video-dev@helixcommunity.org
>http://lists.helixcommunity.org/mailman/listinfo/video-dev
_______________________________________________
Video-dev mailing list
Video-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/video-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic