[Mplayer-cvslog] CVS: main/libvo Makefile,1.18,1.19 vo_dga.c,1.30,1.31 vo_fbdev.c,1.48,1.49 vo_svga.c,1.35,1.36 vo_x11.c,1.37,1.38

Nick Kurshev nick at mplayer.dev.hu
Tue Oct 30 18:04:33 CET 2001


Update of /cvsroot/mplayer/main/libvo
In directory mplayer:/var/tmp.root/cvs-serv6549

Modified Files:
	Makefile vo_dga.c vo_fbdev.c vo_svga.c vo_x11.c 
Log Message:
Using new stuff of rgb15to16

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/Makefile,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Makefile	29 Oct 2001 00:48:20 -0000	1.18
+++ Makefile	30 Oct 2001 17:04:31 -0000	1.19
@@ -7,7 +7,7 @@
 OBJS=$(SRCS:.c=.o)
 
 ifeq ($(TARGET_ARCH_X86),yes)
-SRCS += rgb15to16mmx.c yuv2rgb_mmx.c
+SRCS += yuv2rgb_mmx.c
 ifeq ($(TARGET_OS),Linux)
 SRCS += vo_vesa.c
 endif

Index: vo_dga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_dga.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- vo_dga.c	13 Aug 2001 11:08:18 -0000	1.30
+++ vo_dga.c	30 Oct 2001 17:04:31 -0000	1.31
@@ -23,8 +23,8 @@
  * - works only on x86 architectures
  *
  * $Log$
- * Revision 1.30  2001/08/13 11:08:18  atlka
- * changes according to -utf8 option, draw_osd() function added
+ * Revision 1.31  2001/10/30 17:04:31  nick
+ * Using new stuff of rgb15to16
  *
  * Revision 1.29  2001/07/16 18:41:52  jkeil
  * vo_dga doesn't compile on non-x86 architecture due to x86 asm usage.
@@ -151,11 +151,9 @@
 
 
 #include "x11_common.h"
-
+#include "../postproc/rgb2rgb.h"
 #include "fastmemcpy.h"
 
-extern void rgb15to16_mmx(char* s0,char* d0,int count);
-
 static vo_info_t vo_info =
 {
 #ifdef HAVE_DGA2
@@ -479,18 +477,9 @@
 	  int i;
 	  char *e;
 	  for(i=0; i< vo_dga_lines; i++){
-#ifdef HAVE_MMX		  
-            rgb15to16_mmx( s, d, vo_dga_bytes_per_line);
+            rgb15to16( s, d, vo_dga_bytes_per_line);
 	    d+=vo_dga_bytes_per_line;
 	    s+=vo_dga_bytes_per_line;
-#else
-            e = s+vo_dga_bytes_per_line;
-	    while( s< e ){
-               register uint16_t x =  *(((uint16_t *)s)++);
-	        *(((uint16_t *)d)++)=( x&0x001F )|( ( x&0x7FE0 )<<1 );
-	    }
-
-#endif  
             d+= vo_dga_vp_skip;
 	  }
 	}

Index: vo_fbdev.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_fbdev.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -r1.48 -r1.49
--- vo_fbdev.c	21 Oct 2001 23:53:23 -0000	1.48
+++ vo_fbdev.c	30 Oct 2001 17:04:31 -0000	1.49
@@ -28,6 +28,7 @@
 #include "fastmemcpy.h"
 #include "sub.h"
 #include "yuv2rgb.h"
+#include "../postproc/rgb2rgb.h"
 
 LIBVO_EXTERN(fbdev)
 
@@ -38,7 +39,6 @@
 	""
 };
 
-extern void rgb15to16_mmx(char *s0, char *d0, int count);
 extern int verbose;
 
 /******************************
@@ -1146,20 +1146,10 @@
 		char *d = next_frame;
 		char *s = src[0];
 		if (sbpp == fb_pixel_size) {
-			if (fb_real_bpp == 16 && pixel_format == (IMGFMT_BGR|15)) {
-#ifdef HAVE_MMX
-				rgb15to16_mmx(s, d, 2 * in_width * in_height);
-#else
-				unsigned short *s1 = (unsigned short *) s;
-				unsigned short *d1 = (unsigned short *) d;
-				unsigned short *e = s1 + in_width * in_height;
-				while (s1<e) {
-					register x = *(s1++);
-					*(d1++) = (x&0x001f)|((x&0x7fe0)<<1);
-				}
-#endif
-			} else
-				memcpy(d, s, sbpp * in_width * in_height);
+		    if (fb_real_bpp == 16 && pixel_format == (IMGFMT_BGR|15))
+			rgb15to16(s, d, 2 * in_width * in_height);
+		    else
+			memcpy(d, s, sbpp * in_width * in_height);
 		}
 	}
 	return 0;

Index: vo_svga.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_svga.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- vo_svga.c	14 Aug 2001 12:51:23 -0000	1.35
+++ vo_svga.c	30 Oct 2001 17:04:31 -0000	1.36
@@ -24,8 +24,8 @@
 #endif
 
 #include "sub.h"
+#include "../postproc/rgb2rgb.h"
 
-extern void rgb15to16_mmx(char* s0,char* d0,int count);
 extern int vo_dbpp;
 extern int verbose;
 
@@ -470,19 +470,7 @@
 	}
       } break;
       case 16: {
-#ifdef HAVE_MMX
-        rgb15to16_mmx(src[0],bppbuf,maxw * maxh * 2);
-#else
-        uint16_t *source = (uint16_t *) src[0];
-        uint16_t *dest = (uint16_t *) bppbuf;
-	register uint32_t i = 0;
-	register uint16_t srcdata;
-	
-	while (i < (maxw * maxh)) {
-	  srcdata = source[i];
-	  dest[i++] = (srcdata & 0x1f) | ((srcdata & 0x7fe0) << 1);
-	}
-#endif
+        rgb15to16(src[0],bppbuf,maxw * maxh * 2);
       } break;
     }
     src[0] = bppbuf;

Index: vo_x11.c
===================================================================
RCS file: /cvsroot/mplayer/main/libvo/vo_x11.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- vo_x11.c	28 Oct 2001 18:30:59 -0000	1.37
+++ vo_x11.c	30 Oct 2001 17:04:31 -0000	1.38
@@ -40,6 +40,7 @@
 #include "sub.h"
 
 #include "../postproc/swscale.h"
+#include "../postproc/rgb2rgb.h"
 
 static vo_info_t vo_info =
 {
@@ -495,8 +496,6 @@
  return 0;
 }
 
-void rgb15to16_mmx( char* s0,char* d0,int count );
-
 static uint32_t draw_frame( uint8_t *src[] ){
     int sbpp=( ( image_format&0xFF )+7 )/8;
     int dbpp=( bpp+7 )/8;
@@ -512,26 +511,9 @@
     for( i=0;i<image_height;i++ ) {
       s-=sbpp*image_width;
       if( sbpp==dbpp ) {
-        if( depth==16 && image_format==( IMGFMT_BGR|15 ) ){
-
-       // do 15bpp->16bpp
-#ifdef HAVE_MMX
-       rgb15to16_mmx( s,d,2*image_width );
-#else
-       unsigned short *s1=( unsigned short * )s;
-       unsigned short *d1=( unsigned short * )d;
-       unsigned short *e=s1+image_width;
-       while( s1<e ){
-         register int x=*( s1++ );
-         // rrrrrggggggbbbbb
-         // 0rrrrrgggggbbbbb
-         // 0111 1111 1110 0000=0x7FE0
-         // 00000000000001 1111=0x001F
-         *( d1++ )=( x&0x001F )|( ( x&0x7FE0 )<<1 );
-       }
-#endif
-
-        } else
+        if( depth==16 && image_format==( IMGFMT_BGR|15 ) )
+	  rgb15to16(s,d,2*image_width );
+        else
           memcpy( d,s,sbpp*image_width );
       } else {
          // sbpp!=dbpp
@@ -549,24 +531,9 @@
     }
   } else {
     if( sbpp==dbpp ) {
-      if( depth==16 && image_format==( IMGFMT_BGR|15 ) ){
-       // do 15bpp->16bpp
-#ifdef HAVE_MMX
-       rgb15to16_mmx( s,d,2*image_width*image_height );
-#else
-       unsigned short *s1=( unsigned short * )s;
-       unsigned short *d1=( unsigned short * )d;
-       unsigned short *e=s1+image_width*image_height;
-       while( s1<e ){
-         register int x=*( s1++ );
-         // rrrrrggggggbbbbb
-         // 0rrrrrgggggbbbbb
-         // 0111 1111 1110 0000=0x7FE0
-         // 00000000000001 1111=0x001F
-         *( d1++ )=( x&0x001F )|( ( x&0x7FE0 )<<1 );
-       }
-#endif
-      } else
+      if( depth==16 && image_format==( IMGFMT_BGR|15 ) )
+        rgb15to16( s,d,2*image_width*image_height );
+      else
         memcpy( d,s,sbpp*image_width*image_height );
     } else {
         // sbpp!=dbpp




More information about the MPlayer-cvslog mailing list