if test x$enable_mga = xyes
then
PLUGINS="${PLUGINS} mga"
+ if test x"$ac_cv_mmx_inline" != x"no"; then
+ PLUGINS="${PLUGINS} mgammx"
+ fi
fi
fi
# Extract the first word of "sdl12-config", so it can be a program name with args.
set dummy sdl12-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6485: checking for $ac_word" >&5
+echo "configure:6488: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SDL12_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "sdl11-config", so it can be a program name with args.
set dummy sdl11-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6525: checking for $ac_word" >&5
+echo "configure:6528: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SDL11_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Extract the first word of "sdl-config", so it can be a program name with args.
set dummy sdl-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6566: checking for $ac_word" >&5
+echo "configure:6569: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_SDL_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6612: checking for $ac_hdr" >&5
+echo "configure:6615: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6617 "configure"
+#line 6620 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6622: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6692: checking for $ac_hdr" >&5
+echo "configure:6695: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6697 "configure"
+#line 6700 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6702: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6705: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
else
echo $ac_n "checking for directX headers in ${withval}""... $ac_c" 1>&6
-echo "configure:6731: checking for directX headers in ${withval}" >&5
+echo "configure:6734: checking for directX headers in ${withval}" >&5
if test -f ${withval}/include/directx.h
then
PLUGINS="${PLUGINS} directx"
# Extract the first word of "gnome-config", so it can be a program name with args.
set dummy gnome-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6818: checking for $ac_word" >&5
+echo "configure:6821: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6863: checking for $ac_hdr" >&5
+echo "configure:6866: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6868 "configure"
+#line 6871 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6873: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6876: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
# Extract the first word of "gtk-config", so it can be a program name with args.
set dummy gtk-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6933: checking for $ac_word" >&5
+echo "configure:6936: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6983: checking for $ac_hdr" >&5
+echo "configure:6986: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 6988 "configure"
+#line 6991 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6996: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7050: checking for $ac_hdr" >&5
+echo "configure:7053: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7055 "configure"
+#line 7058 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7060: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7113: checking for $ac_hdr" >&5
+echo "configure:7116: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7118 "configure"
+#line 7121 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7126: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
then
ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6
-echo "configure:7163: checking for alsa/asoundlib.h" >&5
+echo "configure:7166: checking for alsa/asoundlib.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 7168 "configure"
+#line 7171 "configure"
#include "confdefs.h"
#include <alsa/asoundlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
-echo "configure:7190: checking for main in -lasound" >&5
+echo "configure:7193: checking for main in -lasound" >&5
ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7198 "configure"
+#line 7201 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:7205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
* mga.c : Matrox Graphic Array plugin for vlc
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
- * $Id: mga.c,v 1.12 2002/01/05 16:09:49 sam Exp $
+ * $Id: mga.c,v 1.13 2002/01/06 17:18:12 sam Exp $
*
* Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
* Samuel Hocevar <sam@zoy.org>
MODULE_CONFIG_STOP
MODULE_INIT_START
+#ifdef MODULE_NAME_IS_mga
SET_DESCRIPTION( "Matrox Graphic Array video module" )
ADD_CAPABILITY( VOUT, 10 )
ADD_SHORTCUT( "mga" )
+#else
+ SET_DESCRIPTION( "MMX-accelerated Matrox Graphic Array video module" )
+ ADD_CAPABILITY( VOUT, 11 )
+ ADD_SHORTCUT( "mgammx" )
+#endif
MODULE_INIT_STOP
MODULE_ACTIVATE_START
{
/* Grmbl, we have a G200 which mistakenly assumes 4:2:0 planar
* has *packed* chroma information! Do some conversion... */
- u8 *p_cr, *p_cb, *p_dest;
+ u8 *p_dest = p_pic->p_sys->p_chroma;
+ u8 *p_cr = p_pic->U_PIXELS;
+ u8 *p_cb = p_pic->V_PIXELS;
int i;
- /* TODO: optimize this a bit... */
- p_dest = p_pic->p_sys->p_chroma;
- p_cr = p_pic->U_PIXELS;
- p_cb = p_pic->V_PIXELS;
-
- for( i = p_vout->p_sys->mga.frame_size / 4; i--; )
+ /* frame_size is a multiple of 64 */
+ for( i = p_vout->p_sys->mga.frame_size / 64; i--; )
{
- *p_dest++ = *p_cr++;
- *p_dest++ = *p_cb++;
+#ifdef MODULE_NAME_IS_mga
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+ *p_dest++ = *p_cr++; *p_dest++ = *p_cb++;
+#else
+
+# define MMX_MERGECBCR " \n\
+movd (%0), %%mm0 # Load 4 Cr 00 00 00 00 v3 v2 v1 v0 \n\
+movd (%1), %%mm1 # Load 4 Cb 00 00 00 00 u3 u2 u1 u0 \n\
+punpcklbw %%mm1, %%mm0 # u3 v3 u2 v2 u1 v1 u0 v0 \n\
+movq %%mm0, (%2) # Store CrCb \n\
+movd 4(%0), %%mm0 # Load 4 Cr 00 00 00 00 v3 v2 v1 v0 \n\
+movd 4(%1), %%mm1 # Load 4 Cb 00 00 00 00 u3 u2 u1 u0 \n\
+punpcklbw %%mm1, %%mm0 # u3 v3 u2 v2 u1 v1 u0 v0 \n\
+movq %%mm0, 8(%2) # Store CrCb \n\
+movd 8(%0), %%mm0 # Load 4 Cr 00 00 00 00 v3 v2 v1 v0 \n\
+movd 8(%1), %%mm1 # Load 4 Cb 00 00 00 00 u3 u2 u1 u0 \n\
+punpcklbw %%mm1, %%mm0 # u3 v3 u2 v2 u1 v1 u0 v0 \n\
+movq %%mm0, 16(%2) # Store CrCb \n\
+movd 16(%0), %%mm0 # Load 4 Cr 00 00 00 00 v3 v2 v1 v0 \n\
+movd 16(%1), %%mm1 # Load 4 Cb 00 00 00 00 u3 u2 u1 u0 \n\
+punpcklbw %%mm1, %%mm0 # u3 v3 u2 v2 u1 v1 u0 v0 \n\
+movq %%mm0, 32(%2) # Store CrCb \n\
+"
+ __asm__( ".align 8" MMX_MERGECBCR
+ : : "r" (p_cr), "r" (p_cb), "r" (p_dest) );
+ p_cr += 16; p_cb += 16; p_dest += 32;
+#endif
}
}
}