[MPlayer-dev-eng] Fwd: [Mplayerxp-cvslog] CVS:

sr seru at gmx.net
Sat Jan 4 17:11:46 CET 2003


El sáb, 04 de ene de 2003, a las 03:34:53 +0100, Arpi dijo:
> Hi,
> 
> >  #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;
> 
> shouldn't these be global???
true, i changed it, look at the new patch
> 
> > -
> > +  if(gCpuCaps.hasMMX) mplayer_accel |= MM_ACCEL_X86_MMX;
> > +  if(gCpuCaps.hasMMX2) mplayer_accel |= MM_ACCEL_X86_MMXEXT;
> > +  if(gCpuCaps.hasSSE) mplayer_accel |= MM_ACCEL_X86_SSE;
> > +  if(gCpuCaps.has3DNow) mplayer_accel |= MM_ACCEL_X86_3DNOW;
> > +  if(gCpuCaps.has3DNowExt) mplayer_accel |= MM_ACCEL_X86_3DNOWEXT;
> 
> sense of this?
none, it slipt in :( it is used for some codecs in mplayerxp, here's a grep:

./mplayerxp/libmpcodecs/vd_libmpeg2.c:extern unsigned mplayer_accel;
./mplayerxp/libmpcodecs/vd_libmpeg2.c:    mpeg2_init(mplayer_accel);
./mplayerxp/libmpcodecs/ad_a52.c:extern unsigned mplayer_accel;
./mplayerxp/libmpcodecs/ad_a52.c:  a52_accel = mplayer_accel;
./mplayerxp/libmpcodecs/ad_mp3.c:extern unsigned mplayer_accel;
./mplayerxp/libmpcodecs/ad_mp3.c:  MP3_Init(fakemono,mplayer_accel,&mplayer_audio_read,audio_codec_param);

> 
> have you tested it? i bet it didn't even compile...
i just tested the new patch and it should work. 
manpage should also be updated. new switches are -mmx, -nommx, -sse, etc.
> 
> 
> A'rpi / Astral & ESP-team
> 
> --
> Developer of MPlayer, the Movie Player for Linux - http://www.MPlayerHQ.hu
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> http://mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.644
diff -u -r1.644 mplayer.c
--- mplayer.c	3 Jan 2003 20:46:28 -0000	1.644
+++ mplayer.c	4 Jan 2003 16:07:30 -0000
@@ -584,6 +585,54 @@
   return eof;
 }
 
+/* Test for cpu capabilities (and corresponding OS support) for optimizing */
+#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; 
+  mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags:  MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
+      gCpuCaps.hasMMX,gCpuCaps.hasMMX2,
+      gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
+      gCpuCaps.hasSSE, gCpuCaps.hasSSE2);
+#ifdef RUNTIME_CPUDETECT
+  mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection);
+#else
+  mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions);
+#ifdef HAVE_MMX
+  mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX");
+#endif
+#ifdef HAVE_MMX2
+  mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2");
+#endif
+#ifdef HAVE_3DNOW
+  mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow");
+#endif
+#ifdef HAVE_3DNOWEX
+  mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx");
+#endif
+#ifdef HAVE_SSE
+  mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE");
+#endif
+#ifdef HAVE_SSE2
+  mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
+#endif
+  mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
+#endif
+}
+#endif
+
 static int play_tree_step = 1;
 
 /*
@@ -633,39 +682,6 @@
   mp_msg_set_level(MSGL_STATUS);
 
   mp_msg(MSGT_CPLAYER,MSGL_INFO,banner_text);
-  /* Test for cpu capabilities (and corresponding OS support) for optimizing */
-#ifdef ARCH_X86
-  GetCpuCaps(&gCpuCaps);
-  mp_msg(MSGT_CPLAYER,MSGL_INFO,"CPUflags:  MMX: %d MMX2: %d 3DNow: %d 3DNow2: %d SSE: %d SSE2: %d\n",
-      gCpuCaps.hasMMX,gCpuCaps.hasMMX2,
-      gCpuCaps.has3DNow, gCpuCaps.has3DNowExt,
-      gCpuCaps.hasSSE, gCpuCaps.hasSSE2);
-#ifdef RUNTIME_CPUDETECT
-  mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithRuntimeDetection);
-#else
-  mp_msg(MSGT_CPLAYER,MSGL_INFO, MSGTR_CompiledWithCPUExtensions);
-#ifdef HAVE_MMX
-  mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX");
-#endif
-#ifdef HAVE_MMX2
-  mp_msg(MSGT_CPLAYER,MSGL_INFO," MMX2");
-#endif
-#ifdef HAVE_3DNOW
-  mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNow");
-#endif
-#ifdef HAVE_3DNOWEX
-  mp_msg(MSGT_CPLAYER,MSGL_INFO," 3DNowEx");
-#endif
-#ifdef HAVE_SSE
-  mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE");
-#endif
-#ifdef HAVE_SSE2
-  mp_msg(MSGT_CPLAYER,MSGL_INFO," SSE2");
-#endif
-  mp_msg(MSGT_CPLAYER,MSGL_INFO,"\n\n");
-#endif
-
-#endif
 
 #ifdef USE_TV
   tv_param_immediate = 1;
@@ -702,6 +718,10 @@
 
     geometryFull(&opt_screen_size_x, &opt_screen_size_y, NULL, NULL,
 	vo_screenwidth, vo_screenheight, vo_screenwidth, vo_screenheight);
+
+#ifdef ARCH_X86
+    get_mmx_optimizations();
+#endif
 
     playtree = play_tree_cleanup(playtree);
     if(playtree) {
Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.190
diff -u -r1.190 cfg-mplayer.h
--- cfg-mplayer.h	3 Jan 2003 12:40:09 -0000	1.190
+++ cfg-mplayer.h	4 Jan 2003 16:07:32 -0000
@@ -120,6 +120,15 @@
 extern int nortc;
 #endif
 
+#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;
 
@@ -317,6 +326,22 @@
 	// draw by slices or whole frame (usefull with libmpeg2/libavcodec)
 	{"slices", &vd_use_slices, CONF_TYPE_FLAG, 0, 0, 1, NULL},
 	{"noslices", &vd_use_slices, 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
 	// -vo aa
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20030104/fc170d7e/attachment.pgp>


More information about the MPlayer-dev-eng mailing list