[MPlayer-dev-eng] Fwd: [Mplayerxp-cvslog] CVS: mplayerxp/mplayerxp cfg-mplayer.h,1.15,1.16 mplayer.c,1.91,1.92

Arpi arpi at thot.banki.hu
Sat Jan 4 12:37:18 CET 2003


this is interesting, we should port it to mplayer...
any volunteers? :)

--------- Forwarded message ---------
From: Nick Kurshev <nickols_k at users.sourceforge.net>
To: mplayerxp-cvslog at lists.sourceforge.net
Subject: [Mplayerxp-cvslog] CVS: mplayerxp/mplayerxp cfg-mplayer.h,1.15,1.16 mplayer.c,1.91,1.92

Update of /cvsroot/mplayerxp/mplayerxp/mplayerxp
In directory sc8-pr-cvs1:/tmp/cvs-serv21091

Modified Files:
	cfg-mplayer.h mplayer.c 
Log Message:
en(dis)able mmx features at run-time

Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayerxp/mplayerxp/mplayerxp/cfg-mplayer.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- cfg-mplayer.h	24 Dec 2002 18:58:51 -0000	1.15
+++ cfg-mplayer.h	4 Jan 2003 09:36:20 -0000	1.16
@@ -93,6 +93,15 @@
 extern unsigned vo_da_buffs;
 extern unsigned vo_use_bm;
 
+#ifdef ARCH_X86
+extern int x86_mmx;
+extern int x86_mmx2;
+extern int x86_3dnow;
+extern int x86_3dnow2;
+extern int x86_sse;
+extern int x86_sse2;
+#endif
+
 /* from libvo/aspect.c */
 extern float monitor_aspect;
 extern float vo_panscan;
@@ -271,6 +280,21 @@
         {"enable_bm", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 1, NULL},
         {"enable_bm2", &vo_use_bm, CONF_TYPE_FLAG, 0, 0, 2, NULL},
         {"disable_bm", &vo_use_bm, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+
+#ifdef ARCH_X86
+        {"mmx", &x86_mmx, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"nommx", &x86_mmx, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+        {"mmx2", &x86_mmx2, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"nommx2", &x86_mmx2, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+        {"3dnow", &x86_3dnow, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"no3dnow", &x86_3dnow, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+        {"3dnow2", &x86_3dnow2, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"no3dnow2", &x86_3dnow2, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+        {"sse", &x86_sse, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"nosse", &x86_sse, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+        {"sse2", &x86_sse2, CONF_TYPE_FLAG, 0, 0, 1, NULL},
+        {"nosse2", &x86_sse2, CONF_TYPE_FLAG, 0, 1, 0, NULL},
+#endif
 
 #ifdef HAVE_AA
 	{"aa*",	vo_aa_parseoption,  CONF_TYPE_FUNC_FULL, 0, 0, 0 , 
&vo_aa_revertoption},

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayerxp/mplayerxp/mplayerxp/mplayer.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -d -r1.91 -r1.92
--- mplayer.c	2 Jan 2003 18:13:18 -0000	1.91
+++ mplayer.c	4 Jan 2003 09:36:20 -0000	1.92
@@ -704,9 +704,21 @@
 }
 
 #ifdef ARCH_X86
+int x86_mmx=-1;
+int x86_mmx2=-1;
+int x86_3dnow=-1;
+int x86_3dnow2=-1;
+int x86_sse=-1;
+int x86_sse2=-1;
 static void get_mmx_optimizations( void )
 {
   GetCpuCaps(&gCpuCaps);
+  if(x86_mmx != -1) gCpuCaps.hasMMX=x86_mmx;
+  if(x86_mmx2 != -1) gCpuCaps.hasMMX2=x86_mmx2;
+  if(x86_3dnow != -1) gCpuCaps.has3DNow=x86_3dnow;
+  if(x86_3dnow2 != -1) gCpuCaps.has3DNowExt=x86_3dnow2;
+  if(x86_sse != -1) gCpuCaps.hasSSE=x86_sse;
+  if(x86_sse2 != -1) gCpuCaps.hasSSE2=x86_sse2;
   MSG_INFO("CPUflags: Type: %d MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE:
%d SSE2: %d\n",
       gCpuCaps.cpuType,gCpuCaps.hasMMX,gCpuCaps.hasMMX2,
       gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
@@ -1665,9 +1677,6 @@
   MSG_INFO("%s",banner_text);
 //  memset(&vtune,0,sizeof(vo_tune_info_t));
   /* Test for cpu capabilities (and corresponding OS support) for
optimizing */
-#ifdef ARCH_X86
-  get_mmx_optimizations();
-#endif
 
     playtree = play_tree_new();
 
@@ -1678,6 +1687,10 @@
     parse_cfgfiles(mconfig);
 
     if(m_config_parse_command_line(mconfig, argc, argv, envp) < 0)
exit(1); // error parsing cmdline
+
+#ifdef ARCH_X86
+  get_mmx_optimizations();
+#endif
 
     playtree = play_tree_cleanup(playtree);
     if(playtree) {



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mplayerxp-cvslog mailing list
Mplayerxp-cvslog at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mplayerxp-cvslog




More information about the MPlayer-dev-eng mailing list