]> git.sesse.net Git - vlc/commitdiff
* ./BUGS: added a list of known bugs. Please add your findings!
authorSam Hocevar <sam@videolan.org>
Fri, 4 Jan 2002 14:01:35 +0000 (14:01 +0000)
committerSam Hocevar <sam@videolan.org>
Fri, 4 Jan 2002 14:01:35 +0000 (14:01 +0000)
  * ./MODULES: added a short description of each module. Maybe we should
    add more details to make this file really useful.
  * ./doc/bugreport-howto.txt: wishful thinking...
  * ./Makefile: added a workaround for the fact that .c files don't depend
    on <videolan/vlc.h>.
  * ./plugins/memcpy/memcpy.c: all memcpy modules are now built from the same
    single file.
  * ./src/interface/main.c: added the --nommx, --no3dnow, --nommxext, --nosse
    and --noaltivec options to vlc.
  * ./configure.in: removed the --disable-mmx option, now useless because
    of the vlc --no* options.
  * ./src/interface/main.c: fixed a crash caused by the memcpy module
    being released too early.
  * ./include/video.h: more vout4 changes, including margin support, more
    FOURCC formats recognized, transparent support of identical or almost
    identical FOURCC formats.
  * ./include/video_output.h: added a vout_Render function to video output
    modules which is to be executed before vout_Display.
  * ./include/common.h: this header is back.
  * ./plugins/chroma/i420_rgb.c: planar YUV 4:2:0 to packed RGB conversion
    functions, mostly taken from vout3's yuv functions, but heavily modified
    to use FAST_MEMCPY and to handle image dimensions which are not multiples
    of 16. Not all functions have been written yet, though.
  * ./plugins/chroma/i420_yuy2.c: planar YUV 4:2:0 to packed YUV conversion
    functions, various targets such as 4:2:2 YUYV, YVYU, UYVY, or 2:1:1 YUYV,
    with accelerated MMX versions.
  * ./plugins/chroma/i422_yuy2.c: same as i420_yuy2.c but takes planar YUV
    4:2:2 pictures in input. With accelerated MMX versions as well. This plugin
    makes it possible to display 4:2:2 files on most video cards without the
    quality loss of 4:2:0 downsampling.
  * ./plugins/filter/*: thanks to the vout_Render function, all filters now
    output their data perfectly in sync.
  * ./plugins/dvdread/Makefile: fix to prevent unnecessary target rebuilds.
  * ./plugins/sdl/vout_sdl.c: support for YV12, UYVY, YUY2 and YVYU overlays.
  * ./plugins/x11/xcommon.c: support for I420, YV12, YUY2 and Y211 overlays.

73 files changed:
BUGS [new file with mode: 0644]
ChangeLog
MODULES [new file with mode: 0644]
Makefile
Makefile.modules
configure
configure.in
doc/bugreport-howto.txt [new file with mode: 0644]
doc/vlc.1
extras/libdvdcss/css.c
include/common.h [new file with mode: 0644]
include/config.h
include/modules.h
include/threads.h
include/vdec_ext-plugins.h
include/video.h
include/video_output.h
include/videolan/vlc.h
plugins/beos/MsgVals.h
plugins/chroma/Makefile
plugins/chroma/common.c [deleted file]
plugins/chroma/i420_rgb.c [new file with mode: 0644]
plugins/chroma/i420_rgb.h [moved from plugins/chroma/transforms.h with 82% similarity]
plugins/chroma/i420_rgb16.c [new file with mode: 0644]
plugins/chroma/i420_rgb8.c [new file with mode: 0644]
plugins/chroma/i420_rgb_c.h [moved from plugins/chroma/chroma_common.h with 85% similarity]
plugins/chroma/i420_rgb_mmx.h [new file with mode: 0644]
plugins/chroma/i420_yuy2.c [new file with mode: 0644]
plugins/chroma/i420_yuy2.h [new file with mode: 0644]
plugins/chroma/i422_yuy2.c [new file with mode: 0644]
plugins/chroma/i422_yuy2.h [new file with mode: 0644]
plugins/chroma/yv12_rgb16.c [deleted file]
plugins/chroma/yv12_rgb8.c [deleted file]
plugins/directx/vout_directx.c
plugins/dummy/input_dummy.c
plugins/dummy/vout_dummy.c
plugins/dvdread/Makefile
plugins/dvdread/dvdread.c
plugins/dvdread/input_dvdread.c
plugins/filter/deinterlace.c
plugins/filter/distort.c
plugins/filter/filter_common.h
plugins/filter/invert.c
plugins/filter/transform.c
plugins/filter/wall.c
plugins/gtk/gtk_playlist.c
plugins/kde/kde_disc.cpp
plugins/kde/kde_disc.h
plugins/kde/kde_menu.h
plugins/kde/kde_net.cpp
plugins/kde/kde_net.h
plugins/kde/kde_slider.h
plugins/memcpy/Makefile
plugins/memcpy/memcpy.c
plugins/memcpy/memcpy3dn.c [deleted file]
plugins/memcpy/memcpymmx.c [deleted file]
plugins/memcpy/memcpymmxext.c [deleted file]
plugins/mpeg_vdec/vpar_blocks.c
plugins/mpeg_vdec/vpar_blocks.h
plugins/sdl/aout_sdl.c
plugins/sdl/vout_sdl.c
plugins/spudec/spu_decoder.c
plugins/text/ncurses.c
plugins/text/rc.c
plugins/x11/xcommon.c
src/input/mpeg_system.c
src/interface/intf_msg.c
src/interface/main.c
src/misc/beos_specific.cpp
src/misc/modules_plugin.h
src/video_output/video_output.c
src/video_output/vout_pictures.c
src/video_output/vout_subpictures.c

diff --git a/BUGS b/BUGS
new file mode 100644 (file)
index 0000000..4381c44
--- /dev/null
+++ b/BUGS
@@ -0,0 +1,61 @@
+List of known vlc bugs
+$Id: BUGS,v 1.1 2002/01/04 14:01:33 sam Exp $
+
+   Please try to keep this file up to date. Also, grep for FIXME in the
+source files for more and more bugs to fix.
+
+   For information on how to post a useful bug report, please read
+doc/bugreport-howto.txt.
+
+
+Core:
+
+  * vlc_cond_broadcast unimplemented on most plaforms.
+
+  * --<moduletype> <module>:<args> doesn't work anymore.
+
+
+Input:
+
+  * There is a memory leak in the input because the input thread is
+  never joined for termination.
+
+  * vlc:foo targets don't work anymore.
+
+
+Video output:
+
+  * We don't render subtitles on RGB surfaces.
+
+  * The DirectX video output plugin is broken because of vout4.
+
+  * The GGI video output plugin is broken because of vout4.
+
+  * The BeOS video output plugin is broken because of vout4.
+
+  * The QNX video output plugin is broken because of vout4.
+
+
+Chroma transformations:
+
+  * The only working YUV2RGB transformation function is the MMX version
+  of the 4:2:0 to RGB16 function.
+
+  * Most chroma transformation modules completely ignore margins.
+
+  * Most chroma transformation modules restrict the width of a picture
+  to multiples of 8 or even 16. We can achieve better than that.
+
+
+Filters:
+
+  * Most filters completely ignore margins.
+
+
+Gtk interface:
+
+  * Playing like a madman with the `Playlist' button makes the interface
+  crash.
+
+  * Saving preferences does not work at all.
+
index a152ee1cd8cda966c3c95554202aab07a47083d3..53359451f7a758bd5187373e9f634893940de3af 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1048,7 +1048,7 @@ Mon,  5 Mar 2001 00:41:16 +0100
     It will allow to watch some DVD that went through menus by default.
   * Beginning of menus in gnome interface.
   * Fix bug in ac3dec for mono streams
-  * BeOS: bew video output method, the vlc now uses BBitmap instead of
+  * BeOS: new video output method, the vlc now uses BBitmap instead of
     BDirectWindow (better performances)
   * BeOS: added resizing
   * BeOS: added beta support for overlay
diff --git a/MODULES b/MODULES
new file mode 100644 (file)
index 0000000..8e2d076
--- /dev/null
+++ b/MODULES
@@ -0,0 +1,137 @@
+List of vlc plugins
+$Id: MODULES,v 1.1 2002/01/04 14:01:34 sam Exp $
+
+ * ac3_adec: software AC3 decoder.
+
+ * ac3_spdif: AC3 decoder using SPDIF pass-through.
+
+ * alsa: audio output module using the ALSA API.
+
+ * arts: audio output module using the aRts sound daemon.
+
+ * beos: audio output, video output, and interface module for BeOS.
+
+ * chroma_i420_rgb: planar YUV to packed RGB conversion functions.
+
+ * chroma_i420_rgb_mmx: MMX accelerated version of chroma_i420_rgb.
+
+ * chroma_i420_yuy2: planar 4:2:0 YUV to packed YUV conversion functions.
+
+ * chroma_i420_yuy2_mmx: MMX accelerated version of chroma_i420_yuy2.
+
+ * chroma_i422_yuy2: planar 4:2:2 YUV to packed YUV conversion functions.
+
+ * chroma_i422_yuy2_mmx: MMX accelerated version of chroma_i422_yuy2.
+
+ * directx: audio output and video output module using the DirectX API.
+
+ * dsp: audio output module using the OSS /dev/dsp interface.
+
+ * dummy: dummy audio output, video output, interface and input modules.
+
+ * null: a module with no capabilities.
+
+ * dvd: input module for accessing DVDs.
+
+ * dvdread: input module for accessing DVDs, uses libdvdread.
+
+ * esd: audio output module using the Esound sound daemon.
+
+ * fb: video output module for the Linux framebuffer.
+
+ * filter_deinterlace: naive deinterlacing filter.
+
+ * filter_transform: filter for horizontal and vertical image flips and
+                     90° rotations.
+
+ * filter_invert: inverse video filter.
+
+ * filter_distort: miscellaneous image effects filter.
+
+ * filter_wall: image wall filter.
+
+ * ggi: video output module using the GGI API.
+
+ * glide: video output module using the Glide API.
+
+ * gnome: interface using the GNOME widget set.
+
+ * gtk: interface using the Gtk+ widget set.
+
+ * downmix: downmix module, used by the AC3 decoder.
+
+ * downmixsse: SSE accelerated version of downmix.
+
+ * downmix3dn: 3D Now! accelerated version of downmix.
+
+ * idct: inverse DCT module, used by the video decoder.
+
+ * idctclassic: another version of idct.
+
+ * idctmmx: MMX accelerated version of idct.
+
+ * idctmmxext: MMX EXT accelerated version of idct.
+
+ * idctaltivec: AltiVec accelerated version of idct.
+
+ * imdct: iMDCT module, used by the AC3 decoder.
+
+ * imdct3dn: 3D Now! accelerated version of imdct.
+
+ * imdctsse: SSE accelerated version of imdct.
+
+ * kde: interface module using the KDE widget set.
+
+ * lpcm_adec: LPCM audio decoder.
+
+ * macosx: audio output, video output and interface module for Mac OS X.
+
+ * mad: MPEG and MPEG2 audio decoder using the libmad library.
+
+ * memcpy: memory chunk copying module.
+
+ * memcpymmx: MMX accelerated version of memcpy.
+
+ * memcpymmxext: MMX EXT accelerated version of memcpy.
+
+ * memcpy3dn: 3D Now! accelerated version of memcpy.
+
+ * mga: video output module for Matrox cards using the Linux mga kernel
+        driver.
+
+ * motion: motion compensation module, used by the video decoder.
+
+ * motionmmx: MMX accelerated version of motion.
+
+ * motionmmxext: MMX EXT accelerated version of motion.
+
+ * motion3dnow: 3D Now! accelerated version of motion.
+
+ * motionaltivec: AltiVec accelerated version of motion.
+
+ * mpeg_es: input module for MPEG ES decapsulation.
+
+ * mpeg_ps: input module for MPEG PS decapsulation.
+
+ * mpeg_ts: input module for MPEG TS decapsulation.
+
+ * mpeg_adec: MPEG and MPEG2 audio decoder.
+
+ * mpeg_vdec: MPEG and MPEG2 video decoder.
+
+ * qt: interface module using the Qt widget set.
+
+ * sdl: audio output and video output module using the SDL library.
+
+ * spudec: DVD subtitles decoder.
+
+ * ncurses: interface module using the ncurses library.
+
+ * rc: interface module using stdio.
+
+ * vcd: input module for accessing Video CDs.
+
+ * x11: video output module using the X11 API.
+
+ * xvideo: video output module using the XVideo API.
+
index 26b1a13ebc43ab259570f573556de9e6a9b72b97..5d6b62419c76e43696c2c5b7252901ad3e55ed42 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -55,8 +55,12 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \
                alsa/alsa \
                arts/arts \
                beos/beos \
-               chroma/chroma_yv12_rgb8 \
-               chroma/chroma_yv12_rgb16 \
+               chroma/chroma_i420_rgb \
+               chroma/chroma_i420_rgb_mmx \
+               chroma/chroma_i420_yuy2 \
+               chroma/chroma_i420_yuy2_mmx \
+               chroma/chroma_i422_yuy2 \
+               chroma/chroma_i422_yuy2_mmx \
                directx/directx \
                dsp/dsp \
                dummy/dummy \
@@ -111,9 +115,7 @@ PLUGINS_TARGETS := ac3_adec/ac3_adec \
                text/rc \
                vcd/vcd \
                x11/x11 \
-               x11/xvideo \
-               yuv/yuv \
-               yuv/yuvmmx
+               x11/xvideo
 
 #
 # C Objects
@@ -157,6 +159,24 @@ VLC_OBJ := $(C_OBJ) $(CPP_OBJ) $(BUILTIN_OBJ) $(RESOURCE_OBJ)
 #
 H_OBJ :=       src/misc/modules_builtin.h
 
+#
+# Included headers which don't get noticed by Makefile.dep
+#
+H_DEP :=       videolan/vlc.h \
+               defs.h \
+               config.h \
+               int_types.h \
+               modules_inner.h \
+               common.h \
+               beos_specific.h \
+               darwin_specific.h \
+               win32_specific.h \
+               intf_msg.h \
+               threads.h \
+               mtime.h \
+               modules.h \
+               main.h
+
 #
 # Other lists of files
 #
@@ -526,12 +546,14 @@ $(C_DEP): %.d: FORCE
 $(CPP_DEP): %.dpp: FORCE
        @$(MAKE) -s --no-print-directory -f Makefile.dep $@
 
-$(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile $(H_OBJ)
+$(C_OBJ): %.o: Makefile.opts Makefile.dep Makefile
+$(C_OBJ): %.o: $(H_OBJ) $(H_DEP:%=include/%)
 $(C_OBJ): %.o: .dep/%.d
 $(C_OBJ): %.o: %.c
        $(CC) $(CFLAGS) $(CFLAGS_VLC) -c -o $@ $<
 
 $(CPP_OBJ): %.o: Makefile.opts Makefile.dep Makefile
+$(CPP_OBJ): %.o: $(H_OBJ) $(H_DEP:%=include/%)
 $(CPP_OBJ): %.o: .dep/%.dpp
 $(CPP_OBJ): %.o: %.cpp
        $(CC) $(CFLAGS) $(CFLAGS_VLC) -c -o $@ $<
index 866dbf1ad3b68e983d054cbd3af092a3e1a754fc..71d4bb5a45d5d6a8d8ecba54d961f6c2141b1808 100644 (file)
@@ -57,6 +57,7 @@ clean:
 FORCE:
 
 $(OBJ_ALL): ../../Makefile.modules ../../Makefile.dep ../../Makefile Makefile
+$(OBJ_ALL): $(H_DEP:%=../../include/%)
 
 $(C_DEP): %.d: FORCE
        @$(MAKE) -s --no-print-directory -f ../../Makefile.dep $@ CFLAGS="$(CFLAGS) $(CFLAGS_EXTRA)"
index 65a20c84617fe279ebd2be2ea0e29fe97eedaa73..f98ebb6953a7187769ed75b04c31b6cd8612ee7d 100755 (executable)
--- a/configure
+++ b/configure
@@ -24,8 +24,6 @@ ac_help="$ac_help
                           (default i686 on IA-32 and 750 on PPC)"
 ac_help="$ac_help
   --enable-release        Activate extra optimizations (default disabled)"
-ac_help="$ac_help
-  --disable-mmx           Disable MMX optimizations (default enabled for x86)"
 ac_help="$ac_help
   --disable-altivec       Disable altivec optimizations (default enabled on PPC)"
 ac_help="$ac_help
@@ -663,7 +661,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:667: checking host system type" >&5
+echo "configure:665: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -684,7 +682,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking target system type""... $ac_c" 1>&6
-echo "configure:688: checking target system type" >&5
+echo "configure:686: checking target system type" >&5
 
 target_alias=$target
 case "$target_alias" in
@@ -702,7 +700,7 @@ target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$target" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:706: checking build system type" >&5
+echo "configure:704: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -749,7 +747,7 @@ save_CFLAGS="${CFLAGS}"
 save_LDFLAGS="${LDFLAGS}"
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:753: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:751: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -778,7 +776,7 @@ fi
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:782: checking for $ac_word" >&5
+echo "configure:780: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -808,7 +806,7 @@ if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:812: checking for $ac_word" >&5
+echo "configure:810: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -859,7 +857,7 @@ fi
       # Extract the first word of "cl", so it can be a program name with args.
 set dummy cl; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:863: checking for $ac_word" >&5
+echo "configure:861: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -891,7 +889,7 @@ fi
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:895: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:893: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -902,12 +900,12 @@ cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext << EOF
 
-#line 906 "configure"
+#line 904 "configure"
 #include "confdefs.h"
 
 main(){return(0);}
 EOF
-if { (eval echo configure:911: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:909: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -933,12 +931,12 @@ if test $ac_cv_prog_cc_works = no; then
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:937: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:935: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:942: checking whether we are using GNU C" >&5
+echo "configure:940: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -947,7 +945,7 @@ else
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:951: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:949: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -966,7 +964,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
 ac_save_CFLAGS="$CFLAGS"
 CFLAGS=
 echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:970: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:968: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -998,7 +996,7 @@ else
 fi
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1002: checking how to run the C preprocessor" >&5
+echo "configure:1000: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1013,13 +1011,13 @@ else
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1017 "configure"
+#line 1015 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1021: \"$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
   :
@@ -1030,13 +1028,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1034 "configure"
+#line 1032 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1038: \"$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
   :
@@ -1047,13 +1045,13 @@ else
   rm -rf conftest*
   CPP="${CC-cc} -nologo -E"
   cat > conftest.$ac_ext <<EOF
-#line 1051 "configure"
+#line 1049 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1057: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1055: \"$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
   :
@@ -1091,7 +1089,7 @@ EOF
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1095: checking for $ac_word" >&5
+echo "configure:1093: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1120,7 +1118,7 @@ fi
 
 
         echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6
-echo "configure:1124: checking for strerror in -lcposix" >&5
+echo "configure:1122: checking for strerror in -lcposix" >&5
 ac_lib_var=`echo cposix'_'strerror | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1128,7 +1126,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lcposix  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1132 "configure"
+#line 1130 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1139,7 +1137,7 @@ int main() {
 strerror()
 ; return 0; }
 EOF
-if { (eval echo configure:1143: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1141: \"$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
@@ -1162,12 +1160,12 @@ fi
   
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1166: checking for ANSI C header files" >&5
+echo "configure:1164: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1171 "configure"
+#line 1169 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1175,7 +1173,7 @@ else
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1177: \"$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*
@@ -1192,7 +1190,7 @@ rm -f conftest*
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1196 "configure"
+#line 1194 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1210,7 +1208,7 @@ fi
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1214 "configure"
+#line 1212 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1231,7 +1229,7 @@ if test "$cross_compiling" = yes; then
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1235 "configure"
+#line 1233 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1242,7 +1240,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
 exit (0); }
 
 EOF
-if { (eval echo configure:1246: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1266,12 +1264,12 @@ EOF
 fi
 
 echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1270: checking for working const" >&5
+echo "configure:1268: checking for working const" >&5
 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1275 "configure"
+#line 1273 "configure"
 #include "confdefs.h"
 
 int main() {
@@ -1320,7 +1318,7 @@ ccp = (char const *const *) p;
 
 ; return 0; }
 EOF
-if { (eval echo configure:1324: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_const=yes
 else
@@ -1341,21 +1339,21 @@ EOF
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1345: checking for inline" >&5
+echo "configure:1343: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 1352 "configure"
+#line 1350 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:1359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1357: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -1381,12 +1379,12 @@ EOF
 esac
 
 echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1385: checking for off_t" >&5
+echo "configure:1383: checking for off_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1390 "configure"
+#line 1388 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1414,12 +1412,12 @@ EOF
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1418: checking for size_t" >&5
+echo "configure:1416: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1423 "configure"
+#line 1421 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1449,19 +1447,19 @@ fi
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
 echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1453: checking for working alloca.h" >&5
+echo "configure:1451: checking for working alloca.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1458 "configure"
+#line 1456 "configure"
 #include "confdefs.h"
 #include <alloca.h>
 int main() {
 char *p = alloca(2 * sizeof(int));
 ; return 0; }
 EOF
-if { (eval echo configure:1465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_header_alloca_h=yes
 else
@@ -1482,12 +1480,12 @@ EOF
 fi
 
 echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1486: checking for alloca" >&5
+echo "configure:1484: checking for alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1491 "configure"
+#line 1489 "configure"
 #include "confdefs.h"
 
 #ifdef __GNUC__
@@ -1515,7 +1513,7 @@ int main() {
 char *p = (char *) alloca(1);
 ; return 0; }
 EOF
-if { (eval echo configure:1519: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1517: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_func_alloca_works=yes
 else
@@ -1547,12 +1545,12 @@ EOF
 
 
 echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1551: checking whether alloca needs Cray hooks" >&5
+echo "configure:1549: checking whether alloca needs Cray hooks" >&5
 if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1556 "configure"
+#line 1554 "configure"
 #include "confdefs.h"
 #if defined(CRAY) && ! defined(CRAY2)
 webecray
@@ -1577,12 +1575,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
 if test $ac_cv_os_cray = yes; then
 for ac_func in _getb67 GETB67 getb67; do
   echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1581: checking for $ac_func" >&5
+echo "configure:1579: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1586 "configure"
+#line 1584 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1605,7 +1603,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1607: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1632,7 +1630,7 @@ done
 fi
 
 echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1636: checking stack direction for C alloca" >&5
+echo "configure:1634: checking stack direction for C alloca" >&5
 if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1640,7 +1638,7 @@ else
   ac_cv_c_stack_direction=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1644 "configure"
+#line 1642 "configure"
 #include "confdefs.h"
 find_stack_direction ()
 {
@@ -1659,7 +1657,7 @@ main ()
   exit (find_stack_direction() < 0);
 }
 EOF
-if { (eval echo configure:1663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_stack_direction=1
 else
@@ -1684,17 +1682,17 @@ for ac_hdr in unistd.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1688: checking for $ac_hdr" >&5
+echo "configure:1686: 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 1693 "configure"
+#line 1691 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1696: \"$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*
@@ -1723,12 +1721,12 @@ done
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1727: checking for $ac_func" >&5
+echo "configure:1725: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1732 "configure"
+#line 1730 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -1751,7 +1749,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:1755: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -1776,7 +1774,7 @@ fi
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:1780: checking for working mmap" >&5
+echo "configure:1778: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1784,7 +1782,7 @@ else
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 1788 "configure"
+#line 1786 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -1924,7 +1922,7 @@ main()
 }
 
 EOF
-if { (eval echo configure:1928: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -1948,12 +1946,12 @@ fi
 
 
     echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6
-echo "configure:1952: checking whether we are using the GNU C Library 2.1 or newer" >&5
+echo "configure:1950: checking whether we are using the GNU C Library 2.1 or newer" >&5
 if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1957 "configure"
+#line 1955 "configure"
 #include "confdefs.h"
 
 #include <features.h>
@@ -1989,17 +1987,17 @@ stdlib.h string.h unistd.h sys/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1993: checking for $ac_hdr" >&5
+echo "configure:1991: 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 1998 "configure"
+#line 1996 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2003: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2001: \"$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*
@@ -2030,12 +2028,12 @@ getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
 strdup strtoul tsearch __argz_count __argz_stringify __argz_next
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2034: checking for $ac_func" >&5
+echo "configure:2032: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2039 "configure"
+#line 2037 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2058,7 +2056,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2062: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2098,7 +2096,7 @@ fi
 
 
   echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:2102: checking for iconv" >&5
+echo "configure:2100: checking for iconv" >&5
 if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2106,7 +2104,7 @@ else
     am_cv_func_iconv="no, consider installing GNU libiconv"
     am_cv_lib_iconv=no
     cat > conftest.$ac_ext <<EOF
-#line 2110 "configure"
+#line 2108 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -2116,7 +2114,7 @@ iconv_t cd = iconv_open("","");
        iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:2120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_func_iconv=yes
 else
@@ -2128,7 +2126,7 @@ rm -f conftest*
       am_save_LIBS="$LIBS"
       LIBS="$LIBS -liconv"
       cat > conftest.$ac_ext <<EOF
-#line 2132 "configure"
+#line 2130 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <iconv.h>
@@ -2138,7 +2136,7 @@ iconv_t cd = iconv_open("","");
          iconv_close(cd);
 ; return 0; }
 EOF
-if { (eval echo configure:2142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2140: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_lib_iconv=yes
         am_cv_func_iconv=yes
@@ -2159,13 +2157,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
 EOF
 
     echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:2163: checking for iconv declaration" >&5
+echo "configure:2161: checking for iconv declaration" >&5
     if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   
       cat > conftest.$ac_ext <<EOF
-#line 2169 "configure"
+#line 2167 "configure"
 #include "confdefs.h"
 
 #include <stdlib.h>
@@ -2184,7 +2182,7 @@ int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:2188: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2186: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   am_cv_proto_iconv_arg1=""
 else
@@ -2213,19 +2211,19 @@ EOF
 
    
   echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6
-echo "configure:2217: checking for nl_langinfo and CODESET" >&5
+echo "configure:2215: checking for nl_langinfo and CODESET" >&5
 if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2222 "configure"
+#line 2220 "configure"
 #include "confdefs.h"
 #include <langinfo.h>
 int main() {
 char* cs = nl_langinfo(CODESET);
 ; return 0; }
 EOF
-if { (eval echo configure:2229: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2227: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_langinfo_codeset=yes
 else
@@ -2248,19 +2246,19 @@ EOF
 
    if test $ac_cv_header_locale_h = yes; then
     echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2252: checking for LC_MESSAGES" >&5
+echo "configure:2250: checking for LC_MESSAGES" >&5
 if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2257 "configure"
+#line 2255 "configure"
 #include "confdefs.h"
 #include <locale.h>
 int main() {
 return LC_MESSAGES
 ; return 0; }
 EOF
-if { (eval echo configure:2264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2262: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   am_cv_val_LC_MESSAGES=yes
 else
@@ -2281,7 +2279,7 @@ EOF
     fi
   fi
    echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2285: checking whether NLS is requested" >&5
+echo "configure:2283: checking whether NLS is requested" >&5
         # Check whether --enable-nls or --disable-nls was given.
 if test "${enable_nls+set}" = set; then
   enableval="$enable_nls"
@@ -2303,7 +2301,7 @@ fi
 EOF
 
       echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2307: checking whether included gettext is requested" >&5
+echo "configure:2305: checking whether included gettext is requested" >&5
       # Check whether --with-included-gettext or --without-included-gettext was given.
 if test "${with_included_gettext+set}" = set; then
   withval="$with_included_gettext"
@@ -2323,17 +2321,17 @@ fi
 
        ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2327: checking for libintl.h" >&5
+echo "configure:2325: checking for libintl.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 2332 "configure"
+#line 2330 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2337: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2335: \"$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*
@@ -2350,12 +2348,12 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6
-echo "configure:2354: checking for GNU gettext in libc" >&5
+echo "configure:2352: checking for GNU gettext in libc" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2359 "configure"
+#line 2357 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 extern int _nl_msg_cat_cntr;
@@ -2364,7 +2362,7 @@ bindtextdomain ("", "");
 return (int) gettext ("") + _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:2368: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2366: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gnugettext1_libc=yes
 else
@@ -2380,14 +2378,14 @@ echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6
 
           if test "$gt_cv_func_gnugettext1_libc" != "yes"; then
             echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6
-echo "configure:2384: checking for GNU gettext in libintl" >&5
+echo "configure:2382: checking for GNU gettext in libintl" >&5
 if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   gt_save_LIBS="$LIBS"
                LIBS="$LIBS -lintl $LIBICONV"
                cat > conftest.$ac_ext <<EOF
-#line 2391 "configure"
+#line 2389 "configure"
 #include "confdefs.h"
 #include <libintl.h>
 extern int _nl_msg_cat_cntr;
@@ -2396,7 +2394,7 @@ bindtextdomain ("", "");
 return (int) gettext ("") + _nl_msg_cat_cntr
 ; return 0; }
 EOF
-if { (eval echo configure:2400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2398: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   gt_cv_func_gnugettext1_libintl=yes
 else
@@ -2429,12 +2427,12 @@ EOF
             for ac_func in dcgettext
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2433: checking for $ac_func" >&5
+echo "configure:2431: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2438 "configure"
+#line 2436 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -2457,7 +2455,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -2486,7 +2484,7 @@ done
                     # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2490: checking for $ac_word" >&5
+echo "configure:2488: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2520,7 +2518,7 @@ fi
             # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2524: checking for $ac_word" >&5
+echo "configure:2522: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2557,7 +2555,7 @@ fi
                     # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2561: checking for $ac_word" >&5
+echo "configure:2559: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2607,7 +2605,7 @@ fi
         # Extract the first word of "msgfmt", so it can be a program name with args.
 set dummy msgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2611: checking for $ac_word" >&5
+echo "configure:2609: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2641,7 +2639,7 @@ fi
         # Extract the first word of "gmsgfmt", so it can be a program name with args.
 set dummy gmsgfmt; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2645: checking for $ac_word" >&5
+echo "configure:2643: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2677,7 +2675,7 @@ fi
         # Extract the first word of "xgettext", so it can be a program name with args.
 set dummy xgettext; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2681: checking for $ac_word" >&5
+echo "configure:2679: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2748,7 +2746,7 @@ do
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2752: checking for $ac_word" >&5
+echo "configure:2750: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2781,7 +2779,7 @@ done
       ac_verc_fail=yes
     else
             echo $ac_n "checking version of bison""... $ac_c" 1>&6
-echo "configure:2785: checking version of bison" >&5
+echo "configure:2783: checking version of bison" >&5
       ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
       case $ac_prog_version in
         '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
@@ -2828,7 +2826,7 @@ echo "configure:2785: checking version of bison" >&5
        LINGUAS=
      else
        echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:2832: checking for catalogs to be installed" >&5
+echo "configure:2830: checking for catalogs to be installed" >&5
        NEW_LINGUAS=
        for presentlang in $ALL_LINGUAS; do
          useit=no
@@ -2880,7 +2878,7 @@ echo "configure:2832: checking for catalogs to be installed" >&5
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:2884: checking for a BSD compatible install" >&5
+echo "configure:2882: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2949,7 +2947,7 @@ fi
     *)
                   ac_cv_c_bigendian=unknown
       echo $ac_n "checking what the byte order looks to be""... $ac_c" 1>&6
-echo "configure:2953: checking what the byte order looks to be" >&5
+echo "configure:2951: checking what the byte order looks to be" >&5
         cat >conftest.c <<EOF
         short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
         short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
@@ -2993,12 +2991,12 @@ EOF
 for ac_func in gettimeofday select strerror strtod strtol isatty
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2997: checking for $ac_func" >&5
+echo "configure:2995: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3002 "configure"
+#line 3000 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3021,7 +3019,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3023: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3046,12 +3044,12 @@ fi
 done
 
 echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:3050: checking for connect" >&5
+echo "configure:3048: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3055 "configure"
+#line 3053 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -3074,7 +3072,7 @@ connect();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3078: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -3093,7 +3091,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3097: checking for connect in -lsocket" >&5
+echo "configure:3095: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3101,7 +3099,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3105 "configure"
+#line 3103 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3112,7 +3110,7 @@ int main() {
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:3116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3114: \"$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
@@ -3136,12 +3134,12 @@ fi
 fi
 
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:3140: checking for gethostbyname" >&5
+echo "configure:3138: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3145 "configure"
+#line 3143 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -3164,7 +3162,7 @@ gethostbyname();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -3183,7 +3181,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3187: checking for gethostbyname in -lnsl" >&5
+echo "configure:3185: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3191,7 +3189,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3195 "configure"
+#line 3193 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3202,7 +3200,7 @@ int main() {
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:3206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3204: \"$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
@@ -3226,12 +3224,12 @@ fi
 fi
 
 echo $ac_n "checking for nanosleep""... $ac_c" 1>&6
-echo "configure:3230: checking for nanosleep" >&5
+echo "configure:3228: checking for nanosleep" >&5
 if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3235 "configure"
+#line 3233 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char nanosleep(); below.  */
@@ -3254,7 +3252,7 @@ nanosleep();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3258: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_nanosleep=yes"
 else
@@ -3273,7 +3271,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6
-echo "configure:3277: checking for nanosleep in -lrt" >&5
+echo "configure:3275: checking for nanosleep in -lrt" >&5
 ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3281,7 +3279,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lrt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3285 "configure"
+#line 3283 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3292,7 +3290,7 @@ int main() {
 nanosleep()
 ; return 0; }
 EOF
-if { (eval echo configure:3296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3294: \"$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
@@ -3312,7 +3310,7 @@ else
   echo "$ac_t""no" 1>&6
 
     echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6
-echo "configure:3316: checking for nanosleep in -lposix4" >&5
+echo "configure:3314: checking for nanosleep in -lposix4" >&5
 ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3320,7 +3318,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lposix4  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3324 "configure"
+#line 3322 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3331,7 +3329,7 @@ int main() {
 nanosleep()
 ; return 0; }
 EOF
-if { (eval echo configure:3335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3333: \"$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
@@ -3360,12 +3358,12 @@ fi
 for ac_func in usleep
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3364: checking for $ac_func" >&5
+echo "configure:3362: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3369 "configure"
+#line 3367 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3388,7 +3386,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3413,12 +3411,12 @@ fi
 done
 
 echo $ac_n "checking for inet_aton""... $ac_c" 1>&6
-echo "configure:3417: checking for inet_aton" >&5
+echo "configure:3415: checking for inet_aton" >&5
 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3422 "configure"
+#line 3420 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char inet_aton(); below.  */
@@ -3441,7 +3439,7 @@ inet_aton();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_inet_aton=yes"
 else
@@ -3460,7 +3458,7 @@ else
   echo "$ac_t""no" 1>&6
 
   echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6
-echo "configure:3464: checking for inet_aton in -lresolv" >&5
+echo "configure:3462: checking for inet_aton in -lresolv" >&5
 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3468,7 +3466,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lresolv  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3472 "configure"
+#line 3470 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3479,7 +3477,7 @@ int main() {
 inet_aton()
 ; return 0; }
 EOF
-if { (eval echo configure:3483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3481: \"$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
@@ -3505,12 +3503,12 @@ fi
 for ac_func in vasprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3509: checking for $ac_func" >&5
+echo "configure:3507: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3514 "configure"
+#line 3512 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3533,7 +3531,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3560,12 +3558,12 @@ done
 for ac_func in swab
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3564: checking for $ac_func" >&5
+echo "configure:3562: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3569 "configure"
+#line 3567 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3588,7 +3586,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3590: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3615,12 +3613,12 @@ done
 for ac_func in memalign valloc
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3619: checking for $ac_func" >&5
+echo "configure:3617: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3624 "configure"
+#line 3622 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3643,7 +3641,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3647: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3645: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3671,12 +3669,12 @@ done
 for ac_func in sigrelse
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3675: checking for $ac_func" >&5
+echo "configure:3673: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3680 "configure"
+#line 3678 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3699,7 +3697,7 @@ $ac_func();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3726,12 +3724,12 @@ done
 
 NEED_GETOPT=0
 echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:3730: checking for getopt_long" >&5
+echo "configure:3728: checking for getopt_long" >&5
 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3735 "configure"
+#line 3733 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char getopt_long(); below.  */
@@ -3754,7 +3752,7 @@ getopt_long();
 
 ; return 0; }
 EOF
-if { (eval echo configure:3758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3756: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_getopt_long=yes"
 else
@@ -3776,7 +3774,7 @@ else
   echo "$ac_t""no" 1>&6
  # FreeBSD has a gnugetopt library for this:
   echo $ac_n "checking for getopt_long in -lgnugetopt""... $ac_c" 1>&6
-echo "configure:3780: checking for getopt_long in -lgnugetopt" >&5
+echo "configure:3778: checking for getopt_long in -lgnugetopt" >&5
 ac_lib_var=`echo gnugetopt'_'getopt_long | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3784,7 +3782,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lgnugetopt  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3788 "configure"
+#line 3786 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3795,7 +3793,7 @@ int main() {
 getopt_long()
 ; return 0; }
 EOF
-if { (eval echo configure:3799: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3797: \"$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
@@ -3823,12 +3821,12 @@ fi
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:3827: checking return type of signal handlers" >&5
+echo "configure:3825: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3832 "configure"
+#line 3830 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -3845,7 +3843,7 @@ int main() {
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:3849: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3847: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -3864,7 +3862,7 @@ EOF
 
 
 echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:3868: checking for dlopen in -ldl" >&5
+echo "configure:3866: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3872,7 +3870,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3876 "configure"
+#line 3874 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3883,7 +3881,7 @@ int main() {
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:3887: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3885: \"$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
@@ -3904,7 +3902,7 @@ else
 fi
 
 echo $ac_n "checking for cos in -lm""... $ac_c" 1>&6
-echo "configure:3908: checking for cos in -lm" >&5
+echo "configure:3906: checking for cos in -lm" >&5
 ac_lib_var=`echo m'_'cos | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3912,7 +3910,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3916 "configure"
+#line 3914 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3923,7 +3921,7 @@ int main() {
 cos()
 ; return 0; }
 EOF
-if { (eval echo configure:3927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3925: \"$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
@@ -3945,7 +3943,7 @@ else
 fi
 
 echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
-echo "configure:3949: checking for pow in -lm" >&5
+echo "configure:3947: checking for pow in -lm" >&5
 ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3953,7 +3951,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3957 "configure"
+#line 3955 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3964,7 +3962,7 @@ int main() {
 pow()
 ; return 0; }
 EOF
-if { (eval echo configure:3968: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3966: \"$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
@@ -3991,7 +3989,7 @@ fi
 THREAD_LIB=error
 if test "x${THREAD_LIB}" = xerror; then
   echo $ac_n "checking for pthread_attr_init in -lpthread""... $ac_c" 1>&6
-echo "configure:3995: checking for pthread_attr_init in -lpthread" >&5
+echo "configure:3993: checking for pthread_attr_init in -lpthread" >&5
 ac_lib_var=`echo pthread'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3999,7 +3997,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthread  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4003 "configure"
+#line 4001 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4010,7 +4008,7 @@ int main() {
 pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:4014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4012: \"$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
@@ -4033,7 +4031,7 @@ fi
 fi
 if test "x${THREAD_LIB}" = xerror; then
   echo $ac_n "checking for pthread_attr_init in -lpthreads""... $ac_c" 1>&6
-echo "configure:4037: checking for pthread_attr_init in -lpthreads" >&5
+echo "configure:4035: checking for pthread_attr_init in -lpthreads" >&5
 ac_lib_var=`echo pthreads'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4041,7 +4039,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4045 "configure"
+#line 4043 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4052,7 +4050,7 @@ int main() {
 pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:4056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4054: \"$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
@@ -4075,7 +4073,7 @@ fi
 fi
 if test "x${THREAD_LIB}" = xerror; then
   echo $ac_n "checking for pthread_attr_init in -lc_r""... $ac_c" 1>&6
-echo "configure:4079: checking for pthread_attr_init in -lc_r" >&5
+echo "configure:4077: checking for pthread_attr_init in -lc_r" >&5
 ac_lib_var=`echo c_r'_'pthread_attr_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4083,7 +4081,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lc_r  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4087 "configure"
+#line 4085 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4094,7 +4092,7 @@ int main() {
 pthread_attr_init()
 ; return 0; }
 EOF
-if { (eval echo configure:4098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4096: \"$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
@@ -4117,12 +4115,12 @@ fi
 fi
 if test "x${THREAD_LIB}" = xerror; then
   echo $ac_n "checking for pthread_attr_init""... $ac_c" 1>&6
-echo "configure:4121: checking for pthread_attr_init" >&5
+echo "configure:4119: checking for pthread_attr_init" >&5
 if eval "test \"`echo '$''{'ac_cv_func_pthread_attr_init'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4126 "configure"
+#line 4124 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char pthread_attr_init(); below.  */
@@ -4145,7 +4143,7 @@ pthread_attr_init();
 
 ; return 0; }
 EOF
-if { (eval echo configure:4149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4147: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_func_pthread_attr_init=yes"
 else
@@ -4168,7 +4166,7 @@ fi
 fi
 
 echo $ac_n "checking for cthread_fork in -lthreads""... $ac_c" 1>&6
-echo "configure:4172: checking for cthread_fork in -lthreads" >&5
+echo "configure:4170: checking for cthread_fork in -lthreads" >&5
 ac_lib_var=`echo threads'_'cthread_fork | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -4176,7 +4174,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lthreads  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 4180 "configure"
+#line 4178 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -4187,7 +4185,7 @@ int main() {
 cthread_fork()
 ; return 0; }
 EOF
-if { (eval echo configure:4191: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4189: \"$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
@@ -4209,7 +4207,7 @@ fi
 
 
 cat > conftest.$ac_ext <<EOF
-#line 4213 "configure"
+#line 4211 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 EOF
@@ -4225,7 +4223,7 @@ fi
 rm -f conftest*
 
 cat > conftest.$ac_ext <<EOF
-#line 4229 "configure"
+#line 4227 "configure"
 #include "confdefs.h"
 #include <strings.h>
 EOF
@@ -4245,17 +4243,17 @@ for ac_hdr in getopt.h strings.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4249: checking for $ac_hdr" >&5
+echo "configure:4247: 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 4254 "configure"
+#line 4252 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4259: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4257: \"$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*
@@ -4285,17 +4283,17 @@ for ac_hdr in sys/sockio.h fcntl.h sys/time.h sys/times.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4289: checking for $ac_hdr" >&5
+echo "configure:4287: 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 4294 "configure"
+#line 4292 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4297: \"$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*
@@ -4325,17 +4323,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4329: checking for $ac_hdr" >&5
+echo "configure:4327: 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 4334 "configure"
+#line 4332 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4339: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4337: \"$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*
@@ -4365,17 +4363,17 @@ for ac_hdr in dlfcn.h image.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4369: checking for $ac_hdr" >&5
+echo "configure:4367: 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 4374 "configure"
+#line 4372 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4379: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4377: \"$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*
@@ -4405,17 +4403,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4409: checking for $ac_hdr" >&5
+echo "configure:4407: 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 4414 "configure"
+#line 4412 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4419: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4417: \"$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*
@@ -4445,17 +4443,17 @@ for ac_hdr in machine/param.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4449: checking for $ac_hdr" >&5
+echo "configure:4447: 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 4454 "configure"
+#line 4452 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4457: \"$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*
@@ -4483,12 +4481,12 @@ done
 
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:4487: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:4485: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4492 "configure"
+#line 4490 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -4497,7 +4495,7 @@ int main() {
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:4501: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4499: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -4522,17 +4520,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4526: checking for $ac_hdr" >&5
+echo "configure:4524: 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 4531 "configure"
+#line 4529 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4534: \"$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*
@@ -4560,20 +4558,20 @@ done
 
 
 echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
-echo "configure:4564: checking for ntohl in sys/param.h" >&5
+echo "configure:4562: checking for ntohl in sys/param.h" >&5
 if eval "test \"`echo '$''{'ac_cv_c_ntohl_sys_param_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -Wall -Werror"
      cat > conftest.$ac_ext <<EOF
-#line 4570 "configure"
+#line 4568 "configure"
 #include "confdefs.h"
 #include <sys/param.h>
 int main() {
 void foo() { int meuh; ntohl(meuh); }
 ; return 0; }
 EOF
-if { (eval echo configure:4577: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4575: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_ntohl_sys_param_h=yes
 else
@@ -4594,20 +4592,20 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC accepts -finline-limit""... $ac_c" 1>&6
-echo "configure:4598: checking if \$CC accepts -finline-limit" >&5
+echo "configure:4596: checking if \$CC accepts -finline-limit" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline_limit'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -finline-limit-30000"
      cat > conftest.$ac_ext <<EOF
-#line 4604 "configure"
+#line 4602 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4609: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline_limit=yes
 else
@@ -4625,20 +4623,20 @@ if test x"$ac_cv_c_inline_limit" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -bundle -undefined error""... $ac_c" 1>&6
-echo "configure:4629: checking if \$CC accepts -bundle -undefined error" >&5
+echo "configure:4627: checking if \$CC accepts -bundle -undefined error" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_darwin'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -bundle -undefined error"
      cat > conftest.$ac_ext <<EOF
-#line 4635 "configure"
+#line 4633 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4642: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4640: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_ld_darwin=yes
 else
@@ -4656,20 +4654,20 @@ if test x"$ac_cv_ld_darwin" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC accepts -shared""... $ac_c" 1>&6
-echo "configure:4660: checking if \$CC accepts -shared" >&5
+echo "configure:4658: checking if \$CC accepts -shared" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_plugins'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   CFLAGS="${save_CFLAGS} -shared"
      cat > conftest.$ac_ext <<EOF
-#line 4666 "configure"
+#line 4664 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4673: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4671: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_ld_plugins=yes
 else
@@ -4688,7 +4686,7 @@ fi
         
 if test x"${SOFLAGS}" = x; then
     echo $ac_n "checking for soname setting""... $ac_c" 1>&6
-echo "configure:4692: checking for soname setting" >&5
+echo "configure:4690: checking for soname setting" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_soname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4697,14 +4695,14 @@ else
         try_SOFLAGS="-Wl,-soname -Wl,"
         LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
         cat > conftest.$ac_ext <<EOF
-#line 4701 "configure"
+#line 4699 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_ld_soname="${try_SOFLAGS}"
 else
@@ -4716,14 +4714,14 @@ else
             try_SOFLAGS="-Wl,-h -Wl,"
             LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
             cat > conftest.$ac_ext <<EOF
-#line 4720 "configure"
+#line 4718 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:4727: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_ld_soname="${try_SOFLAGS}"
 else
@@ -4752,22 +4750,22 @@ have problems using libdvdcss.
 fi
 
 echo $ac_n "checking __attribute__ ((aligned ())) support""... $ac_c" 1>&6
-echo "configure:4756: checking __attribute__ ((aligned ())) support" >&5
+echo "configure:4754: checking __attribute__ ((aligned ())) support" >&5
 if eval "test \"`echo '$''{'ac_cv_c_attribute_aligned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_attribute_aligned=0
-       CFLAGS="${save_CFLAGS} -Werror"
+        CFLAGS="${save_CFLAGS} -Werror"
     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
         cat > conftest.$ac_ext <<EOF
-#line 4764 "configure"
+#line 4762 "configure"
 #include "confdefs.h"
 
 int main() {
 static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;
 ; return 0; }
 EOF
-if { (eval echo configure:4771: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4769: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try
 else
@@ -4790,19 +4788,19 @@ CFLAGS="${save_CFLAGS}"
 LDFLAGS="${save_LDFLAGS}"
 
 echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:4794: checking for boolean_t in sys/types.h" >&5
+echo "configure:4792: checking for boolean_t in sys/types.h" >&5
 if eval "test \"`echo '$''{'ac_cv_c_boolean_t_sys_types_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4799 "configure"
+#line 4797 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 int main() {
 boolean_t foo;
 ; return 0; }
 EOF
-if { (eval echo configure:4806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4804: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_boolean_t_sys_types_h=yes
 else
@@ -4823,19 +4821,19 @@ EOF
 fi
 
 echo $ac_n "checking for boolean_t in pthread.h""... $ac_c" 1>&6
-echo "configure:4827: checking for boolean_t in pthread.h" >&5
+echo "configure:4825: checking for boolean_t in pthread.h" >&5
 if eval "test \"`echo '$''{'ac_cv_c_boolean_t_pthread_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4832 "configure"
+#line 4830 "configure"
 #include "confdefs.h"
 #include <pthread.h>
 int main() {
 boolean_t foo;
 ; return 0; }
 EOF
-if { (eval echo configure:4839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4837: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_boolean_t_pthread_h=yes
 else
@@ -4856,19 +4854,19 @@ EOF
 fi
 
 echo $ac_n "checking for boolean_t in cthreads.h""... $ac_c" 1>&6
-echo "configure:4860: checking for boolean_t in cthreads.h" >&5
+echo "configure:4858: checking for boolean_t in cthreads.h" >&5
 if eval "test \"`echo '$''{'ac_cv_c_boolean_t_cthreads_h'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4865 "configure"
+#line 4863 "configure"
 #include "confdefs.h"
 #include <cthreads.h>
 int main() {
 boolean_t foo;
 ; return 0; }
 EOF
-if { (eval echo configure:4872: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4870: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_boolean_t_cthreads_h=yes
 else
@@ -4890,29 +4888,29 @@ fi
 
 ARCH=${target_cpu}
 
-BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts memcpy idct idctclassic motion imdct downmix mpeg_adec lpcm_adec ac3_adec mpeg_vdec"
-PLUGINS="${PLUGINS} ac3_spdif spudec chroma_yv12_rgb16 filter_deinterlace filter_invert filter_wall filter_transform filter_distort"
+BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts memcpy idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 mpeg_adec lpcm_adec ac3_adec mpeg_vdec"
+PLUGINS="${PLUGINS} ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort"
 
-MMX_MODULES="memcpymmx idctmmx motionmmx"
+MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx"
 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
 SSE_MODULES="imdctsse downmixsse"
 ALTIVEC_MODULES="idctaltivec motionaltivec"
 
 echo $ac_n "checking if \$CC groks MMX inline assembly""... $ac_c" 1>&6
-echo "configure:4904: checking if \$CC groks MMX inline assembly" >&5
+echo "configure:4902: checking if \$CC groks MMX inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_mmx_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4909 "configure"
+#line 4907 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:4916: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4914: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mmx_inline=yes
 else
@@ -4930,19 +4928,19 @@ if test x"$ac_cv_mmx_inline" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC groks MMX EXT inline assembly""... $ac_c" 1>&6
-echo "configure:4934: checking if \$CC groks MMX EXT inline assembly" >&5
+echo "configure:4932: checking if \$CC groks MMX EXT inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_mmxext_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4939 "configure"
+#line 4937 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:4946: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4944: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_mmxext_inline=yes
 else
@@ -4960,19 +4958,19 @@ if test x"$ac_cv_mmxext_inline" != x"no"; then
 fi
 
 echo $ac_n "checking if \$CC groks 3D Now! inline assembly""... $ac_c" 1>&6
-echo "configure:4964: checking if \$CC groks 3D Now! inline assembly" >&5
+echo "configure:4962: checking if \$CC groks 3D Now! inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_3dnow_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4969 "configure"
+#line 4967 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:4976: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4974: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_3dnow_inline=yes
 else
@@ -4994,19 +4992,19 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks SSE inline assembly""... $ac_c" 1>&6
-echo "configure:4998: checking if \$CC groks SSE inline assembly" >&5
+echo "configure:4996: checking if \$CC groks SSE inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_sse_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5003 "configure"
+#line 5001 "configure"
 #include "confdefs.h"
 
 int main() {
 void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));
 ; return 0; }
 EOF
-if { (eval echo configure:5010: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_sse_inline=yes
 else
@@ -5028,19 +5026,19 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks Altivec inline assembly""... $ac_c" 1>&6
-echo "configure:5032: checking if \$CC groks Altivec inline assembly" >&5
+echo "configure:5030: checking if \$CC groks Altivec inline assembly" >&5
 if eval "test \"`echo '$''{'ac_cv_altivec_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 5037 "configure"
+#line 5035 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile("vperm 0,1,2,3");
 ; return 0; }
 EOF
-if { (eval echo configure:5044: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5042: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_altivec_inline=yes
 else
@@ -5050,14 +5048,14 @@ else
   save_CFLAGS=$CFLAGS
           CFLAGS="$CFLAGS -Wa,-m7400"
           cat > conftest.$ac_ext <<EOF
-#line 5054 "configure"
+#line 5052 "configure"
 #include "confdefs.h"
 
 int main() {
 asm volatile("vperm 0,1,2,3");
 ; return 0; }
 EOF
-if { (eval echo configure:5061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5059: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_altivec_inline="-Wa,-m7400"
 else
@@ -5088,7 +5086,7 @@ EOF
 fi
 
 echo $ac_n "checking if \$CC groks Altivec C extensions""... $ac_c" 1>&6
-echo "configure:5092: checking if \$CC groks Altivec C extensions" >&5
+echo "configure:5090: checking if \$CC groks Altivec C extensions" >&5
 if eval "test \"`echo '$''{'ac_cv_c_altivec'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5096,14 +5094,14 @@ else
      CFLAGS="$CFLAGS -faltivec"
      # Darwin test
      cat > conftest.$ac_ext <<EOF
-#line 5100 "configure"
+#line 5098 "configure"
 #include "confdefs.h"
 
 int main() {
 vec_mtvscr((vector unsigned int)(0));
 ; return 0; }
 EOF
-if { (eval echo configure:5107: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5105: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_altivec=-faltivec
 else
@@ -5114,14 +5112,14 @@ else
         # Linux/PPC test
         CFLAGS="$save_CFLAGS $CFLAGS_IDCTALTIVEC -fvec"
         cat > conftest.$ac_ext <<EOF
-#line 5118 "configure"
+#line 5116 "configure"
 #include "confdefs.h"
 
 int main() {
 vec_mtvscr((vector unsigned int)(0));
 ; return 0; }
 EOF
-if { (eval echo configure:5125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_altivec="-fvec"
 else
@@ -5151,21 +5149,21 @@ EOF
 fi
 
 echo $ac_n "checking if linker needs -framework vecLib""... $ac_c" 1>&6
-echo "configure:5155: checking if linker needs -framework vecLib" >&5
+echo "configure:5153: checking if linker needs -framework vecLib" >&5
 if eval "test \"`echo '$''{'ac_cv_ld_altivec'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   save_LDFLAGS=$LDFLAGS
      LDFLAGS="$LDFLAGS -framework vecLib"
      cat > conftest.$ac_ext <<EOF
-#line 5162 "configure"
+#line 5160 "configure"
 #include "confdefs.h"
 
 int main() {
 
 ; return 0; }
 EOF
-if { (eval echo configure:5169: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   ac_cv_ld_altivec=yes
 else
@@ -5206,7 +5204,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args.
 set dummy ${ac_tool_prefix}windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5210: checking for $ac_word" >&5
+echo "configure:5208: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5238,7 +5236,7 @@ if test -n "$ac_tool_prefix"; then
   # Extract the first word of "windres", so it can be a program name with args.
 set dummy windres; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:5242: checking for $ac_word" >&5
+echo "configure:5240: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -5317,17 +5315,17 @@ for ac_hdr in winioctl.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5321: checking for $ac_hdr" >&5
+echo "configure:5319: 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 5326 "configure"
+#line 5324 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5329: \"$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*
@@ -5360,17 +5358,17 @@ for ac_hdr in sys/ioctl.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5364: checking for $ac_hdr" >&5
+echo "configure:5362: 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 5369 "configure"
+#line 5367 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5372: \"$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*
@@ -5396,17 +5394,17 @@ EOF
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5400: checking for $ac_hdr" >&5
+echo "configure:5398: 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 5405 "configure"
+#line 5403 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5410: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5408: \"$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*
@@ -5436,7 +5434,7 @@ done
   LINUX_DVD_STRUCT=0
   OPENBSD_DVD_STRUCT=0
         cat > conftest.$ac_ext <<EOF
-#line 5440 "configure"
+#line 5438 "configure"
 #include "confdefs.h"
 #include <sys/cdio.h>
 EOF
@@ -5449,7 +5447,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 EOF
 
     cat > conftest.$ac_ext <<EOF
-#line 5453 "configure"
+#line 5451 "configure"
 #include "confdefs.h"
 #include <sys/cdio.h>
 EOF
@@ -5469,7 +5467,7 @@ fi
 rm -f conftest*
 
         cat > conftest.$ac_ext <<EOF
-#line 5473 "configure"
+#line 5471 "configure"
 #include "confdefs.h"
 #include <sys/dvdio.h>
 EOF
@@ -5482,7 +5480,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
 EOF
 
     cat > conftest.$ac_ext <<EOF
-#line 5486 "configure"
+#line 5484 "configure"
 #include "confdefs.h"
 #include <sys/dvdio.h>
 EOF
@@ -5502,7 +5500,7 @@ fi
 rm -f conftest*
 
         cat > conftest.$ac_ext <<EOF
-#line 5506 "configure"
+#line 5504 "configure"
 #include "confdefs.h"
 #include <linux/cdrom.h>
 EOF
@@ -5521,7 +5519,7 @@ rm -f conftest*
 
         NEED_BSDI_LIBDVD=0
   cat > conftest.$ac_ext <<EOF
-#line 5525 "configure"
+#line 5523 "configure"
 #include "confdefs.h"
 #include <dvd.h>
 EOF
@@ -5543,17 +5541,17 @@ else
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5547: checking for $ac_hdr" >&5
+echo "configure:5545: 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 5552 "configure"
+#line 5550 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5557: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5555: \"$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*
@@ -5593,17 +5591,17 @@ rm -f conftest*
 
         ac_safe=`echo "sys/scsi/scsi_types.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/scsi/scsi_types.h""... $ac_c" 1>&6
-echo "configure:5597: checking for sys/scsi/scsi_types.h" >&5
+echo "configure:5595: checking for sys/scsi/scsi_types.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 5602 "configure"
+#line 5600 "configure"
 #include "confdefs.h"
 #include <sys/scsi/scsi_types.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5607: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5605: \"$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*
@@ -5622,17 +5620,17 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   
     ac_safe=`echo "sys/scsi/impl/uscsi.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/scsi/impl/uscsi.h""... $ac_c" 1>&6
-echo "configure:5626: checking for sys/scsi/impl/uscsi.h" >&5
+echo "configure:5624: checking for sys/scsi/impl/uscsi.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 5631 "configure"
+#line 5629 "configure"
 #include "confdefs.h"
 #include <sys/scsi/impl/uscsi.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5634: \"$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*
@@ -5665,17 +5663,17 @@ fi
 
         ac_safe=`echo "sys/scsi.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/scsi.h""... $ac_c" 1>&6
-echo "configure:5669: checking for sys/scsi.h" >&5
+echo "configure:5667: checking for sys/scsi.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 5674 "configure"
+#line 5672 "configure"
 #include "confdefs.h"
 #include <sys/scsi.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5679: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5677: \"$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*
@@ -5693,7 +5691,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
     cat > conftest.$ac_ext <<EOF
-#line 5697 "configure"
+#line 5695 "configure"
 #include "confdefs.h"
 #include <sys/scsi.h>
 EOF
@@ -5765,17 +5763,12 @@ else
 fi
 
 
-# Check whether --enable-mmx or --disable-mmx was given.
-if test "${enable_mmx+set}" = set; then
-  enableval="$enable_mmx"
-   if test x$enableval = xyes; then ARCH="${ARCH} mmx";
-    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi 
-else
-   if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386; then ARCH="${ARCH} mmx";
-    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi 
+if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
+then
+    ARCH="${ARCH} mmx"
+    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
 fi
 
-
 # Check whether --enable-altivec or --disable-altivec was given.
 if test "${enable_altivec+set}" = set; then
   enableval="$enable_altivec"
@@ -5838,7 +5831,7 @@ if test "${enable_pth+set}" = set; then
   enableval="$enable_pth"
    if test x$enableval = xyes; then
     echo $ac_n "checking for pth_init in -lpth""... $ac_c" 1>&6
-echo "configure:5842: checking for pth_init in -lpth" >&5
+echo "configure:5835: checking for pth_init in -lpth" >&5
 ac_lib_var=`echo pth'_'pth_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -5846,7 +5839,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lpth  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 5850 "configure"
+#line 5843 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -5857,7 +5850,7 @@ int main() {
 pth_init()
 ; return 0; }
 EOF
-if { (eval echo configure:5861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5854: \"$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
@@ -5885,7 +5878,7 @@ else
 fi
 
     cat > conftest.$ac_ext <<EOF
-#line 5889 "configure"
+#line 5882 "configure"
 #include "confdefs.h"
 #include <pth.h>
 EOF
@@ -6013,7 +6006,7 @@ fi
 if test x$enable_vcd != xno
 then
   cat > conftest.$ac_ext <<EOF
-#line 6017 "configure"
+#line 6010 "configure"
 #include "confdefs.h"
 #include <linux/cdrom.h>
 EOF
@@ -6074,7 +6067,7 @@ if test "${with_mad+set}" = set; then
   withval="$with_mad"
    if test "x$with_val" != "xno"; then
       if test -n $with_val; then
-           CFLAGS_MAD="-I$with_val/include"
+        CFLAGS_MAD="-I$with_val/include"
         LIB_MAD="-L$with_val/lib -lmad"
       else
         LIB_MAD="-lmad"
@@ -6087,17 +6080,17 @@ if test "${with_mad+set}" = set; then
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6091: checking for $ac_hdr" >&5
+echo "configure:6084: 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 6096 "configure"
+#line 6089 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6101: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6094: \"$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*
@@ -6127,7 +6120,7 @@ fi
 done
 
       echo $ac_n "checking for mad_bit_init in -lmad""... $ac_c" 1>&6
-echo "configure:6131: checking for mad_bit_init in -lmad" >&5
+echo "configure:6124: checking for mad_bit_init in -lmad" >&5
 ac_lib_var=`echo mad'_'mad_bit_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -6135,7 +6128,7 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lmad  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 6139 "configure"
+#line 6132 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -6146,7 +6139,7 @@ int main() {
 mad_bit_init()
 ; return 0; }
 EOF
-if { (eval echo configure:6150: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6143: \"$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
@@ -6213,7 +6206,7 @@ if test "${enable_esd+set}" = set; then
      # Extract the first word of "esd-config", so it can be a program name with args.
 set dummy esd-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6217: checking for $ac_word" >&5
+echo "configure:6210: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6264,7 +6257,7 @@ if test "${enable_arts+set}" = set; then
      # Extract the first word of "artsc-config", so it can be a program name with args.
 set dummy artsc-config; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6268: checking for $ac_word" >&5
+echo "configure:6261: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_path_ARTS_CONFIG'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -6322,17 +6315,17 @@ else
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6326: checking for $ac_hdr" >&5
+echo "configure:6319: 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 6331 "configure"
+#line 6324 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6329: \"$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*
@@ -6377,17 +6370,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6381: checking for $ac_hdr" >&5
+echo "configure:6374: 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 6386 "configure"
+#line 6379 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6391: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6384: \"$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*
@@ -6465,7 +6458,7 @@ 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:6469: checking for $ac_word" >&5
+echo "configure:6462: 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
@@ -6505,7 +6498,7 @@ fi
     # 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:6509: checking for $ac_word" >&5
+echo "configure:6502: 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
@@ -6546,7 +6539,7 @@ fi
     # 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:6550: checking for $ac_word" >&5
+echo "configure:6543: 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
@@ -6592,17 +6585,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6596: checking for $ac_hdr" >&5
+echo "configure:6589: 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 6601 "configure"
+#line 6594 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6599: \"$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*
@@ -6672,17 +6665,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6676: checking for $ac_hdr" >&5
+echo "configure:6669: 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 6681 "configure"
+#line 6674 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6679: \"$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*
@@ -6711,7 +6704,7 @@ done
 
     else
       echo $ac_n "checking for directX headers in ${withval}""... $ac_c" 1>&6
-echo "configure:6715: checking for directX headers in ${withval}" >&5
+echo "configure:6708: checking for directX headers in ${withval}" >&5
       if test -f ${withval}/include/directx.h
       then
         PLUGINS="${PLUGINS} directx"
@@ -6798,7 +6791,7 @@ if test "${enable_gnome+set}" = set; then
     # 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:6802: checking for $ac_word" >&5
+echo "configure:6795: 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
@@ -6843,17 +6836,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6847: checking for $ac_hdr" >&5
+echo "configure:6840: 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 6852 "configure"
+#line 6845 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6857: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6850: \"$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*
@@ -6913,7 +6906,7 @@ fi
   # 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:6917: checking for $ac_word" >&5
+echo "configure:6910: 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
@@ -6959,17 +6952,17 @@ fi
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:6963: checking for $ac_hdr" >&5
+echo "configure:6956: 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 6968 "configure"
+#line 6961 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:6973: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:6966: \"$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*
@@ -7026,17 +7019,17 @@ if test x$enable_x11 != xno &&
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7030: checking for $ac_hdr" >&5
+echo "configure:7023: 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 7035 "configure"
+#line 7028 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7040: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7033: \"$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*
@@ -7089,17 +7082,17 @@ if test x$enable_xvideo != xno &&
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7093: checking for $ac_hdr" >&5
+echo "configure:7086: 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 7098 "configure"
+#line 7091 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7103: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7096: \"$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*
@@ -7139,17 +7132,17 @@ if test "${enable_alsa+set}" = set; then
    then
      ac_safe=`echo "alsa/asoundlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for alsa/asoundlib.h""... $ac_c" 1>&6
-echo "configure:7143: checking for alsa/asoundlib.h" >&5
+echo "configure:7136: 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 7148 "configure"
+#line 7141 "configure"
 #include "confdefs.h"
 #include <alsa/asoundlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7153: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7146: \"$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*
@@ -7166,7 +7159,7 @@ fi
 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:7170: checking for main in -lasound" >&5
+echo "configure:7163: 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
@@ -7174,14 +7167,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lasound  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 7178 "configure"
+#line 7171 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:7185: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7178: \"$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
index f0b40bae047cf59ad109fb2ee3f39156b42c0940..3cf19d1a1b03c564b81877e5847f657cf33cedbb 100644 (file)
@@ -252,7 +252,7 @@ dnl Checks for __attribute__(aligned()) directive
 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
     [ac_cv_c_attribute_aligned],
     [ac_cv_c_attribute_aligned=0
-       CFLAGS="${save_CFLAGS} -Werror"
+        CFLAGS="${save_CFLAGS} -Werror"
     for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
         AC_TRY_COMPILE([],
         [static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;],
@@ -297,13 +297,13 @@ ARCH=${target_cpu}
 dnl
 dnl  default modules
 dnl
-BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts memcpy idct idctclassic motion imdct downmix mpeg_adec lpcm_adec ac3_adec mpeg_vdec"
-PLUGINS="${PLUGINS} ac3_spdif spudec chroma_yv12_rgb16 filter_deinterlace filter_invert filter_wall filter_transform filter_distort"
+BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts memcpy idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 mpeg_adec lpcm_adec ac3_adec mpeg_vdec"
+PLUGINS="${PLUGINS} ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort"
 
 dnl
 dnl  Accelerated modules
 dnl
-MMX_MODULES="memcpymmx idctmmx motionmmx"
+MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx"
 MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
 THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
 SSE_MODULES="imdctsse downmixsse"
@@ -576,14 +576,13 @@ AC_ARG_ENABLE(release,
   LIBDVDCSS_VERSION="${LIBDVDCSS_VERSION}_`date +%Y-%m-%d`"; ])
 
 dnl
-dnl  MMX acceleration
+dnl  x86 accelerations
 dnl
-AC_ARG_ENABLE(mmx,
-[  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
-[ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
-    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
-[ if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386; then ARCH="${ARCH} mmx";
-    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
+if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
+then
+    ARCH="${ARCH} mmx"
+    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
+fi
 
 dnl
 dnl  AltiVec acceleration
@@ -808,7 +807,7 @@ AC_ARG_WITH(mad,
   [  --with-mad[=PATH]       libmad module (default disabled)],
   [ if test "x$with_val" != "xno"; then
       if test -n $with_val; then
-           CFLAGS_MAD="-I$with_val/include"
+        CFLAGS_MAD="-I$with_val/include"
         LIB_MAD="-L$with_val/lib -lmad"
       else
         LIB_MAD="-lmad"
diff --git a/doc/bugreport-howto.txt b/doc/bugreport-howto.txt
new file mode 100644 (file)
index 0000000..3d97be6
--- /dev/null
@@ -0,0 +1,58 @@
+
+  Bug report  HOWTO
+ - - - - - - - - - -
+
+ * General rules
+
+   - Be sure the problem you are reporting is not already known, or
+  maybe even already solved. Source of information include the BUGS
+  file, the mailing-list archives at http://www.via.ecp.fr/ml/videolan/
+  and your old friend Google.
+
+   - Be sure to be using a recent version. Bug reports against old
+  versions of vlc are likely to be ignored, because changes in the
+  program may make it impossible to reproduce the bug, or may even have
+  fixed it.
+
+   - Give as many details as possible about your problem! Better too
+  much than not enough.
+
+   - Don't forget to say which version of vlc you are using (0.2.91,
+  CVS snapshot from 21 Dec 2001, Debian packages 0.2.92-4). It is
+  important to tell us where you got the packages from (web site, CVS,
+  distribution).
+
+   - Also, your platform is very important. vlc runs on a lot of
+  different operating systems, so you should at least provide your
+  operating system name and version (Windows 98, Debian Linux woody,
+  BeOS, ...) and your CPU (Pentium 3, Sparc, PowerPC, ...).
+
+
+ * Reporting a ./configure or make issue
+
+   - Give the full log showing the problem:
+      ./configure <options> > logfile.txt 2>&1
+      make 2>&1 > logfile.txt 2>&1
+
+   - When dealing with a ./configure issue, please provide the generated
+  config.log file.
+
+   - Your compiler brand and version may be relevant here as well.
+
+
+ * Reporting a crash
+
+   - Try to reproduce the crash and to explain how you reproduced it.
+
+   - A gdb backtrace can be useful. For it to have any meaning, vlc
+  should have been compiled with debug symbols (add the --enable-debug
+  flag to ./configure)
+
+
+ * Where to send bug reports?
+
+   - The vlc-devel mailing-list is probably the best place to send your
+  bug report, just email it to <vlc-devel@videolan.org>. If you are
+  concerned by the size of the attached files, you can put them on a
+  website and post their address instead.
+
index d7250ec5b5996713f83f6334829784ebec499dcc..3aa66b65bac9716ac415a456ec7385ef7dd8f849 100644 (file)
--- a/doc/vlc.1
+++ b/doc/vlc.1
@@ -172,6 +172,10 @@ Select the CSS decryption verbosity level, 0, 1 or 2.
 .B \-\-input <method>
 Choose the input method, "dvd", "ps", "ts" for instance.
 .TP
+.B \-\-nommx, \-\-no3dnow, \-\-nommxext, \-\-nosse, \-\-noaltivec
+Disable the CPU's MMX, 3D Now!, MMX EXT, SSE or AltiVec support. This may
+be useful when you suspect a bug in an accelerated module.
+.TP
 .B \-h, \-\-help
 Print help and exit.
 .TP
index a5163521e4a113923937dce6f080df94ab7627fe..09138ed25dc9cda43f3eaed26ae6242a77dd895a 100644 (file)
@@ -2,7 +2,7 @@
  * css.c: Functions for DVD authentification and unscrambling
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: css.c,v 1.18 2001/12/30 07:09:54 sam Exp $
+ * $Id: css.c,v 1.19 2002/01/04 14:01:34 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *         Håkan Hjort <d95hjort@dtek.chalmers.se>
@@ -325,7 +325,7 @@ int CSSGetDiscKey( dvdcss_handle dvdcss )
             } while( ( playerkeys[i].i_offset != -1 ) &&
                      ( memcmp( test_key, disc_key, KEY_SIZE ) ) );
 
-           /* The decrypted disk key will replace the disk key hash */
+            /* The decrypted disk key will replace the disk key hash */
             memcpy( dvdcss->css.disc.p_disc_key, disc_key, KEY_SIZE );
             break;
 #else
diff --git a/include/common.h b/include/common.h
new file mode 100644 (file)
index 0000000..5261701
--- /dev/null
@@ -0,0 +1,580 @@
+/*****************************************************************************
+ * common.h: common definitions
+ * Collection of useful common types and macros definitions
+ *****************************************************************************
+ * Copyright (C) 1998, 1999, 2000 VideoLAN
+ * $Id: common.h,v 1.64 2002/01/04 14:01:34 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@via.ecp.fr>
+ *          Vincent Seguin <seguin@via.ecp.fr>
+ *          Gildas Bazin <gbazin@netcourrier.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Required system headers
+ *****************************************************************************/
+#include <string.h>                                            /* strerror() */
+
+/*****************************************************************************
+ * Basic types definitions
+ *****************************************************************************/
+
+typedef u8                  byte_t;
+
+/* Boolean type */
+#ifdef BOOLEAN_T_IN_SYS_TYPES_H
+#   include <sys/types.h>
+#elif defined(BOOLEAN_T_IN_PTHREAD_H)
+#   include <pthread.h>
+#elif defined(BOOLEAN_T_IN_CTHREADS_H)
+#   include <cthreads.h>
+#else
+typedef int                 boolean_t;
+#endif
+#ifdef SYS_GNU
+#   define _MACH_I386_BOOLEAN_H_
+#endif
+
+/* ptrdiff_t definition */
+#ifdef HAVE_STDDEF_H
+#   include <stddef.h>
+#else
+#   include <malloc.h>
+#   ifndef _PTRDIFF_T
+#       define _PTRDIFF_T
+/* Not portable in a 64-bit environment. */
+typedef int                 ptrdiff_t;
+#   endif
+#endif
+
+/* Counter for statistics and profiling */
+typedef unsigned long       count_t;
+
+/* DCT elements types */
+typedef s16                 dctelem_t;
+
+/* Video buffer types */
+typedef u8                  yuv_data_t;
+
+/*****************************************************************************
+ * mtime_t: high precision date or time interval
+ *****************************************************************************
+ * Store an high precision date or time interval. The maximum precision is the
+ * micro-second, and a 64 bits integer is used to avoid any overflow (maximum
+ * time interval is then 292271 years, which should be long enough for any
+ * video). Date are stored as a time interval since a common date.
+ * Note that date and time intervals can be manipulated using regular
+ * arithmetic operators, and that no special functions are required.
+ *****************************************************************************/
+typedef s64 mtime_t;
+
+/*****************************************************************************
+ * Classes declaration
+ *****************************************************************************/
+
+/* Plugins */
+struct plugin_bank_s;
+struct plugin_info_s;
+
+typedef struct plugin_bank_s *          p_plugin_bank_t;
+typedef struct plugin_info_s *          p_plugin_info_t;
+
+/* Plugins */
+struct playlist_s;
+struct playlist_item_s;
+struct module_s;
+
+typedef struct playlist_s *             p_playlist_t;
+typedef struct playlist_item_s *        p_playlist_item_t;
+
+/* Interface */
+struct intf_thread_s;
+struct intf_sys_s;
+struct intf_console_s;
+struct intf_msg_s;
+struct intf_channel_s;
+
+typedef struct intf_thread_s *          p_intf_thread_t;
+typedef struct intf_sys_s *             p_intf_sys_t;
+typedef struct intf_console_s *         p_intf_console_t;
+typedef struct intf_msg_s *             p_intf_msg_t;
+typedef struct intf_channel_s *         p_intf_channel_t;
+
+/* Input */
+struct input_thread_s;
+struct input_channel_s;
+struct input_cfg_s;
+struct input_area_s;
+
+typedef struct input_thread_s *         p_input_thread_t;
+typedef struct input_channel_s *        p_input_channel_t;
+typedef struct input_cfg_s *            p_input_cfg_t;
+typedef struct input_area_s *           p_input_area_t;
+
+/* Audio */
+struct aout_thread_s;
+struct aout_sys_s;
+
+typedef struct aout_thread_s *          p_aout_thread_t;
+typedef struct aout_sys_s *             p_aout_sys_t;
+
+/* Video */
+struct vout_thread_s;
+struct vout_font_s;
+struct vout_sys_s;
+struct chroma_sys_s;
+struct vdec_thread_s;
+struct vpar_thread_s;
+struct video_parser_s;
+
+typedef struct vout_thread_s *          p_vout_thread_t;
+typedef struct vout_font_s *            p_vout_font_t;
+typedef struct vout_sys_s *             p_vout_sys_t;
+typedef struct chroma_sys_s *           p_chroma_sys_t;
+typedef struct vdec_thread_s *          p_vdec_thread_t;
+typedef struct vpar_thread_s *          p_vpar_thread_t;
+typedef struct video_parser_s *         p_video_parser_t;
+
+/* Decoders */
+struct decoder_config_s;
+struct decoder_fifo_s;
+
+/* Misc */
+struct macroblock_s;
+struct data_packet_s;
+struct imdct_s;
+struct complex_s;
+struct dm_par_s;
+struct picture_s;
+struct picture_sys_s;
+struct picture_heap_s;
+struct es_descriptor_s;
+struct pgrm_descriptor_s;
+struct pes_packet_s;
+struct input_area_s;
+struct bit_stream_s;
+struct probedata_s;
+
+/*****************************************************************************
+ * Macros and inline functions
+ *****************************************************************************/
+#ifdef NTOHL_IN_SYS_PARAM_H
+#   include <sys/param.h>
+
+#elif defined(WIN32)
+/* Swap bytes in 16 bit value.  */
+#   define __bswap_constant_16(x) \
+     ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
+
+#   if defined __GNUC__ && __GNUC__ >= 2
+#       define __bswap_16(x) \
+            (__extension__                                                    \
+             ({ register unsigned short int __v;                              \
+                if (__builtin_constant_p (x))                                 \
+                  __v = __bswap_constant_16 (x);                              \
+                else                                                          \
+                  __asm__ __volatile__ ("rorw $8, %w0"                        \
+                                        : "=r" (__v)                          \
+                                        : "0" ((unsigned short int) (x))      \
+                                        : "cc");                              \
+                __v; }))
+#   else
+/* This is better than nothing.  */
+#       define __bswap_16(x) __bswap_constant_16 (x)
+#   endif
+
+/* Swap bytes in 32 bit value.  */
+#   define __bswap_constant_32(x) \
+        ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) |            \
+         (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))
+
+#   if defined __GNUC__ && __GNUC__ >= 2
+/* To swap the bytes in a word the i486 processors and up provide the
+   `bswap' opcode.  On i386 we have to use three instructions.  */
+#       if !defined __i486__ && !defined __pentium__ && !defined __pentiumpro__
+#           define __bswap_32(x) \
+                (__extension__                                                \
+                 ({ register unsigned int __v;                                \
+                    if (__builtin_constant_p (x))                             \
+                      __v = __bswap_constant_32 (x);                          \
+                    else                                                      \
+                      __asm__ __volatile__ ("rorw $8, %w0;"                   \
+                                            "rorl $16, %0;"                   \
+                                            "rorw $8, %w0"                    \
+                                            : "=r" (__v)                      \
+                                            : "0" ((unsigned int) (x))        \
+                                            : "cc");                          \
+                    __v; }))
+#       else
+#           define __bswap_32(x) \
+                (__extension__                                                \
+                 ({ register unsigned int __v;                                \
+                    if (__builtin_constant_p (x))                             \
+                      __v = __bswap_constant_32 (x);                          \
+                    else                                                      \
+                      __asm__ __volatile__ ("bswap %0"                        \
+                                            : "=r" (__v)                      \
+                                            : "0" ((unsigned int) (x)));      \
+                    __v; }))
+#       endif
+#   else
+#       define __bswap_32(x) __bswap_constant_32 (x)
+#   endif
+
+#   if defined __GNUC__ && __GNUC__ >= 2
+/* Swap bytes in 64 bit value.  */
+#       define __bswap_constant_64(x) \
+            ((((x) & 0xff00000000000000ull) >> 56)                            \
+             | (((x) & 0x00ff000000000000ull) >> 40)                          \
+             | (((x) & 0x0000ff0000000000ull) >> 24)                          \
+             | (((x) & 0x000000ff00000000ull) >> 8)                           \
+             | (((x) & 0x00000000ff000000ull) << 8)                           \
+             | (((x) & 0x0000000000ff0000ull) << 24)                          \
+             | (((x) & 0x000000000000ff00ull) << 40)                          \
+             | (((x) & 0x00000000000000ffull) << 56))
+
+#       define __bswap_64(x) \
+            (__extension__                                                    \
+             ({ union { __extension__ unsigned long long int __ll;            \
+                        unsigned long int __l[2]; } __w, __r;                 \
+                if (__builtin_constant_p (x))                                 \
+                  __r.__ll = __bswap_constant_64 (x);                         \
+                else                                                          \
+                  {                                                           \
+                    __w.__ll = (x);                                           \
+                    __r.__l[0] = __bswap_32 (__w.__l[1]);                     \
+                    __r.__l[1] = __bswap_32 (__w.__l[0]);                     \
+                  }                                                           \
+                __r.__ll; }))
+#   endif
+
+#else /* NTOHL_IN_SYS_PARAM_H || WIN32 */
+#   include <netinet/in.h>
+
+#endif /* NTOHL_IN_SYS_PARAM_H || WIN32 */
+
+/* CEIL: division with round to nearest greater integer */
+#define CEIL(n, d)  ( ((n) / (d)) + ( ((n) % (d)) ? 1 : 0) )
+
+/* PAD: PAD(n, d) = CEIL(n ,d) * d */
+#define PAD(n, d)   ( ((n) % (d)) ? ((((n) / (d)) + 1) * (d)) : (n) )
+
+/* MAX and MIN: self explanatory */
+#ifndef MAX
+#   define MAX(a, b)   ( ((a) > (b)) ? (a) : (b) )
+#endif
+#ifndef MIN
+#   define MIN(a, b)   ( ((a) < (b)) ? (a) : (b) )
+#endif
+
+/* MSB (big endian)/LSB (little endian) conversions - network order is always
+ * MSB, and should be used for both network communications and files. Note that
+ * byte orders other than little and big endians are not supported, but only
+ * the VAX seems to have such exotic properties - note that these 'functions'
+ * needs <netinet/in.h> or the local equivalent. */
+/* FIXME: hton64 should be declared as an extern inline function to avoid
+ * border effects (see byteorder.h) */
+#if WORDS_BIGENDIAN
+#   define hton16      htons
+#   define hton32      htonl
+#   define hton64(i)   ( i )
+#   define ntoh16      ntohs
+#   define ntoh32      ntohl
+#   define ntoh64(i)   ( i )
+#else
+#   define hton16      htons
+#   define hton32      htonl
+#   define hton64(i)   ( ((u64)(htonl((i) & 0xffffffff)) << 32) | htonl(((i) >> 32) & 0xffffffff ) )
+#   define ntoh16      ntohs
+#   define ntoh32      ntohl
+#   define ntoh64      hton64
+#endif
+
+/* Macros with automatic casts */
+#define U64_AT(p)   ( ntoh64 ( *( (u64 *)(p) ) ) )
+#define U32_AT(p)   ( ntoh32 ( *( (u32 *)(p) ) ) )
+#define U16_AT(p)   ( ntoh16 ( *( (u16 *)(p) ) ) )
+
+/* Alignment of critical static data structures */
+#ifdef ATTRIBUTE_ALIGNED_MAX
+#   define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
+#else
+#   define ATTR_ALIGN(align)
+#endif
+
+/* Alignment of critical dynamic data structure */
+#ifdef HAVE_MEMALIGN
+    /* Some systems have memalign() but no declaration for it */
+    void * memalign( size_t align, size_t size );
+#else
+#   ifdef HAVE_VALLOC
+        /* That's like using a hammer to kill a fly, but eh... */
+#       include <unistd.h>
+#       define memalign(align,size) valloc(size)
+#   else
+        /* Assume malloc alignment is sufficient */
+#       define memalign(align,size) malloc(size)
+#   endif    
+#endif
+
+#define I64C(x)         x##LL
+
+
+#if defined( WIN32 )
+/* The ntoh* and hton* bytes swapping functions are provided by winsock
+ * but for conveniency and speed reasons it is better to implement them
+ * ourselves. ( several plugins use them and it is too much hassle to link
+ * winsock with each of them ;-)
+ */
+#   undef ntoh32(x)
+#   undef ntoh16(x)
+#   undef ntoh64(x)
+#   undef hton32(x)
+#   undef hton16(x)
+#   undef hton64(x)
+
+#   ifdef WORDS_BIGENDIAN
+#       define ntoh32(x)       (x)
+#       define ntoh16(x)       (x)
+#       define ntoh64(x)       (x)
+#       define hton32(x)       (x)
+#       define hton16(x)       (x)
+#       define hton64(x)       (x)
+#   else
+#       define ntoh32(x)     __bswap_32 (x)
+#       define ntoh16(x)     __bswap_16 (x)
+#       define ntoh64(x)     __bswap_32 (x)
+#       define hton32(x)     __bswap_32 (x)
+#       define hton16(x)     __bswap_16 (x)
+#       define hton64(x)     __bswap_32 (x)
+#   endif
+
+/* win32, cl and icl support */
+#   if defined( _MSC_VER )
+#       define __attribute__(x)
+#       define __inline__      __inline
+#       define strncasecmp     strnicmp
+#       define strcasecmp      stricmp
+#       define S_ISBLK(m)      (0)
+#       define S_ISCHR(m)      (0)
+#       define S_ISFIFO(m)     (((m)&_S_IFMT) == _S_IFIFO)
+#       define S_ISREG(m)      (((m)&_S_IFMT) == _S_IFREG)
+#       undef I64C(x)
+#       define I64C(x)         x##i64
+#   endif
+
+/* several type definitions */
+#   if defined( __MINGW32__ )
+#       if !defined( _OFF_T_ )
+typedef long long _off_t;
+typedef _off_t off_t;
+#           define _OFF_T_
+#       else
+#           define off_t long long
+#       endif
+#   endif
+
+#   if defined( _MSC_VER )
+#       if !defined( _OFF_T_DEFINED )
+typedef __int64 off_t;
+#           define _OFF_T_DEFINED
+#       else
+#           define off_t __int64
+#       endif
+#       define stat _stati64
+#   endif
+
+#   ifndef snprintf
+#       define snprintf _snprintf  /* snprintf not defined in mingw32 (bug?) */
+#   endif
+
+#endif
+
+/*****************************************************************************
+ * CPU capabilities
+ *****************************************************************************/
+#define CPU_CAPABILITY_NONE    0
+#define CPU_CAPABILITY_486     (1<<0)
+#define CPU_CAPABILITY_586     (1<<1)
+#define CPU_CAPABILITY_PPRO    (1<<2)
+#define CPU_CAPABILITY_MMX     (1<<3)
+#define CPU_CAPABILITY_3DNOW   (1<<4)
+#define CPU_CAPABILITY_MMXEXT  (1<<5)
+#define CPU_CAPABILITY_SSE     (1<<6)
+#define CPU_CAPABILITY_ALTIVEC (1<<16)
+#define CPU_CAPABILITY_FPU     (1<<31)
+
+/*****************************************************************************
+ * I18n stuff
+ *****************************************************************************/
+#if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT )
+#   include <libintl.h>
+#else
+#   define _(String) (String)
+#   define N_(String) (String)
+#   define textdomain(Domain)
+#   define bindtextdomain(Package, Directory) 1
+#endif
+
+/*****************************************************************************
+ * Plug-in stuff
+ *****************************************************************************/
+typedef struct module_symbols_s
+{
+    struct main_s* p_main;
+    struct aout_bank_s* p_aout_bank;
+    struct vout_bank_s* p_vout_bank;
+
+    int    ( * main_GetIntVariable ) ( char *, int );
+    char * ( * main_GetPszVariable ) ( char *, char * );
+    void   ( * main_PutIntVariable ) ( char *, int );
+    void   ( * main_PutPszVariable ) ( char *, char * );
+
+    int  ( * intf_ProcessKey ) ( struct intf_thread_s *, int );
+    void ( * intf_AssignKey )  ( struct intf_thread_s *, int, int, int );
+
+    void ( * intf_Msg )        ( char *, ... );
+    void ( * intf_ErrMsg )     ( char *, ... );
+    void ( * intf_StatMsg )    ( char *, ... );
+    void ( * intf_WarnMsg )    ( int, char *, ... );
+    void ( * intf_WarnMsgImm ) ( int, char *, ... );
+#ifdef TRACE
+    void ( * intf_DbgMsg )     ( char *, char *, int, char *, ... );
+    void ( * intf_DbgMsgImm )  ( char *, char *, int, char *, ... );
+#endif
+
+    int  ( * intf_PlaylistAdd )     ( struct playlist_s *, int, const char* );
+    int  ( * intf_PlaylistDelete )  ( struct playlist_s *, int );
+    void ( * intf_PlaylistNext )    ( struct playlist_s * );
+    void ( * intf_PlaylistPrev )    ( struct playlist_s * );
+    void ( * intf_PlaylistDestroy ) ( struct playlist_s * );
+    void ( * intf_PlaylistJumpto )  ( struct playlist_s *, int );
+    void ( * intf_UrlDecode )       ( char * );
+
+    void    ( * msleep )         ( mtime_t );
+    mtime_t ( * mdate )          ( void );
+
+    int  ( * network_ChannelCreate )( void );
+    int  ( * network_ChannelJoin )  ( int );
+
+    int  ( * input_SetProgram )     ( struct input_thread_s *,
+                                      struct pgrm_descriptor_s * );
+    void ( * input_SetStatus )      ( struct input_thread_s *, int );
+    void ( * input_Seek )           ( struct input_thread_s *, off_t );
+    void ( * input_DumpStream )     ( struct input_thread_s * );
+    char * ( * input_OffsetToTime ) ( struct input_thread_s *, char *, off_t );
+    int  ( * input_ChangeES )       ( struct input_thread_s *,
+                                      struct es_descriptor_s *, u8 );
+    int  ( * input_ToggleES )       ( struct input_thread_s *,
+                                      struct es_descriptor_s *, boolean_t );
+    int  ( * input_ChangeArea )     ( struct input_thread_s *,
+                                      struct input_area_s * );
+    struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
+                                                  u16 );
+    struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
+                                      struct pgrm_descriptor_s *, u16, size_t );
+    void ( * input_DelES )          ( struct input_thread_s *,
+                                      struct es_descriptor_s * );
+    int  ( * input_SelectES )       ( struct input_thread_s *,
+                                      struct es_descriptor_s * );
+    int  ( * input_UnselectES )     ( struct input_thread_s *,
+                                      struct es_descriptor_s * );
+    struct pgrm_descriptor_s* ( * input_AddProgram ) ( struct input_thread_s *,
+                                                       u16, size_t );
+    void ( * input_DelProgram )     ( struct input_thread_s *,
+                                      struct pgrm_descriptor_s * );
+    struct input_area_s * ( * input_AddArea ) ( struct input_thread_s * );
+    void ( * input_DelArea )        ( struct input_thread_s *,
+                                      struct input_area_s * );
+
+    void ( * InitBitstream )        ( struct bit_stream_s *,
+                                      struct decoder_fifo_s *,
+                                      void ( * ) ( struct bit_stream_s *,
+                                                   boolean_t ),
+                                      void * );
+    void ( * DecoderError )         ( struct decoder_fifo_s * p_fifo );
+    int  ( * input_InitStream )     ( struct input_thread_s *, size_t );
+    void ( * input_EndStream )      ( struct input_thread_s * );
+
+    void ( * input_ParsePES )       ( struct input_thread_s *,
+                                      struct es_descriptor_s * );
+    void ( * input_GatherPES )      ( struct input_thread_s *,
+                                      struct data_packet_s *,
+                                      struct es_descriptor_s *,
+                                      boolean_t, boolean_t );
+    void ( * input_DecodePES )      ( struct decoder_fifo_s *,
+                                      struct pes_packet_s * );
+    struct es_descriptor_s * ( * input_ParsePS ) ( struct input_thread_s *,
+                                                   struct data_packet_s * );
+    void ( * input_DemuxPS )        ( struct input_thread_s *,
+                                      struct data_packet_s * );
+    void ( * input_DemuxTS )        ( struct input_thread_s *,
+                                      struct data_packet_s * );
+    void ( * input_DemuxPSI )       ( struct input_thread_s *,
+                                      struct data_packet_s *,
+                                      struct es_descriptor_s *, 
+                                      boolean_t, boolean_t );
+
+    int ( * input_ClockManageControl )   ( struct input_thread_s *,
+                                           struct pgrm_descriptor_s *,
+                                           mtime_t );
+
+    struct aout_fifo_s * ( * aout_CreateFifo ) 
+                                       ( int, int, long, long, long, void * );
+    void ( * aout_DestroyFifo )     ( struct aout_fifo_s * );
+
+    struct vout_thread_s * (* vout_CreateThread) ( int *, int, int, u32, int );
+    void  ( * vout_DestroyThread )  ( struct vout_thread_s *, int * );
+
+    struct picture_s * ( * vout_CreatePicture )
+                                    ( struct vout_thread_s *,
+                                      boolean_t, boolean_t, boolean_t ); 
+    void  ( * vout_AllocatePicture )( struct picture_s *, int, int, u32 );
+    void  ( * vout_DisplayPicture ) ( struct vout_thread_s *, 
+                                      struct picture_s * );
+    void  ( * vout_DestroyPicture ) ( struct vout_thread_s *,
+                                      struct picture_s * );
+    void  ( * vout_LinkPicture )    ( struct vout_thread_s *,
+                                      struct picture_s * );
+    void  ( * vout_UnlinkPicture )  ( struct vout_thread_s *,
+                                      struct picture_s * );
+    void  ( * vout_DatePicture )    ( struct vout_thread_s *, 
+                                      struct picture_s *, mtime_t );
+    void  ( * vout_PlacePicture )   ( struct vout_thread_s *, int, int,
+                                      int *, int *, int *, int * );
+
+    struct subpicture_s * (* vout_CreateSubPicture)
+                                        ( struct vout_thread_s *, int, int );
+    void  ( * vout_DestroySubPicture )  ( struct vout_thread_s *, 
+                                          struct subpicture_s * );
+    void  ( * vout_DisplaySubPicture )  ( struct vout_thread_s *, 
+                                          struct subpicture_s * );
+    
+    u32  ( * UnalignedShowBits )    ( struct bit_stream_s *, unsigned int );
+    void ( * UnalignedRemoveBits )  ( struct bit_stream_s * );
+    u32  ( * UnalignedGetBits )     ( struct bit_stream_s *, unsigned int );
+
+    char * ( * DecodeLanguage ) ( u16 );
+
+    struct module_s * ( * module_Need ) ( int, char *, struct probedata_s * );
+    void ( * module_Unneed )            ( struct module_s * );
+} module_symbols_t;
+
+#ifdef PLUGIN
+extern module_symbols_t* p_symbols;
+#endif
+
index a984a85fac32325c4dbac57ecc4851c6c4e2246e..3d1fdbc630df8df5a3728b3cdbf612bca46fbebd 100644 (file)
@@ -75,7 +75,7 @@
 
 /* When a thread waits on a condition in debug mode, delay to wait before
  * outputting an error message (in second) */
-#define THREAD_COND_TIMEOUT                            5
+#define THREAD_COND_TIMEOUT             5
 
 /* Environment variable containing the memcpy method */
 #define MEMCPY_METHOD_VAR               "vlc_memcpy"
  *****************************************************************************/
 
 /* Maximum number of video output threads */
-#define VOUT_MAX_THREADS                10
+#define VOUT_MAX_THREADS                256
 
 /*
  * Default settings for video output threads
index ad06b770a7841b3a16d48484a322b82ebd00dc7d..26e142c93d81620bcf871fc0634adc16fa9115ab 100644 (file)
@@ -2,7 +2,7 @@
  * modules.h : Module management functions.
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules.h,v 1.38 2001/12/30 07:09:54 sam Exp $
+ * $Id: modules.h,v 1.39 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -169,15 +169,20 @@ typedef struct memcpy_module_s
 
 } memcpy_module_t;
 
-/* FIXME: not yet used */
 typedef struct probedata_s
 {
     u8  i_type;
+
     struct
     {
         char * psz_data;
     } aout;
 
+    struct
+    {
+        u32 i_chroma;
+    } vout;
+
     struct
     {
         struct picture_heap_s* p_output;
@@ -251,6 +256,8 @@ typedef struct function_list_s
             void ( * pf_end )        ( struct vout_thread_s * );
             void ( * pf_destroy )    ( struct vout_thread_s * );
             int  ( * pf_manage )     ( struct vout_thread_s * );
+            void ( * pf_render )     ( struct vout_thread_s *,
+                                       struct picture_s * );
             void ( * pf_display )    ( struct vout_thread_s *,
                                        struct picture_s * );
             void ( * pf_setpalette ) ( struct vout_thread_s *,
index ab3fd3bd484be826f10f2538b4c56e377e80c07c..99c29527e52b5aef487df4d3716ad4d281e6bff9 100644 (file)
@@ -3,7 +3,7 @@
  * This header provides a portable threads implementation.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: threads.h,v 1.33 2001/12/30 07:09:54 sam Exp $
+ * $Id: threads.h,v 1.34 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
@@ -484,9 +484,9 @@ static __inline__ int vlc_cond_init( vlc_cond_t *p_condvar )
 
     /* Create an auto-reset event. */
     p_condvar->signal = CreateEvent( NULL, /* no security */
-                                    FALSE,  /* auto-reset event */
-                                    FALSE,  /* non-signaled initially */
-                                    NULL ); /* unnamed */
+                                     FALSE,  /* auto-reset event */
+                                     FALSE,  /* non-signaled initially */
+                                     NULL ); /* unnamed */
 
     return( !p_condvar->signal );
     
index 5c50241e4dbe9bc9b9b06c5feeed08a9530175a0..3b72d5995e506c8d476cfa777554174373ee40ce 100644 (file)
@@ -2,7 +2,7 @@
  * vdec_ext-plugins.h : structures from the video decoder exported to plug-ins
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vdec_ext-plugins.h,v 1.8 2001/12/09 17:01:35 sam Exp $
+ * $Id: vdec_ext-plugins.h,v 1.9 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -63,7 +63,7 @@ typedef struct macroblock_s
     /* Motion compensation information */
     motion_inner_t          p_motions[8];
     int                     i_nb_motions;
-    pixel_data_t *          pp_dest[3];
+    yuv_data_t *            pp_dest[3];
 
 } macroblock_t;
 
index 16d248a624b5e171caf814ec7e38012a84b93948..00c6a11fb9876bdbb66918a550a4c9444d0cc8a1 100644 (file)
@@ -4,7 +4,7 @@
  * includes all common video types and constants.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video.h,v 1.38 2002/01/02 14:37:42 sam Exp $
+ * $Id: video.h,v 1.39 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
 /*****************************************************************************
  * plane_t: description of a planar graphic field
  *****************************************************************************/
-typedef u8 pixel_data_t;
-
 typedef struct plane_s
 {
-    pixel_data_t *p_data;                       /* Start of the plane's data */
+    u8 *p_pixels;                               /* Start of the plane's data */
 
     /* Variables used for fast memcpy operations */
-    int i_bytes;                       /* Total number of bytes in the plane */
-    int i_line_bytes;                     /* Total number of bytes in a line */
+    int i_lines;                                          /* Number of lines */
+    int i_pitch;             /* Number of bytes in a line, including margins */
+
+    /* Size of a macropixel, defaults to 1 */
+    int i_pixel_bytes;
+
+    /* Is there a margin ? defaults to no */
+    boolean_t b_margin;
+
+    /* Variables used for pictures with margins */
+    int i_visible_bytes;                 /* How many real pixels are there ? */
+    boolean_t b_hidden;           /* Are we allowed to write to the margin ? */
 
     /* Variables used for RGB planes */
     int i_red_mask;
@@ -53,11 +61,11 @@ typedef struct plane_s
  *****************************************************************************/
 typedef struct picture_s
 {
-    /* Picture data - data can always be freely modified, but no pointer
-     * may EVER be modified. A direct buffer can be handled as the plugin
-     * wishes, but for internal video output pictures the allocated pointer
-     * MUST be planes[0].p_data */
-    plane_t         planes[ VOUT_MAX_PLANES ];  /* description of the planes */
+    /* Picture data - data can always be freely modified, but p_data may
+     * NEVER be modified. A direct buffer can be handled as the plugin
+     * wishes, it can even swap p_pixels buffers. */
+    u8             *p_data;
+    plane_t         p[ VOUT_MAX_PLANES ];       /* description of the planes */
     int             i_planes;                  /* number of allocated planes */
 
     /* Type and flags - should NOT be modified except by the vout thread */
@@ -70,12 +78,6 @@ typedef struct picture_s
     int             i_refcount;                    /* link reference counter */
     mtime_t         date;                                    /* display date */
 
-    /* Picture margins - needed because of possible padding issues */
-    int             i_left_margin;
-    int             i_right_margin;
-    int             i_top_margin;
-    int             i_bottom_margin;
-
     /* Picture dynamic properties - those properties can be changed by the
      * decoder */
     boolean_t       b_progressive;            /* is it a progressive frame ? */
@@ -105,7 +107,7 @@ typedef struct picture_heap_s
      * and should NOT be modified */
     int             i_width;                                /* picture width */
     int             i_height;                              /* picture height */
-    u64             i_chroma;                              /* picture chroma */
+    u32             i_chroma;                              /* picture chroma */
     int             i_aspect;                                /* aspect ratio */
 
     /* Real pictures */
@@ -132,47 +134,103 @@ typedef struct picture_heap_s
 #define DESTROYED_PICTURE       6              /* allocated but no more used */
 
 /*****************************************************************************
- * Flags used to describe the format of a picture
+ * Flags used to describe picture format - see http://www.webartz.com/fourcc/
  *****************************************************************************/
 
-#define ONLY_FOURCC(i_chroma)   ((i_chroma)&0x00000000ffffffff)
-#define ONLY_EXTRA(i_chroma)    ((i_chroma)&0xffffffff00000000)
-
-/* Picture chroma - see http://www.webartz.com/fourcc/ */
-#define FOURCC_BI_RGB           0x00000000           /* Planar RGB, for 8bpp */
-#define FOURCC_RGB              0x32424752               /* alias for BI_RGB */
-#define FOURCC_BI_BITFIELDS     0x00000003  /* Planar RGB, for 16, 24, 32bpp */
-#define FOURCC_I420             0x30323449            /* Planar 4:2:0, Y:U:V */
-#define FOURCC_IYUV             0x56555949                 /* alias for I420 */
-#define FOURCC_YV12             0x32315659            /* Planar 4:2:0, Y:V:U */
+/* Packed RGB formats */
+#define FOURCC_BI_RGB        0x00000000                      /* RGB for 8bpp */
+#define FOURCC_RGB           0x32424752                  /* alias for BI_RGB */
+#define FOURCC_BI_BITFIELDS  0x00000003            /* RGB, for 16, 24, 32bpp */
+#define FOURCC_RV15          0x35315652    /* RGB 15bpp, 0x1f, 0x7e0, 0xf800 */
+#define FOURCC_RV16          0x36315652    /* RGB 16bpp, 0x1f, 0x3e0, 0x7c00 */
+
+/* Planar YUV formats */
+#define FOURCC_I420          0x30323449               /* Planar 4:2:0, Y:U:V */
+#define FOURCC_IYUV          0x56555949                    /* alias for I420 */
+#define FOURCC_YV12          0x32315659               /* Planar 4:2:0, Y:V:U */
+
+/* Packed YUV formats */
+#define FOURCC_IUYV          0x56595549 /* Packed 4:2:2, U:Y:V:Y, interlaced */
+#define FOURCC_UYVY          0x59565955             /* Packed 4:2:2, U:Y:V:Y */
+#define FOURCC_UYNV          0x564e5955                    /* alias for UYVY */
+#define FOURCC_Y422          0x32323459                    /* alias for UYVY */
+#define FOURCC_cyuv          0x76757963   /* Packed 4:2:2, U:Y:V:Y, reverted */
+#define FOURCC_YUY2          0x32595559             /* Packed 4:2:2, Y:U:Y:V */
+#define FOURCC_YUNV          0x564e5559                    /* alias for YUY2 */
+#define FOURCC_YVYU          0x55585659             /* Packed 4:2:2, Y:V:Y:U */
+#define FOURCC_Y211          0x31313259             /* Packed 2:1:1, Y:U:Y:V */
 
 /* Custom formats which we use but which don't exist in the fourcc database */
-#define FOURCC_I422             0x32323449
-#define FOURCC_I444             0x34343449
-
-/* Picture format - gives more precise information than the chroma */
-#define DEPTH_8BPP              ((u64)0x00000008<<32)
-#define DEPTH_15BPP             ((u64)0x00000015<<32)
-#define DEPTH_16BPP             ((u64)0x00000016<<32)
-#define DEPTH_24BPP             ((u64)0x00000024<<32)
-#define DEPTH_32BPP             ((u64)0x00000032<<32)
+#define FOURCC_I422          0x32323449               /* Planar 4:2:2, Y:U:V */
+#define FOURCC_I444          0x34343449               /* Planar 4:4:4, Y:U:V */
 
 /* Plane indices */
-#define MAIN_PLANE              0
-#define Y_PLANE                 0
-#define U_PLANE                 1
-#define V_PLANE                 2
-#define Cb_PLANE                1
-#define Cr_PLANE                2
-#define R_PLANE                 0
-#define G_PLANE                 1
-#define B_PLANE                 2
+#define Y_PLANE      0
+#define U_PLANE      1
+#define V_PLANE      2
 
 /* Shortcuts */
-#define P_MAIN planes[ MAIN_PLANE ].p_data
-#define P_Y planes[ Y_PLANE ].p_data
-#define P_U planes[ U_PLANE ].p_data
-#define P_V planes[ V_PLANE ].p_data
+#define Y_PIXELS     p[Y_PLANE].p_pixels
+#define U_PIXELS     p[U_PLANE].p_pixels
+#define V_PIXELS     p[V_PLANE].p_pixels
+
+/*****************************************************************************
+ * vout_CopyPicture: copy a picture to another one
+ *****************************************************************************
+ * This function takes advantage of the image format, and reduces the
+ * number of calls to memcpy() to the minimum. Source and destination
+ * images must have same width, height, and chroma.
+ *****************************************************************************/
+static __inline__ void vout_CopyPicture( picture_t *p_src, picture_t *p_dest )
+{
+    int i;
+
+    for( i = 0; i < p_src->i_planes ; i++ )
+    {
+        if( p_src->p[i].i_pitch == p_dest->p[i].i_pitch )
+        {
+            if( p_src->p[i].b_margin )
+            {
+                /* If p_src->b_margin is set, p_dest->b_margin must be set */
+                if( p_dest->p[i].b_hidden )
+                {
+                    /* There are margins, but they are hidden : perfect ! */
+                    FAST_MEMCPY( p_dest->p[i].p_pixels, p_src->p[i].p_pixels,
+                                 p_src->p[i].i_pitch * p_src->p[i].i_lines );
+                    continue;
+                }
+                else
+                {
+                    /* We can't directly copy the margin. Too bad. */
+                }
+            }
+            else
+            {
+                /* Same pitch, no margins : perfect ! */
+                FAST_MEMCPY( p_dest->p[i].p_pixels, p_src->p[i].p_pixels,
+                             p_src->p[i].i_pitch * p_src->p[i].i_lines );
+                continue;
+            }
+        }
+        else
+        {
+            /* Pitch values are different */
+        }
+
+        /* We need to proceed line by line */
+        {
+            u8 *p_in = p_src->p[i].p_pixels, *p_out = p_dest->p[i].p_pixels;
+            int i_line;
+
+            for( i_line = p_src->p[i].i_lines; i_line--; )
+            {
+                FAST_MEMCPY( p_out, p_in, p_src->p[i].i_visible_bytes );
+                p_in += p_src->p[i].i_pitch;
+                p_out += p_dest->p[i].i_pitch;
+            }
+        }
+    }
+}
 
 /*****************************************************************************
  * subpicture_t: video subtitle
index 273f82721651b5125691b4767bf955ffb2c7efde..117ec60248af9f25587e1bb99de595cc77acd098 100644 (file)
@@ -2,10 +2,10 @@
  * video_output.h : video output thread
  * This module describes the programming interface for video output threads.
  * It includes functions allowing to open a new thread, send pictures to a
- * thread, and destroy a previously oppenned video output thread.
+ * thread, and destroy a previously opened video output thread.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_output.h,v 1.69 2002/01/02 14:37:42 sam Exp $
+ * $Id: video_output.h,v 1.70 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -128,6 +128,8 @@ typedef struct vout_thread_s
     void             ( *pf_end )        ( struct vout_thread_s * );
     void             ( *pf_destroy )    ( struct vout_thread_s * );
     int              ( *pf_manage )     ( struct vout_thread_s * );
+    void             ( *pf_render )     ( struct vout_thread_s *,
+                                          struct picture_s * );
     void             ( *pf_display )    ( struct vout_thread_s *,
                                           struct picture_s * );
     void             ( *pf_setpalette ) ( struct vout_thread_s *,
@@ -191,7 +193,7 @@ typedef struct vout_thread_s
 void            vout_InitBank       ( void );
 void            vout_EndBank        ( void );
 
-vout_thread_t * vout_CreateThread   ( int *pi_status, int, int, u64, int );
+vout_thread_t * vout_CreateThread   ( int *pi_status, int, int, u32, int );
 void            vout_DestroyThread  ( vout_thread_t *, int *pi_status );
 
 vout_fifo_t *   vout_CreateFifo     ( void );
@@ -200,7 +202,7 @@ void            vout_FreeFifo       ( vout_fifo_t * );
 
 picture_t *     vout_CreatePicture  ( vout_thread_t *,
                                       boolean_t, boolean_t, boolean_t );
-void            vout_AllocatePicture( picture_t *, int, int, int );
+void            vout_AllocatePicture( picture_t *, int, int, u32 );
 void            vout_DestroyPicture ( vout_thread_t *, picture_t * );
 void            vout_DisplayPicture ( vout_thread_t *, picture_t * );
 void            vout_DatePicture    ( vout_thread_t *, picture_t *, mtime_t );
index d92df71374192f11c618640628fd1870cd17aa58..97c2a6f6d139fe6aaf991f2c9a85ac622da58d80 100644 (file)
@@ -1,9 +1,8 @@
 /*****************************************************************************
- * vlc.h: common definitions
- * Collection of useful common types and macros definitions
+ * vlc.h: global header for vlc
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc.h,v 1.2 2002/01/02 14:37:42 sam Exp $
+ * $Id: vlc.h,v 1.3 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
-/*****************************************************************************
- * Required system headers
- *****************************************************************************/
-#include <string.h>                                            /* strerror() */
-
 /*****************************************************************************
  * Required vlc headers
  *****************************************************************************/
 #   include "modules_inner.h"
 #endif
 
-/*****************************************************************************
- * Basic types definitions
- *****************************************************************************/
-
-typedef u8                  byte_t;
-
-/* Boolean type */
-#ifdef BOOLEAN_T_IN_SYS_TYPES_H
-#   include <sys/types.h>
-#elif defined(BOOLEAN_T_IN_PTHREAD_H)
-#   include <pthread.h>
-#elif defined(BOOLEAN_T_IN_CTHREADS_H)
-#   include <cthreads.h>
-#else
-typedef int                 boolean_t;
-#endif
-#ifdef SYS_GNU
-#   define _MACH_I386_BOOLEAN_H_
-#endif
-
-/* ptrdiff_t definition */
-#ifdef HAVE_STDDEF_H
-#   include <stddef.h>
-#else
-#   include <malloc.h>
-#   ifndef _PTRDIFF_T
-#       define _PTRDIFF_T
-/* Not portable in a 64-bit environment. */
-typedef int                 ptrdiff_t;
-#   endif
-#endif
-
-/* Counter for statistics and profiling */
-typedef unsigned long       count_t;
-
-/* DCT elements types */
-typedef s16                 dctelem_t;
-
-/* Video buffer types */
-typedef u8                  yuv_data_t;
-
-/*****************************************************************************
- * mtime_t: high precision date or time interval
- *****************************************************************************
- * Store an high precision date or time interval. The maximum precision is the
- * micro-second, and a 64 bits integer is used to avoid any overflow (maximum
- * time interval is then 292271 years, which should be long enough for any
- * video). Date are stored as a time interval since a common date.
- * Note that date and time intervals can be manipulated using regular
- * arithmetic operators, and that no special functions are required.
- *****************************************************************************/
-typedef s64 mtime_t;
-
-/*****************************************************************************
- * Classes declaration
- *****************************************************************************/
-
-/* Plugins */
-struct plugin_bank_s;
-struct plugin_info_s;
-
-typedef struct plugin_bank_s *          p_plugin_bank_t;
-typedef struct plugin_info_s *          p_plugin_info_t;
-
-/* Plugins */
-struct playlist_s;
-struct playlist_item_s;
-struct module_s;
-
-typedef struct playlist_s *             p_playlist_t;
-typedef struct playlist_item_s *        p_playlist_item_t;
-
-/* Interface */
-struct intf_thread_s;
-struct intf_sys_s;
-struct intf_console_s;
-struct intf_msg_s;
-struct intf_channel_s;
-
-typedef struct intf_thread_s *          p_intf_thread_t;
-typedef struct intf_sys_s *             p_intf_sys_t;
-typedef struct intf_console_s *         p_intf_console_t;
-typedef struct intf_msg_s *             p_intf_msg_t;
-typedef struct intf_channel_s *         p_intf_channel_t;
-
-/* Input */
-struct input_thread_s;
-struct input_channel_s;
-struct input_cfg_s;
-struct input_area_s;
-
-typedef struct input_thread_s *         p_input_thread_t;
-typedef struct input_channel_s *        p_input_channel_t;
-typedef struct input_cfg_s *            p_input_cfg_t;
-typedef struct input_area_s *           p_input_area_t;
-
-/* Audio */
-struct aout_thread_s;
-struct aout_sys_s;
-
-typedef struct aout_thread_s *          p_aout_thread_t;
-typedef struct aout_sys_s *             p_aout_sys_t;
-
-/* Video */
-struct vout_thread_s;
-struct vout_font_s;
-struct vout_sys_s;
-struct chroma_sys_s;
-struct vdec_thread_s;
-struct vpar_thread_s;
-struct video_parser_s;
-
-typedef struct vout_thread_s *          p_vout_thread_t;
-typedef struct vout_font_s *            p_vout_font_t;
-typedef struct vout_sys_s *             p_vout_sys_t;
-typedef struct chroma_sys_s *           p_chroma_sys_t;
-typedef struct vdec_thread_s *          p_vdec_thread_t;
-typedef struct vpar_thread_s *          p_vpar_thread_t;
-typedef struct video_parser_s *         p_video_parser_t;
-
-/* Decoders */
-struct decoder_config_s;
-struct decoder_fifo_s;
-
-/* Misc */
-struct macroblock_s;
-struct data_packet_s;
-struct imdct_s;
-struct complex_s;
-struct dm_par_s;
-struct picture_s;
-struct picture_sys_s;
-struct picture_heap_s;
-struct es_descriptor_s;
-struct pgrm_descriptor_s;
-struct pes_packet_s;
-struct input_area_s;
-struct bit_stream_s;
-struct probedata_s;
-
-/*****************************************************************************
- * Macros and inline functions
- *****************************************************************************/
-#ifdef NTOHL_IN_SYS_PARAM_H
-#   include <sys/param.h>
-
-#elif defined(WIN32)
-/* Swap bytes in 16 bit value.  */
-#   define __bswap_constant_16(x) \
-     ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
-
-#   if defined __GNUC__ && __GNUC__ >= 2
-#       define __bswap_16(x) \
-            (__extension__                                                    \
-             ({ register unsigned short int __v;                              \
-                if (__builtin_constant_p (x))                                 \
-                  __v = __bswap_constant_16 (x);                              \
-                else                                                          \
-                  __asm__ __volatile__ ("rorw $8, %w0"                        \
-                                        : "=r" (__v)                          \
-                                        : "0" ((unsigned short int) (x))      \
-                                        : "cc");                              \
-                __v; }))
-#   else
-/* This is better than nothing.  */
-#       define __bswap_16(x) __bswap_constant_16 (x)
-#   endif
-
-/* Swap bytes in 32 bit value.  */
-#   define __bswap_constant_32(x) \
-        ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >>  8) |            \
-         (((x) & 0x0000ff00) <<  8) | (((x) & 0x000000ff) << 24))
-
-#   if defined __GNUC__ && __GNUC__ >= 2
-/* To swap the bytes in a word the i486 processors and up provide the
-   `bswap' opcode.  On i386 we have to use three instructions.  */
-#       if !defined __i486__ && !defined __pentium__ && !defined __pentiumpro__
-#           define __bswap_32(x) \
-                (__extension__                                                \
-                 ({ register unsigned int __v;                                \
-                    if (__builtin_constant_p (x))                             \
-                      __v = __bswap_constant_32 (x);                          \
-                    else                                                      \
-                      __asm__ __volatile__ ("rorw $8, %w0;"                   \
-                                            "rorl $16, %0;"                   \
-                                            "rorw $8, %w0"                    \
-                                            : "=r" (__v)                      \
-                                            : "0" ((unsigned int) (x))        \
-                                            : "cc");                          \
-                    __v; }))
-#       else
-#           define __bswap_32(x) \
-                (__extension__                                                \
-                 ({ register unsigned int __v;                                \
-                    if (__builtin_constant_p (x))                             \
-                      __v = __bswap_constant_32 (x);                          \
-                    else                                                      \
-                      __asm__ __volatile__ ("bswap %0"                        \
-                                            : "=r" (__v)                      \
-                                            : "0" ((unsigned int) (x)));      \
-                    __v; }))
-#       endif
-#   else
-#       define __bswap_32(x) __bswap_constant_32 (x)
-#   endif
-
-#   if defined __GNUC__ && __GNUC__ >= 2
-/* Swap bytes in 64 bit value.  */
-#       define __bswap_constant_64(x) \
-            ((((x) & 0xff00000000000000ull) >> 56)                            \
-             | (((x) & 0x00ff000000000000ull) >> 40)                          \
-             | (((x) & 0x0000ff0000000000ull) >> 24)                          \
-             | (((x) & 0x000000ff00000000ull) >> 8)                           \
-             | (((x) & 0x00000000ff000000ull) << 8)                           \
-             | (((x) & 0x0000000000ff0000ull) << 24)                          \
-             | (((x) & 0x000000000000ff00ull) << 40)                          \
-             | (((x) & 0x00000000000000ffull) << 56))
-
-#       define __bswap_64(x) \
-            (__extension__                                                    \
-             ({ union { __extension__ unsigned long long int __ll;            \
-                        unsigned long int __l[2]; } __w, __r;                 \
-                if (__builtin_constant_p (x))                                 \
-                  __r.__ll = __bswap_constant_64 (x);                         \
-                else                                                          \
-                  {                                                           \
-                    __w.__ll = (x);                                           \
-                    __r.__l[0] = __bswap_32 (__w.__l[1]);                     \
-                    __r.__l[1] = __bswap_32 (__w.__l[0]);                     \
-                  }                                                           \
-                __r.__ll; }))
-#   endif
-
-#else /* NTOHL_IN_SYS_PARAM_H || WIN32 */
-#   include <netinet/in.h>
-
-#endif /* NTOHL_IN_SYS_PARAM_H || WIN32 */
-
-/* CEIL: division with round to nearest greater integer */
-#define CEIL(n, d)  ( ((n) / (d)) + ( ((n) % (d)) ? 1 : 0) )
-
-/* PAD: PAD(n, d) = CEIL(n ,d) * d */
-#define PAD(n, d)   ( ((n) % (d)) ? ((((n) / (d)) + 1) * (d)) : (n) )
-
-/* MAX and MIN: self explanatory */
-#ifndef MAX
-#   define MAX(a, b)   ( ((a) > (b)) ? (a) : (b) )
-#endif
-#ifndef MIN
-#   define MIN(a, b)   ( ((a) < (b)) ? (a) : (b) )
-#endif
-
-/* MSB (big endian)/LSB (little endian) conversions - network order is always
- * MSB, and should be used for both network communications and files. Note that
- * byte orders other than little and big endians are not supported, but only
- * the VAX seems to have such exotic properties - note that these 'functions'
- * needs <netinet/in.h> or the local equivalent. */
-/* FIXME: hton64 should be declared as an extern inline function to avoid
- * border effects (see byteorder.h) */
-#if WORDS_BIGENDIAN
-#   define hton16      htons
-#   define hton32      htonl
-#   define hton64(i)   ( i )
-#   define ntoh16      ntohs
-#   define ntoh32      ntohl
-#   define ntoh64(i)   ( i )
-#else
-#   define hton16      htons
-#   define hton32      htonl
-#   define hton64(i)   ( ((u64)(htonl((i) & 0xffffffff)) << 32) | htonl(((i) >> 32) & 0xffffffff ) )
-#   define ntoh16      ntohs
-#   define ntoh32      ntohl
-#   define ntoh64      hton64
-#endif
-
-/* Macros with automatic casts */
-#define U64_AT(p)   ( ntoh64 ( *( (u64 *)(p) ) ) )
-#define U32_AT(p)   ( ntoh32 ( *( (u32 *)(p) ) ) )
-#define U16_AT(p)   ( ntoh16 ( *( (u16 *)(p) ) ) )
-
-/* Alignment of critical static data structures */
-#ifdef ATTRIBUTE_ALIGNED_MAX
-#   define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
-#else
-#   define ATTR_ALIGN(align)
-#endif
-
-/* Alignment of critical dynamic data structure */
-#ifdef HAVE_MEMALIGN
-    /* Some systems have memalign() but no declaration for it */
-    void * memalign( size_t align, size_t size );
-#else
-#   ifdef HAVE_VALLOC
-        /* That's like using a hammer to kill a fly, but eh... */
-#       include <unistd.h>
-#       define memalign(align,size) valloc(size)
-#   else
-        /* Assume malloc alignment is sufficient */
-#       define memalign(align,size) malloc(size)
-#   endif    
-#endif
-
-#define I64C(x)         x##LL
-
-
-#if defined( WIN32 )
-/* The ntoh* and hton* bytes swapping functions are provided by winsock
- * but for conveniency and speed reasons it is better to implement them
- * ourselves. ( several plugins use them and it is too much hassle to link
- * winsock with each of them ;-)
- */
-#   undef ntoh32(x)
-#   undef ntoh16(x)
-#   undef ntoh64(x)
-#   undef hton32(x)
-#   undef hton16(x)
-#   undef hton64(x)
-
-#   ifdef WORDS_BIGENDIAN
-#       define ntoh32(x)       (x)
-#       define ntoh16(x)       (x)
-#       define ntoh64(x)       (x)
-#       define hton32(x)       (x)
-#       define hton16(x)       (x)
-#       define hton64(x)       (x)
-#   else
-#       define ntoh32(x)     __bswap_32 (x)
-#       define ntoh16(x)     __bswap_16 (x)
-#       define ntoh64(x)     __bswap_32 (x)
-#       define hton32(x)     __bswap_32 (x)
-#       define hton16(x)     __bswap_16 (x)
-#       define hton64(x)     __bswap_32 (x)
-#   endif
-
-/* win32, cl and icl support */
-#   if defined( _MSC_VER )
-#       define __attribute__(x)
-#       define __inline__      __inline
-#       define strncasecmp     strnicmp
-#       define strcasecmp      stricmp
-#       define S_ISBLK(m)      (0)
-#       define S_ISCHR(m)      (0)
-#       define S_ISFIFO(m)     (((m)&_S_IFMT) == _S_IFIFO)
-#       define S_ISREG(m)      (((m)&_S_IFMT) == _S_IFREG)
-#       undef I64C(x)
-#       define I64C(x)         x##i64
-#   endif
-
-/* several type definitions */
-#   if defined( __MINGW32__ )
-#       if !defined( _OFF_T_ )
-typedef long long _off_t;
-typedef _off_t off_t;
-#           define _OFF_T_
-#       else
-#           define off_t long long
-#       endif
-#   endif
-
-#   if defined( _MSC_VER )
-#       if !defined( _OFF_T_DEFINED )
-typedef __int64 off_t;
-#           define _OFF_T_DEFINED
-#       else
-#           define off_t __int64
-#       endif
-#       define stat _stati64
-#   endif
-
-#   ifndef snprintf
-#       define snprintf _snprintf  /* snprintf not defined in mingw32 (bug?) */
-#   endif
-
-#endif
-
-/*****************************************************************************
- * CPU capabilities
- *****************************************************************************/
-#define CPU_CAPABILITY_NONE    0
-#define CPU_CAPABILITY_486     1<<0
-#define CPU_CAPABILITY_586     1<<1
-#define CPU_CAPABILITY_PPRO    1<<2
-#define CPU_CAPABILITY_MMX     1<<3
-#define CPU_CAPABILITY_3DNOW   1<<4
-#define CPU_CAPABILITY_MMXEXT  1<<5
-#define CPU_CAPABILITY_SSE     1<<6
-#define CPU_CAPABILITY_ALTIVEC 1<<16
-#define CPU_CAPABILITY_FPU     1<<31
-
-/*****************************************************************************
- * I18n stuff
- *****************************************************************************/
-#if defined( ENABLE_NLS ) && defined ( HAVE_GETTEXT )
-#   include <libintl.h>
-#else
-#   define _(String) (String)
-#   define N_(String) (String)
-#   define textdomain(Domain)
-#   define bindtextdomain(Package, Directory) 1
-#endif
-
-/*****************************************************************************
- * Plug-in stuff
- *****************************************************************************/
-typedef struct module_symbols_s
-{
-    struct main_s* p_main;
-    struct aout_bank_s* p_aout_bank;
-    struct vout_bank_s* p_vout_bank;
-
-    int    ( * main_GetIntVariable ) ( char *, int );
-    char * ( * main_GetPszVariable ) ( char *, char * );
-    void   ( * main_PutIntVariable ) ( char *, int );
-    void   ( * main_PutPszVariable ) ( char *, char * );
-
-    int  ( * intf_ProcessKey ) ( struct intf_thread_s *, int );
-    void ( * intf_AssignKey )  ( struct intf_thread_s *, int, int, int );
-
-    void ( * intf_Msg )        ( char *, ... );
-    void ( * intf_ErrMsg )     ( char *, ... );
-    void ( * intf_StatMsg )    ( char *, ... );
-    void ( * intf_WarnMsg )    ( int, char *, ... );
-    void ( * intf_WarnMsgImm ) ( int, char *, ... );
-#ifdef TRACE
-    void ( * intf_DbgMsg )     ( char *, char *, int, char *, ... );
-    void ( * intf_DbgMsgImm )  ( char *, char *, int, char *, ... );
-#endif
-
-    int  ( * intf_PlaylistAdd )     ( struct playlist_s *, int, const char* );
-    int  ( * intf_PlaylistDelete )  ( struct playlist_s *, int );
-    void ( * intf_PlaylistNext )    ( struct playlist_s * );
-    void ( * intf_PlaylistPrev )    ( struct playlist_s * );
-    void ( * intf_PlaylistDestroy ) ( struct playlist_s * );
-    void ( * intf_PlaylistJumpto )  ( struct playlist_s *, int );
-    void ( * intf_UrlDecode )       ( char * );
-
-    void    ( * msleep )         ( mtime_t );
-    mtime_t ( * mdate )          ( void );
-
-    int  ( * network_ChannelCreate )( void );
-    int  ( * network_ChannelJoin )  ( int );
-
-    int  ( * input_SetProgram )     ( struct input_thread_s *,
-                                      struct pgrm_descriptor_s * );
-    void ( * input_SetStatus )      ( struct input_thread_s *, int );
-    void ( * input_Seek )           ( struct input_thread_s *, off_t );
-    void ( * input_DumpStream )     ( struct input_thread_s * );
-    char * ( * input_OffsetToTime ) ( struct input_thread_s *, char *, off_t );
-    int  ( * input_ChangeES )       ( struct input_thread_s *,
-                                      struct es_descriptor_s *, u8 );
-    int  ( * input_ToggleES )       ( struct input_thread_s *,
-                                      struct es_descriptor_s *, boolean_t );
-    int  ( * input_ChangeArea )     ( struct input_thread_s *,
-                                      struct input_area_s * );
-    struct es_descriptor_s * ( * input_FindES ) ( struct input_thread_s *,
-                                                  u16 );
-    struct es_descriptor_s * ( * input_AddES ) ( struct input_thread_s *,
-                                      struct pgrm_descriptor_s *, u16, size_t );
-    void ( * input_DelES )          ( struct input_thread_s *,
-                                      struct es_descriptor_s * );
-    int  ( * input_SelectES )       ( struct input_thread_s *,
-                                      struct es_descriptor_s * );
-    int  ( * input_UnselectES )     ( struct input_thread_s *,
-                                      struct es_descriptor_s * );
-    struct pgrm_descriptor_s* ( * input_AddProgram ) ( struct input_thread_s *,
-                                                       u16, size_t );
-    void ( * input_DelProgram )     ( struct input_thread_s *,
-                                      struct pgrm_descriptor_s * );
-    struct input_area_s * ( * input_AddArea ) ( struct input_thread_s * );
-    void ( * input_DelArea )        ( struct input_thread_s *,
-                                      struct input_area_s * );
-
-    void ( * InitBitstream )        ( struct bit_stream_s *,
-                                      struct decoder_fifo_s *,
-                                      void ( * ) ( struct bit_stream_s *,
-                                                   boolean_t ),
-                                      void * );
-    void ( * DecoderError )         ( struct decoder_fifo_s * p_fifo );
-    int  ( * input_InitStream )     ( struct input_thread_s *, size_t );
-    void ( * input_EndStream )      ( struct input_thread_s * );
-
-    void ( * input_ParsePES )       ( struct input_thread_s *,
-                                      struct es_descriptor_s * );
-    void ( * input_GatherPES )      ( struct input_thread_s *,
-                                      struct data_packet_s *,
-                                      struct es_descriptor_s *,
-                                      boolean_t, boolean_t );
-    void ( * input_DecodePES )      ( struct decoder_fifo_s *,
-                                      struct pes_packet_s * );
-    struct es_descriptor_s * ( * input_ParsePS ) ( struct input_thread_s *,
-                                                   struct data_packet_s * );
-    void ( * input_DemuxPS )        ( struct input_thread_s *,
-                                      struct data_packet_s * );
-    void ( * input_DemuxTS )        ( struct input_thread_s *,
-                                      struct data_packet_s * );
-    void ( * input_DemuxPSI )       ( struct input_thread_s *,
-                                      struct data_packet_s *,
-                                      struct es_descriptor_s *, 
-                                      boolean_t, boolean_t );
+#include "common.h"
 
-    int ( * input_ClockManageControl )   ( struct input_thread_s *,
-                                           struct pgrm_descriptor_s *,
-                                           mtime_t );
-
-    struct aout_fifo_s * ( * aout_CreateFifo ) 
-                                       ( int, int, long, long, long, void * );
-    void ( * aout_DestroyFifo )     ( struct aout_fifo_s * );
-
-    struct vout_thread_s * (* vout_CreateThread) ( int *, int, int, u64, int );
-    void  ( * vout_DestroyThread )  ( struct vout_thread_s *, int * );
-
-    struct picture_s * ( * vout_CreatePicture )
-                                    ( struct vout_thread_s *,
-                                      boolean_t, boolean_t, boolean_t ); 
-    void  ( * vout_AllocatePicture )( struct picture_s *, int, int, int );
-    void  ( * vout_DisplayPicture ) ( struct vout_thread_s *, 
-                                      struct picture_s * );
-    void  ( * vout_DestroyPicture ) ( struct vout_thread_s *,
-                                      struct picture_s * );
-    void  ( * vout_LinkPicture )    ( struct vout_thread_s *,
-                                      struct picture_s * );
-    void  ( * vout_UnlinkPicture )  ( struct vout_thread_s *,
-                                      struct picture_s * );
-    void  ( * vout_DatePicture )    ( struct vout_thread_s *, 
-                                      struct picture_s *, mtime_t );
-    void  ( * vout_PlacePicture )   ( struct vout_thread_s *, int, int,
-                                      int *, int *, int *, int * );
-
-    struct subpicture_s * (* vout_CreateSubPicture)
-                                        ( struct vout_thread_s *, int, int );
-    void  ( * vout_DestroySubPicture )  ( struct vout_thread_s *, 
-                                          struct subpicture_s * );
-    void  ( * vout_DisplaySubPicture )  ( struct vout_thread_s *, 
-                                          struct subpicture_s * );
-    
-    u32  ( * UnalignedShowBits )    ( struct bit_stream_s *, unsigned int );
-    void ( * UnalignedRemoveBits )  ( struct bit_stream_s * );
-    u32  ( * UnalignedGetBits )     ( struct bit_stream_s *, unsigned int );
-
-    char * ( * DecodeLanguage ) ( u16 );
-
-    struct module_s * ( * module_Need ) ( int, char *, struct probedata_s * );
-    void ( * module_Unneed )            ( struct module_s * );
-} module_symbols_t;
-
-#ifdef PLUGIN
-extern module_symbols_t* p_symbols;
-#endif
-
-/*****************************************************************************
- * Required vlc headers
- *****************************************************************************/
 #ifdef SYS_BEOS
 #   include "beos_specific.h"
 #endif
index 91b2a1e0464dd6f81fc80acdff9ac17272b5b0c5..46fbdc68fde0bff6f9ac634acc1d02fab8766040 100644 (file)
@@ -2,7 +2,7 @@
  * MsgVals.h
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: MsgVals.h,v 1.7 2001/10/29 11:07:09 tcastley Exp $
+ * $Id: MsgVals.h,v 1.8 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Tony Castley <tcastley@mail.powerup.com.au>
  *
@@ -35,7 +35,7 @@ const uint32 FASTER_PLAY    = 'FAPL';
 const uint32 SLOWER_PLAY    = 'SLPL';
 const uint32 SEEK_PLAYBACK  = 'SEEK';
 const uint32 VOLUME_CHG     = 'VOCH';
-const uint32 VOLUME_MUTE       = 'MUTE';
+const uint32 VOLUME_MUTE    = 'MUTE';
 const uint32 SELECT_CHANNEL = 'CHAN';
 const uint32 SELECT_SUBTITLE = 'SUBT';
 const uint32 PREV_TITLE     = 'PRTI';
index 9a76d5d4b6c175398ce76e2889f8509a95bf0672..9d4f5a74984bb8c77f7192ac6b98f58577d89645 100644 (file)
@@ -1,2 +1,6 @@
-chroma_yv12_rgb8_SOURCES = yv12_rgb8.c
-chroma_yv12_rgb16_SOURCES = yv12_rgb16.c
+chroma_i420_rgb_SOURCES = i420_rgb.c i420_rgb8.c i420_rgb16.c
+chroma_i420_rgb_mmx_SOURCES = i420_rgb.c i420_rgb16.c
+chroma_i420_yuy2_SOURCES = i420_yuy2.c
+chroma_i420_yuy2_mmx_SOURCES = i420_yuy2.c
+chroma_i422_yuy2_SOURCES = i422_yuy2.c
+chroma_i422_yuy2_mmx_SOURCES = i422_yuy2.c
diff --git a/plugins/chroma/common.c b/plugins/chroma/common.c
deleted file mode 100644 (file)
index 325cfaf..0000000
+++ /dev/null
@@ -1,628 +0,0 @@
-/*****************************************************************************
- * common.c: Chroma transformation functions
- *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: common.c,v 1.2 2001/12/30 07:09:54 sam Exp $
- *
- * Authors: Vincent Seguin <seguin@via.ecp.fr>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <math.h>                                            /* exp(), pow() */
-#include <errno.h>                                                 /* ENOMEM */
-#include <stdlib.h>                                                /* free() */
-#include <string.h>                                            /* strerror() */
-
-#include <videolan/vlc.h>
-
-#include "video.h"
-#include "video_output.h"
-
-#include "video_common.h"
-
-#include "intf_msg.h"
-
-static int     yuv_Probe      ( probedata_t *p_data );
-static int     yuv_Init       ( vout_thread_t *p_vout );
-static int     yuv_Reset      ( vout_thread_t *p_vout );
-static void    yuv_End        ( vout_thread_t *p_vout );
-
-static void    SetGammaTable  ( int *pi_table, double f_gamma );
-static void    SetYUV         ( vout_thread_t *p_vout );
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( yuv_getfunctions )( function_list_t * p_function_list )
-{
-    p_function_list->pf_probe = yuv_Probe;
-    p_function_list->functions.yuv.pf_init = yuv_Init;
-    p_function_list->functions.yuv.pf_reset = yuv_Reset;
-    p_function_list->functions.yuv.pf_end = yuv_End;
-}
-
-/*****************************************************************************
- * yuv_Probe: tests probe the audio device and return a score
- *****************************************************************************
- * This function tries to open the DSP and returns a score to the plugin
- * manager so that it can choose the most appropriate one.
- *****************************************************************************/
-static int yuv_Probe( probedata_t *p_data )
-{
-    if( TestMethod( YUV_METHOD_VAR, "yuv" ) )
-    {
-        return( 999 );
-    }
-
-    /* This module always works */
-    return( 50 );
-}
-
-/*****************************************************************************
- * yuv_Init: allocate and initialize translations tables
- *****************************************************************************
- * This function will allocate memory to store translation tables, depending
- * of the screen depth.
- *****************************************************************************/
-static int yuv_Init( vout_thread_t *p_vout )
-{
-    size_t      tables_size;                        /* tables size, in bytes */
-
-    /* Computes tables size - 3 Bpp use 32 bits pixel entries in tables */
-    switch( p_vout->i_bytes_per_pixel )
-    {
-    case 1:
-        tables_size = sizeof( u8 )
-                * (p_vout->b_grayscale ? GRAY_TABLE_SIZE : PALETTE_TABLE_SIZE);
-        break;
-    case 2:
-        tables_size = sizeof( u16 )
-                * (p_vout->b_grayscale ? GRAY_TABLE_SIZE : RGB_TABLE_SIZE);
-        break;
-    case 3:
-    case 4:
-    default:
-        tables_size = sizeof( u32 )
-                * (p_vout->b_grayscale ? GRAY_TABLE_SIZE : RGB_TABLE_SIZE);
-        break;
-    }
-
-    /* Allocate memory */
-    p_vout->yuv.p_base = malloc( tables_size );
-    if( p_vout->yuv.p_base == NULL )
-    {
-        intf_ErrMsg("error: %s", strerror(ENOMEM));
-        return( 1 );
-    }
-
-    /* Allocate memory for conversion buffer and offset array */
-    p_vout->yuv.p_buffer = malloc( VOUT_MAX_WIDTH * p_vout->i_bytes_per_pixel );
-    if( p_vout->yuv.p_buffer == NULL )
-    {
-        intf_ErrMsg("error: %s", strerror(ENOMEM));
-        free( p_vout->yuv.p_base );
-        return( 1 );
-    }
-
-    /* In 8bpp we have a twice as big offset table because we also
-     * need the offsets for U and V (not only Y) */
-    p_vout->yuv.p_offset = malloc( p_vout->i_width * sizeof( int ) *
-                             ( ( p_vout->i_bytes_per_pixel == 1 ) ? 2 : 1 ) );
-    if( p_vout->yuv.p_offset == NULL )
-    {
-        intf_ErrMsg("error: %s", strerror(ENOMEM));
-        free( p_vout->yuv.p_base );
-        free( p_vout->yuv.p_buffer );
-        return( 1 );
-    }
-
-    /* Initialize tables */
-    SetYUV( p_vout );
-    return( 0 );
-}
-
-/*****************************************************************************
- * yuv_End: destroy translations tables
- *****************************************************************************
- * Free memory allocated by yuv_CCreate.
- *****************************************************************************/
-static void yuv_End( vout_thread_t *p_vout )
-{
-    free( p_vout->yuv.p_base );
-    free( p_vout->yuv.p_buffer );
-    free( p_vout->yuv.p_offset );
-}
-
-/*****************************************************************************
- * yuv_Reset: re-initialize translations tables
- *****************************************************************************
- * This function will initialize the tables allocated by vout_CreateTables and
- * set functions pointers.
- *****************************************************************************/
-static int yuv_Reset( vout_thread_t *p_vout )
-{
-    yuv_End( p_vout );
-    return( yuv_Init( p_vout ) );
-}
-
-/*****************************************************************************
- * SetGammaTable: return intensity table transformed by gamma curve.
- *****************************************************************************
- * pi_table is a table of 256 entries from 0 to 255.
- *****************************************************************************/
-static void SetGammaTable( int *pi_table, double f_gamma )
-{
-    int         i_y;                                       /* base intensity */
-
-    /* Use exp(gamma) instead of gamma */
-    f_gamma = exp( f_gamma );
-
-    /* Build gamma table */
-    for( i_y = 0; i_y < 256; i_y++ )
-    {
-        pi_table[ i_y ] = pow( (double)i_y / 256, f_gamma ) * 256;
-    }
- }
-
-/*****************************************************************************
- * SetYUV: compute tables and set function pointers
- *****************************************************************************/
-static void SetYUV( vout_thread_t *p_vout )
-{
-    int         pi_gamma[256];                                /* gamma table */
-    int         i_index;                                  /* index in tables */
-
-    /* Build gamma table */
-    SetGammaTable( pi_gamma, p_vout->f_gamma );
-
-    /*
-     * Set pointers and build YUV tables
-     */
-    if( p_vout->b_grayscale )
-    {
-        /* Grayscale: build gray table */
-        switch( p_vout->i_bytes_per_pixel )
-        {
-        case 1:
-            {
-                u16 bright[256], transp[256];
-
-                p_vout->yuv.yuv.p_gray8 =  (u8 *)p_vout->yuv.p_base + GRAY_MARGIN;
-                for( i_index = 0; i_index < GRAY_MARGIN; i_index++ )
-                {
-                    p_vout->yuv.yuv.p_gray8[ -i_index ] =      RGB2PIXEL( p_vout, pi_gamma[0], pi_gamma[0], pi_gamma[0] );
-                    p_vout->yuv.yuv.p_gray8[ 256 + i_index ] = RGB2PIXEL( p_vout, pi_gamma[255], pi_gamma[255], pi_gamma[255] );
-                }
-                for( i_index = 0; i_index < 256; i_index++)
-                {
-                    p_vout->yuv.yuv.p_gray8[ i_index ] = pi_gamma[ i_index ];
-                    bright[ i_index ] = i_index << 8;
-                    transp[ i_index ] = 0;
-                }
-                /* the colors have been allocated, we can set the palette */
-                p_vout->pf_setpalette( p_vout, bright, bright, bright, transp );
-                p_vout->i_white_pixel = 0xff;
-                p_vout->i_black_pixel = 0x00;
-                p_vout->i_gray_pixel = 0x44;
-                p_vout->i_blue_pixel = 0x3b;
-
-                break;
-            }
-        case 2:
-            p_vout->yuv.yuv.p_gray16 =  (u16 *)p_vout->yuv.p_base + GRAY_MARGIN;
-            for( i_index = 0; i_index < GRAY_MARGIN; i_index++ )
-            {
-                p_vout->yuv.yuv.p_gray16[ -i_index ] =      RGB2PIXEL( p_vout, pi_gamma[0], pi_gamma[0], pi_gamma[0] );
-                p_vout->yuv.yuv.p_gray16[ 256 + i_index ] = RGB2PIXEL( p_vout, pi_gamma[255], pi_gamma[255], pi_gamma[255] );
-            }
-            for( i_index = 0; i_index < 256; i_index++)
-            {
-                p_vout->yuv.yuv.p_gray16[ i_index ] = RGB2PIXEL( p_vout, pi_gamma[i_index], pi_gamma[i_index], pi_gamma[i_index] );
-            }
-            break;
-        case 3:
-        case 4:
-            p_vout->yuv.yuv.p_gray32 =  (u32 *)p_vout->yuv.p_base + GRAY_MARGIN;
-            for( i_index = 0; i_index < GRAY_MARGIN; i_index++ )
-            {
-                p_vout->yuv.yuv.p_gray32[ -i_index ] =      RGB2PIXEL( p_vout, pi_gamma[0], pi_gamma[0], pi_gamma[0] );
-                p_vout->yuv.yuv.p_gray32[ 256 + i_index ] = RGB2PIXEL( p_vout, pi_gamma[255], pi_gamma[255], pi_gamma[255] );
-            }
-            for( i_index = 0; i_index < 256; i_index++)
-            {
-                p_vout->yuv.yuv.p_gray32[ i_index ] = RGB2PIXEL( p_vout, pi_gamma[i_index], pi_gamma[i_index], pi_gamma[i_index] );
-            }
-            break;
-         }
-    }
-    else
-    {
-        /* Color: build red, green and blue tables */
-        switch( p_vout->i_bytes_per_pixel )
-        {
-        case 1:
-            {
-                #define RGB_MIN 0
-                #define RGB_MAX 255
-                #define CLIP( x ) ( ((x < 0) ? 0 : (x > 255) ? 255 : x) << 8 )
-
-                int y,u,v;
-                int r,g,b;
-                int uvr, uvg, uvb;
-                int i = 0, j = 0;
-                u16 red[256], green[256], blue[256], transp[256];
-                unsigned char lookup[PALETTE_TABLE_SIZE];
-
-                p_vout->yuv.yuv.p_rgb8 = (u8 *)p_vout->yuv.p_base;
-
-                /* this loop calculates the intersection of an YUV box
-                 * and the RGB cube. */
-                for ( y = 0; y <= 256; y += 16 )
-                {
-                    for ( u = 0; u <= 256; u += 32 )
-                    for ( v = 0; v <= 256; v += 32 )
-                    {
-                        uvr = (V_RED_COEF*(v-128)) >> SHIFT;
-                        uvg = (U_GREEN_COEF*(u-128) + V_GREEN_COEF*(v-128)) >> SHIFT;
-                        uvb = (U_BLUE_COEF*(u-128)) >> SHIFT;
-                        r = y + uvr;
-                        g = y + uvg;
-                        b = y + uvb;
-
-                        if( r >= RGB_MIN && g >= RGB_MIN && b >= RGB_MIN
-                                && r <= RGB_MAX && g <= RGB_MAX && b <= RGB_MAX )
-                        {
-                            /* this one should never happen unless someone fscked up my code */
-                            if(j == 256) { intf_ErrMsg( "vout error: no colors left to build palette" ); break; }
-
-                            /* clip the colors */
-                            red[j] = CLIP( r );
-                            green[j] = CLIP( g );
-                            blue[j] = CLIP( b );
-                            transp[j] = 0;
-
-                            /* allocate color */
-                            lookup[i] = 1;
-                            p_vout->yuv.yuv.p_rgb8[i++] = j;
-                            j++;
-                        }
-                        else
-                        {
-                            lookup[i] = 0;
-                            p_vout->yuv.yuv.p_rgb8[i++] = 0;
-                        }
-                    }
-                    i += 128-81;
-                }
-
-                /* the colors have been allocated, we can set the palette */
-                /* there will eventually be a way to know which colors
-                 * couldn't be allocated and try to find a replacement */
-                p_vout->pf_setpalette( p_vout, red, green, blue, transp );
-
-                p_vout->i_white_pixel = 0xff;
-                p_vout->i_black_pixel = 0x00;
-                p_vout->i_gray_pixel = 0x44;
-                p_vout->i_blue_pixel = 0x3b;
-
-                i = 0;
-                /* this loop allocates colors that got outside
-                 * the RGB cube */
-                for ( y = 0; y <= 256; y += 16 )
-                {
-                    for ( u = 0; u <= 256; u += 32 )
-                    for ( v = 0; v <= 256; v += 32 )
-                    {
-                        int u2, v2;
-                        int dist, mindist = 100000000;
-
-                        if( lookup[i] || y==0)
-                        {
-                            i++;
-                            continue;
-                        }
-
-                        /* heavy. yeah. */
-                        for( u2 = 0; u2 <= 256; u2 += 32 )
-                        for( v2 = 0; v2 <= 256; v2 += 32 )
-                        {
-                            j = ((y>>4)<<7) + (u2>>5)*9 + (v2>>5);
-                            dist = (u-u2)*(u-u2) + (v-v2)*(v-v2);
-                            if( lookup[j] )
-                            /* find the nearest color */
-                            if( dist < mindist )
-                            {
-                                p_vout->yuv.yuv.p_rgb8[i] = p_vout->yuv.yuv.p_rgb8[j];
-                                mindist = dist;
-                            }
-                            j -= 128;
-                            if( lookup[j] )
-                            /* find the nearest color */
-                            if( dist + 128 < mindist )
-                            {
-                                p_vout->yuv.yuv.p_rgb8[i] = p_vout->yuv.yuv.p_rgb8[j];
-                                mindist = dist + 128;
-                            }
-                        }
-                        i++;
-                    }
-                    i += 128-81;
-                }
-
-                break;
-            }
-        case 2:
-            p_vout->yuv.yuv.p_rgb16 = (u16 *)p_vout->yuv.p_base;
-            for( i_index = 0; i_index < RED_MARGIN; i_index++ )
-            {
-                p_vout->yuv.yuv.p_rgb16[RED_OFFSET - RED_MARGIN + i_index] = RGB2PIXEL( p_vout, pi_gamma[0], 0, 0 );
-                p_vout->yuv.yuv.p_rgb16[RED_OFFSET + 256 + i_index] =        RGB2PIXEL( p_vout, pi_gamma[255], 0, 0 );
-            }
-            for( i_index = 0; i_index < GREEN_MARGIN; i_index++ )
-            {
-                p_vout->yuv.yuv.p_rgb16[GREEN_OFFSET - GREEN_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[0], 0 );
-                p_vout->yuv.yuv.p_rgb16[GREEN_OFFSET + 256 + i_index] =          RGB2PIXEL( p_vout, 0, pi_gamma[255], 0 );
-            }
-            for( i_index = 0; i_index < BLUE_MARGIN; i_index++ )
-            {
-                p_vout->yuv.yuv.p_rgb16[BLUE_OFFSET - BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[0] );
-                p_vout->yuv.yuv.p_rgb16[BLUE_OFFSET + BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[255] );
-            }
-            for( i_index = 0; i_index < 256; i_index++ )
-            {
-                p_vout->yuv.yuv.p_rgb16[RED_OFFSET + i_index] =   RGB2PIXEL( p_vout, pi_gamma[ i_index ], 0, 0 );
-                p_vout->yuv.yuv.p_rgb16[GREEN_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[ i_index ], 0 );
-                p_vout->yuv.yuv.p_rgb16[BLUE_OFFSET + i_index] =  RGB2PIXEL( p_vout, 0, 0, pi_gamma[ i_index ] );
-            }
-            break;
-        case 3:
-        case 4:
-            p_vout->yuv.yuv.p_rgb32 = (u32 *)p_vout->yuv.p_base;
-            for( i_index = 0; i_index < RED_MARGIN; i_index++ )
-            {
-                p_vout->yuv.yuv.p_rgb32[RED_OFFSET - RED_MARGIN + i_index] = RGB2PIXEL( p_vout, pi_gamma[0], 0, 0 );
-                p_vout->yuv.yuv.p_rgb32[RED_OFFSET + 256 + i_index] =        RGB2PIXEL( p_vout, pi_gamma[255], 0, 0 );
-            }
-            for( i_index = 0; i_index < GREEN_MARGIN; i_index++ )
-            {
-                p_vout->yuv.yuv.p_rgb32[GREEN_OFFSET - GREEN_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[0], 0 );
-                p_vout->yuv.yuv.p_rgb32[GREEN_OFFSET + 256 + i_index] =          RGB2PIXEL( p_vout, 0, pi_gamma[255], 0 );
-            }
-            for( i_index = 0; i_index < BLUE_MARGIN; i_index++ )
-            {
-                p_vout->yuv.yuv.p_rgb32[BLUE_OFFSET - BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[0] );
-                p_vout->yuv.yuv.p_rgb32[BLUE_OFFSET + BLUE_MARGIN + i_index] = RGB2PIXEL( p_vout, 0, 0, pi_gamma[255] );
-            }
-            for( i_index = 0; i_index < 256; i_index++ )
-            {
-                p_vout->yuv.yuv.p_rgb32[RED_OFFSET + i_index] =   RGB2PIXEL( p_vout, pi_gamma[ i_index ], 0, 0 );
-                p_vout->yuv.yuv.p_rgb32[GREEN_OFFSET + i_index] = RGB2PIXEL( p_vout, 0, pi_gamma[ i_index ], 0 );
-                p_vout->yuv.yuv.p_rgb32[BLUE_OFFSET + i_index] =  RGB2PIXEL( p_vout, 0, 0, pi_gamma[ i_index ] );
-            }
-            break;
-        }
-    }
-
-    /*
-     * Set functions pointers
-     */
-    if( p_vout->b_YCbr)
-    {
-        switch( p_vout->i_bytes_per_pixel)
-        {
-#define _X( foo ) (vout_yuv_convert_t *) _M( foo )
-        case 1:
-            p_vout->yuv.pf_yuv420 = _X( ConvertYUV420YCbr8 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertYUV422YCbr8 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertYUV444YCbr8 );
-            break;
-        
-        case 2:
-            p_vout->yuv.pf_yuv420 = _X( ConvertYUV420YCbr16 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertYUV422YCbr16 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertYUV444YCbr16 );
-           break;
-        
-        case 3:
-            p_vout->yuv.pf_yuv420 = _X( ConvertYUV420YCbr24 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertYUV422YCbr24 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertYUV444YCbr24 );
-             break;
-        
-        case 4:
-            p_vout->yuv.pf_yuv420 = _X( ConvertYUV420YCbr32 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertYUV422YCbr32 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertYUV444YCbr32 );
-            break;
-        }
-#undef _X
-    }    
-    else if( p_vout->b_grayscale )
-    {
-        /* Grayscale */
-        switch( p_vout->i_bytes_per_pixel )
-        {
-#define _X( foo ) (vout_yuv_convert_t *) _M( foo )
-        case 1:
-            p_vout->yuv.pf_yuv420 = _X( ConvertY4Gray8 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertY4Gray8 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertY4Gray8 );
-            break;
-        case 2:
-            p_vout->yuv.pf_yuv420 = _X( ConvertY4Gray16 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertY4Gray16 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertY4Gray16 );
-            break;
-        case 3:
-            p_vout->yuv.pf_yuv420 = _X( ConvertY4Gray24 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertY4Gray24 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertY4Gray24 );
-            break;
-        case 4:
-            p_vout->yuv.pf_yuv420 = _X( ConvertY4Gray32 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertY4Gray32 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertY4Gray32 );
-            break;
-#undef _X
-        }
-    }
-    else
-    {
-        /* Color */
-        switch( p_vout->i_bytes_per_pixel )
-        {
-#define _X( foo ) (vout_yuv_convert_t *) _M( foo )
-        case 1:
-            p_vout->yuv.pf_yuv420 = _X( ConvertYUV420RGB8 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertYUV422RGB8 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertYUV444RGB8 );
-            break;
-        case 2:
-            p_vout->yuv.pf_yuv420 = _X( ConvertYUV420RGB16 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertYUV422RGB16 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertYUV444RGB16 );
-            break;
-        case 3:
-            p_vout->yuv.pf_yuv420 = _X( ConvertYUV420RGB24 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertYUV422RGB24 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertYUV444RGB24 );
-            break;
-        case 4:
-            p_vout->yuv.pf_yuv420 = _X( ConvertYUV420RGB32 );
-            p_vout->yuv.pf_yuv422 = _X( ConvertYUV422RGB32 );
-            p_vout->yuv.pf_yuv444 = _X( ConvertYUV444RGB32 );
-            break;
-#undef _X
-      }
-    }
-}
-
-/*****************************************************************************
- * SetOffset: build offset array for conversion functions
- *****************************************************************************
- * This function will build an offset array used in later conversion functions.
- * It will also set horizontal and vertical scaling indicators. If b_double
- * is set, the p_offset structure has interleaved Y and U/V offsets.
- *****************************************************************************/
-void _M( SetOffset )( int i_width, int i_height, int i_pic_width,
-                      int i_pic_height, boolean_t *pb_h_scaling,
-                      int *pi_v_scaling, int *p_offset, boolean_t b_double )
-{
-    int i_x;                                    /* x position in destination */
-    int i_scale_count;                                     /* modulo counter */
-
-    /*
-     * Prepare horizontal offset array
-     */
-    if( i_pic_width - i_width == 0 )
-    {
-        /* No horizontal scaling: YUV conversion is done directly to picture */
-        *pb_h_scaling = 0;
-    }
-    else if( i_pic_width - i_width > 0 )
-    {
-        /* Prepare scaling array for horizontal extension */
-        *pb_h_scaling = 1;
-        i_scale_count = i_pic_width;
-        if( !b_double )
-        {
-            for( i_x = i_width; i_x--; )
-            {
-                while( (i_scale_count -= i_width) > 0 )
-                {
-                    *p_offset++ = 0;
-                }
-                *p_offset++ = 1;
-                i_scale_count += i_pic_width;
-            }
-        }
-        else
-        {
-            int i_dummy = 0;
-            for( i_x = i_width; i_x--; )
-            {
-                while( (i_scale_count -= i_width) > 0 )
-                {
-                    *p_offset++ = 0;
-                    *p_offset++ = 0;
-                }
-                *p_offset++ = 1;
-                *p_offset++ = i_dummy;
-                i_dummy = 1 - i_dummy;
-                i_scale_count += i_pic_width;
-            }
-        }
-    }
-    else /* if( i_pic_width - i_width < 0 ) */
-    {
-        /* Prepare scaling array for horizontal reduction */
-        *pb_h_scaling = 1;
-        i_scale_count = i_width;
-        if( !b_double )
-        {
-           for( i_x = i_pic_width; i_x--; )
-            {
-                *p_offset = 1;
-                while( (i_scale_count -= i_pic_width) > 0 )
-                {
-                    *p_offset += 1;
-                }
-                p_offset++;
-                i_scale_count += i_width;
-            }
-        }
-        else
-        {
-            int i_remainder = 0;
-            int i_jump;
-            for( i_x = i_pic_width; i_x--; )
-            {
-                i_jump = 1;
-                while( (i_scale_count -= i_pic_width) > 0 )
-                {
-                    i_jump += 1;
-                }
-                *p_offset++ = i_jump;
-                *p_offset++ = ( i_jump += i_remainder ) >> 1;
-                i_remainder = i_jump & 1;
-                i_scale_count += i_width;
-            }
-        }
-     }
-
-    /*
-     * Set vertical scaling indicator
-     */
-    if( i_pic_height - i_height == 0 )
-    {
-        *pi_v_scaling = 0;
-    }
-    else if( i_pic_height - i_height > 0 )
-    {
-        *pi_v_scaling = 1;
-    }
-    else /* if( i_pic_height - i_height < 0 ) */
-    {
-        *pi_v_scaling = -1;
-    }
-}
-
diff --git a/plugins/chroma/i420_rgb.c b/plugins/chroma/i420_rgb.c
new file mode 100644 (file)
index 0000000..c5cc1ed
--- /dev/null
@@ -0,0 +1,224 @@
+/*****************************************************************************
+ * i420_rgb.c : YUV to bitmap RGB conversion module for vlc
+ *****************************************************************************
+ * Copyright (C) 2000, 2001 VideoLAN
+ * $Id: i420_rgb.c,v 1.1 2002/01/04 14:01:34 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <math.h>                                            /* exp(), pow() */
+#include <errno.h>                                                 /* ENOMEM */
+#include <string.h>                                            /* strerror() */
+#include <stdlib.h>                                      /* malloc(), free() */
+
+#include <videolan/vlc.h>
+
+#include "video.h"
+#include "video_output.h"
+
+#include "i420_rgb.h"
+
+/*****************************************************************************
+ * Local and extern prototypes.
+ *****************************************************************************/
+static void chroma_getfunctions ( function_list_t * p_function_list );
+
+static int  chroma_Probe        ( probedata_t *p_data );
+static int  chroma_Init         ( vout_thread_t *p_vout );
+static void chroma_End          ( vout_thread_t *p_vout );
+
+/*****************************************************************************
+ * Build configuration tree.
+ *****************************************************************************/
+MODULE_CONFIG_START
+MODULE_CONFIG_STOP
+
+MODULE_INIT_START
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+    SET_DESCRIPTION( "I420/IYUV/YV12 to RGB 8/15/16/24/32 conversions" )
+    ADD_CAPABILITY( CHROMA, 80 )
+#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
+    SET_DESCRIPTION( "MMX I420/IYUV/YV12 to RGB 15/16/24/32 conversions" )
+    ADD_CAPABILITY( CHROMA, 100 )
+    ADD_REQUIREMENT( MMX )
+#endif
+MODULE_INIT_STOP
+
+MODULE_ACTIVATE_START
+    chroma_getfunctions( &p_module->p_functions->chroma );
+MODULE_ACTIVATE_STOP
+
+MODULE_DEACTIVATE_START
+MODULE_DEACTIVATE_STOP
+
+/*****************************************************************************
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+static void chroma_getfunctions( function_list_t * p_function_list )
+{
+    p_function_list->pf_probe = chroma_Probe;
+    p_function_list->functions.chroma.pf_init = chroma_Init;
+    p_function_list->functions.chroma.pf_end  = chroma_End;
+}
+
+/*****************************************************************************
+ * chroma_Probe: return a score
+ *****************************************************************************
+ * This function checks that we can handle the required data
+ *****************************************************************************/
+static int chroma_Probe( probedata_t *p_data )
+{
+    if( p_data->chroma.p_render->i_width & 1
+         || p_data->chroma.p_render->i_height & 1 )
+    {
+        return 0;
+    }
+
+    switch( p_data->chroma.p_render->i_chroma )
+    {
+        case FOURCC_YV12:
+        case FOURCC_I420:
+        case FOURCC_IYUV:
+            switch( p_data->chroma.p_output->i_chroma )
+            {
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+                case FOURCC_BI_RGB:
+                    break;
+#endif
+                case FOURCC_RV15:
+                case FOURCC_RV16:
+                case FOURCC_BI_BITFIELDS:
+                    break;
+
+                default:
+                    return 0;
+            }
+            break;
+
+        default:
+            return 0;
+    }
+
+    return 100;
+}
+
+/*****************************************************************************
+ * chroma_Init: allocate a chroma function
+ *****************************************************************************
+ * This function allocates and initializes a chroma function
+ *****************************************************************************/
+static int chroma_Init( vout_thread_t *p_vout )
+{
+    if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
+    {
+        return -1;
+    }
+
+    switch( p_vout->render.i_chroma )
+    {
+        case FOURCC_YV12:
+        case FOURCC_I420:
+        case FOURCC_IYUV:
+            switch( p_vout->output.i_chroma )
+            {
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+                case FOURCC_BI_RGB:
+                    p_vout->chroma.pf_convert = _M( I420_RGB8 );
+                    break;
+#endif
+                case FOURCC_RV15:
+                case FOURCC_RV16:
+                    p_vout->chroma.pf_convert = _M( I420_RGB16 );
+                    break;
+
+                case FOURCC_BI_BITFIELDS:
+                    //p_vout->chroma.pf_convert = _M( I420_RGB24 );
+                    p_vout->chroma.pf_convert = _M( I420_RGB32 );
+                    break;
+
+                default:
+                    return -1;
+            }
+            break;
+
+        default:
+            return -1;
+    }
+    
+    p_vout->chroma.p_sys = malloc( sizeof( chroma_sys_t ) );
+    if( p_vout->chroma.p_sys == NULL )
+    {
+        return -1;
+    }
+
+    switch( p_vout->output.i_chroma )
+    {
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+        case FOURCC_BI_RGB:
+            p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH );
+            break;
+#endif
+
+        case FOURCC_RV15:
+        case FOURCC_RV16:
+            p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 2 );
+            break;
+
+        case FOURCC_BI_BITFIELDS:
+            p_vout->chroma.p_sys->p_buffer = malloc( VOUT_MAX_WIDTH * 4 );
+            break;
+
+        default:
+            p_vout->chroma.p_sys->p_buffer = NULL;
+            break;
+    }
+
+    if( p_vout->chroma.p_sys->p_buffer == NULL )
+    {
+        free( p_vout->chroma.p_sys );
+        return -1;
+    }
+
+    p_vout->chroma.p_sys->p_offset = malloc( p_vout->output.i_width
+                                              * sizeof( int ) );
+    if( p_vout->chroma.p_sys->p_offset == NULL )
+    {
+        free( p_vout->chroma.p_sys->p_buffer );
+        free( p_vout->chroma.p_sys );
+        return -1;
+    }
+
+    return 0; 
+}
+
+/*****************************************************************************
+ * chroma_End: free the chroma function
+ *****************************************************************************
+ * This function frees the previously allocated chroma function
+ *****************************************************************************/
+static void chroma_End( vout_thread_t *p_vout )
+{
+    free( p_vout->chroma.p_sys->p_offset );
+    free( p_vout->chroma.p_sys->p_buffer );
+    free( p_vout->chroma.p_sys );
+}
+
similarity index 82%
rename from plugins/chroma/transforms.h
rename to plugins/chroma/i420_rgb.h
index 43e577d3ed3eb782dfa255556d09d197ab2773fe..701d5589177660613629a446fb057a26d1250c00 100644 (file)
@@ -1,27 +1,48 @@
 /*****************************************************************************
- * transforms_common.h: Chroma transformation macros
+ * i420_rgb.h : YUV to bitmap RGB conversion module for vlc
  *****************************************************************************
- * Copyright (C) 1999, 2000, 2001 VideoLAN
- * $Id: transforms.h,v 1.1 2001/12/16 16:18:36 sam Exp $
+ * Copyright (C) 2000 VideoLAN
+ * $Id: i420_rgb.h,v 1.1 2002/01/04 14:01:34 sam Exp $
  *
- * Authors: Vincent Seguin <seguin@via.ecp.fr>
- *          Samuel Hocevar <sam@zoy.org>
+ * Authors: Samuel Hocevar <sam@zoy.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- *
+ * 
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * chroma_sys_t: chroma method descriptor
+ *****************************************************************************
+ * This structure is part of the chroma transformation descriptor, it
+ * describes the yuv2rgb specific properties.
  *****************************************************************************/
+typedef struct chroma_sys_s
+{
+    u8  *p_buffer;
+    int *p_offset;
+
+} chroma_sys_t;
+
+/*****************************************************************************
+ * Prototypes
+ *****************************************************************************/
+#ifdef MODULE_NAME_IS_chroma_i420_rgb
+void _M( I420_RGB8 ) ( vout_thread_t *, picture_t *, picture_t * );
+#endif
+void _M( I420_RGB16 )( vout_thread_t *, picture_t *, picture_t * );
+void _M( I420_RGB24 )( vout_thread_t *, picture_t *, picture_t * );
+void _M( I420_RGB32 )( vout_thread_t *, picture_t *, picture_t * );
 
 /*****************************************************************************
  * CONVERT_*_PIXEL: pixel conversion macros
@@ -47,7 +68,7 @@
     i_blue =    (U_BLUE_COEF * i_uval) >> SHIFT;                              \
     CONVERT_Y_PIXEL( BPP )                                                    \
 
-#define CONVERT_4YUV_PIXEL( CHROMA )                                         \
+#define CONVERT_4YUV_PIXEL( CHROMA )                                          \
     *p_pic++ = p_lookup[                                                      \
         (((*p_y++ + dither10[i_real_y]) >> 4) << 7)                           \
       + ((*p_u + dither20[i_real_y]) >> 5) * 9                                \
@@ -65,7 +86,7 @@
       + ((*p_u++ + dither23[i_real_y]) >> 5) * 9                              \
       + ((*p_v++ + dither23[i_real_y]) >> 5) ];                               \
 
-#define CONVERT_4YUV_PIXEL_SCALE( CHROMA )                                   \
+#define CONVERT_4YUV_PIXEL_SCALE( CHROMA )                                    \
     *p_pic++ = p_lookup[                                                      \
         ( ((*p_y + dither10[i_real_y]) >> 4) << 7)                            \
         + ((*p_u + dither20[i_real_y]) >> 5) * 9                              \
  * for 1, 2 and 4 Bpp.
  *****************************************************************************/
 #define SCALE_WIDTH                                                           \
-    if( b_horizontal_scaling )                                                \
+    if( b_hscale )                                                            \
     {                                                                         \
         /* Horizontal scaling, conversion has been done to buffer.            \
          * Rewind buffer and offset, then copy and scale line */              \
         p_buffer = p_buffer_start;                                            \
         p_offset = p_offset_start;                                            \
-        for( i_x = i_pic_width / 16; i_x--; )                                 \
+        for( i_x = p_vout->output.i_width / 16; i_x--; )                      \
         {                                                                     \
             *p_pic++ = *p_buffer;   p_buffer += *p_offset++;                  \
             *p_pic++ = *p_buffer;   p_buffer += *p_offset++;                  \
             *p_pic++ = *p_buffer;   p_buffer += *p_offset++;                  \
             *p_pic++ = *p_buffer;   p_buffer += *p_offset++;                  \
         }                                                                     \
-        p_pic += i_pic_line_width;                                            \
+        for( i_x = p_vout->output.i_width & 15; i_x--; )                      \
+        {                                                                     \
+            *p_pic++ = *p_buffer;   p_buffer += *p_offset++;                  \
+        }                                                                     \
+        p_pic += i_right_margin;                                              \
     }                                                                         \
     else                                                                      \
     {                                                                         \
         /* No scaling, conversion has been done directly in picture memory.   \
          * Increment of picture pointer to end of line is still needed */     \
-        p_pic += i_pic_width + i_pic_line_width;                              \
+        (u8*)p_pic += p_dest->p->i_pitch;                                     \
     }                                                                         \
 
 /*****************************************************************************
  * This macro scales a line using an offset array.
  *****************************************************************************/
 #define SCALE_WIDTH_DITHER( CHROMA )                                          \
-    if( b_horizontal_scaling )                                                \
+    if( b_hscale )                                                            \
     {                                                                         \
         /* Horizontal scaling - we can't use a buffer due to dithering */     \
         p_offset = p_offset_start;                                            \
-        for( i_x = i_pic_width / 16; i_x--; )                                 \
+        for( i_x = p_vout->output.i_width / 16; i_x--; )                      \
         {                                                                     \
-            CONVERT_4YUV_PIXEL_SCALE( CHROMA )                               \
-            CONVERT_4YUV_PIXEL_SCALE( CHROMA )                               \
-            CONVERT_4YUV_PIXEL_SCALE( CHROMA )                               \
-            CONVERT_4YUV_PIXEL_SCALE( CHROMA )                               \
+            CONVERT_4YUV_PIXEL_SCALE( CHROMA )                                \
+            CONVERT_4YUV_PIXEL_SCALE( CHROMA )                                \
+            CONVERT_4YUV_PIXEL_SCALE( CHROMA )                                \
+            CONVERT_4YUV_PIXEL_SCALE( CHROMA )                                \
         }                                                                     \
     }                                                                         \
     else                                                                      \
     {                                                                         \
-        for( i_x = i_width / 16; i_x--;  )                                    \
+        for( i_x = p_vout->render.i_width / 16; i_x--;  )                     \
         {                                                                     \
-            CONVERT_4YUV_PIXEL( CHROMA )                                     \
-            CONVERT_4YUV_PIXEL( CHROMA )                                     \
-            CONVERT_4YUV_PIXEL( CHROMA )                                     \
-            CONVERT_4YUV_PIXEL( CHROMA )                                     \
+            CONVERT_4YUV_PIXEL( CHROMA )                                      \
+            CONVERT_4YUV_PIXEL( CHROMA )                                      \
+            CONVERT_4YUV_PIXEL( CHROMA )                                      \
+            CONVERT_4YUV_PIXEL( CHROMA )                                      \
         }                                                                     \
     }                                                                         \
     /* Increment of picture pointer to end of line is still needed */         \
-    p_pic += i_pic_line_width;                                                \
+    p_pic += i_right_margin;                                                  \
                                                                               \
     /* Increment the Y coordinate in the matrix, modulo 4 */                  \
     i_real_y = (i_real_y + 1) & 0x3;                                          \
      * Handle vertical scaling. The current line can be copied or next one    \
      * can be ignored.                                                        \
      */                                                                       \
-    switch( i_vertical_scaling )                                              \
+    switch( i_vscale )                                                        \
     {                                                                         \
     case -1:                             /* vertical scaling factor is < 1 */ \
-        while( (i_scale_count -= i_pic_height) > 0 )                          \
+        while( (i_scale_count -= p_vout->output.i_height) > 0 )               \
         {                                                                     \
             /* Height reduction: skip next source line */                     \
-            p_y += i_width;                                                   \
+            p_y += p_vout->render.i_width;                                    \
             i_y++;                                                            \
             if( (CHROMA == 420) || (CHROMA == 422) )                          \
             {                                                                 \
             }                                                                 \
             else if( CHROMA == 444 )                                          \
             {                                                                 \
-                p_u += i_width;                                               \
-                p_v += i_width;                                               \
+                p_u += p_vout->render.i_width;                                \
+                p_v += p_vout->render.i_width;                                \
             }                                                                 \
         }                                                                     \
-        i_scale_count += i_height;                                            \
+        i_scale_count += p_vout->render.i_height;                             \
         break;                                                                \
     case 1:                              /* vertical scaling factor is > 1 */ \
-        while( (i_scale_count -= i_height) > 0 )                              \
+        while( (i_scale_count -= p_vout->render.i_height) > 0 )               \
         {                                                                     \
             /* Height increment: copy previous picture line */                \
-            for( i_x = i_pic_width / 16; i_x--; )                             \
-            {                                                                 \
-                *(((u64 *) p_pic)++) = *(((u64 *) p_pic_start)++ );           \
-                *(((u64 *) p_pic)++) = *(((u64 *) p_pic_start)++ );           \
-                if( BPP > 1 )                               /* 2, 3, 4 Bpp */ \
-                {                                                             \
-                    *(((u64 *) p_pic)++) = *(((u64 *) p_pic_start)++ );       \
-                    *(((u64 *) p_pic)++) = *(((u64 *) p_pic_start)++ );       \
-                }                                                             \
-                if( BPP > 2 )                                  /* 3, 4 Bpp */ \
-                {                                                             \
-                    *(((u64 *) p_pic)++) = *(((u64 *) p_pic_start)++ );       \
-                    *(((u64 *) p_pic)++) = *(((u64 *) p_pic_start)++ );       \
-                }                                                             \
-                if( BPP > 3 )                                     /* 4 Bpp */ \
-                {                                                             \
-                    *(((u64 *) p_pic)++) = *(((u64 *) p_pic_start)++ );       \
-                    *(((u64 *) p_pic)++) = *(((u64 *) p_pic_start)++ );       \
-                }                                                             \
-            }                                                                 \
-            p_pic +=        i_pic_line_width;                                 \
-            p_pic_start +=  i_pic_line_width;                                 \
+            FAST_MEMCPY( p_pic, p_pic_start, p_vout->output.i_width * BPP );  \
+            (u8*)p_pic += p_dest->p->i_pitch;                                 \
         }                                                                     \
-        i_scale_count += i_pic_height;                                        \
+        i_scale_count += p_vout->output.i_height;                             \
         break;                                                                \
     }                                                                         \
 
      * can be ignored.                                                        \
      */                                                                       \
                                                                               \
-    switch( i_vertical_scaling )                                              \
+    switch( i_vscale )                                                        \
     {                                                                         \
     case -1:                             /* vertical scaling factor is < 1 */ \
-        while( (i_scale_count -= i_pic_height) > 0 )                          \
+        while( (i_scale_count -= p_vout->output.i_height) > 0 )               \
         {                                                                     \
             /* Height reduction: skip next source line */                     \
-            p_y += i_width;                                                   \
+            p_y += p_vout->render.i_width;                                    \
             i_y++;                                                            \
             if( (CHROMA == 420) || (CHROMA == 422) )                          \
             {                                                                 \
             }                                                                 \
             else if( CHROMA == 444 )                                          \
             {                                                                 \
-                p_u += i_width;                                               \
-                p_v += i_width;                                               \
+                p_u += p_vout->render.i_width;                                \
+                p_v += p_vout->render.i_width;                                \
             }                                                                 \
         }                                                                     \
-        i_scale_count += i_height;                                            \
+        i_scale_count += p_vout->render.i_height;                             \
         break;                                                                \
     case 1:                              /* vertical scaling factor is > 1 */ \
-        while( (i_scale_count -= i_height) > 0 )                              \
+        while( (i_scale_count -= p_vout->render.i_height) > 0 )               \
         {                                                                     \
-            p_y -= i_width;                                                   \
+            p_y -= p_vout->render.i_width;                                    \
             p_u -= i_chroma_width;                                            \
             p_v -= i_chroma_width;                                            \
             SCALE_WIDTH_DITHER( CHROMA );                                     \
         }                                                                     \
-        i_scale_count += i_pic_height;                                        \
+        i_scale_count += p_vout->output.i_height;                             \
         break;                                                                \
     }                                                                         \
 
diff --git a/plugins/chroma/i420_rgb16.c b/plugins/chroma/i420_rgb16.c
new file mode 100644 (file)
index 0000000..cef58f4
--- /dev/null
@@ -0,0 +1,265 @@
+/*****************************************************************************
+ * i420_rgb16.c : YUV to bitmap RGB conversion module for vlc
+ *****************************************************************************
+ * Copyright (C) 2000 VideoLAN
+ * $Id: i420_rgb16.c,v 1.1 2002/01/04 14:01:34 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <math.h>                                            /* exp(), pow() */
+#include <errno.h>                                                 /* ENOMEM */
+#include <string.h>                                            /* strerror() */
+#include <stdlib.h>                                      /* malloc(), free() */
+
+#include <videolan/vlc.h>
+
+#include "video.h"
+#include "video_output.h"
+
+#include "i420_rgb.h"
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+#   include "i420_rgb_c.h"
+#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
+#   include "i420_rgb_mmx.h"
+#endif
+
+static void SetOffset( int, int, int, int, boolean_t *, int *, int * );
+
+/*****************************************************************************
+ * I420_RGB16: color YUV 4:2:0 to RGB 16 bpp
+ *****************************************************************************
+ * Horizontal alignment needed:
+ *  - input: 8 pixels (8 Y bytes, 4 U/V bytes), margins not allowed
+ *  - output: 1 pixel (2 bytes), margins allowed
+ * Vertical alignment needed:
+ *  - input: 2 lines (2 Y lines, 1 U/V line)
+ *  - output: 1 line
+ *****************************************************************************/
+void _M( I420_RGB16 )( vout_thread_t *p_vout, picture_t *p_src,
+                                              picture_t *p_dest )
+{
+    /* We got this one from the old arguments */
+    u16 *p_pic = (u16*)p_dest->p->p_pixels;
+    u8  *p_y   = p_src->Y_PIXELS;
+    u8  *p_u   = p_src->U_PIXELS;
+    u8  *p_v   = p_src->V_PIXELS;
+
+    boolean_t   b_hscale;                         /* horizontal scaling type */
+    int         i_vscale;                           /* vertical scaling type */
+    int         i_x, i_y;                 /* horizontal and vertical indexes */
+    int         i_right_margin;
+    int         i_rewind;
+    int         i_scale_count;                       /* scale modulo counter */
+    int         i_chroma_width = p_vout->render.i_width / 2; /* chroma width */
+    u16 *       p_pic_start;       /* beginning of the current line for copy */
+
+    /* Conversion buffer pointer */
+    u16 *       p_buffer_start = (u16*)p_vout->chroma.p_sys->p_buffer;
+    u16 *       p_buffer;
+
+    /* Offset array pointer */
+    int *       p_offset_start = p_vout->chroma.p_sys->p_offset;
+    int *       p_offset;
+
+    if( p_dest->p->b_margin )
+    {
+        i_right_margin = (p_dest->p->i_pitch - p_dest->p->i_visible_bytes) / 2;
+    }
+    else
+    {
+        i_right_margin = 0;
+    }
+
+    if( p_vout->render.i_width & 7 )
+    {
+        i_rewind = 8 - ( p_vout->render.i_width & 7 );
+    }
+    else
+    {
+        i_rewind = 0;
+    }
+
+    /* Rule: when a picture of size (x1,y1) with aspect ratio r1 is rendered
+     * on a picture of size (x2,y2) with aspect ratio r2, if x1 grows to x1'
+     * then y1 grows to y1' = x1' * y2/x2 * r2/r1 */
+    SetOffset( p_vout->render.i_width, p_vout->render.i_height,
+               p_vout->output.i_width, p_vout->output.i_height,
+               &b_hscale, &i_vscale, p_offset_start );
+
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+    intf_ErrMsg( "vout error: I420_RGB16 unimplemented, "
+                 "please harass sam@zoy.org" );
+#endif
+
+    /*
+     * Perform conversion
+     */
+    i_scale_count = ( i_vscale == 1 ) ?
+                    p_vout->output.i_height : p_vout->render.i_height;
+    for( i_y = 0; i_y < p_vout->render.i_height; i_y++ )
+    {
+        p_pic_start = p_pic;
+        p_buffer = b_hscale ? p_buffer_start : p_pic;
+
+        for ( i_x = p_vout->render.i_width / 8; i_x--; )
+        {
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+            /* FIXME: TODO */
+#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
+            __asm__( MMX_INIT_16
+                     : : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
+
+            __asm__( ".align 8"
+                     MMX_YUV_MUL
+                     MMX_YUV_ADD
+                     MMX_UNPACK_16
+                     : : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
+
+            p_y += 8;
+            p_u += 4;
+            p_v += 4;
+            p_buffer += 8;
+#endif
+        }
+
+        /* Here we do some unaligned reads and duplicate conversions, but
+         * at least we have all the pixels */
+        if( i_rewind )
+        {
+            p_y -= i_rewind;
+            p_u -= i_rewind >> 1;
+            p_v -= i_rewind >> 1;
+            p_buffer -= i_rewind;
+#if defined (MODULE_NAME_IS_chroma_i420_rgb)
+            /* FIXME: TODO */
+#elif defined (MODULE_NAME_IS_chroma_i420_rgb_mmx)
+            __asm__( MMX_INIT_16
+                     : : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
+
+            __asm__( ".align 8"
+                     MMX_YUV_MUL
+                     MMX_YUV_ADD
+                     MMX_UNPACK_16
+                     : : "r" (p_y), "r" (p_u), "r" (p_v), "r" (p_buffer) );
+
+            p_y += 8;
+            p_u += 4;
+            p_v += 4;
+            p_buffer += 8;
+#endif
+        }
+        SCALE_WIDTH;
+        SCALE_HEIGHT( 420, 2 );
+    }
+}
+
+/*****************************************************************************
+ * I420_RGB24: color YUV 4:2:0 to RGB 24 bpp
+ *****************************************************************************/
+void _M( I420_RGB24 )( vout_thread_t *p_vout, picture_t *p_src,
+                                              picture_t *p_dest )
+{
+    intf_ErrMsg( "vout error: I420_RGB24 unimplemented, "
+                 "please harass sam@zoy.org" );
+}
+
+/*****************************************************************************
+ * I420_RGB32: color YUV 4:2:0 to RGB 32 bpp
+ *****************************************************************************/
+void _M( I420_RGB32 )( vout_thread_t *p_vout, picture_t *p_src,
+                                              picture_t *p_dest )
+{
+    intf_ErrMsg( "vout error: I420_RGB32 unimplemented, "
+                 "please harass sam@zoy.org" );
+}
+
+/* Following functions are local */
+
+/*****************************************************************************
+ * SetOffset: build offset array for conversion functions
+ *****************************************************************************
+ * This function will build an offset array used in later conversion functions.
+ * It will also set horizontal and vertical scaling indicators.
+ *****************************************************************************/
+static void SetOffset( int i_width, int i_height, int i_pic_width,
+                       int i_pic_height, boolean_t *pb_hscale,
+                       int *pi_vscale, int *p_offset )
+{
+    int i_x;                                    /* x position in destination */
+    int i_scale_count;                                     /* modulo counter */
+
+    /*
+     * Prepare horizontal offset array
+     */
+    if( i_pic_width - i_width == 0 )
+    {
+        /* No horizontal scaling: YUV conversion is done directly to picture */
+        *pb_hscale = 0;
+    }
+    else if( i_pic_width - i_width > 0 )
+    {
+        /* Prepare scaling array for horizontal extension */
+        *pb_hscale = 1;
+        i_scale_count = i_pic_width;
+        for( i_x = i_width; i_x--; )
+        {
+            while( (i_scale_count -= i_width) > 0 )
+            {
+                *p_offset++ = 0;
+            }
+            *p_offset++ = 1;
+            i_scale_count += i_pic_width;
+        }
+    }
+    else /* if( i_pic_width - i_width < 0 ) */
+    {
+        /* Prepare scaling array for horizontal reduction */
+        *pb_hscale = 1;
+        i_scale_count = i_width;
+        for( i_x = i_pic_width; i_x--; )
+        {
+            *p_offset = 1;
+            while( (i_scale_count -= i_pic_width) > 0 )
+            {
+                *p_offset += 1;
+            }
+            p_offset++;
+            i_scale_count += i_width;
+        }
+     }
+
+    /*
+     * Set vertical scaling indicator
+     */
+    if( i_pic_height - i_height == 0 )
+    {
+        *pi_vscale = 0;
+    }
+    else if( i_pic_height - i_height > 0 )
+    {
+        *pi_vscale = 1;
+    }
+    else /* if( i_pic_height - i_height < 0 ) */
+    {
+        *pi_vscale = -1;
+    }
+}
+
diff --git a/plugins/chroma/i420_rgb8.c b/plugins/chroma/i420_rgb8.c
new file mode 100644 (file)
index 0000000..9fa80fc
--- /dev/null
@@ -0,0 +1,165 @@
+/*****************************************************************************
+ * i420_rgb8.c : YUV to bitmap RGB conversion module for vlc
+ *****************************************************************************
+ * Copyright (C) 2000 VideoLAN
+ * $Id: i420_rgb8.c,v 1.1 2002/01/04 14:01:34 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <math.h>                                            /* exp(), pow() */
+#include <errno.h>                                                 /* ENOMEM */
+#include <string.h>                                            /* strerror() */
+#include <stdlib.h>                                      /* malloc(), free() */
+
+#include <videolan/vlc.h>
+
+#include "video.h"
+#include "video_output.h"
+
+#include "i420_rgb.h"
+#include "i420_rgb_c.h"
+
+static void SetOffset( int, int, int, int, boolean_t *, int *, int * );
+
+/*****************************************************************************
+ * I420_RGB8: color YUV 4:2:0 to RGB 8 bpp
+ *****************************************************************************/
+void _M( I420_RGB8 )( vout_thread_t *p_vout, picture_t *p_source,
+                                             picture_t *p_dest )
+{
+    /* We got this one from the old arguments */
+    u16 *p_pic = (u16*)p_dest->p->p_pixels;
+    u8 *p_y = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS, *p_v = p_source->V_PIXELS;
+
+    /* FIXME: add margins here */
+    int i_pic_line_width = p_dest->p->i_pitch / 2;
+
+    boolean_t   b_hscale;             /* horizontal scaling type */
+    int         i_vscale;                 /* vertical scaling type */
+    int         i_x, i_y;                 /* horizontal and vertical indexes */
+    int         i_scale_count;                       /* scale modulo counter */
+    int         i_chroma_width;                              /* chroma width */
+    u16 *       p_pic_start;       /* beginning of the current line for copy */
+    u16 *       p_buffer_start;                   /* conversion buffer start */
+    u16 *       p_buffer;                       /* conversion buffer pointer */
+    int *       p_offset_start;                        /* offset array start */
+    int *       p_offset;                            /* offset array pointer */
+
+    /*
+     * Initialize some values  - i_pic_line_width will store the line skip
+     */
+    i_pic_line_width -= p_vout->output.i_width;
+    i_chroma_width = p_vout->render.i_width / 2;
+    p_buffer_start = (u16*)p_vout->chroma.p_sys->p_buffer;
+    p_offset_start = p_vout->chroma.p_sys->p_offset;
+    SetOffset( p_vout->render.i_width, p_vout->render.i_height,
+               p_vout->output.i_width, p_vout->output.i_height,
+               &b_hscale, &i_vscale, p_offset_start );
+
+    /* FIXME */
+    intf_ErrMsg( "vout error: I420_RGB8 unimplemented, "
+                 "please harass sam@zoy.org" );
+}
+
+/* Following functions are local */
+
+/*****************************************************************************
+ * SetOffset: build offset array for conversion functions
+ *****************************************************************************
+ * This function will build an offset array used in later conversion functions.
+ * It will also set horizontal and vertical scaling indicators. If b_double
+ * is set, the p_offset structure has interleaved Y and U/V offsets.
+ *****************************************************************************/
+static void SetOffset( int i_width, int i_height, int i_pic_width,
+                       int i_pic_height, boolean_t *pb_hscale,
+                       int *pi_vscale, int *p_offset )
+{
+    int i_x;                                    /* x position in destination */
+    int i_scale_count;                                     /* modulo counter */
+
+    /*
+     * Prepare horizontal offset array
+     */
+    if( i_pic_width - i_width == 0 )
+    {
+        /* No horizontal scaling: YUV conversion is done directly to picture */
+        *pb_hscale = 0;
+    }
+    else if( i_pic_width - i_width > 0 )
+    {
+        int i_dummy = 0;
+
+        /* Prepare scaling array for horizontal extension */
+        *pb_hscale = 1;
+        i_scale_count = i_pic_width;
+        for( i_x = i_width; i_x--; )
+        {
+            while( (i_scale_count -= i_width) > 0 )
+            {
+                *p_offset++ = 0;
+                *p_offset++ = 0;
+            }
+            *p_offset++ = 1;
+            *p_offset++ = i_dummy;
+            i_dummy = 1 - i_dummy;
+            i_scale_count += i_pic_width;
+        }
+    }
+    else /* if( i_pic_width - i_width < 0 ) */
+    {
+        int i_remainder = 0;
+        int i_jump;
+
+        /* Prepare scaling array for horizontal reduction */
+        *pb_hscale = 1;
+        i_scale_count = i_width;
+        for( i_x = i_pic_width; i_x--; )
+        {
+            i_jump = 1;
+            while( (i_scale_count -= i_pic_width) > 0 )
+            {
+                i_jump += 1;
+            }
+            *p_offset++ = i_jump;
+            *p_offset++ = ( i_jump += i_remainder ) >> 1;
+            i_remainder = i_jump & 1;
+            i_scale_count += i_width;
+        }
+     }
+
+    /*
+     * Set vertical scaling indicator
+     */
+    if( i_pic_height - i_height == 0 )
+    {
+        *pi_vscale = 0;
+    }
+    else if( i_pic_height - i_height > 0 )
+    {
+        *pi_vscale = 1;
+    }
+    else /* if( i_pic_height - i_height < 0 ) */
+    {
+        *pi_vscale = -1;
+    }
+}
+
similarity index 85%
rename from plugins/chroma/chroma_common.h
rename to plugins/chroma/i420_rgb_c.h
index 90aafc585bb1e2c1df740375754eb91898a7ea22..c30a2e81788bbbbfa92af30ef954e87e0dbb3a09 100644 (file)
@@ -5,7 +5,7 @@
  * case by optimized functions.
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: chroma_common.h,v 1.1 2001/12/16 16:18:36 sam Exp $
+ * $Id: i420_rgb_c.h,v 1.1 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
 #define V_RED_COEF      ((int)(1.596 * (1<<SHIFT) / 1.164))
 #define V_GREEN_COEF    ((int)(-0.813 * (1<<SHIFT) / 1.164))
 
-/*****************************************************************************
- * Extern prototypes
- *****************************************************************************/
-
-void _M( SetOffset )( int i_width, int i_height, int i_pic_width,
-                      int i_pic_height, boolean_t *pb_h_scaling,
-                      int *pi_v_scaling, int *p_offset, boolean_t b_double );
-
diff --git a/plugins/chroma/i420_rgb_mmx.h b/plugins/chroma/i420_rgb_mmx.h
new file mode 100644 (file)
index 0000000..dfd0b27
--- /dev/null
@@ -0,0 +1,250 @@
+/*****************************************************************************
+ * transforms_yuvmmx.h: MMX YUV transformation assembly
+ *****************************************************************************
+ * Copyright (C) 1999, 2000 VideoLAN
+ * $Id: i420_rgb_mmx.h,v 1.1 2002/01/04 14:01:34 sam Exp $
+ *
+ * Authors: Olie Lho <ollie@sis.com.tw>
+ *          Gaël Hendryckx <jimmy@via.ecp.fr>
+ *          Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *****************************************************************************/
+
+/* hope these constant values are cache line aligned */
+#define UNUSED_LONGLONG(foo) \
+    unsigned long long foo __asm__ (#foo) __attribute__((unused))
+UNUSED_LONGLONG(mmx_80w)     = 0x0080008000800080;
+UNUSED_LONGLONG(mmx_10w)     = 0x1010101010101010;
+UNUSED_LONGLONG(mmx_00ffw)   = 0x00ff00ff00ff00ff;
+UNUSED_LONGLONG(mmx_Y_coeff) = 0x253f253f253f253f;
+
+UNUSED_LONGLONG(mmx_U_green) = 0xf37df37df37df37d;
+UNUSED_LONGLONG(mmx_U_blue)  = 0x4093409340934093;
+UNUSED_LONGLONG(mmx_V_red)   = 0x3312331233123312;
+UNUSED_LONGLONG(mmx_V_green) = 0xe5fce5fce5fce5fc;
+
+UNUSED_LONGLONG(mmx_redmask) = 0xf8f8f8f8f8f8f8f8;
+UNUSED_LONGLONG(mmx_grnmask) = 0xfcfcfcfcfcfcfcfc;
+UNUSED_LONGLONG(mmx_grnshift)   = 0x03;
+UNUSED_LONGLONG(mmx_blueshift)  = 0x03;
+#undef UNUSED_LONGLONG
+
+#define MMX_INIT_16 "                                                       \n\
+movd      (%1), %%mm0       # Load 4 Cb       00 00 00 00 u3 u2 u1 u0       \n\
+movd      (%2), %%mm1       # Load 4 Cr       00 00 00 00 v3 v2 v1 v0       \n\
+pxor      %%mm4, %%mm4      # zero mm4                                      \n\
+movq      (%0), %%mm6       # Load 8 Y        Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0       \n\
+#movl      $0, (%3)         # cache preload for image                       \n\
+"
+
+#define MMX_INIT_16_GRAY "                                                  \n\
+movq      (%0), %%mm6       # Load 8 Y        Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0       \n\
+#movl      $0, (%3)         # cache preload for image                       \n\
+"
+
+#define MMX_INIT_32 "                                                       \n\
+movd      (%1), %%mm0       # Load 4 Cb       00 00 00 00 u3 u2 u1 u0       \n\
+movl      $0, (%3)          # cache preload for image                       \n\
+movd      (%2), %%mm1       # Load 4 Cr       00 00 00 00 v3 v2 v1 v0       \n\
+pxor      %%mm4, %%mm4      # zero mm4                                      \n\
+movq      (%0), %%mm6       # Load 8 Y        Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0       \n\
+"
+
+/*
+ * Do the multiply part of the conversion for even and odd pixels,
+ * register usage:
+ * mm0 -> Cblue, mm1 -> Cred, mm2 -> Cgreen even pixels,
+ * mm3 -> Cblue, mm4 -> Cred, mm5 -> Cgreen odd  pixels,
+ * mm6 -> Y even, mm7 -> Y odd
+ */
+
+#define MMX_YUV_MUL "                                                       \n\
+# convert the chroma part                                                   \n\
+punpcklbw %%mm4, %%mm0          # scatter 4 Cb    00 u3 00 u2 00 u1 00 u0   \n\
+punpcklbw %%mm4, %%mm1          # scatter 4 Cr    00 v3 00 v2 00 v1 00 v0   \n\
+psubsw    mmx_80w, %%mm0        # Cb -= 128                                 \n\
+psubsw    mmx_80w, %%mm1        # Cr -= 128                                 \n\
+psllw     $3, %%mm0             # Promote precision                         \n\
+psllw     $3, %%mm1             # Promote precision                         \n\
+movq      %%mm0, %%mm2          # Copy 4 Cb       00 u3 00 u2 00 u1 00 u0   \n\
+movq      %%mm1, %%mm3          # Copy 4 Cr       00 v3 00 v2 00 v1 00 v0   \n\
+pmulhw    mmx_U_green, %%mm2    # Mul Cb with green coeff -> Cb green       \n\
+pmulhw    mmx_V_green, %%mm3    # Mul Cr with green coeff -> Cr green       \n\
+pmulhw    mmx_U_blue, %%mm0     # Mul Cb -> Cblue 00 b3 00 b2 00 b1 00 b0   \n\
+pmulhw    mmx_V_red, %%mm1      # Mul Cr -> Cred  00 r3 00 r2 00 r1 00 r0   \n\
+paddsw    %%mm3, %%mm2          # Cb green + Cr green -> Cgreen             \n\
+                                                                            \n\
+# convert the luma part                                                     \n\
+psubusb   mmx_10w, %%mm6        # Y -= 16                                   \n\
+movq      %%mm6, %%mm7          # Copy 8 Y        Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0   \n\
+pand      mmx_00ffw, %%mm6      # get Y even      00 Y6 00 Y4 00 Y2 00 Y0   \n\
+psrlw     $8, %%mm7             # get Y odd       00 Y7 00 Y5 00 Y3 00 Y1   \n\
+psllw     $3, %%mm6             # Promote precision                         \n\
+psllw     $3, %%mm7             # Promote precision                         \n\
+pmulhw    mmx_Y_coeff, %%mm6    # Mul 4 Y even    00 y6 00 y4 00 y2 00 y0   \n\
+pmulhw    mmx_Y_coeff, %%mm7    # Mul 4 Y odd     00 y7 00 y5 00 y3 00 y1   \n\
+"
+
+/*
+ * Do the addition part of the conversion for even and odd pixels,
+ * register usage:
+ * mm0 -> Cblue, mm1 -> Cred, mm2 -> Cgreen even pixels,
+ * mm3 -> Cblue, mm4 -> Cred, mm5 -> Cgreen odd  pixels,
+ * mm6 -> Y even, mm7 -> Y odd
+ */
+
+#define MMX_YUV_ADD "                                                       \n\
+# Do horizontal and vertical scaling                                        \n\
+movq      %%mm0, %%mm3          # Copy Cblue                                \n\
+movq      %%mm1, %%mm4          # Copy Cred                                 \n\
+movq      %%mm2, %%mm5          # Copy Cgreen                               \n\
+paddsw    %%mm6, %%mm0          # Y even + Cblue  00 B6 00 B4 00 B2 00 B0   \n\
+paddsw    %%mm7, %%mm3          # Y odd  + Cblue  00 B7 00 B5 00 B3 00 B1   \n\
+paddsw    %%mm6, %%mm1          # Y even + Cred   00 R6 00 R4 00 R2 00 R0   \n\
+paddsw    %%mm7, %%mm4          # Y odd  + Cred   00 R7 00 R5 00 R3 00 R1   \n\
+paddsw    %%mm6, %%mm2          # Y even + Cgreen 00 G6 00 G4 00 G2 00 G0   \n\
+paddsw    %%mm7, %%mm5          # Y odd  + Cgreen 00 G7 00 G5 00 G3 00 G1   \n\
+                                                                            \n\
+# Limit RGB even to 0..255                                                  \n\
+packuswb  %%mm0, %%mm0          # B6 B4 B2 B0 / B6 B4 B2 B0                 \n\
+packuswb  %%mm1, %%mm1          # R6 R4 R2 R0 / R6 R4 R2 R0                 \n\
+packuswb  %%mm2, %%mm2          # G6 G4 G2 G0 / G6 G4 G2 G0                 \n\
+                                                                            \n\
+# Limit RGB odd to 0..255                                                   \n\
+packuswb  %%mm3, %%mm3          # B7 B5 B3 B1 / B7 B5 B3 B1                 \n\
+packuswb  %%mm4, %%mm4          # R7 R5 R3 R1 / R7 R5 R3 R1                 \n\
+packuswb  %%mm5, %%mm5          # G7 G5 G3 G1 / G7 G5 G3 G1                 \n\
+                                                                            \n\
+# Interleave RGB even and odd                                               \n\
+punpcklbw %%mm3, %%mm0          #                 B7 B6 B5 B4 B3 B2 B1 B0   \n\
+punpcklbw %%mm4, %%mm1          #                 R7 R6 R5 R4 R3 R2 R1 R0   \n\
+punpcklbw %%mm5, %%mm2          #                 G7 G6 G5 G4 G3 G2 G1 G0   \n\
+"
+
+/*
+ * Grayscale case, only use Y
+ */
+
+#define MMX_YUV_GRAY "                                                      \n\
+# convert the luma part                                                     \n\
+psubusb   mmx_10w, %%mm6                                                    \n\
+movq      %%mm6, %%mm7                                                      \n\
+pand      mmx_00ffw, %%mm6                                                  \n\
+psrlw     $8, %%mm7                                                         \n\
+psllw     $3, %%mm6                                                         \n\
+psllw     $3, %%mm7                                                         \n\
+pmulhw    mmx_Y_coeff, %%mm6                                                \n\
+pmulhw    mmx_Y_coeff, %%mm7                                                \n\
+packuswb  %%mm6, %%mm6                                                      \n\
+packuswb  %%mm7, %%mm7                                                      \n\
+punpcklbw %%mm7, %%mm6                                                      \n\
+"
+
+#define MMX_UNPACK_16_GRAY "                                                \n\
+movq      %%mm6, %%mm5                                                      \n\
+pand      mmx_redmask, %%mm6                                                \n\
+pand      mmx_grnmask, %%mm5                                                \n\
+movq      %%mm6, %%mm7                                                      \n\
+psrlw     mmx_blueshift, %%mm7                                              \n\
+pxor      %%mm3, %%mm3                                                      \n\
+movq      %%mm7, %%mm2                                                      \n\
+movq      %%mm5, %%mm0                                                      \n\
+punpcklbw %%mm3, %%mm5                                                      \n\
+punpcklbw %%mm6, %%mm7                                                      \n\
+psllw     mmx_blueshift, %%mm5                                              \n\
+por       %%mm5, %%mm7                                                      \n\
+movq      %%mm7, (%3)                                                       \n\
+punpckhbw %%mm3, %%mm0                                                      \n\
+punpckhbw %%mm6, %%mm2                                                      \n\
+psllw     mmx_blueshift, %%mm0                                              \n\
+movq      8(%0), %%mm6                                                      \n\
+por       %%mm0, %%mm2                                                      \n\
+movq      %%mm2, 8(%3)                                                      \n\
+"
+
+
+/*
+ * convert RGB plane to RGB 16 bits,
+ * mm0 -> B, mm1 -> R, mm2 -> G,
+ * mm4 -> GB, mm5 -> AR pixel 4-7,
+ * mm6 -> GB, mm7 -> AR pixel 0-3
+ */
+
+#define MMX_UNPACK_16 "                                                     \n\
+# mask unneeded bits off                                                    \n\
+pand      mmx_redmask, %%mm0    # b7b6b5b4 b3______ b7b6b5b4 b3______       \n\
+pand      mmx_grnmask, %%mm2    # g7g6g5g4 g3g2____ g7g6g5g4 g3g2____       \n\
+pand      mmx_redmask, %%mm1    # r7r6r5r4 r3______ r7r6r5r4 r3______       \n\
+psrlw     mmx_blueshift,%%mm0   # ______b7 b6b5b4b3 ______b7 b6b5b4b3       \n\
+pxor      %%mm4, %%mm4          # zero mm4                                  \n\
+movq      %%mm0, %%mm5          # Copy B7-B0                                \n\
+movq      %%mm2, %%mm7          # Copy G7-G0                                \n\
+                                                                            \n\
+# convert rgb24 plane to rgb16 pack for pixel 0-3                           \n\
+punpcklbw %%mm4, %%mm2          # ________ ________ g7g6g5g4 g3g2____       \n\
+punpcklbw %%mm1, %%mm0          # r7r6r5r4 r3______ ______b7 b6b5b4b3       \n\
+psllw     mmx_blueshift,%%mm2   # ________ __g7g6g5 g4g3g2__ ________       \n\
+por       %%mm2, %%mm0          # r7r6r5r4 r3g7g6g5 g4g3g2b7 b6b5b4b3       \n\
+movq      8(%0), %%mm6          # Load 8 Y        Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0   \n\
+movq      %%mm0, (%3)           # store pixel 0-3                           \n\
+                                                                            \n\
+# convert rgb24 plane to rgb16 pack for pixel 0-3                           \n\
+punpckhbw %%mm4, %%mm7          # ________ ________ g7g6g5g4 g3g2____       \n\
+punpckhbw %%mm1, %%mm5          # r7r6r5r4 r3______ ______b7 b6b5b4b3       \n\
+psllw     mmx_blueshift,%%mm7   # ________ __g7g6g5 g4g3g2__ ________       \n\
+movd      4(%1), %%mm0          # Load 4 Cb       __ __ __ __ u3 u2 u1 u0   \n\
+por       %%mm7, %%mm5          # r7r6r5r4 r3g7g6g5 g4g3g2b7 b6b5b4b3       \n\
+movd      4(%2), %%mm1          # Load 4 Cr       __ __ __ __ v3 v2 v1 v0   \n\
+movq      %%mm5, 8(%3)          # store pixel 4-7                           \n\
+"
+
+/*
+ * convert RGB plane to RGB packed format,
+ * mm0 -> B, mm1 -> R, mm2 -> G, mm3 -> 0,
+ * mm4 -> GB, mm5 -> AR pixel 4-7,
+ * mm6 -> GB, mm7 -> AR pixel 0-3
+ */
+
+#define MMX_UNPACK_32 "                                                     \n\
+pxor      %%mm3, %%mm3  # zero mm3                                          \n\
+movq      %%mm0, %%mm6  #                 B7 B6 B5 B4 B3 B2 B1 B0           \n\
+movq      %%mm1, %%mm7  #                 R7 R6 R5 R4 R3 R2 R1 R0           \n\
+movq      %%mm0, %%mm4  #                 B7 B6 B5 B4 B3 B2 B1 B0           \n\
+movq      %%mm1, %%mm5  #                 R7 R6 R5 R4 R3 R2 R1 R0           \n\
+punpcklbw %%mm2, %%mm6  #                 G3 B3 G2 B2 G1 B1 G0 B0           \n\
+punpcklbw %%mm3, %%mm7  #                 00 R3 00 R2 00 R1 00 R0           \n\
+punpcklwd %%mm7, %%mm6  #                 00 R1 B1 G1 00 R0 B0 G0           \n\
+movq      %%mm6, (%3)   # Store ARGB1 ARGB0                                 \n\
+movq      %%mm0, %%mm6  #                 B7 B6 B5 B4 B3 B2 B1 B0           \n\
+punpcklbw %%mm2, %%mm6  #                 G3 B3 G2 B2 G1 B1 G0 B0           \n\
+punpckhwd %%mm7, %%mm6  #                 00 R3 G3 B3 00 R2 B3 G2           \n\
+movq      %%mm6, 8(%3)  # Store ARGB3 ARGB2                                 \n\
+punpckhbw %%mm2, %%mm4  #                 G7 B7 G6 B6 G5 B5 G4 B4           \n\
+punpckhbw %%mm3, %%mm5  #                 00 R7 00 R6 00 R5 00 R4           \n\
+punpcklwd %%mm5, %%mm4  #                 00 R5 B5 G5 00 R4 B4 G4           \n\
+movq      %%mm4, 16(%3) # Store ARGB5 ARGB4                                 \n\
+movq      %%mm0, %%mm4  #                 B7 B6 B5 B4 B3 B2 B1 B0           \n\
+punpckhbw %%mm2, %%mm4  #                 G7 B7 G6 B6 G5 B5 G4 B4           \n\
+punpckhwd %%mm5, %%mm4  #                 00 R7 G7 B7 00 R6 B6 G6           \n\
+movq      %%mm4, 24(%3) # Store ARGB7 ARGB6                                 \n\
+                                                                            \n\
+#movd      4(%1), %%mm0  # Load 4 Cb       00 00 00 00 u3 u2 u1 u0           \n\
+#movd      4(%2), %%mm1  # Load 4 Cr       00 00 00 00 v3 v2 v1 v0           \n\
+#pxor      %%mm4, %%mm4  # zero mm4                                          \n\
+#movq      8(%0), %%mm6  # Load 8 Y        Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0           \n\
+"
+
diff --git a/plugins/chroma/i420_yuy2.c b/plugins/chroma/i420_yuy2.c
new file mode 100644 (file)
index 0000000..9ae01d3
--- /dev/null
@@ -0,0 +1,458 @@
+/*****************************************************************************
+ * i420_yuy2.c : YUV to YUV conversion module for vlc
+ *****************************************************************************
+ * Copyright (C) 2000, 2001 VideoLAN
+ * $Id: i420_yuy2.c,v 1.1 2002/01/04 14:01:34 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <math.h>                                            /* exp(), pow() */
+#include <errno.h>                                                 /* ENOMEM */
+#include <string.h>                                            /* strerror() */
+#include <stdlib.h>                                      /* malloc(), free() */
+
+#include <videolan/vlc.h>
+
+#include "video.h"
+#include "video_output.h"
+
+#include "i420_yuy2.h"
+
+#define SRC_FOURCC  "I420/IYUV/YV12"
+
+#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
+#    define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv/Y211"
+#else
+#    define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv"
+#endif
+
+/*****************************************************************************
+ * Local and extern prototypes.
+ *****************************************************************************/
+static void chroma_getfunctions ( function_list_t * p_function_list );
+
+static int  chroma_Probe        ( probedata_t *p_data );
+static int  chroma_Init         ( vout_thread_t *p_vout );
+static void chroma_End          ( vout_thread_t *p_vout );
+
+static void I420_YUY2           ( vout_thread_t *, picture_t *, picture_t * );
+static void I420_YVYU           ( vout_thread_t *, picture_t *, picture_t * );
+static void I420_UYVY           ( vout_thread_t *, picture_t *, picture_t * );
+static void I420_IUYV           ( vout_thread_t *, picture_t *, picture_t * );
+static void I420_cyuv           ( vout_thread_t *, picture_t *, picture_t * );
+#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
+static void I420_Y211           ( vout_thread_t *, picture_t *, picture_t * );
+#endif
+
+/*****************************************************************************
+ * Build configuration tree.
+ *****************************************************************************/
+MODULE_CONFIG_START
+MODULE_CONFIG_STOP
+
+MODULE_INIT_START
+#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
+    SET_DESCRIPTION( "conversions from " SRC_FOURCC " to " DEST_FOURCC )
+    ADD_CAPABILITY( CHROMA, 80 )
+#elif defined (MODULE_NAME_IS_chroma_i420_yuy2_mmx)
+    SET_DESCRIPTION( "MMX conversions from " SRC_FOURCC " to " DEST_FOURCC )
+    ADD_CAPABILITY( CHROMA, 100 )
+    ADD_REQUIREMENT( MMX )
+#endif
+MODULE_INIT_STOP
+
+MODULE_ACTIVATE_START
+    chroma_getfunctions( &p_module->p_functions->chroma );
+MODULE_ACTIVATE_STOP
+
+MODULE_DEACTIVATE_START
+MODULE_DEACTIVATE_STOP
+
+/*****************************************************************************
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+static void chroma_getfunctions( function_list_t * p_function_list )
+{
+    p_function_list->pf_probe = chroma_Probe;
+    p_function_list->functions.chroma.pf_init = chroma_Init;
+    p_function_list->functions.chroma.pf_end  = chroma_End;
+}
+
+/*****************************************************************************
+ * chroma_Probe: return a score
+ *****************************************************************************
+ * This function checks that we can handle the required data
+ *****************************************************************************/
+static int chroma_Probe( probedata_t *p_data )
+{
+    if( p_data->chroma.p_render->i_width & 1
+         || p_data->chroma.p_render->i_height & 1 )
+    {
+        return 0;
+    }
+
+    switch( p_data->chroma.p_render->i_chroma )
+    {
+        case FOURCC_YV12:
+        case FOURCC_I420:
+        case FOURCC_IYUV:
+            switch( p_data->chroma.p_output->i_chroma )
+            {
+                case FOURCC_YUY2:
+                case FOURCC_YUNV:
+                    break;
+
+                case FOURCC_YVYU:
+                    break;
+
+                case FOURCC_UYVY:
+                case FOURCC_UYNV:
+                case FOURCC_Y422:
+                    break;
+
+                case FOURCC_IUYV:
+                    break;
+
+                case FOURCC_cyuv:
+                    break;
+
+#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
+                case FOURCC_Y211:
+                    break;
+#endif
+
+                default:
+                    return 0;
+            }
+            break;
+
+        default:
+            return 0;
+    }
+
+    return 100;
+}
+
+/*****************************************************************************
+ * chroma_Init: allocate a chroma function
+ *****************************************************************************
+ * This function allocates and initializes a chroma function
+ *****************************************************************************/
+static int chroma_Init( vout_thread_t *p_vout )
+{
+    if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
+    {
+        return -1;
+    }
+
+    switch( p_vout->render.i_chroma )
+    {
+        case FOURCC_YV12:
+        case FOURCC_I420:
+        case FOURCC_IYUV:
+            switch( p_vout->output.i_chroma )
+            {
+                case FOURCC_YUY2:
+                case FOURCC_YUNV:
+                    p_vout->chroma.pf_convert = I420_YUY2;
+                    break;
+
+                case FOURCC_YVYU:
+                    p_vout->chroma.pf_convert = I420_YVYU;
+                    break;
+
+                case FOURCC_UYVY:
+                case FOURCC_UYNV:
+                case FOURCC_Y422:
+                    p_vout->chroma.pf_convert = I420_UYVY;
+                    break;
+
+                case FOURCC_IUYV:
+                    p_vout->chroma.pf_convert = I420_IUYV;
+                    break;
+
+                case FOURCC_cyuv:
+                    p_vout->chroma.pf_convert = I420_cyuv;
+                    break;
+
+#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
+                case FOURCC_Y211:
+                    p_vout->chroma.pf_convert = I420_Y211;
+                    break;
+#endif
+
+                default:
+                    return -1;
+            }
+            break;
+
+        default:
+            return -1;
+    }
+    
+    return 0; 
+}
+
+/*****************************************************************************
+ * chroma_End: free the chroma function
+ *****************************************************************************
+ * This function frees the previously allocated chroma function
+ *****************************************************************************/
+static void chroma_End( vout_thread_t *p_vout )
+{
+    ;
+}
+
+/* Following functions are local */
+
+/*****************************************************************************
+ * I420_YUY2: planar YUV 4:2:0 to packed YUYV 4:2:2
+ *****************************************************************************/
+static void I420_YUY2( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    u8 *p_line1, *p_line2 = p_dest->p->p_pixels;
+    u8 *p_y1, *p_y2 = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS;
+    u8 *p_v = p_source->V_PIXELS;
+
+    int i_x, i_y;
+
+    for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
+    {
+        p_line1 = p_line2;
+        p_line2 += p_dest->p->i_pitch;
+
+        p_y1 = p_y2;
+        p_y2 += p_source->p[Y_PLANE].i_pitch;
+
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
+#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
+            C_YUV420_YUYV( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_YUYV( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_YUYV( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_YUYV( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+#else
+            __asm__( ".align 8" MMX_YUV420_YUYV
+                     : : "r" (p_line1), "r" (p_line2),
+                         "r" (p_y1), "r" (p_y2), "r" (p_u), "r" (p_v) ); 
+
+            p_line1 += 8; p_line2 += 8;
+            p_y1 += 4; p_y2 += 4; p_u += 2; p_v += 2;
+
+            __asm__( ".align 8" MMX_YUV420_YUYV
+                     : : "r" (p_line1), "r" (p_line2),
+                         "r" (p_y1), "r" (p_y2), "r" (p_u), "r" (p_v) ); 
+
+            p_line1 += 8; p_line2 += 8;
+            p_y1 += 4; p_y2 += 4; p_u += 2; p_v += 2;
+#endif
+        }
+    }
+}
+
+/*****************************************************************************
+ * I420_YVYU: planar YUV 4:2:0 to packed YVYU 4:2:2
+ *****************************************************************************/
+static void I420_YVYU( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    u8 *p_line1, *p_line2 = p_dest->p->p_pixels;
+    u8 *p_y1, *p_y2 = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS;
+    u8 *p_v = p_source->V_PIXELS;
+
+    int i_x, i_y;
+
+    for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
+    {
+        p_line1 = p_line2;
+        p_line2 += p_dest->p->i_pitch;
+
+        p_y1 = p_y2;
+        p_y2 += p_source->p[Y_PLANE].i_pitch;
+
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
+#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
+            C_YUV420_YVYU( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_YVYU( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_YVYU( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_YVYU( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+#else
+            __asm__( ".align 8" MMX_YUV420_YVYU
+                     : : "r" (p_line1), "r" (p_line2),
+                         "r" (p_y1), "r" (p_y2), "r" (p_u), "r" (p_v) ); 
+
+            p_line1 += 8; p_line2 += 8;
+            p_y1 += 4; p_y2 += 4; p_u += 2; p_v += 2;
+
+            __asm__( ".align 8" MMX_YUV420_YVYU
+                     : : "r" (p_line1), "r" (p_line2),
+                         "r" (p_y1), "r" (p_y2), "r" (p_u), "r" (p_v) ); 
+
+            p_line1 += 8; p_line2 += 8;
+            p_y1 += 4; p_y2 += 4; p_u += 2; p_v += 2;
+#endif
+        }
+    }
+}
+
+/*****************************************************************************
+ * I420_UYVY: planar YUV 4:2:0 to packed UYVY 4:2:2
+ *****************************************************************************/
+static void I420_UYVY( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    u8 *p_line1, *p_line2 = p_dest->p->p_pixels;
+    u8 *p_y1, *p_y2 = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS;
+    u8 *p_v = p_source->V_PIXELS;
+
+    int i_x, i_y;
+
+    for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
+    {
+        p_line1 = p_line2;
+        p_line2 += p_dest->p->i_pitch;
+
+        p_y1 = p_y2;
+        p_y2 += p_source->p[Y_PLANE].i_pitch;
+
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
+#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
+            C_YUV420_UYVY( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_UYVY( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_UYVY( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_UYVY( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+#else
+            __asm__( ".align 8" MMX_YUV420_UYVY
+                     : : "r" (p_line1), "r" (p_line2),
+                         "r" (p_y1), "r" (p_y2), "r" (p_u), "r" (p_v) ); 
+
+            p_line1 += 8; p_line2 += 8;
+            p_y1 += 4; p_y2 += 4; p_u += 2; p_v += 2;
+
+            __asm__( ".align 8" MMX_YUV420_UYVY
+                     : : "r" (p_line1), "r" (p_line2),
+                         "r" (p_y1), "r" (p_y2), "r" (p_u), "r" (p_v) ); 
+
+            p_line1 += 8; p_line2 += 8;
+            p_y1 += 4; p_y2 += 4; p_u += 2; p_v += 2;
+#endif
+        }
+    }
+}
+
+/*****************************************************************************
+ * I420_IUYV: planar YUV 4:2:0 to interleaved packed UYVY 4:2:2
+ *****************************************************************************/
+static void I420_IUYV( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    /* FIXME: TODO ! */
+    intf_ErrMsg( "chroma error: I420_IUYV unimplemented, "
+                 "please harass <sam@zoy.org>" );
+}
+
+/*****************************************************************************
+ * I420_cyuv: planar YUV 4:2:0 to upside-down packed UYVY 4:2:2
+ *****************************************************************************/
+static void I420_cyuv( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    u8 *p_line1 = p_dest->p->p_pixels + p_dest->p->i_lines * p_dest->p->i_pitch
+                                      + p_dest->p->i_pitch;
+    u8 *p_line2 = p_dest->p->p_pixels + p_dest->p->i_lines * p_dest->p->i_pitch;
+    u8 *p_y1, *p_y2 = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS;
+    u8 *p_v = p_source->V_PIXELS;
+
+    int i_x, i_y;
+
+    for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
+    {
+        p_line1 -= 3 * p_dest->p->i_pitch;
+        p_line2 -= 3 * p_dest->p->i_pitch;
+
+        p_y1 = p_y2;
+        p_y2 += p_source->p[Y_PLANE].i_pitch;
+
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
+#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
+            C_YUV420_UYVY( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_UYVY( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_UYVY( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_UYVY( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+#else
+            __asm__( ".align 8" MMX_YUV420_UYVY
+                     : : "r" (p_line1), "r" (p_line2),
+                         "r" (p_y1), "r" (p_y2), "r" (p_u), "r" (p_v) ); 
+
+            p_line1 += 8; p_line2 += 8;
+            p_y1 += 4; p_y2 += 4; p_u += 2; p_v += 2;
+
+            __asm__( ".align 8" MMX_YUV420_UYVY
+                     : : "r" (p_line1), "r" (p_line2),
+                         "r" (p_y1), "r" (p_y2), "r" (p_u), "r" (p_v) ); 
+
+            p_line1 += 8; p_line2 += 8;
+            p_y1 += 4; p_y2 += 4; p_u += 2; p_v += 2;
+#endif
+        }
+    }
+}
+
+/*****************************************************************************
+ * I420_Y211: planar YUV 4:2:0 to packed YUYV 2:1:1
+ *****************************************************************************/
+#if defined (MODULE_NAME_IS_chroma_i420_yuy2)
+static void I420_Y211( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    u8 *p_line1, *p_line2 = p_dest->p->p_pixels;
+    u8 *p_y1, *p_y2 = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS;
+    u8 *p_v = p_source->V_PIXELS;
+
+    int i_x, i_y;
+
+    for( i_y = p_vout->render.i_height / 2 ; i_y-- ; )
+    {
+        p_line1 = p_line2;
+        p_line2 += p_dest->p->i_pitch;
+
+        p_y1 = p_y2;
+        p_y2 += p_source->p[Y_PLANE].i_pitch;
+
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
+            C_YUV420_Y211( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+            C_YUV420_Y211( p_line1, p_line2, p_y1, p_y2, p_u, p_v );
+        }
+    }
+}
+#endif
+
diff --git a/plugins/chroma/i420_yuy2.h b/plugins/chroma/i420_yuy2.h
new file mode 100644 (file)
index 0000000..7daecdb
--- /dev/null
@@ -0,0 +1,137 @@
+/*****************************************************************************
+ * i420_yuy2.h : YUV to YUV conversion module for vlc
+ *****************************************************************************
+ * Copyright (C) 2000, 2001 VideoLAN
+ * $Id: i420_yuy2.h,v 1.1 2002/01/04 14:01:34 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifdef MODULE_NAME_IS_chroma_i420_yuy2_mmx
+
+#define UNUSED_LONGLONG(foo) \
+    unsigned long long foo __asm__ (#foo) __attribute__((unused))
+UNUSED_LONGLONG(woo_00ffw) = 0x00ff00ff00ff00ff;
+UNUSED_LONGLONG(woo_80w)   = 0x0000000080808080;
+
+#define MMX_YUV420_YUYV "                                                 \n\
+movq       (%2), %%mm0  # Load 8 Y            y7 y6 y5 y4 y3 y2 y1 y0     \n\
+movd       (%4), %%mm1  # Load 4 Cb           00 00 00 00 u3 u2 u1 u0     \n\
+movd       (%5), %%mm2  # Load 4 Cr           00 00 00 00 v3 v2 v1 v0     \n\
+punpcklbw %%mm2, %%mm1  #                     v3 u3 v2 u2 v1 u1 v0 u0     \n\
+movq      %%mm0, %%mm2  #                     y7 y6 y5 y4 y3 y2 y1 y0     \n\
+punpcklbw %%mm1, %%mm2  #                     v1 y3 u1 y2 v0 y1 u0 y0     \n\
+movq      %%mm2, (%0)   # Store low YUYV                                  \n\
+punpckhbw %%mm1, %%mm0  #                     v3 y7 u3 y6 v2 y5 u2 y4     \n\
+movq      %%mm0, 8(%0)  # Store high YUYV                                 \n\
+movq       (%3), %%mm0  # Load 8 Y            Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0     \n\
+movq      %%mm0, %%mm2  #                     Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0     \n\
+punpcklbw %%mm1, %%mm2  #                     v1 Y3 u1 Y2 v0 Y1 u0 Y0     \n\
+movq      %%mm2, (%1)   # Store low YUYV                                  \n\
+punpckhbw %%mm1, %%mm0  #                     v3 Y7 u3 Y6 v2 Y5 u2 Y4     \n\
+movq      %%mm0, 8(%1)  # Store high YUYV                                 \n\
+"
+
+#define MMX_YUV420_YVYU "                                                 \n\
+movq       (%2), %%mm0  # Load 8 Y            y7 y6 y5 y4 y3 y2 y1 y0     \n\
+movd       (%4), %%mm2  # Load 4 Cb           00 00 00 00 u3 u2 u1 u0     \n\
+movd       (%5), %%mm1  # Load 4 Cr           00 00 00 00 v3 v2 v1 v0     \n\
+punpcklbw %%mm2, %%mm1  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
+movq      %%mm0, %%mm2  #                     y7 y6 y5 y4 y3 y2 y1 y0     \n\
+punpcklbw %%mm1, %%mm2  #                     u1 y3 v1 y2 u0 y1 v0 y0     \n\
+movq      %%mm2, (%0)   # Store low YUYV                                  \n\
+punpckhbw %%mm1, %%mm0  #                     u3 y7 v3 y6 u2 y5 v2 y4     \n\
+movq      %%mm0, 8(%0)  # Store high YUYV                                 \n\
+movq       (%3), %%mm0  # Load 8 Y            Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0     \n\
+movq      %%mm0, %%mm2  #                     Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0     \n\
+punpcklbw %%mm1, %%mm2  #                     u1 Y3 v1 Y2 u0 Y1 v0 Y0     \n\
+movq      %%mm2, (%1)   # Store low YUYV                                  \n\
+punpckhbw %%mm1, %%mm0  #                     u3 Y7 v3 Y6 u2 Y5 v2 Y4     \n\
+movq      %%mm0, 8(%1)  # Store high YUYV                                 \n\
+"
+
+#define MMX_YUV420_UYVY "                                                 \n\
+movq       (%2), %%mm0  # Load 8 Y            y7 y6 y5 y4 y3 y2 y1 y0     \n\
+movq       (%3), %%mm3  # Load 8 Y            Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0     \n\
+movd       (%4), %%mm2  # Load 4 Cb           00 00 00 00 u3 u2 u1 u0     \n\
+movd       (%5), %%mm1  # Load 4 Cr           00 00 00 00 v3 v2 v1 v0     \n\
+punpcklbw %%mm2, %%mm1  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
+movq      %%mm1, %%mm2  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
+punpcklbw %%mm0, %%mm2  #                     y3 v1 y2 u1 y1 v0 y0 u0     \n\
+movq      %%mm2, (%0)   # Store low UYVY                                  \n\
+movq      %%mm1, %%mm2  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
+punpckhbw %%mm0, %%mm2  #                     y3 v1 y2 u1 y1 v0 y0 u0     \n\
+movq      %%mm2, 8(%0)  # Store high UYVY                                 \n\
+movq      %%mm1, %%mm2  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
+punpcklbw %%mm3, %%mm2  #                     Y3 v1 Y2 u1 Y1 v0 Y0 u0     \n\
+movq      %%mm2, (%1)   # Store low UYVY                                  \n\
+punpckhbw %%mm3, %%mm1  #                     Y7 v3 Y6 u3 Y5 v2 Y4 u2     \n\
+movq      %%mm1, 8(%1)  # Store high UYVY                                 \n\
+"
+
+/* FIXME: this code does not work ! Chroma seems to be wrong. */
+#define MMX_YUV420_Y211 "                                                 \n\
+movq       (%2), %%mm0  # Load 8 Y            y7 y6 y5 y4 y3 y2 y1 y0     \n\
+movq       (%3), %%mm1  # Load 8 Y            Y7 Y6 Y5 Y4 Y3 Y2 Y1 Y0     \n\
+movd       (%4), %%mm2  # Load 4 Cb           00 00 00 00 u3 u2 u1 u0     \n\
+movd       (%5), %%mm3  # Load 4 Cr           00 00 00 00 v3 v2 v1 v0     \n\
+pand  woo_00ffw, %%mm0  # get Y even          00 Y6 00 Y4 00 Y2 00 Y0     \n\
+packuswb  %%mm0, %%mm0  # pack Y              y6 y4 y2 y0 y6 y4 y2 y0     \n\
+pand  woo_00ffw, %%mm2  # get U even          00 u6 00 u4 00 u2 00 u0     \n\
+packuswb  %%mm2, %%mm2  # pack U              00 00 u2 u0 00 00 u2 u0     \n\
+pand  woo_00ffw, %%mm3  # get V even          00 v6 00 v4 00 v2 00 v0     \n\
+packuswb  %%mm3, %%mm3  # pack V              00 00 v2 v0 00 00 v2 v0     \n\
+punpcklbw %%mm3, %%mm2  #                     00 00 00 00 v2 u2 v0 u0     \n\
+psubsw  woo_80w, %%mm2  # U,V -= 128                                      \n\
+punpcklbw %%mm2, %%mm0  #                     v2 y6 u2 y4 v0 y2 u0 y0     \n\
+movq      %%mm0, (%0)   # Store YUYV                                      \n\
+pand  woo_00ffw, %%mm1  # get Y even          00 Y6 00 Y4 00 Y2 00 Y0     \n\
+packuswb  %%mm1, %%mm1  # pack Y              Y6 Y4 Y2 Y0 Y6 Y4 Y2 Y0     \n\
+punpcklbw %%mm2, %%mm1  #                     v2 Y6 u2 Y4 v0 Y2 u0 Y0     \n\
+movq      %%mm1, (%1)   # Store YUYV                                      \n\
+"
+
+#else
+
+#define C_YUV420_YUYV( p_line1, p_line2, p_y1, p_y2, p_u, p_v )             \
+    *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
+    *(p_line1)++ =            *(p_line2)++ = *(p_u)++;                      \
+    *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
+    *(p_line1)++ =            *(p_line2)++ = *(p_v)++;                      \
+
+#define C_YUV420_YVYU( p_line1, p_line2, p_y1, p_y2, p_u, p_v )             \
+    *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
+    *(p_line1)++ =            *(p_line2)++ = *(p_v)++;                      \
+    *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
+    *(p_line1)++ =            *(p_line2)++ = *(p_u)++;                      \
+
+#define C_YUV420_UYVY( p_line1, p_line2, p_y1, p_y2, p_u, p_v )             \
+    *(p_line1)++ =            *(p_line2)++ = *(p_u)++;                      \
+    *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
+    *(p_line1)++ =            *(p_line2)++ = *(p_v)++;                      \
+    *(p_line1)++ = *(p_y1)++; *(p_line2)++ = *(p_y2)++;                     \
+
+#define C_YUV420_Y211( p_line1, p_line2, p_y1, p_y2, p_u, p_v )             \
+    *(p_line1)++ = *(p_y1); ((u16*)p_y1)++;                                 \
+    *(p_line2)++ = *(p_y2); ((u16*)p_y2)++;                                 \
+    *(p_line1)++ = *(p_line2)++ = *(p_u) - 0x80; ((u16*)p_u)++;             \
+    *(p_line1)++ = *(p_y1); ((u16*)p_y1)++;                                 \
+    *(p_line2)++ = *(p_y2); ((u16*)p_y2)++;                                 \
+    *(p_line1)++ = *(p_line2)++ = *(p_v) - 0x80; ((u16*)p_v)++;             \
+
+#endif
+
diff --git a/plugins/chroma/i422_yuy2.c b/plugins/chroma/i422_yuy2.c
new file mode 100644 (file)
index 0000000..cf7676a
--- /dev/null
@@ -0,0 +1,407 @@
+/*****************************************************************************
+ * i422_yuy2.c : YUV to YUV conversion module for vlc
+ *****************************************************************************
+ * Copyright (C) 2000, 2001 VideoLAN
+ * $Id: i422_yuy2.c,v 1.1 2002/01/04 14:01:34 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include <math.h>                                            /* exp(), pow() */
+#include <errno.h>                                                 /* ENOMEM */
+#include <string.h>                                            /* strerror() */
+#include <stdlib.h>                                      /* malloc(), free() */
+
+#include <videolan/vlc.h>
+
+#include "video.h"
+#include "video_output.h"
+
+#include "i422_yuy2.h"
+
+#define SRC_FOURCC  "I422"
+#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
+#    define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv/Y211"
+#else
+#    define DEST_FOURCC "YUY2/YUNV/YVYU/UYVY/UYNV/Y422/IUYV/cyuv"
+#endif
+
+/*****************************************************************************
+ * Local and extern prototypes.
+ *****************************************************************************/
+static void chroma_getfunctions ( function_list_t * p_function_list );
+
+static int  chroma_Probe        ( probedata_t *p_data );
+static int  chroma_Init         ( vout_thread_t *p_vout );
+static void chroma_End          ( vout_thread_t *p_vout );
+
+static void I422_YUY2           ( vout_thread_t *, picture_t *, picture_t * );
+static void I422_YVYU           ( vout_thread_t *, picture_t *, picture_t * );
+static void I422_UYVY           ( vout_thread_t *, picture_t *, picture_t * );
+static void I422_IUYV           ( vout_thread_t *, picture_t *, picture_t * );
+static void I422_cyuv           ( vout_thread_t *, picture_t *, picture_t * );
+#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
+static void I422_Y211           ( vout_thread_t *, picture_t *, picture_t * );
+#endif
+
+/*****************************************************************************
+ * Build configuration tree.
+ *****************************************************************************/
+MODULE_CONFIG_START
+MODULE_CONFIG_STOP
+
+MODULE_INIT_START
+#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
+    SET_DESCRIPTION( "conversions from " SRC_FOURCC " to " DEST_FOURCC )
+    ADD_CAPABILITY( CHROMA, 80 )
+#elif defined (MODULE_NAME_IS_chroma_i422_yuy2_mmx)
+    SET_DESCRIPTION( "MMX conversions from " SRC_FOURCC " to " DEST_FOURCC )
+    ADD_CAPABILITY( CHROMA, 100 )
+    ADD_REQUIREMENT( MMX )
+#endif
+MODULE_INIT_STOP
+
+MODULE_ACTIVATE_START
+    chroma_getfunctions( &p_module->p_functions->chroma );
+MODULE_ACTIVATE_STOP
+
+MODULE_DEACTIVATE_START
+MODULE_DEACTIVATE_STOP
+
+/*****************************************************************************
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+static void chroma_getfunctions( function_list_t * p_function_list )
+{
+    p_function_list->pf_probe = chroma_Probe;
+    p_function_list->functions.chroma.pf_init = chroma_Init;
+    p_function_list->functions.chroma.pf_end  = chroma_End;
+}
+
+/*****************************************************************************
+ * chroma_Probe: return a score
+ *****************************************************************************
+ * This function checks that we can handle the required data
+ *****************************************************************************/
+static int chroma_Probe( probedata_t *p_data )
+{
+    if( p_data->chroma.p_render->i_width & 1
+         || p_data->chroma.p_render->i_height & 1 )
+    {
+        return 0;
+    }
+
+    switch( p_data->chroma.p_render->i_chroma )
+    {
+        case FOURCC_I422:
+            switch( p_data->chroma.p_output->i_chroma )
+            {
+                case FOURCC_YUY2:
+                case FOURCC_YUNV:
+                    break;
+
+                case FOURCC_YVYU:
+                    break;
+
+                case FOURCC_UYVY:
+                case FOURCC_UYNV:
+                case FOURCC_Y422:
+                    break;
+
+                case FOURCC_IUYV:
+                    break;
+
+                case FOURCC_cyuv:
+                    break;
+
+#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
+                case FOURCC_Y211:
+                    break;
+#endif
+
+                default:
+                    return 0;
+            }
+            break;
+
+        default:
+            return 0;
+    }
+
+    return 100;
+}
+
+/*****************************************************************************
+ * chroma_Init: allocate a chroma function
+ *****************************************************************************
+ * This function allocates and initializes a chroma function
+ *****************************************************************************/
+static int chroma_Init( vout_thread_t *p_vout )
+{
+    if( p_vout->render.i_width & 1 || p_vout->render.i_height & 1 )
+    {
+        return -1;
+    }
+
+    switch( p_vout->render.i_chroma )
+    {
+        case FOURCC_I422:
+            switch( p_vout->output.i_chroma )
+            {
+                case FOURCC_YUY2:
+                case FOURCC_YUNV:
+                    p_vout->chroma.pf_convert = I422_YUY2;
+                    break;
+
+                case FOURCC_YVYU:
+                    p_vout->chroma.pf_convert = I422_YVYU;
+                    break;
+
+                case FOURCC_UYVY:
+                case FOURCC_UYNV:
+                case FOURCC_Y422:
+                    p_vout->chroma.pf_convert = I422_UYVY;
+                    break;
+
+                case FOURCC_IUYV:
+                    p_vout->chroma.pf_convert = I422_IUYV;
+                    break;
+
+                case FOURCC_cyuv:
+                    p_vout->chroma.pf_convert = I422_cyuv;
+                    break;
+
+#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
+                case FOURCC_Y211:
+                    p_vout->chroma.pf_convert = I422_Y211;
+                    break;
+#endif
+
+                default:
+                    return -1;
+            }
+            break;
+
+        default:
+            return -1;
+    }
+    
+    return 0; 
+}
+
+/*****************************************************************************
+ * chroma_End: free the chroma function
+ *****************************************************************************
+ * This function frees the previously allocated chroma function
+ *****************************************************************************/
+static void chroma_End( vout_thread_t *p_vout )
+{
+    ;
+}
+
+/* Following functions are local */
+
+/*****************************************************************************
+ * I422_YUY2: planar YUV 4:2:2 to packed YUY2 4:2:2
+ *****************************************************************************/
+static void I422_YUY2( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    u8 *p_line = p_dest->p->p_pixels;
+    u8 *p_y = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS;
+    u8 *p_v = p_source->V_PIXELS;
+
+    int i_x, i_y;
+
+    for( i_y = p_vout->render.i_height ; i_y-- ; )
+    {
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
+#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
+            C_YUV422_YUYV( p_line, p_y, p_u, p_v );
+            C_YUV422_YUYV( p_line, p_y, p_u, p_v );
+            C_YUV422_YUYV( p_line, p_y, p_u, p_v );
+            C_YUV422_YUYV( p_line, p_y, p_u, p_v );
+#else
+            __asm__( ".align 8" MMX_YUV422_YUYV
+                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) ); 
+
+            p_line += 8; p_y += 4; p_u += 2; p_v += 2;
+
+            __asm__( ".align 8" MMX_YUV422_YUYV
+                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) ); 
+
+            p_line += 8; p_y += 4; p_u += 2; p_v += 2;
+#endif
+        }
+    }
+}
+
+/*****************************************************************************
+ * I422_YVYU: planar YUV 4:2:2 to packed YVYU 4:2:2
+ *****************************************************************************/
+static void I422_YVYU( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    u8 *p_line = p_dest->p->p_pixels;
+    u8 *p_y = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS;
+    u8 *p_v = p_source->V_PIXELS;
+
+    int i_x, i_y;
+
+    for( i_y = p_vout->render.i_height ; i_y-- ; )
+    {
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
+#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
+            C_YUV422_YVYU( p_line, p_y, p_u, p_v );
+            C_YUV422_YVYU( p_line, p_y, p_u, p_v );
+            C_YUV422_YVYU( p_line, p_y, p_u, p_v );
+            C_YUV422_YVYU( p_line, p_y, p_u, p_v );
+#else
+            __asm__( ".align 8" MMX_YUV422_YVYU
+                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) ); 
+
+            p_line += 8; p_y += 4; p_u += 2; p_v += 2;
+
+            __asm__( ".align 8" MMX_YUV422_YVYU
+                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) ); 
+
+            p_line += 8; p_y += 4; p_u += 2; p_v += 2;
+#endif
+        }
+    }
+}
+
+/*****************************************************************************
+ * I422_UYVY: planar YUV 4:2:2 to packed UYVY 4:2:2
+ *****************************************************************************/
+static void I422_UYVY( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    u8 *p_line = p_dest->p->p_pixels;
+    u8 *p_y = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS;
+    u8 *p_v = p_source->V_PIXELS;
+
+    int i_x, i_y;
+
+    for( i_y = p_vout->render.i_height ; i_y-- ; )
+    {
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
+#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
+            C_YUV422_UYVY( p_line, p_y, p_u, p_v );
+            C_YUV422_UYVY( p_line, p_y, p_u, p_v );
+            C_YUV422_UYVY( p_line, p_y, p_u, p_v );
+            C_YUV422_UYVY( p_line, p_y, p_u, p_v );
+#else
+            __asm__( ".align 8" MMX_YUV422_UYVY
+                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) ); 
+
+            p_line += 8; p_y += 4; p_u += 2; p_v += 2;
+
+            __asm__( ".align 8" MMX_YUV422_UYVY
+                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) ); 
+
+            p_line += 8; p_y += 4; p_u += 2; p_v += 2;
+#endif
+        }
+    }
+}
+
+/*****************************************************************************
+ * I422_IUYV: planar YUV 4:2:2 to interleaved packed IUYV 4:2:2
+ *****************************************************************************/
+static void I422_IUYV( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    /* FIXME: TODO ! */
+    intf_ErrMsg( "chroma error: I422_IUYV unimplemented, "
+                 "please harass <sam@zoy.org>" );
+}
+
+/*****************************************************************************
+ * I422_cyuv: planar YUV 4:2:2 to upside-down packed UYVY 4:2:2
+ *****************************************************************************/
+static void I422_cyuv( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    u8 *p_line = p_dest->p->p_pixels + p_dest->p->i_lines * p_dest->p->i_pitch;
+    u8 *p_y = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS;
+    u8 *p_v = p_source->V_PIXELS;
+
+    int i_x, i_y;
+
+    for( i_y = p_vout->render.i_height ; i_y-- ; )
+    {
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
+            p_line -= 2 * p_dest->p->i_pitch;
+
+#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
+            C_YUV422_UYVY( p_line, p_y, p_u, p_v );
+            C_YUV422_UYVY( p_line, p_y, p_u, p_v );
+            C_YUV422_UYVY( p_line, p_y, p_u, p_v );
+            C_YUV422_UYVY( p_line, p_y, p_u, p_v );
+#else
+            __asm__( ".align 8" MMX_YUV422_UYVY
+                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) ); 
+
+            p_line += 8; p_y += 4; p_u += 2; p_v += 2;
+
+            __asm__( ".align 8" MMX_YUV422_UYVY
+                     : : "r" (p_line), "r" (p_y), "r" (p_u), "r" (p_v) ); 
+
+            p_line += 8; p_y += 4; p_u += 2; p_v += 2;
+#endif
+        }
+    }
+}
+
+/*****************************************************************************
+ * I422_Y211: planar YUV 4:2:2 to packed YUYV 2:1:1
+ *****************************************************************************/
+#if defined (MODULE_NAME_IS_chroma_i422_yuy2)
+static void I422_Y211( vout_thread_t *p_vout, picture_t *p_source,
+                                              picture_t *p_dest )
+{
+    u8 *p_line = p_dest->p->p_pixels + p_dest->p->i_lines * p_dest->p->i_pitch;
+    u8 *p_y = p_source->Y_PIXELS;
+    u8 *p_u = p_source->U_PIXELS;
+    u8 *p_v = p_source->V_PIXELS;
+
+    int i_x, i_y;
+
+    for( i_y = p_vout->render.i_height ; i_y-- ; )
+    {
+        for( i_x = p_vout->render.i_width / 8 ; i_x-- ; )
+        {
+            C_YUV422_Y211( p_line, p_y, p_u, p_v );
+            C_YUV422_Y211( p_line, p_y, p_u, p_v );
+        }
+    }
+}
+#endif
+
diff --git a/plugins/chroma/i422_yuy2.h b/plugins/chroma/i422_yuy2.h
new file mode 100644 (file)
index 0000000..dba548d
--- /dev/null
@@ -0,0 +1,92 @@
+/*****************************************************************************
+ * i422_yuy2.h : YUV to YUV conversion module for vlc
+ *****************************************************************************
+ * Copyright (C) 2002 VideoLAN
+ * $Id: i422_yuy2.h,v 1.1 2002/01/04 14:01:34 sam Exp $
+ *
+ * Authors: Samuel Hocevar <sam@zoy.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#ifdef MODULE_NAME_IS_chroma_i422_yuy2_mmx
+
+#define MMX_YUV422_YUYV "                                                 \n\
+movq       (%1), %%mm0  # Load 8 Y            y7 y6 y5 y4 y3 y2 y1 y0     \n\
+movd       (%2), %%mm1  # Load 4 Cb           00 00 00 00 u3 u2 u1 u0     \n\
+movd       (%3), %%mm2  # Load 4 Cr           00 00 00 00 v3 v2 v1 v0     \n\
+punpcklbw %%mm2, %%mm1  #                     v3 u3 v2 u2 v1 u1 v0 u0     \n\
+movq      %%mm0, %%mm2  #                     y7 y6 y5 y4 y3 y2 y1 y0     \n\
+punpcklbw %%mm1, %%mm2  #                     v1 y3 u1 y2 v0 y1 u0 y0     \n\
+movq      %%mm2, (%0)   # Store low YUYV                                  \n\
+punpckhbw %%mm1, %%mm0  #                     v3 y7 u3 y6 v2 y5 u2 y4     \n\
+movq      %%mm0, 8(%0)  # Store high YUYV                                 \n\
+"
+
+#define MMX_YUV422_YVYU "                                                 \n\
+movq       (%1), %%mm0  # Load 8 Y            y7 y6 y5 y4 y3 y2 y1 y0     \n\
+movd       (%2), %%mm2  # Load 4 Cb           00 00 00 00 u3 u2 u1 u0     \n\
+movd       (%3), %%mm1  # Load 4 Cr           00 00 00 00 v3 v2 v1 v0     \n\
+punpcklbw %%mm2, %%mm1  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
+movq      %%mm0, %%mm2  #                     y7 y6 y5 y4 y3 y2 y1 y0     \n\
+punpcklbw %%mm1, %%mm2  #                     u1 y3 v1 y2 u0 y1 v0 y0     \n\
+movq      %%mm2, (%0)   # Store low YUYV                                  \n\
+punpckhbw %%mm1, %%mm0  #                     u3 y7 v3 y6 u2 y5 v2 y4     \n\
+movq      %%mm0, 8(%0)  # Store high YUYV                                 \n\
+"
+
+#define MMX_YUV422_UYVY "                                                 \n\
+movq       (%1), %%mm0  # Load 8 Y            y7 y6 y5 y4 y3 y2 y1 y0     \n\
+movd       (%2), %%mm2  # Load 4 Cb           00 00 00 00 u3 u2 u1 u0     \n\
+movd       (%3), %%mm1  # Load 4 Cr           00 00 00 00 v3 v2 v1 v0     \n\
+punpcklbw %%mm2, %%mm1  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
+movq      %%mm1, %%mm2  #                     u3 v3 u2 v2 u1 v1 u0 v0     \n\
+punpcklbw %%mm0, %%mm2  #                     y3 v1 y2 u1 y1 v0 y0 u0     \n\
+movq      %%mm2, (%0)   # Store low UYVY                                  \n\
+punpckhbw %%mm0, %%mm1  #                     y7 v3 y6 u3 y5 v2 y4 u2     \n\
+movq      %%mm1, 8(%0)  # Store high UYVY                                 \n\
+"
+
+#define MMX_YUV422_Y211 "                                                 \n\
+"
+
+#else
+
+#define C_YUV422_YUYV( p_line, p_y, p_u, p_v )                              \
+    *(p_line)++ = *(p_y)++;                                                 \
+    *(p_line)++ = *(p_u)++;                                                 \
+    *(p_line)++ = *(p_y)++;                                                 \
+    *(p_line)++ = *(p_v)++;                                                 \
+
+#define C_YUV422_YVYU( p_line, p_y, p_u, p_v )                              \
+    *(p_line)++ = *(p_y)++;                                                 \
+    *(p_line)++ = *(p_v)++;                                                 \
+    *(p_line)++ = *(p_y)++;                                                 \
+    *(p_line)++ = *(p_u)++;                                                 \
+
+#define C_YUV422_UYVY( p_line, p_y, p_u, p_v )                              \
+    *(p_line)++ = *(p_u)++;                                                 \
+    *(p_line)++ = *(p_y)++;                                                 \
+    *(p_line)++ = *(p_v)++;                                                 \
+    *(p_line)++ = *(p_y)++;                                                 \
+
+#define C_YUV422_Y211( p_line, p_y, p_u, p_v )                              \
+    *(p_line)++ = *(p_y); ((u16*)p_y)++;                                    \
+    *(p_line)++ = *(p_u) - 0x80; ((u16*)p_u)++;                             \
+    *(p_line)++ = *(p_y); ((u16*)p_y)++;                                    \
+    *(p_line)++ = *(p_v) - 0x80; ((u16*)p_v)++;                             \
+
+#endif
+
diff --git a/plugins/chroma/yv12_rgb16.c b/plugins/chroma/yv12_rgb16.c
deleted file mode 100644 (file)
index 81dbf56..0000000
+++ /dev/null
@@ -1,262 +0,0 @@
-/*****************************************************************************
- * yv12_rgb16.c : YUV to paletted RGB16 conversion module for vlc
- *****************************************************************************
- * Copyright (C) 2000 VideoLAN
- * $Id: yv12_rgb16.c,v 1.3 2002/01/02 14:37:42 sam Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <math.h>                                            /* exp(), pow() */
-#include <errno.h>                                                 /* ENOMEM */
-#include <string.h>                                            /* strerror() */
-#include <stdlib.h>                                      /* malloc(), free() */
-
-#include <videolan/vlc.h>
-
-#include "video.h"
-#include "video_output.h"
-
-#include "chroma_common.h"
-#include "transforms.h"
-
-/*****************************************************************************
- * chroma_sys_t: chroma method descriptor
- *****************************************************************************
- * This structure is part of the chroma transformation descriptor, it
- * describes the yuv2rgb16 specific properties.
- *****************************************************************************/
-typedef struct chroma_sys_s
-{
-    u8 *p_tables;
-    u8 *p_buffer;
-    u8 *p_offset;
-} chroma_sys_t;
-
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void chroma_getfunctions ( function_list_t * p_function_list );
-
-static int  chroma_Probe        ( probedata_t *p_data );
-static int  chroma_Init         ( vout_thread_t *p_vout );
-static void chroma_End          ( vout_thread_t *p_vout );
-
-static void ConvertYUV420RGB16  ( vout_thread_t *, picture_t *, picture_t * );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
-    SET_DESCRIPTION( "YV12 to RGB16 conversion module" )
-    ADD_CAPABILITY( CHROMA, 80 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
-    _M( chroma_getfunctions )( &p_module->p_functions->chroma );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Local prototypes.
- *****************************************************************************/
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( chroma_getfunctions )( function_list_t * p_function_list )
-{
-    p_function_list->pf_probe = chroma_Probe;
-    p_function_list->functions.chroma.pf_init = chroma_Init;
-    p_function_list->functions.chroma.pf_end  = chroma_End;
-}
-
-/*****************************************************************************
- * chroma_Probe: return a score
- *****************************************************************************
- * This function checks that we can handle the required data
- *****************************************************************************/
-static int chroma_Probe( probedata_t *p_data )
-{
-    switch( p_data->chroma.p_render->i_chroma )
-    {
-        case FOURCC_YV12:
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-            switch( ONLY_FOURCC( p_data->chroma.p_output->i_chroma ) )
-            {
-                case FOURCC_BI_BITFIELDS:
-                    break;
-
-                default:
-                    return 0;
-            }
-            break;
-
-        default:
-            return 0;
-    }
-
-    return 100;
-}
-
-/*****************************************************************************
- * chroma_Init: allocate a chroma function
- *****************************************************************************
- * This function allocates and initializes a chroma function
- *****************************************************************************/
-static int chroma_Init( vout_thread_t *p_vout )
-{
-    switch( p_vout->render.i_chroma )
-    {
-        case FOURCC_YV12:
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-            switch( ONLY_FOURCC( p_vout->output.i_chroma ) )
-            {
-                case FOURCC_BI_BITFIELDS:
-                    switch( ONLY_EXTRA( p_vout->output.i_chroma ) )
-                    {
-                        case DEPTH_16BPP:
-                            p_vout->chroma.pf_convert = ConvertYUV420RGB16;
-                            break;
-
-                        default:
-                            return -1;
-                    }
-                    break;
-
-                default:
-                    return -1;
-            }
-            break;
-
-        default:
-            return -1;
-    }
-    
-#if 0
-    p_vout->chroma.p_sys = malloc( sizeof( chroma_sys_t ) );
-    if( p_vout->chroma.p_sys == NULL )
-    {
-        return -1;
-    }
-#endif
-
-    /* FIXME: this is really suboptimal ! */
-
-    return 0; 
-}
-
-/*****************************************************************************
- * chroma_End: free the chroma function
- *****************************************************************************
- * This function frees the previously allocated chroma function
- *****************************************************************************/
-static void chroma_End( vout_thread_t *p_vout )
-{
-#if 0
-    free( p_vout->chroma.p_sys );
-#endif
-
-    return; 
-}
-
-/* Following functions are local */
-
-/*****************************************************************************
- * ConvertYUV420RGB16: color YUV 4:2:0 to RGB 8 bpp
- *****************************************************************************/
-static void ConvertYUV420RGB16( vout_thread_t *p_vout, picture_t *p_source,
-                                                       picture_t *p_dest )
-{
-    /**********************************************************************
-     *          XXX   XXX    FIXME      FIXME   XXX  XXX    XXX           *
-     *          XXX   XXX   XXX TODO  TODO XXX  XXX  XXX   TODO           *
-     *          XXX   XXX  XXX   XXX  XXX       XXX XXX    XXX            *
-     *          XXX FIXME  XXX FIXME  XXX       FIXME     XXX             *
-     *          XXX   XXX  XXX   XXX  XXX       XXX XXX   XXX             *
-     *          XXX   XXX  XXX   XXX  TODO XXX  XXX  XXX                  *
-     *          XXX   XXX  XXX   XXX    FIXME   XXX  XXX  XXX             *
-     **********************************************************************/
-
-    pixel_data_t *p_in, *p_in_end, *p_out, *p_out_end;
-
-    p_in = p_source->P_Y;
-    p_in_end = p_in + p_source->planes[ Y_PLANE ].i_bytes;
-
-    p_out = p_dest->P_MAIN;
-    p_out_end = p_out + p_dest->planes[ MAIN_PLANE ].i_bytes;
-
-    while( p_in < p_in_end && p_out < p_out_end )
-    {
-        int i_src = p_source->planes[ Y_PLANE ].i_line_bytes;
-        int i_dst = p_dest->planes[ MAIN_PLANE ].i_line_bytes / 2;
-
-        /* Masks: 0xf800 0x07e0 0x001f */
-#define RED ((u16*)p_out)[--i_dst] = (u16)(p_in[--i_src]>>3) << 11;
-#define GREEN ((u16*)p_out)[--i_dst] = (u16)(p_in[--i_src]>>2) << 5;
-#define BLUE ((u16*)p_out)[--i_dst] = (u16)(p_in[--i_src]>>3) << 0;
-#define WHITE ((u16*)p_out)[--i_dst] = ((u16)(p_in[i_src]>>3) << 11) | ((u16)(p_in[i_src]>>2) << 5) | ((u16)(p_in[i_src]>>3) << 0); --i_src;
-#define BLACK ((u16*)p_out)[--i_dst] = 0; --i_src;
-        
-        while( i_src && i_dst )
-        {
-            WHITE; WHITE; WHITE; WHITE; WHITE; WHITE; WHITE; WHITE;
-            //BLACK; BLUE; GREEN; RED; GREEN; BLUE; WHITE; RED;
-        }
-
-        p_in += p_source->planes[ Y_PLANE ].i_line_bytes;
-        p_out += p_dest->planes[ MAIN_PLANE ].i_line_bytes;
-
-        if( p_in >= p_in_end || p_out >= p_out_end )
-        {
-            break;
-        }
-
-        i_src = p_source->planes[ Y_PLANE ].i_line_bytes;
-        i_dst = p_dest->planes[ MAIN_PLANE ].i_line_bytes / 2;
-
-        while( i_src && i_dst )
-        {
-            WHITE; WHITE; WHITE; WHITE; WHITE; WHITE; WHITE; WHITE;
-            //GREEN; RED; WHITE; BLUE; BLACK; RED; GREEN; BLUE;
-        }
-
-        p_in += p_source->planes[ Y_PLANE ].i_line_bytes;
-        p_out += p_dest->planes[ MAIN_PLANE ].i_line_bytes;
-    }
-
-    /**********************************************************************
-     *          XXX   XXX  XXX   XXX    FIXME   XXX  XXX    XXX           *
-     *          XXX   XXX  XXX   XXX  TODO XXX  XXX  XXX   TODO           *
-     *           XXX XXX   XXX   XXX  XXX       XXX XXX    XXX            *
-     *             TODO    XXX   XXX  XXX       FIXME     XXX             *
-     *            TODO     XXX   XXX  XXX       XXX XXX   XXX             *
-     *           XXX       TODO  XXX  TODO XXX  XXX  XXX                  *
-     *          XXX          FIXME      FIXME   XXX  XXX  XXX             *
-     **********************************************************************/
-}
-
diff --git a/plugins/chroma/yv12_rgb8.c b/plugins/chroma/yv12_rgb8.c
deleted file mode 100644 (file)
index 2c04c0e..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-/*****************************************************************************
- * yv12_rgb8.c : YUV to paletted RGB8 conversion module for vlc
- *****************************************************************************
- * Copyright (C) 2000 VideoLAN
- * $Id: yv12_rgb8.c,v 1.4 2002/01/02 14:37:42 sam Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <math.h>                                            /* exp(), pow() */
-#include <errno.h>                                                 /* ENOMEM */
-#include <string.h>                                            /* strerror() */
-#include <stdlib.h>                                      /* malloc(), free() */
-
-#include <videolan/vlc.h>
-
-#include "video.h"
-#include "video_output.h"
-
-#include "chroma_common.h"
-#include "transforms.h"
-
-/*****************************************************************************
- * chroma_sys_t: chroma method descriptor
- *****************************************************************************
- * This structure is part of the chroma transformation descriptor, it
- * describes the yuv2rgb8 specific properties.
- *****************************************************************************/
-typedef struct chroma_sys_s
-{
-    u8 *p_tables;
-    u8 *p_buffer;
-    u8 *p_offset;
-} chroma_sys_t;
-
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void chroma_getfunctions ( function_list_t * p_function_list );
-
-static int  chroma_Probe        ( probedata_t *p_data );
-static int  chroma_Init         ( vout_thread_t *p_vout, probedata_t *p_data );
-static int  chroma_End          ( vout_thread_t *p_vout );
-
-static void ConvertY4Gray8      ( vout_thread_t *, picture_t *, picture_t * );
-static void ConvertYUV420RGB8   ( vout_thread_t *, picture_t *, picture_t * );
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
-    SET_DESCRIPTION( "YV12 to RGB8 conversion module" )
-    ADD_CAPABILITY( CHROMA, 50 )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
-    _M( chroma_getfunctions )( &p_module->p_functions->chroma );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/*****************************************************************************
- * Local prototypes.
- *****************************************************************************/
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-void _M( chroma_getfunctions )( function_list_t * p_function_list )
-{
-    p_function_list->pf_probe = chroma_Probe;
-    p_function_list->functions.chroma.pf_init = chroma_Init;
-    p_function_list->functions.chroma.pf_end  = chroma_End;
-}
-
-/*****************************************************************************
- * chroma_Probe: return a score
- *****************************************************************************
- * This function checks that we can handle the required data
- *****************************************************************************/
-static int chroma_Probe( probedata_t *p_data )
-{
-    if( p_data->chroma.source.i_chroma != YUV_420_PICTURE
-         || p_data->chroma.dest.i_chroma != RGB_8BPP_PICTURE )
-    {
-        return 0;
-    }
-
-    return( 100 );
-}
-
-/*****************************************************************************
- * chroma_Init: allocate a chroma function
- *****************************************************************************
- * This function allocates and initializes a chroma function
- *****************************************************************************/
-static int chroma_Init( vout_thread_t *p_vout, probedata_t *p_data )
-{
-    if( p_data->chroma.source.i_chroma != YUV_420_PICTURE
-         || p_data->chroma.dest.i_chroma != RGB_8BPP_PICTURE )
-    {
-        return 0;
-    }
-
-    p_vout->chroma.p_sys = malloc( sizeof( chroma_sys_t ) );
-    if( p_vout->chroma.p_sys == NULL )
-    {
-        return 0;
-    }
-
-    p_vout->chroma.p_sys->p_tables = malloc( sizeof( u8 ) *
-                (p_vout->b_grayscale ? GRAY_TABLE_SIZE : PALETTE_TABLE_SIZE) );
-    if( p_vout->chroma.p_sys->p_tables == NULL )
-    {
-        free( p_vout->chroma.p_sys );
-        return 0;
-    }
-
-    p_vout->chroma.p_sys->p_buffer = malloc( sizeof( u8 ) * VOUT_MAX_WIDTH );
-    if( p_vout->chroma.p_sys->p_buffer == NULL )
-    {
-        free( p_vout->chroma.p_sys->p_tables );
-        free( p_vout->chroma.p_sys );
-        return 0;
-    }
-
-    p_vout->chroma.p_sys->p_offset = malloc( sizeof( int ) *
-                                           2 * p_data->chroma.dest.i_width );
-    if( p_vout->chroma.p_sys->p_buffer == NULL )
-    {
-        free( p_vout->chroma.p_sys->p_offset );
-        free( p_vout->chroma.p_sys->p_tables );
-        free( p_vout->chroma.p_sys );
-        return 0;
-    }
-
-    //SetYUV( p_vout );
-
-    return 0; 
-}
-
-/*****************************************************************************
- * chroma_End: free the chroma function
- *****************************************************************************
- * This function frees the previously allocated chroma function
- *****************************************************************************/
-static int chroma_End( vout_thread_t *p_vout )
-{
-    return 0; 
-}
-
-/* Following functions are local */
-
-#if 0
-/*****************************************************************************
- * ConvertY4Gray8: grayscale YUV 4:x:x to RGB 8 bpp
- *****************************************************************************/
-static void ConvertY4Gray8( vout_thread_t *p_vout, picture_t *p_source,
-                                                   picture_t *p_dest )
-{
-    boolean_t   b_horizontal_scaling;             /* horizontal scaling type */
-    int         i_vertical_scaling;                 /* vertical scaling type */
-    int         i_x, i_y;                 /* horizontal and vertical indexes */
-    int         i_scale_count;                       /* scale modulo counter */
-    int         i_chroma_width;                    /* chroma width, not used */
-    u8 *        p_gray;                             /* base conversion table */
-    u8 *        p_pic_start;       /* beginning of the current line for copy */
-    u8 *        p_buffer_start;                   /* conversion buffer start */
-    u8 *        p_buffer;                       /* conversion buffer pointer */
-    int *       p_offset_start;                        /* offset array start */
-    int *       p_offset;                            /* offset array pointer */
-
-    /*
-     * Initialize some values  - i_pic_line_width will store the line skip
-     */
-//    i_pic_line_width -= i_pic_width;
-    p_gray =            p_vout->chroma.p_sys->p_gray8;
-    p_buffer_start =    p_vout->chroma.p_sys->p_buffer;
-    p_offset_start =    p_vout->chroma.p_sys->p_offset;
-    _M( SetOffset )( i_width, i_height, i_pic_width, i_pic_height,
-               &b_horizontal_scaling, &i_vertical_scaling, p_offset_start, 0 );
-
-    /*
-     * Perform conversion
-     */
-    i_scale_count = ( i_vertical_scaling == 1 ) ? i_pic_height : i_height;
-    for( i_y = 0; i_y < i_height; i_y++ )
-    {
-        /* Mark beginnning of line for possible later line copy, and initialize
-         * buffer */
-        p_pic_start =   p_pic;
-        p_buffer =      b_horizontal_scaling ? p_buffer_start : p_pic;
-
-        /* Do YUV conversion to buffer - YUV picture is always formed of 16
-         * pixels wide blocks */
-        for( i_x = i_width / 16; i_x--;  )
-        {
-            *p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
-            *p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
-            *p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
-            *p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
-            *p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
-            *p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
-            *p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
-            *p_buffer++ = p_gray[ *p_y++ ]; *p_buffer++ = p_gray[ *p_y++ ];
-        }
-
-        /* Do horizontal and vertical scaling */
-        SCALE_WIDTH;
-        SCALE_HEIGHT(400, 1);
-    }
-}
-#endif
-
-/*****************************************************************************
- * ConvertYUV420RGB8: color YUV 4:2:0 to RGB 8 bpp
- *****************************************************************************/
-static void ConvertYUV420RGB8( vout_thread_t *p_vout, picture_t *p_source,
-                                                      picture_t *p_dest )
-{
-    printf( "Colorspace transformation, YV12 to RGB8\n");
-#if 0
-    boolean_t   b_horizontal_scaling;             /* horizontal scaling type */
-    int         i_vertical_scaling;                 /* vertical scaling type */
-    int         i_x, i_y;                 /* horizontal and vertical indexes */
-    int         i_scale_count;                       /* scale modulo counter */
-    int         i_real_y;                                           /* y % 4 */
-    u8 *        p_lookup;                                    /* lookup table */
-    int         i_chroma_width;                              /* chroma width */
-    u8 *        p_offset_start;                        /* offset array start */
-    u8 *        p_offset;                            /* offset array pointer */
-
-    int i_pic_line_width = p_source->i_width; /* XXX not sure */
-    int i_width = p_source->i_width;
-    int i_height = p_source->i_height;
-    int i_pic_width = p_dest->i_width;
-    int i_pic_height = p_dest->i_height;
-    u8* p_y = p_source->planes[ Y_PLANE ].p_data;
-    u8* p_u = p_source->planes[ U_PLANE ].p_data;
-    u8* p_v = p_source->planes[ V_PLANE ].p_data;
-    u8* p_pic = p_dest->planes[ MAIN_PLANE ].p_data;
-
-    /* 
-     * The dithering matrices
-     */
-    static int dither10[4] = {  0x0,  0x8,  0x2,  0xa };
-    static int dither11[4] = {  0xc,  0x4,  0xe,  0x6 };
-    static int dither12[4] = {  0x3,  0xb,  0x1,  0x9 };
-    static int dither13[4] = {  0xf,  0x7,  0xd,  0x5 };
-
-    static int dither20[4] = {  0x0, 0x10,  0x4, 0x14 };
-    static int dither21[4] = { 0x18,  0x8, 0x1c,  0xc };
-    static int dither22[4] = {  0x6, 0x16,  0x2, 0x12 };
-    static int dither23[4] = { 0x1e,  0xe, 0x1a,  0xa };
-
-    /*
-     * Initialize some values  - i_pic_line_width will store the line skip
-     */
-    i_pic_line_width -= p_dest->i_width; /*i_pic_width*/
-    i_chroma_width =    p_source->i_width / 2;
-    p_offset_start =    p_vout->chroma.p_sys->p_offset;
-    p_lookup =          p_vout->chroma.p_sys->p_tables;
-    _M( SetOffset )( p_source->i_width, p_source->i_height,
-                     p_dest->i_width, p_dest->i_height,
-                     &b_horizontal_scaling, &i_vertical_scaling,
-                     p_offset_start, 1 );
-
-    /*
-     * Perform conversion
-     */
-    i_scale_count = ( i_vertical_scaling == 1 ) ? p_dest->i_height : p_source->i_height;
-    i_real_y = 0;
-    for( i_y = 0; i_y < p_source->i_height; i_y++ )
-    {
-        /* Do horizontal and vertical scaling */
-        SCALE_WIDTH_DITHER( 420 );
-        SCALE_HEIGHT_DITHER( 420 );
-    }
-#endif
-}
-
index 642fed9008597f47bb114818fcdaeefca38c872b..5766f204cc931a1c5af16c4545b6f89540050fdb 100644 (file)
@@ -2,7 +2,7 @@
  * vout_directx.c: Windows DirectX video output display method
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: vout_directx.c,v 1.17 2001/12/30 07:09:54 sam Exp $
+ * $Id: vout_directx.c,v 1.18 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -163,7 +163,7 @@ static int vout_Create( vout_thread_t *p_vout )
                                                 VOUT_FULLSCREEN_DEFAULT );
 #if 0
     p_vout->b_need_render = !main_GetIntVariable( VOUT_OVERLAY_VAR,
-                                                 VOUT_OVERLAY_DEFAULT );
+                                                  VOUT_OVERLAY_DEFAULT );
 #else
     p_vout->b_need_render = 0;                          /* default = overlay */
 #endif
@@ -325,7 +325,7 @@ static int vout_Manage( vout_thread_t *p_vout )
     {
         intf_WarnMsg( 3, "vout: vout_Manage Scale Change" );
         if( p_vout->b_need_render )
-           InvalidateRect( p_vout->p_sys->hwnd, NULL, TRUE );
+            InvalidateRect( p_vout->p_sys->hwnd, NULL, TRUE );
         if( DirectXUpdateOverlay( p_vout ) )
             /* failed so try again next time */
             PostMessage( p_vout->p_sys->hwnd, WM_CHAR, (WPARAM)'S', 0);
index b0e659cf40ff793915056ca83a31829f745a8e9d..7b63f261d53c14d257da958fed825abf2eec792e 100644 (file)
@@ -2,7 +2,7 @@
  * input_dummy.c: dummy input plugin, to manage "vlc:***" special options
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: input_dummy.c,v 1.11 2001/12/30 07:09:55 sam Exp $
+ * $Id: input_dummy.c,v 1.12 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -118,6 +118,13 @@ static void DummyOpen( input_thread_t * p_input )
     psz_name += 4;
     i_len -= 4;
 
+    /* Check for a "vlc:nop" command */
+    if( i_len == 3 && !strncasecmp( psz_name, "nop", 3 ) )
+    {
+        intf_WarnMsg( 2, "input: command `nop'" );
+        return;
+    }
+
     /* Check for a "vlc:quit" command */
     if( i_len == 4 && !strncasecmp( psz_name, "quit", 4 ) )
     {
index 6656120f99a8e92c8b1050a53cab2c3eadef7e4f..1eaf76836512149fbae081bc32525adb7b56f310 100644 (file)
@@ -2,7 +2,7 @@
  * vout_dummy.c: Dummy video output display method for testing purposes
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: vout_dummy.c,v 1.14 2002/01/02 14:37:42 sam Exp $
+ * $Id: vout_dummy.c,v 1.15 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -58,6 +58,7 @@ static int  vout_Init      ( struct vout_thread_s * );
 static void vout_End       ( struct vout_thread_s * );
 static void vout_Destroy   ( struct vout_thread_s * );
 static int  vout_Manage    ( struct vout_thread_s * );
+static void vout_Render    ( struct vout_thread_s *, struct picture_s * );
 static void vout_Display   ( struct vout_thread_s *, struct picture_s * );
 
 static int  DummyNewPicture( struct vout_thread_s *, struct picture_s * );
@@ -74,6 +75,7 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
     p_function_list->functions.vout.pf_end        = vout_End;
     p_function_list->functions.vout.pf_destroy    = vout_Destroy;
     p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_render     = vout_Render;
     p_function_list->functions.vout.pf_display    = vout_Display;
     p_function_list->functions.vout.pf_setpalette = NULL;
 }
@@ -127,7 +129,7 @@ static int vout_Init( vout_thread_t *p_vout )
             break;
 
         default:
-            p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_16BPP;
+            p_vout->output.i_chroma = FOURCC_RV16;
             p_vout->output.i_width  = p_vout->render.i_width;
             p_vout->output.i_height = p_vout->render.i_height;
             p_vout->output.i_aspect = p_vout->render.i_aspect;
@@ -155,13 +157,8 @@ static int vout_Init( vout_thread_t *p_vout )
             break;
         }
 
-        p_pic->i_status        = DESTROYED_PICTURE;
-        p_pic->i_type          = DIRECT_PICTURE;
-
-        p_pic->i_left_margin   =
-        p_pic->i_right_margin  =
-        p_pic->i_top_margin    =
-        p_pic->i_bottom_margin = 0;
+        p_pic->i_status = DESTROYED_PICTURE;
+        p_pic->i_type   = DIRECT_PICTURE;
 
         PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
 
@@ -182,7 +179,7 @@ static void vout_End( vout_thread_t *p_vout )
     for( i_index = I_OUTPUTPICTURES ; i_index ; )
     {
         i_index--;
-        free( PP_OUTPUTPICTURE[ i_index ]->planes[ 0 ].p_data );
+        free( PP_OUTPUTPICTURE[ i_index ]->p_data );
     }
 }
 
@@ -207,18 +204,22 @@ static int vout_Manage( vout_thread_t *p_vout )
     return( 0 );
 }
 
+/*****************************************************************************
+ * vout_Render: render previously calculated output
+ *****************************************************************************/
+static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    /* No need to do anything, the fake direct buffers stay as they are */
+}
+
 /*****************************************************************************
  * vout_Display: displays previously rendered output
- *****************************************************************************
- * This function send the currently rendered image to dummy image, waits until
- * it is displayed and switch the two rendering buffers, preparing next frame.
  *****************************************************************************/
 static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
 {
     /* No need to do anything, the fake direct buffers stay as they are */
 }
 
-
 /*****************************************************************************
  * DummyNewPicture: allocate a picture
  *****************************************************************************
@@ -226,8 +227,6 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
  *****************************************************************************/
 static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
-    int i_luma_bytes, i_chroma_bytes;
-
     int i_width  = p_vout->output.i_width;
     int i_height = p_vout->output.i_height;
 
@@ -240,23 +239,28 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
     case FOURCC_YV12:
 
         /* Allocate the memory buffer */
-        i_luma_bytes = i_width * i_height * sizeof(pixel_data_t);
-        i_chroma_bytes = i_width * ( i_height / 2 ) * sizeof(pixel_data_t);
+        p_pic->p_data = memalign( 16, i_width * i_height * 3 / 2 );
 
         /* Y buffer */
-        p_pic->P_Y = malloc( i_luma_bytes + 2 * i_chroma_bytes );
-        p_pic->planes[ Y_PLANE ].i_bytes = i_luma_bytes;
-        p_pic->planes[ Y_PLANE ].i_line_bytes = i_width * sizeof(pixel_data_t);
+        p_pic->Y_PIXELS = p_pic->p_data;
+        p_pic->p[Y_PLANE].i_lines = i_height;
+        p_pic->p[Y_PLANE].i_pitch = i_width;
+        p_pic->p[Y_PLANE].i_pixel_bytes = 1;
+        p_pic->p[Y_PLANE].b_margin = 0;
 
         /* U buffer */
-        p_pic->P_U = p_pic->P_Y + i_height * i_width;
-        p_pic->planes[ U_PLANE ].i_bytes = i_chroma_bytes / 2;
-        p_pic->planes[ U_PLANE ].i_line_bytes = i_width / 2 * sizeof(pixel_data_t);
+        p_pic->U_PIXELS = p_pic->Y_PIXELS + i_height * i_width;
+        p_pic->p[U_PLANE].i_lines = i_height / 2;
+        p_pic->p[U_PLANE].i_pitch = i_width / 2;
+        p_pic->p[U_PLANE].i_pixel_bytes = 1;
+        p_pic->p[U_PLANE].b_margin = 0;
 
         /* V buffer */
-        p_pic->P_V = p_pic->P_U + i_height * i_width / 2;
-        p_pic->planes[ V_PLANE ].i_bytes = i_chroma_bytes / 2;
-        p_pic->planes[ V_PLANE ].i_line_bytes = i_width / 2 * sizeof(pixel_data_t);
+        p_pic->V_PIXELS = p_pic->U_PIXELS + i_height * i_width / 4;
+        p_pic->p[V_PLANE].i_lines = i_height / 2;
+        p_pic->p[V_PLANE].i_pitch = i_width / 2;
+        p_pic->p[V_PLANE].i_pixel_bytes = 1;
+        p_pic->p[V_PLANE].b_margin = 0;
 
         /* We allocated 3 planes */
         p_pic->i_planes = 3;
@@ -266,19 +270,20 @@ static int DummyNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
 
     /* Unknown chroma, allocate an RGB buffer, the video output's job
      * will be to do the chroma->RGB conversion */
-    case FOURCC_BI_BITFIELDS | DEPTH_16BPP:
-
-        /* Precalculate some values */
-        i_luma_bytes = sizeof(u16) * i_width * i_height;
+    case FOURCC_RV16:
 
         /* Allocate the memory buffer */
-        p_pic->P_MAIN = malloc( i_luma_bytes );
-        p_pic->planes[ MAIN_PLANE ].i_bytes = i_luma_bytes;
+        p_pic->p_data = memalign( 16, i_width * i_height * 2 );
 
         /* Fill important structures */
-        p_pic->planes[ MAIN_PLANE ].i_red_mask   = 0xf800;
-        p_pic->planes[ MAIN_PLANE ].i_green_mask = 0x07e0;
-        p_pic->planes[ MAIN_PLANE ].i_blue_mask  = 0x001f;
+        p_pic->p->p_pixels = p_pic->p_data;
+        p_pic->p->i_lines = i_height;
+        p_pic->p->i_pitch = i_width;
+        p_pic->p->i_pixel_bytes = 2;
+        p_pic->p->b_margin = 0;
+        p_pic->p->i_red_mask   = 0xf800;
+        p_pic->p->i_green_mask = 0x07e0;
+        p_pic->p->i_blue_mask  = 0x001f;
 
         /* We allocated 1 plane */
         p_pic->i_planes = 1;
index 3ef18dbe5a0811ddefa588f273d4698587a4c907..139d30e76051fdcd3a4694ed598bd7b60f7959ed 100644 (file)
@@ -3,7 +3,7 @@ dvdread_SOURCES = dvdread.c input_dvdread.c $(SRC_DVDREAD_EXTRA)
 ifeq (1,$(NEED_LIBDVDCSS))
 LIBDVDCSS_OBJ = ../../lib/libdvdcss.a ../../lib/libdvdcss.so
 endif
-LIBDVDREAD_OBJ = ../../lib/libdvdread.a ../../lib/libdvdread.so
+LIBDVDREAD_OBJ = ../../lib/libdvdread.a
 
 EXTRA_DEP = $(LIBDVDCSS_OBJ) $(LIBDVDREAD_OBJ)
 
index 8145cce4aecfc3279033b7eab45d4b31ce74353f..9f101b54a39139151aaa6030a79986f968323484 100644 (file)
@@ -2,7 +2,7 @@
  * dvdread.c : DvdRead input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: dvdread.c,v 1.5 2001/12/30 22:10:26 stef Exp $
+ * $Id: dvdread.c,v 1.6 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -63,7 +63,7 @@ MODULE_INIT_START
     ADD_CAPABILITY( INPUT, 80 )
 #endif
     ADD_SHORTCUT( "dvdread" )
-           
+    
 MODULE_INIT_STOP
 
 MODULE_ACTIVATE_START
index 1b43220d882bd148ed8ee345a86f630f50829e8a..4db1c66e70c790c962fcd12dc0a422db6e79cbda 100644 (file)
@@ -6,7 +6,7 @@
  * It depends on: libdvdread for ifo files and block reading.
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: input_dvdread.c,v 1.15 2002/01/02 14:37:42 sam Exp $
+ * $Id: input_dvdread.c,v 1.16 2002/01/04 14:01:34 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
@@ -841,7 +841,7 @@ static int DvdReadRead( input_thread_t * p_input,
         {
             b_eot = 1;
             p_dvd->i_pack_len = 0;
-           return 1;
+            return 1;
         }
     }
 
@@ -953,7 +953,7 @@ static int DvdReadRead( input_thread_t * p_input,
             >= p_input->stream.p_selected_area->i_size || b_eot )
     {
         if( ( p_input->stream.p_selected_area->i_id + 1 ) >= 
-                       p_input->stream.i_area_nb )
+                        p_input->stream.i_area_nb )
         {
             /* EOF */
             vlc_mutex_unlock( &p_input->stream.stream_lock );
@@ -963,7 +963,7 @@ static int DvdReadRead( input_thread_t * p_input,
         /* EOT */
         intf_WarnMsg( 4, "dvd info: new title" );
         DvdReadSetArea( p_input, p_input->stream.pp_areas[
-                       p_input->stream.p_selected_area->i_id+1] );
+                        p_input->stream.p_selected_area->i_id+1] );
         vlc_mutex_unlock( &p_input->stream.stream_lock );
         return 0;
     }
index 6e9590c64573db87ded8fca097ab0fef628c9154..923429aba1de8fd990597b27916e00b50856554e 100644 (file)
@@ -2,7 +2,7 @@
  * deinterlace.c : deinterlacer plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: deinterlace.c,v 1.2 2002/01/02 14:37:42 sam Exp $
+ * $Id: deinterlace.c,v 1.3 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -76,6 +76,7 @@ typedef struct vout_sys_s
 {
     int i_mode;
     struct vout_thread_s *p_vout;
+    mtime_t last_date;
 
 } vout_sys_t;
 
@@ -88,6 +89,7 @@ static int  vout_Init      ( struct vout_thread_s * );
 static void vout_End       ( struct vout_thread_s * );
 static void vout_Destroy   ( struct vout_thread_s * );
 static int  vout_Manage    ( struct vout_thread_s * );
+static void vout_Render    ( struct vout_thread_s *, struct picture_s * );
 static void vout_Display   ( struct vout_thread_s *, struct picture_s * );
 
 /*****************************************************************************
@@ -102,6 +104,7 @@ static void vout_getfunctions( function_list_t * p_function_list )
     p_function_list->functions.vout.pf_end        = vout_End;
     p_function_list->functions.vout.pf_destroy    = vout_Destroy;
     p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_render     = vout_Render;
     p_function_list->functions.vout.pf_display    = vout_Display;
     p_function_list->functions.vout.pf_setpalette = NULL;
 }
@@ -235,6 +238,8 @@ static int vout_Init( vout_thread_t *p_vout )
         return( 0 );
     }
  
+    p_vout->p_sys->last_date = 0;
+
     main_PutPszVariable( VOUT_FILTER_VAR, psz_filter );
 
     ALLOCATE_DIRECTBUFFERS( VOUT_MAX_PICTURES );
@@ -253,7 +258,7 @@ static void vout_End( vout_thread_t *p_vout )
     for( i_index = I_OUTPUTPICTURES ; i_index ; )
     {
         i_index--;
-        free( PP_OUTPUTPICTURE[ i_index ]->planes[ 0 ].p_data );
+        free( PP_OUTPUTPICTURE[ i_index ]->p_data );
     }
 }
 
@@ -281,16 +286,22 @@ static int vout_Manage( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_Display: displays previously rendered output
+ * vout_Render: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to Deinterlace image,
  * waits until it is displayed and switch the two rendering buffers, preparing
  * next frame.
  *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void vout_Render ( vout_thread_t *p_vout, picture_t *p_pic )
 {
     picture_t *p_outpic;
-    int i_index, i_field;
+    int i_plane, i_field;
+    /* 20ms is a bit arbitrary, but it's only for the first image we get */
+    mtime_t new_date = p_vout->p_sys->last_date
+                       ? ( 3 * p_pic->date - p_vout->p_sys->last_date ) / 2
+                       : p_pic->date + 20000;
+
+    p_vout->p_sys->last_date = p_pic->date;
 
     for( i_field = 0 ; i_field < 2 ; i_field++ )
     {
@@ -306,21 +317,21 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
             msleep( VOUT_OUTMEM_SLEEP );
         }   
 
-        /* XXX: completely arbitrary values ! */
         vout_DatePicture( p_vout->p_sys->p_vout, p_outpic,
-                          mdate() + (mtime_t)(50000 + i_field * 20000) );
+                          p_pic->date + i_field ? new_date : p_pic->date );
 
         /* Copy image and skip lines */
-        for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
+        for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
         {
-            pixel_data_t *p_in, *p_out_end, *p_out;
+            u8 *p_in, *p_out_end, *p_out;
             int i_increment;
 
-            p_in = p_pic->planes[ i_index ].p_data
-                       + i_field * p_pic->planes[ i_index ].i_line_bytes;
+            p_in = p_pic->p[i_plane].p_pixels
+                       + i_field * p_pic->p[i_plane].i_pitch;
 
-            p_out = p_outpic->planes[ i_index ].p_data;
-            p_out_end = p_out + p_outpic->planes[ i_index ].i_bytes;
+            p_out = p_outpic->p[i_plane].p_pixels;
+            p_out_end = p_out + p_outpic->p[i_plane].i_pitch
+                                 * p_outpic->p[i_plane].i_lines;
 
             switch( p_vout->render.i_chroma )
             {
@@ -333,52 +344,51 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
                 case DEINTERLACE_MODE_BOB:
                     for( ; p_out < p_out_end ; )
                     {
-                        FAST_MEMCPY( p_out, p_in,
-                                     p_pic->planes[ i_index ].i_line_bytes );
+                        FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
 
-                        p_out += p_pic->planes[ i_index ].i_line_bytes;
-                        p_in += 2 * p_pic->planes[ i_index ].i_line_bytes;
+                        p_out += p_pic->p[i_plane].i_pitch;
+                        p_in += 2 * p_pic->p[i_plane].i_pitch;
                     }
                     break;
 
                 case DEINTERLACE_MODE_BLEND:
-                    if( i_index != Y_PLANE )
+                    if( i_plane != Y_PLANE )
                     {
                         for( ; p_out < p_out_end ; )
                         {
                             FAST_MEMCPY( p_out, p_in,
-                                     p_pic->planes[ i_index ].i_line_bytes );
+                                         p_pic->p[i_plane].i_pitch );
 
-                            p_out += p_pic->planes[ i_index ].i_line_bytes;
+                            p_out += p_pic->p[i_plane].i_pitch;
 
                             FAST_MEMCPY( p_out, p_in,
-                                     p_pic->planes[ i_index ].i_line_bytes );
+                                         p_pic->p[i_plane].i_pitch );
 
-                            p_out += p_pic->planes[ i_index ].i_line_bytes;
-                            p_in += 2 * p_pic->planes[ i_index ].i_line_bytes;
+                            p_out += p_pic->p[i_plane].i_pitch;
+                            p_in += 2 * p_pic->p[i_plane].i_pitch;
                         }
                         break;
                     }
 
                     if( i_field == 0 )
                     {
-                        FAST_MEMCPY( p_out, p_in,
-                                     p_pic->planes[ i_index ].i_line_bytes );
-                        p_in += 2 * p_pic->planes[ i_index ].i_line_bytes;
-                        p_out += p_pic->planes[ i_index ].i_line_bytes;
+                        FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
+                        p_in += 2 * p_pic->p[i_plane].i_pitch;
+                        p_out += p_pic->p[i_plane].i_pitch;
                     }
 
                     for( ; p_out < p_out_end ; )
                     {
-                        FAST_MEMCPY( p_out, p_in,
-                                     p_pic->planes[ i_index ].i_line_bytes );
+                        FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
 
-                        p_out += p_pic->planes[ i_index ].i_line_bytes;
+                        p_out += p_pic->p[i_plane].i_pitch;
 
-                        memblend( p_out, p_in, p_in + 2 * p_pic->planes[ i_index ].i_line_bytes, p_pic->planes[ i_index ].i_line_bytes );
+                        memblend( p_out, p_in,
+                                  p_in + 2 * p_pic->p[i_plane].i_pitch,
+                                  p_pic->p[i_plane].i_pitch );
 
-                        p_in += 2 * p_pic->planes[ i_index ].i_line_bytes;
-                        p_out += p_pic->planes[ i_index ].i_line_bytes;
+                        p_in += 2 * p_pic->p[i_plane].i_pitch;
+                        p_out += p_pic->p[i_plane].i_pitch;
                     }
                     break;
                 }
@@ -386,18 +396,16 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
 
             case FOURCC_I422:
 
-                i_increment = 2 * p_pic->planes[ i_index ].i_line_bytes;
+                i_increment = 2 * p_pic->p[i_plane].i_pitch;
 
-                if( i_index == Y_PLANE )
+                if( i_plane == Y_PLANE )
                 {
                     for( ; p_out < p_out_end ; )
                     {
-                        FAST_MEMCPY( p_out, p_in,
-                                 p_pic->planes[ i_index ].i_line_bytes );
-                        p_out += p_pic->planes[ i_index ].i_line_bytes;
-                        FAST_MEMCPY( p_out, p_in,
-                                 p_pic->planes[ i_index ].i_line_bytes );
-                        p_out += p_pic->planes[ i_index ].i_line_bytes;
+                        FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
+                        p_out += p_pic->p[i_plane].i_pitch;
+                        FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
+                        p_out += p_pic->p[i_plane].i_pitch;
                         p_in += i_increment;
                     }
                 }
@@ -405,9 +413,8 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
                 {
                     for( ; p_out < p_out_end ; )
                     {
-                        FAST_MEMCPY( p_out, p_in,
-                                 p_pic->planes[ i_index ].i_line_bytes );
-                        p_out += p_pic->planes[ i_index ].i_line_bytes;
+                        FAST_MEMCPY( p_out, p_in, p_pic->p[i_plane].i_pitch );
+                        p_out += p_pic->p[i_plane].i_pitch;
                         p_in += i_increment;
                     }
                 }
@@ -422,6 +429,18 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
     }
 }
 
+/*****************************************************************************
+ * vout_Display: displays previously rendered output
+ *****************************************************************************
+ * This function send the currently rendered image to Invert image, waits
+ * until it is displayed and switch the two rendering buffers, preparing next
+ * frame.
+ *****************************************************************************/
+static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    ;
+}
+
 static void *memblend( void *p_dest, const void *p_s1,
                        const void *p_s2, size_t i_bytes )
 {
index bbefa08b570550cb158ccf9aa4326bb0d19fb65a..93fd273a3e210af9630803ad7127c51af041f8bc 100644 (file)
@@ -2,7 +2,7 @@
  * distort.c : Misc video effects plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: distort.c,v 1.4 2002/01/02 14:37:42 sam Exp $
+ * $Id: distort.c,v 1.5 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -92,6 +92,7 @@ static int  vout_Init      ( struct vout_thread_s * );
 static void vout_End       ( struct vout_thread_s * );
 static void vout_Destroy   ( struct vout_thread_s * );
 static int  vout_Manage    ( struct vout_thread_s * );
+static void vout_Render    ( struct vout_thread_s *, struct picture_s * );
 static void vout_Display   ( struct vout_thread_s *, struct picture_s * );
 
 static void DistortWave    ( struct vout_thread_s *, struct picture_s *,
@@ -111,6 +112,7 @@ static void vout_getfunctions( function_list_t * p_function_list )
     p_function_list->functions.vout.pf_end        = vout_End;
     p_function_list->functions.vout.pf_destroy    = vout_Destroy;
     p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_render     = vout_Render;
     p_function_list->functions.vout.pf_display    = vout_Display;
     p_function_list->functions.vout.pf_setpalette = NULL;
 }
@@ -178,23 +180,10 @@ static int vout_Init( vout_thread_t *p_vout )
     I_OUTPUTPICTURES = 0;
 
     /* Initialize the output structure */
-    switch( p_vout->render.i_chroma )
-    {
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-        case FOURCC_YV12:
-        case FOURCC_I422:
-        case FOURCC_I444:
-            p_vout->output.i_chroma = p_vout->render.i_chroma;
-            p_vout->output.i_width  = p_vout->render.i_width;
-            p_vout->output.i_height = p_vout->render.i_height;
-            p_vout->output.i_aspect = p_vout->render.i_aspect;
-            break;
-
-        default:
-            return( 0 ); /* unknown chroma */
-            break;
-    }
+    p_vout->output.i_chroma = p_vout->render.i_chroma;
+    p_vout->output.i_width  = p_vout->render.i_width;
+    p_vout->output.i_height = p_vout->render.i_height;
+    p_vout->output.i_aspect = p_vout->render.i_aspect;
 
     /* Try to open the real video output */
     psz_filter = main_GetPszVariable( VOUT_FILTER_VAR, "" );
@@ -236,7 +225,7 @@ static void vout_End( vout_thread_t *p_vout )
     for( i_index = I_OUTPUTPICTURES ; i_index ; )
     {
         i_index--;
-        free( PP_OUTPUTPICTURE[ i_index ]->planes[ 0 ].p_data );
+        free( PP_OUTPUTPICTURE[ i_index ]->p_data );
     }
 }
 
@@ -264,13 +253,13 @@ static int vout_Manage( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_Display: displays previously rendered output
+ * vout_Render: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to Distort image, waits
  * until it is displayed and switch the two rendering buffers, preparing next
  * frame.
  *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
 {
     picture_t *p_outpic;
 
@@ -285,7 +274,7 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
         msleep( VOUT_OUTMEM_SLEEP );
     }
 
-    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, mdate() + 50000 );
+    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
 
     switch( p_vout->p_sys->i_mode )
     {
@@ -304,6 +293,17 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
     vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
 }
 
+/*****************************************************************************
+ * vout_Display: displays previously rendered output
+ *****************************************************************************
+ * This function send the currently rendered image to Invert image, waits
+ * until it is displayed and switch the two rendering buffers, preparing next
+ * frame.
+ *****************************************************************************/
+static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    ;
+}
 
 /*****************************************************************************
  * DistortWave: draw a wave effect on the picture
@@ -323,13 +323,12 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
     {
         int i_line, i_num_lines, i_offset;
         u8 black_pixel;
-        pixel_data_t *p_in, *p_out;
+        u8 *p_in, *p_out;
 
-        p_in = p_inpic->planes[ i_index ].p_data;
-        p_out = p_outpic->planes[ i_index ].p_data;
+        p_in = p_inpic->p[i_index].p_pixels;
+        p_out = p_outpic->p[i_index].p_pixels;
 
-        i_num_lines = p_inpic->planes[ i_index ].i_bytes
-                          / p_inpic->planes[ i_index ].i_line_bytes;
+        i_num_lines = p_inpic->p[i_index].i_lines;
 
         black_pixel = ( i_index == Y_PLANE ) ? 0x00 : 0x80;
 
@@ -337,7 +336,7 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
         for( i_line = 0 ; i_line < i_num_lines ; i_line++ )
         {
             /* Calculate today's offset, don't go above 1/20th of the screen */
-            i_offset = (double)(p_inpic->planes[ i_index ].i_line_bytes)
+            i_offset = (double)(p_inpic->p[i_index].i_pitch)
                          * sin( f_angle + 10.0 * (double)i_line
                                                / (double)i_num_lines )
                          / 20.0;
@@ -347,26 +346,25 @@ static void DistortWave( vout_thread_t *p_vout, picture_t *p_inpic,
                 if( i_offset < 0 )
                 {
                     FAST_MEMCPY( p_out, p_in - i_offset,
-                         p_inpic->planes[ i_index ].i_line_bytes + i_offset );
-                    p_in += p_inpic->planes[ i_index ].i_line_bytes;
-                    p_out += p_outpic->planes[ i_index ].i_line_bytes;
+                                 p_inpic->p[i_index].i_pitch + i_offset );
+                    p_in += p_inpic->p[i_index].i_pitch;
+                    p_out += p_outpic->p[i_index].i_pitch;
                     memset( p_out + i_offset, black_pixel, -i_offset );
                 }
                 else
                 {
                     FAST_MEMCPY( p_out + i_offset, p_in,
-                         p_inpic->planes[ i_index ].i_line_bytes - i_offset );
+                                 p_inpic->p[i_index].i_pitch - i_offset );
                     memset( p_out, black_pixel, i_offset );
-                    p_in += p_inpic->planes[ i_index ].i_line_bytes;
-                    p_out += p_outpic->planes[ i_index ].i_line_bytes;
+                    p_in += p_inpic->p[i_index].i_pitch;
+                    p_out += p_outpic->p[i_index].i_pitch;
                 }
             }
             else
             {
-                FAST_MEMCPY( p_out, p_in,
-                             p_inpic->planes[ i_index ].i_line_bytes );
-                p_in += p_inpic->planes[ i_index ].i_line_bytes;
-                p_out += p_outpic->planes[ i_index ].i_line_bytes;
+                FAST_MEMCPY( p_out, p_in, p_inpic->p[i_index].i_pitch );
+                p_in += p_inpic->p[i_index].i_pitch;
+                p_out += p_outpic->p[i_index].i_pitch;
             }
 
         }
@@ -391,29 +389,27 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
     {
         int i_line, i_first_line, i_num_lines, i_offset;
         u8 black_pixel;
-        pixel_data_t *p_in, *p_out;
+        u8 *p_in, *p_out;
 
         black_pixel = ( i_index == Y_PLANE ) ? 0x00 : 0x80;
 
-        i_num_lines = p_inpic->planes[ i_index ].i_bytes
-                          / p_inpic->planes[ i_index ].i_line_bytes;
+        i_num_lines = p_inpic->p[i_index].i_lines;
 
         i_first_line = i_num_lines * 4 / 5;
 
-        p_in = p_inpic->planes[ i_index ].p_data;
-        p_out = p_outpic->planes[ i_index ].p_data;
+        p_in = p_inpic->p[i_index].p_pixels;
+        p_out = p_outpic->p[i_index].p_pixels;
 
-        FAST_MEMCPY( p_out, p_in,
-                     i_first_line * p_inpic->planes[ i_index ].i_line_bytes );
+        FAST_MEMCPY( p_out, p_in, i_first_line * p_inpic->p[i_index].i_pitch );
 
-        p_in += i_first_line * p_inpic->planes[ i_index ].i_line_bytes;
-        p_out += i_first_line * p_outpic->planes[ i_index ].i_line_bytes;
+        p_in += i_first_line * p_inpic->p[i_index].i_pitch;
+        p_out += i_first_line * p_outpic->p[i_index].i_pitch;
 
         /* Ok, we do 3 times the sin() calculation for each line. So what ? */
         for( i_line = i_first_line ; i_line < i_num_lines ; i_line++ )
         {
             /* Calculate today's offset, don't go above 1/20th of the screen */
-            i_offset = (double)(p_inpic->planes[ i_index ].i_line_bytes)
+            i_offset = (double)(p_inpic->p[i_index].i_pitch)
                          * sin( f_angle + 2.0 * (double)i_line
                                               / (double)( 1 + i_line
                                                             - i_first_line) )
@@ -426,26 +422,25 @@ static void DistortRipple( vout_thread_t *p_vout, picture_t *p_inpic,
                 if( i_offset < 0 )
                 {
                     FAST_MEMCPY( p_out, p_in - i_offset,
-                         p_inpic->planes[ i_index ].i_line_bytes + i_offset );
-                    p_in -= p_inpic->planes[ i_index ].i_line_bytes;
-                    p_out += p_outpic->planes[ i_index ].i_line_bytes;
+                                 p_inpic->p[i_index].i_pitch + i_offset );
+                    p_in -= p_inpic->p[i_index].i_pitch;
+                    p_out += p_outpic->p[i_index].i_pitch;
                     memset( p_out + i_offset, black_pixel, -i_offset );
                 }
                 else
                 {
                     FAST_MEMCPY( p_out + i_offset, p_in,
-                         p_inpic->planes[ i_index ].i_line_bytes - i_offset );
+                                 p_inpic->p[i_index].i_pitch - i_offset );
                     memset( p_out, black_pixel, i_offset );
-                    p_in -= p_inpic->planes[ i_index ].i_line_bytes;
-                    p_out += p_outpic->planes[ i_index ].i_line_bytes;
+                    p_in -= p_inpic->p[i_index].i_pitch;
+                    p_out += p_outpic->p[i_index].i_pitch;
                 }
             }
             else
             {
-                FAST_MEMCPY( p_out, p_in,
-                             p_inpic->planes[ i_index ].i_line_bytes );
-                p_in -= p_inpic->planes[ i_index ].i_line_bytes;
-                p_out += p_outpic->planes[ i_index ].i_line_bytes;
+                FAST_MEMCPY( p_out, p_in, p_inpic->p[i_index].i_pitch );
+                p_in -= p_inpic->p[i_index].i_pitch;
+                p_out += p_outpic->p[i_index].i_pitch;
             }
 
         }
index b70cd1cbda7da9d166ef95f9b09e46d8679df945..691ded68b725294c08505dc42691ea0332adc654 100644 (file)
@@ -2,7 +2,7 @@
  * filter_common.h: Common filter functions
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: filter_common.h,v 1.1 2001/12/19 03:50:22 sam Exp $
+ * $Id: filter_common.h,v 1.2 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -45,7 +45,7 @@
         /* Allocate the picture */                                            \
         vout_AllocatePicture( p_pic,                                          \
                               p_vout->output.i_width,                         \
-                               p_vout->output.i_height,                       \
+                              p_vout->output.i_height,                        \
                               p_vout->output.i_chroma );                      \
                                                                               \
         if( !p_pic->i_planes )                                                \
             break;                                                            \
         }                                                                     \
                                                                               \
-        p_pic->i_status        = DESTROYED_PICTURE;                           \
-        p_pic->i_type          = DIRECT_PICTURE;                              \
-                                                                              \
-        p_pic->i_left_margin   =                                              \
-        p_pic->i_right_margin  =                                              \
-        p_pic->i_top_margin    =                                              \
-        p_pic->i_bottom_margin = 0;                                           \
+        p_pic->i_status = DESTROYED_PICTURE;                                  \
+        p_pic->i_type   = DIRECT_PICTURE;                                     \
                                                                               \
         PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;                         \
                                                                               \
index 77f161fb90151801940a8a79a8560989bddee4ae..891ddd3678ccc14e18dda935d0af648c9087e9aa 100644 (file)
@@ -2,7 +2,7 @@
  * invert.c : Invert video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: invert.c,v 1.4 2002/01/02 14:37:42 sam Exp $
+ * $Id: invert.c,v 1.5 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -82,6 +82,7 @@ static int  vout_Init      ( struct vout_thread_s * );
 static void vout_End       ( struct vout_thread_s * );
 static void vout_Destroy   ( struct vout_thread_s * );
 static int  vout_Manage    ( struct vout_thread_s * );
+static void vout_Render    ( struct vout_thread_s *, struct picture_s * );
 static void vout_Display   ( struct vout_thread_s *, struct picture_s * );
 
 /*****************************************************************************
@@ -96,6 +97,7 @@ static void vout_getfunctions( function_list_t * p_function_list )
     p_function_list->functions.vout.pf_end        = vout_End;
     p_function_list->functions.vout.pf_destroy    = vout_Destroy;
     p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_render     = vout_Render;
     p_function_list->functions.vout.pf_display    = vout_Display;
     p_function_list->functions.vout.pf_setpalette = NULL;
 }
@@ -138,23 +140,10 @@ static int vout_Init( vout_thread_t *p_vout )
     I_OUTPUTPICTURES = 0;
 
     /* Initialize the output structure */
-    switch( p_vout->render.i_chroma )
-    {
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-        case FOURCC_YV12:
-        case FOURCC_I422:
-        case FOURCC_I444:
-            p_vout->output.i_chroma = p_vout->render.i_chroma;
-            p_vout->output.i_width  = p_vout->render.i_width;
-            p_vout->output.i_height = p_vout->render.i_height;
-            p_vout->output.i_aspect = p_vout->render.i_aspect;
-            break;
-
-        default:
-            return( 0 ); /* unknown chroma */
-            break;
-    }
+    p_vout->output.i_chroma = p_vout->render.i_chroma;
+    p_vout->output.i_width  = p_vout->render.i_width;
+    p_vout->output.i_height = p_vout->render.i_height;
+    p_vout->output.i_aspect = p_vout->render.i_aspect;
 
     /* Try to open the real video output */
     psz_filter = main_GetPszVariable( VOUT_FILTER_VAR, "" );
@@ -193,7 +182,7 @@ static void vout_End( vout_thread_t *p_vout )
     for( i_index = I_OUTPUTPICTURES ; i_index ; )
     {
         i_index--;
-        free( PP_OUTPUTPICTURE[ i_index ]->planes[ 0 ].p_data );
+        free( PP_OUTPUTPICTURE[ i_index ]->p_data );
     }
 }
 
@@ -221,13 +210,13 @@ static int vout_Manage( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_Display: displays previously rendered output
+ * vout_Render: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to Invert image, waits
  * until it is displayed and switch the two rendering buffers, preparing next
  * frame.
  *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
 {
     picture_t *p_outpic;
     int i_index;
@@ -243,17 +232,18 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
         msleep( VOUT_OUTMEM_SLEEP );
     }   
 
-    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, mdate() + 50000 );
+    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
     vout_LinkPicture( p_vout->p_sys->p_vout, p_outpic );
 
     for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
     {
-        pixel_data_t *p_in, *p_in_end, *p_out;
+        u8 *p_in, *p_in_end, *p_out;
 
-        p_in = p_pic->planes[ i_index ].p_data;
-        p_in_end = p_in + p_pic->planes[ i_index ].i_bytes - 64;
+        p_in = p_pic->p[i_index].p_pixels;
+        p_in_end = p_in - 64 + p_pic->p[i_index].i_lines
+                                * p_pic->p[i_index].i_pitch;
 
-        p_out = p_outpic->planes[ i_index ].p_data;
+        p_out = p_outpic->p[i_index].p_pixels;
 
         for( ; p_in < p_in_end ; )
         {
@@ -282,3 +272,15 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
     vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
 }
 
+/*****************************************************************************
+ * vout_Display: displays previously rendered output
+ *****************************************************************************
+ * This function send the currently rendered image to Invert image, waits
+ * until it is displayed and switch the two rendering buffers, preparing next
+ * frame.
+ *****************************************************************************/
+static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    ;
+}
+
index 5bb8316467dad83a653d19b18796f4b81ce553ca..c7eae95e9edadf30214586a2d6450ca4ba945d3f 100644 (file)
@@ -2,7 +2,7 @@
  * transform.c : transform image plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: transform.c,v 1.3 2002/01/02 14:37:42 sam Exp $
+ * $Id: transform.c,v 1.4 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -90,6 +90,7 @@ static int  vout_Init      ( struct vout_thread_s * );
 static void vout_End       ( struct vout_thread_s * );
 static void vout_Destroy   ( struct vout_thread_s * );
 static int  vout_Manage    ( struct vout_thread_s * );
+static void vout_Render    ( struct vout_thread_s *, struct picture_s * );
 static void vout_Display   ( struct vout_thread_s *, struct picture_s * );
 
 /*****************************************************************************
@@ -104,6 +105,7 @@ static void vout_getfunctions( function_list_t * p_function_list )
     p_function_list->functions.vout.pf_end        = vout_End;
     p_function_list->functions.vout.pf_destroy    = vout_Destroy;
     p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_render     = vout_Render;
     p_function_list->functions.vout.pf_display    = vout_Display;
     p_function_list->functions.vout.pf_setpalette = NULL;
 }
@@ -189,23 +191,10 @@ static int vout_Init( vout_thread_t *p_vout )
     I_OUTPUTPICTURES = 0;
 
     /* Initialize the output structure */
-    switch( p_vout->render.i_chroma )
-    {
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-        case FOURCC_YV12:
-        case FOURCC_I422:
-        case FOURCC_I444:
-            p_vout->output.i_chroma = p_vout->render.i_chroma;
-            p_vout->output.i_width  = p_vout->render.i_width;
-            p_vout->output.i_height = p_vout->render.i_height;
-            p_vout->output.i_aspect = p_vout->render.i_aspect;
-            break;
-
-        default:
-            return( 0 ); /* unknown chroma */
-            break;
-    }
+    p_vout->output.i_chroma = p_vout->render.i_chroma;
+    p_vout->output.i_width  = p_vout->render.i_width;
+    p_vout->output.i_height = p_vout->render.i_height;
+    p_vout->output.i_aspect = p_vout->render.i_aspect;
 
     /* Try to open the real video output */
     psz_filter = main_GetPszVariable( VOUT_FILTER_VAR, "" );
@@ -255,7 +244,7 @@ static void vout_End( vout_thread_t *p_vout )
     for( i_index = I_OUTPUTPICTURES ; i_index ; )
     {
         i_index--;
-        free( PP_OUTPUTPICTURE[ i_index ]->planes[ 0 ].p_data );
+        free( PP_OUTPUTPICTURE[ i_index ]->p_data );
     }
 }
 
@@ -283,13 +272,13 @@ static int vout_Manage( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_Display: displays previously rendered output
+ * vout_Render: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to Transform image, waits
  * until it is displayed and switch the two rendering buffers, preparing next
  * frame.
  *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
 {
     picture_t *p_outpic;
     int i_index;
@@ -305,7 +294,7 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
         msleep( VOUT_OUTMEM_SLEEP );
     }   
 
-    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, mdate() + 50000 );
+    vout_DatePicture( p_vout->p_sys->p_vout, p_outpic, p_pic->date );
     vout_LinkPicture( p_vout->p_sys->p_vout, p_outpic );
 
     switch( p_vout->p_sys->i_mode )
@@ -313,23 +302,24 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
         case TRANSFORM_MODE_90:
             for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
             {
-                int i_line_bytes = p_pic->planes[ i_index ].i_line_bytes;
+                int i_pitch = p_pic->p[i_index].i_pitch;
 
-                pixel_data_t *p_in = p_pic->planes[ i_index ].p_data;
+                u8 *p_in = p_pic->p[i_index].p_pixels;
 
-                pixel_data_t *p_out = p_outpic->planes[ i_index ].p_data;
-                pixel_data_t *p_out_end = p_out
-                                       + p_outpic->planes[ i_index ].i_bytes;
+                u8 *p_out = p_outpic->p[i_index].p_pixels;
+                u8 *p_out_end = p_out + p_outpic->p[i_index].i_lines
+                                         * p_outpic->p[i_index].i_pitch;
 
                 for( ; p_out < p_out_end ; )
                 {
-                    pixel_data_t *p_line_end;
+                    u8 *p_line_end;
 
-                    p_line_end = p_in + p_pic->planes[ i_index ].i_bytes;
+                    p_line_end = p_in + p_pic->p[i_index].i_lines
+                                         * p_pic->p[i_index].i_pitch;
 
                     for( ; p_in < p_line_end ; )
                     {
-                        p_line_end -= i_line_bytes;
+                        p_line_end -= i_pitch;
                         *(--p_out_end) = *p_line_end;
                     }
 
@@ -341,10 +331,11 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
         case TRANSFORM_MODE_180:
             for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
             {
-                pixel_data_t *p_in = p_pic->planes[ i_index ].p_data;
-                pixel_data_t *p_in_end = p_in + p_pic->planes[ i_index ].i_bytes;
+                u8 *p_in = p_pic->p[i_index].p_pixels;
+                u8 *p_in_end = p_in + p_pic->p[i_index].i_lines
+                                       * p_pic->p[i_index].i_pitch;
 
-                pixel_data_t *p_out = p_outpic->planes[ i_index ].p_data;
+                u8 *p_out = p_outpic->p[i_index].p_pixels;
 
                 for( ; p_in < p_in_end ; )
                 {
@@ -356,23 +347,24 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
         case TRANSFORM_MODE_270:
             for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
             {
-                int i_line_bytes = p_pic->planes[ i_index ].i_line_bytes;
+                int i_pitch = p_pic->p[i_index].i_pitch;
 
-                pixel_data_t *p_in = p_pic->planes[ i_index ].p_data;
+                u8 *p_in = p_pic->p[i_index].p_pixels;
 
-                pixel_data_t *p_out = p_outpic->planes[ i_index ].p_data;
-                pixel_data_t *p_out_end = p_out
-                                       + p_outpic->planes[ i_index ].i_bytes;
+                u8 *p_out = p_outpic->p[i_index].p_pixels;
+                u8 *p_out_end = p_out + p_outpic->p[i_index].i_lines
+                                         * p_outpic->p[i_index].i_pitch;
 
                 for( ; p_out < p_out_end ; )
                 {
-                    pixel_data_t *p_in_end;
+                    u8 *p_in_end;
 
-                    p_in_end = p_in + p_pic->planes[ i_index ].i_bytes;
+                    p_in_end = p_in + p_pic->p[i_index].i_lines
+                                       * p_pic->p[i_index].i_pitch;
 
                     for( ; p_in < p_in_end ; )
                     {
-                        p_in_end -= i_line_bytes;
+                        p_in_end -= i_pitch;
                         *p_out++ = *p_in_end;
                     }
 
@@ -384,17 +376,17 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
         case TRANSFORM_MODE_VFLIP:
             for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
             {
-                pixel_data_t *p_in = p_pic->planes[ i_index ].p_data;
-                pixel_data_t *p_in_end = p_in + p_pic->planes[ i_index ].i_bytes;
+                u8 *p_in = p_pic->p[i_index].p_pixels;
+                u8 *p_in_end = p_in + p_pic->p[i_index].i_lines
+                                       * p_pic->p[i_index].i_pitch;
 
-                pixel_data_t *p_out = p_outpic->planes[ i_index ].p_data;
+                u8 *p_out = p_outpic->p[i_index].p_pixels;
 
                 for( ; p_in < p_in_end ; )
                 {
-                    p_in_end -= p_pic->planes[ i_index ].i_line_bytes;
-                    FAST_MEMCPY( p_out, p_in_end,
-                                 p_pic->planes[ i_index ].i_line_bytes );
-                    p_out += p_pic->planes[ i_index ].i_line_bytes;
+                    p_in_end -= p_pic->p[i_index].i_pitch;
+                    FAST_MEMCPY( p_out, p_in_end, p_pic->p[i_index].i_pitch );
+                    p_out += p_pic->p[i_index].i_pitch;
                 }
             }
             break;
@@ -402,22 +394,22 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
         case TRANSFORM_MODE_HFLIP:
             for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
             {
-                pixel_data_t *p_in = p_pic->planes[ i_index ].p_data;
-                pixel_data_t *p_in_end = p_in + p_pic->planes[ i_index ].i_bytes;
+                u8 *p_in = p_pic->p[i_index].p_pixels;
+                u8 *p_in_end = p_in + p_pic->p[i_index].i_lines
+                                       * p_pic->p[i_index].i_pitch;
 
-                pixel_data_t *p_out = p_outpic->planes[ i_index ].p_data;
+                u8 *p_out = p_outpic->p[i_index].p_pixels;
 
                 for( ; p_in < p_in_end ; )
                 {
-                    pixel_data_t *p_line_end = p_in
-                            + p_pic->planes[ i_index ].i_line_bytes;
+                    u8 *p_line_end = p_in + p_pic->p[i_index].i_pitch;
 
                     for( ; p_in < p_line_end ; )
                     {
                         *p_out++ = *(--p_line_end);
                     }
 
-                    p_in += p_pic->planes[ i_index ].i_line_bytes;
+                    p_in += p_pic->p[i_index].i_pitch;
                 }
             }
             break;
@@ -431,3 +423,15 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
     vout_DisplayPicture( p_vout->p_sys->p_vout, p_outpic );
 }
 
+/*****************************************************************************
+ * vout_Display: displays previously rendered output
+ *****************************************************************************
+ * This function send the currently rendered image to Invert image, waits
+ * until it is displayed and switch the two rendering buffers, preparing next
+ * frame.
+ *****************************************************************************/
+static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    ;
+}
+
index 1999db16c2ad50b1ac69f2759cdbf7d06f1ba23d..8860b9a4a7aa85894d02430de259b3f06d879f82 100644 (file)
@@ -2,7 +2,7 @@
  * wall.c : Wall video plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000, 2001 VideoLAN
- * $Id: wall.c,v 1.5 2002/01/02 14:37:42 sam Exp $
+ * $Id: wall.c,v 1.6 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -90,6 +90,7 @@ static int  vout_Init      ( vout_thread_t * );
 static void vout_End       ( vout_thread_t * );
 static void vout_Destroy   ( vout_thread_t * );
 static int  vout_Manage    ( vout_thread_t * );
+static void vout_Render    ( vout_thread_t *, struct picture_s * );
 static void vout_Display   ( vout_thread_t *, struct picture_s * );
 
 static void RemoveAllVout  ( vout_thread_t *p_vout );
@@ -106,6 +107,7 @@ static void vout_getfunctions( function_list_t * p_function_list )
     p_function_list->functions.vout.pf_end        = vout_End;
     p_function_list->functions.vout.pf_destroy    = vout_Destroy;
     p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_render     = vout_Render;
     p_function_list->functions.vout.pf_display    = vout_Display;
     p_function_list->functions.vout.pf_setpalette = NULL;
 }
@@ -134,7 +136,7 @@ static int vout_Create( vout_thread_t *p_vout )
     }
 
     p_vout->p_sys->i_col = 3;
-    p_vout->p_sys->i_row = 2;
+    p_vout->p_sys->i_row = 3;
 
     p_vout->p_sys->pp_vout = malloc( p_vout->p_sys->i_row *
                                      p_vout->p_sys->i_col *
@@ -162,23 +164,10 @@ static int vout_Init( vout_thread_t *p_vout )
     I_OUTPUTPICTURES = 0;
 
     /* Initialize the output structure */
-    switch( p_vout->render.i_chroma )
-    {
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-        case FOURCC_YV12:
-        case FOURCC_I422:
-        case FOURCC_I444:
-            p_vout->output.i_chroma = p_vout->render.i_chroma;
-            p_vout->output.i_width  = p_vout->render.i_width;
-            p_vout->output.i_height = p_vout->render.i_height;
-            p_vout->output.i_aspect = p_vout->render.i_aspect;
-            break;
-
-        default:
-            return( 0 ); /* unknown chroma */
-            break;
-    }
+    p_vout->output.i_chroma = p_vout->render.i_chroma;
+    p_vout->output.i_width  = p_vout->render.i_width;
+    p_vout->output.i_height = p_vout->render.i_height;
+    p_vout->output.i_aspect = p_vout->render.i_aspect;
 
     /* Try to open the real video output */
     psz_filter = main_GetPszVariable( VOUT_FILTER_VAR, NULL );
@@ -188,6 +177,7 @@ static int vout_Init( vout_thread_t *p_vout )
 
     p_vout->p_sys->i_vout = 0;
 
+    /* FIXME: use bresenham instead of those ugly divisions */
     for( i_row = 0; i_row < p_vout->p_sys->i_row; i_row++ )
     {
         for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
@@ -195,24 +185,25 @@ static int vout_Init( vout_thread_t *p_vout )
             if( i_col + 1 < p_vout->p_sys->i_col )
             {
                 i_width = ( p_vout->render.i_width
-                             / p_vout->p_sys->i_col ) & ~0xf;
+                             / p_vout->p_sys->i_col ) & ~0x1;
             }
             else
             {
                 i_width = p_vout->render.i_width
                            - ( ( p_vout->render.i_width
-                                  / p_vout->p_sys->i_col ) & ~0xf ) * i_col;
+                                  / p_vout->p_sys->i_col ) & ~0x1 ) * i_col;
             }
 
             if( i_row + 1 < p_vout->p_sys->i_row )
             {
-                i_height = p_vout->render.i_height / p_vout->p_sys->i_row;
+                i_height = ( p_vout->render.i_height
+                              / p_vout->p_sys->i_row ) & ~0x3;
             }
             else
             {
                 i_height = p_vout->render.i_height
-                            - p_vout->render.i_height
-                               / p_vout->p_sys->i_row * i_row;
+                            - ( ( p_vout->render.i_height
+                                   / p_vout->p_sys->i_row ) & ~0x3 ) * i_row;
             }
 
             p_vout->p_sys->pp_vout[ p_vout->p_sys->i_vout ].p_vout =
@@ -251,7 +242,7 @@ static void vout_End( vout_thread_t *p_vout )
     for( i_index = I_OUTPUTPICTURES ; i_index ; )
     {
         i_index--;
-        free( PP_OUTPUTPICTURE[ i_index ]->planes[ 0 ].p_data );
+        free( PP_OUTPUTPICTURE[ i_index ]->p_data );
     }
 }
 
@@ -280,22 +271,32 @@ static int vout_Manage( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
- * vout_Display: displays previously rendered output
+ * vout_Render: displays previously rendered output
  *****************************************************************************
  * This function send the currently rendered image to Wall image, waits
  * until it is displayed and switch the two rendering buffers, preparing next
  * frame.
  *****************************************************************************/
-static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
 {
-    picture_t *p_outpic;
-    int i_col, i_row, i_vout, i_index;
-    mtime_t i_date = mdate() + 50000;
+    picture_t *p_outpic = NULL;
+    int i_col, i_row, i_vout, i_plane;
+    int pi_left_skip[VOUT_MAX_PLANES], pi_top_skip[VOUT_MAX_PLANES];
 
     i_vout = 0;
 
+    for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
+    {
+        pi_top_skip[i_plane] = 0;
+    }
+
     for( i_row = 0; i_row < p_vout->p_sys->i_row; i_row++ )
     {
+        for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
+        {
+            pi_left_skip[i_plane] = 0;
+        }
+
         for( i_col = 0; i_col < p_vout->p_sys->i_col; i_col++ )
         {
             while( ( p_outpic =
@@ -314,54 +315,32 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
             }
 
             vout_DatePicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
-                              p_outpic, i_date );
+                              p_outpic, p_pic->date );
             vout_LinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
                               p_outpic );
 
-            for( i_index = 0 ; i_index < p_pic->i_planes ; i_index++ )
+            for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
             {
-                yuv_data_t *p_in, *p_in_end, *p_out;
-                int i_out_bytes, i_offset;
-
-                /* XXX: beware, it's p_outpic ! */
-                i_out_bytes = p_outpic->planes[ i_index ].i_line_bytes;
-
-                if( i_col + 1 < p_vout->p_sys->i_col )
-                {
-                    i_offset = i_out_bytes * i_col;
-                }
-                else
-                {
-                    i_offset = p_pic->planes[ i_index ].i_line_bytes
-                                - i_out_bytes;
-                }
+                u8 *p_in, *p_in_end, *p_out;
+                int i_in_pitch = p_pic->p[i_plane].i_pitch;
+                int i_out_pitch = p_outpic->p[i_plane].i_pitch;
 
-                p_in = p_pic->planes[ i_index ].p_data
-                        + p_pic->planes[ i_index ].i_bytes
-                           / p_vout->p_sys->i_row * i_row
-                        + i_offset;
+                p_in = p_pic->p[i_plane].p_pixels
+                        + pi_top_skip[i_plane] + pi_left_skip[i_plane];
 
-                if( i_row + 1 < p_vout->p_sys->i_row )
-                {
-                    p_in_end = p_in
-                                + p_pic->planes[ i_index ].i_bytes
-                                   / p_vout->p_sys->i_row;
-                }
-                else
-                {
-                    p_in_end = p_pic->planes[ i_index ].p_data
-                                + p_pic->planes[ i_index ].i_bytes
-                                + i_offset;
-                }
+                p_in_end = p_in + p_outpic->p[i_plane].i_lines
+                                   * p_pic->p[i_plane].i_pitch;
 
-                p_out = p_outpic->planes[ i_index ].p_data;
+                p_out = p_outpic->p[i_plane].p_pixels;
 
                 while( p_in < p_in_end )
                 {
-                    FAST_MEMCPY( p_out, p_in, i_out_bytes );
-                    p_in += p_pic->planes[ i_index ].i_line_bytes;
-                    p_out += i_out_bytes;
+                    FAST_MEMCPY( p_out, p_in, i_out_pitch );
+                    p_in += i_in_pitch;
+                    p_out += i_out_pitch;
                 }
+
+                pi_left_skip[i_plane] += p_outpic->p[i_plane].i_pitch;
             }
 
             vout_UnlinkPicture( p_vout->p_sys->pp_vout[ i_vout ].p_vout,
@@ -371,9 +350,27 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
 
             i_vout++;
         }
+
+        for( i_plane = 0 ; i_plane < p_pic->i_planes ; i_plane++ )
+        {
+            pi_top_skip[i_plane] += p_outpic->p[i_plane].i_lines
+                                     * p_pic->p[i_plane].i_pitch;
+        }
     }
 }
 
+/*****************************************************************************
+ * vout_Display: displays previously rendered output
+ *****************************************************************************
+ * This function send the currently rendered image to Invert image, waits
+ * until it is displayed and switch the two rendering buffers, preparing next
+ * frame.
+ *****************************************************************************/
+static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    ;
+}
+
 static void RemoveAllVout( vout_thread_t *p_vout )
 {
     while( p_vout->p_sys->i_vout )
index 36c2d34ead41c231b12204f6d3006fc3f236458a..cdd3be5fd23bba61dc92b527d71483babe1bab7f 100644 (file)
@@ -2,7 +2,7 @@
  * gtk_playlist.c : Interface for the playlist dialog
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: gtk_playlist.c,v 1.24 2001/12/30 07:09:55 sam Exp $
+ * $Id: gtk_playlist.c,v 1.25 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Pierre Baillet <oct@zoy.org>
  *          Stéphane Borel <stef@via.ecp.fr>
@@ -431,12 +431,12 @@ void GtkDropDataReceived( intf_thread_t * p_intf,
         {
             char i_save;
 
-           i_save = p_temp[0];
-           p_temp[0] = '\0';
-           p_protocol = strdup( p_string );
-           p_temp[0] = i_save;
-           p_temp++;
-           
+            i_save = p_temp[0];
+            p_temp[0] = '\0';
+            p_protocol = strdup( p_string );
+            p_temp[0] = i_save;
+            p_temp++;
+
             /* Allowed things are proto: or proto:// */
             if( p_temp[0] == '/' && p_temp[1] == '/')
             {
@@ -460,11 +460,11 @@ void GtkDropDataReceived( intf_thread_t * p_intf,
         {
             p_files = g_list_concat( p_files, GtkReadFiles( p_string ) ); 
         }
-       else
-       {
+        else
+        {
             p_files = g_list_concat( p_files,
                       g_list_append( NULL, g_strdup( p_string ) ) );
-       }
+        }
        
         /* free the malloc and go on... */
         free( p_protocol );
index 413e6ed837620c0a6a83e1a8aa33716401906486..a5475ee535e9bd8fe71aded283673172e18f78cd 100644 (file)
 #include <kdialogbase.h>
 #include <klineedit.h>
 
-KDiskDialog::KDiskDialog( QWidget *parent, const char *name ) :
-               KDialogBase( parent, name, true, QString::null, Ok|Cancel, Ok, true )
+KDiskDialog::KDiskDialog( QWidget *parent, const char *name )
+            :KDialogBase( parent, name, true, QString::null,
+                          Ok|Cancel, Ok, true )
 {
-       QVBox *pageVBox = makeVBoxMainWidget();
+    QVBox *pageVBox = makeVBoxMainWidget();
 
-       QHBox *deviceSelectHBox = new QHBox( pageVBox );
-       deviceSelectHBox->setSpacing( 5 );
-       fButtonGroup = new QVButtonGroup( "Disk type", deviceSelectHBox );
-       fDVDButton = new QRadioButton( "DVD", fButtonGroup);
-       fDVDButton->setChecked( true );
-       fVCDButton = new QRadioButton( "VCD", fButtonGroup);
-       fVCDButton->setEnabled( false );
+    QHBox *deviceSelectHBox = new QHBox( pageVBox );
+    deviceSelectHBox->setSpacing( 5 );
+    fButtonGroup = new QVButtonGroup( "Disk type", deviceSelectHBox );
+    fDVDButton = new QRadioButton( "DVD", fButtonGroup);
+    fDVDButton->setChecked( true );
+    fVCDButton = new QRadioButton( "VCD", fButtonGroup);
+    fVCDButton->setEnabled( false );
 
-       QVGroupBox *startVBox = new QVGroupBox( "Starting position", deviceSelectHBox );
+    QVGroupBox *startVBox = new QVGroupBox( "Starting position", deviceSelectHBox );
 
-       QHBox *titleHBox = new QHBox( startVBox );
-       QLabel *titleLabel = new QLabel( "Title ", titleHBox );
-       fTitle = new QSpinBox( titleHBox );
-       QHBox *chapterHBox = new QHBox( startVBox );
-       QLabel *chapterLabel = new QLabel( "Chapter ", chapterHBox );
-       fChapter = new QSpinBox( chapterHBox );
+    QHBox *titleHBox = new QHBox( startVBox );
+    QLabel *titleLabel = new QLabel( "Title ", titleHBox );
+    fTitle = new QSpinBox( titleHBox );
+    QHBox *chapterHBox = new QHBox( startVBox );
+    QLabel *chapterLabel = new QLabel( "Chapter ", chapterHBox );
+    fChapter = new QSpinBox( chapterHBox );
 
-       QHBox *deviceNameHBox = new QHBox( pageVBox );
-       QLabel *deviceNameLabel = new QLabel( "Device name ", deviceNameHBox );
-       fLineEdit = new KLineEdit( "/dev/dvd", deviceNameHBox );
+    QHBox *deviceNameHBox = new QHBox( pageVBox );
+    QLabel *deviceNameLabel = new QLabel( "Device name ", deviceNameHBox );
+    fLineEdit = new KLineEdit( "/dev/dvd", deviceNameHBox );
 }
 
 KDiskDialog::~KDiskDialog()
@@ -53,27 +54,27 @@ KDiskDialog::~KDiskDialog()
 
 QString KDiskDialog::type() const
 {
-       if ( fDVDButton->isChecked() )
-       {
-               return ( QString("dvd") );
-       }
-       else
-       {
-               return ( QString("vcd") );
-       }
+    if ( fDVDButton->isChecked() )
+    {
+        return ( QString("dvd") );
+    }
+    else
+    {
+        return ( QString("vcd") );
+    }
 }
 
 QString KDiskDialog::device() const
 {
-       return ( fLineEdit->text() );
+    return ( fLineEdit->text() );
 }
 
 int KDiskDialog::title() const
 {
-       return ( fTitle->value() );
+    return ( fTitle->value() );
 }
 
 int KDiskDialog::chapter() const
 {
-       return ( fChapter->value() );
+    return ( fChapter->value() );
 }
index 1e4955266ad894fd75c8d0da8d30a2fe5c4e7c19..b06f2ed5a255602e27e2097cdef2563bc3b761de 100644 (file)
@@ -21,25 +21,26 @@ class KLineEdit;
   *@author andres
   */
 
-class KDiskDialog : public KDialogBase  {
-   Q_OBJECT
-public: 
-       KDiskDialog( QWidget *parent=0, const char *name=0 );
-       ~KDiskDialog();
-
-       QString type() const;
-       QString device() const;
-       int                     title() const;
-       int                     chapter() const;
-
-private:
-
-       QVButtonGroup   *fButtonGroup;
-       QRadioButton            *fDVDButton;
-       QRadioButton            *fVCDButton;
-       QSpinBox                        *fTitle;
-       QSpinBox         *fChapter;
-       KLineEdit                       *fLineEdit;
+class KDiskDialog : public KDialogBase
+{
+    Q_OBJECT
+    public: 
+        KDiskDialog( QWidget *parent=0, const char *name=0 );
+        ~KDiskDialog();
+
+        QString    type() const;
+        QString    device() const;
+        int        title() const;
+        int        chapter() const;
+
+    private:
+
+        QVButtonGroup    *fButtonGroup;
+        QRadioButton     *fDVDButton;
+        QRadioButton     *fVCDButton;
+        QSpinBox         *fTitle;
+        QSpinBox         *fChapter;
+        KLineEdit        *fLineEdit;
 
 };
 
index 3037d9e72ed4847a3deb6c8d0255d7503af2fe0f..4b8cff4e72a00dedb827cf60609bb88acc32ce21 100644 (file)
@@ -20,22 +20,24 @@ class KActionMenu;
   *@author andres
   */
 
-class KTitleMenu : public KPopupMenu  {
-   Q_OBJECT
-public: 
-       KTitleMenu( intf_thread_t *p_intf, QWidget *parent=0, const char *name=0 );
-       ~KTitleMenu();
-
-private:
-       intf_thread_t           *fInterfaceThread;
-       KActionMenu             *fLanguageList;
-
-private slots: // Private slots
-       /** this method regenerates the popup menu */
-       void regenerateSlot();
-
-       /** this method is called when the user selects a language */
-       void languageSelectedSlot();
+class KTitleMenu : public KPopupMenu
+{
+    Q_OBJECT
+    public: 
+        KTitleMenu( intf_thread_t *p_intf, QWidget *parent=0,
+                    const char *name=0 );
+        ~KTitleMenu();
+
+    private:
+        intf_thread_t      *fInterfaceThread;
+        KActionMenu        *fLanguageList;
+
+    private slots: // Private slots
+        /** this method regenerates the popup menu */
+        void regenerateSlot();
+
+        /** this method is called when the user selects a language */
+        void languageSelectedSlot();
 
 };
 
index d348ac6193b61c7d7e4c7d63392f2179681c2a02..0f1d510ff785481d0c3e1d498e1e2792ee6c586c 100644 (file)
 #include <qvgroupbox.h>
 #include <qwidget.h>
 
-KNetDialog::KNetDialog( QWidget *parent, const char *name ) :
-               KDialogBase( parent, name, true, QString::null, Ok|Cancel, Ok, true )
+KNetDialog::KNetDialog( QWidget *parent, const char *name )
+           :KDialogBase( parent, name, true,
+                         QString::null, Ok|Cancel, Ok, true )
 {
-       QVBox *pageVBox = makeVBoxMainWidget();
+    QVBox *pageVBox = makeVBoxMainWidget();
 
-       QHBox *layout = new QHBox( pageVBox );
-       layout->setSpacing( 5 );
-       fButtonGroup = new QVButtonGroup( "Protocol", layout );
-       fTSButton = new QRadioButton( "TS", fButtonGroup);
-       fTSButton->setChecked( true );
-       fRTPButton = new QRadioButton( "RTP", fButtonGroup);
-       fRTPButton->setEnabled( false );
-       fHTTPButton = new QRadioButton( "HTTP", fButtonGroup);
-       fHTTPButton->setEnabled( false );
+    QHBox *layout = new QHBox( pageVBox );
+    layout->setSpacing( 5 );
+    fButtonGroup = new QVButtonGroup( "Protocol", layout );
+    fTSButton = new QRadioButton( "TS", fButtonGroup);
+    fTSButton->setChecked( true );
+    fRTPButton = new QRadioButton( "RTP", fButtonGroup);
+    fRTPButton->setEnabled( false );
+    fHTTPButton = new QRadioButton( "HTTP", fButtonGroup);
+    fHTTPButton->setEnabled( false );
 
-       QVGroupBox *serverVBox = new QVGroupBox( "Starting position", layout );
+    QVGroupBox *serverVBox = new QVGroupBox( "Starting position", layout );
 
-       QHBox *titleHBox = new QHBox( serverVBox );
-       QLabel *titleLabel = new QLabel( "Address ", titleHBox );
-       fAddress = new KLineEdit( "vls", titleHBox );
-       QHBox *portHBox = new QHBox( serverVBox );
-       QLabel *portLabel = new QLabel( "Port ", portHBox );
-       fPort = new QSpinBox( 0, 65535, 1, portHBox );
+    QHBox *titleHBox = new QHBox( serverVBox );
+    QLabel *titleLabel = new QLabel( "Address ", titleHBox );
+    fAddress = new KLineEdit( "vls", titleHBox );
+    QHBox *portHBox = new QHBox( serverVBox );
+    QLabel *portLabel = new QLabel( "Port ", portHBox );
+    fPort = new QSpinBox( 0, 65535, 1, portHBox );
 }
 
 KNetDialog::~KNetDialog()
@@ -51,26 +52,26 @@ KNetDialog::~KNetDialog()
 
 QString KNetDialog::protocol() const
 {
-       if ( fTSButton->isChecked() )
-       {
-               return ( QString( "ts" ) );
-       }
-       else if ( fRTPButton->isChecked() )
-       {
-               return ( QString( "rtp" ) );
-       }
-       else
-       {
-               return ( QString( "http" ) );
-       }
+    if ( fTSButton->isChecked() )
+    {
+        return ( QString( "ts" ) );
+    }
+    else if ( fRTPButton->isChecked() )
+    {
+        return ( QString( "rtp" ) );
+    }
+    else
+    {
+        return ( QString( "http" ) );
+    }
 }
 
 QString KNetDialog::server() const
 {
-       return ( fAddress->text() );
+    return ( fAddress->text() );
 }
 
 int KNetDialog::port() const
 {
-       return ( fPort->value() );
+    return ( fPort->value() );
 }
index 954b38725126bdb058fa6d44aa23bf76ddd0ea43..64ce10f8ac3238070fc90332f648346c1fe7cde4 100644 (file)
@@ -21,23 +21,24 @@ class KLineEdit;
   *@author andres
   */
 
-class KNetDialog : public KDialogBase  {
-               Q_OBJECT
-       public:
-               KNetDialog(QWidget *parent=0, const char *name=0);
-               ~KNetDialog();
-
-               QString protocol() const;
-               QString server() const;
-               int                     port() const;
-
-       private:
-               QVButtonGroup   *fButtonGroup;
-               QRadioButton            *fTSButton;
-               QRadioButton            *fRTPButton;
-               QRadioButton            *fHTTPButton;
-               KLineEdit                               *fAddress;
-               QSpinBox                                *fPort;
+class KNetDialog : public KDialogBase
+{
+    Q_OBJECT
+    public:
+        KNetDialog(QWidget *parent=0, const char *name=0);
+        ~KNetDialog();
+
+        QString    protocol() const;
+        QString    server() const;
+        int        port() const;
+
+    private:
+        QVButtonGroup    *fButtonGroup;
+        QRadioButton     *fTSButton;
+        QRadioButton     *fRTPButton;
+        QRadioButton     *fHTTPButton;
+        KLineEdit        *fAddress;
+        QSpinBox         *fPort;
 
 };
 
index 98b090474b0cff465dcd9893f64d2f8fbe9fc44c..c5a4fc0b61b462e6289a907e1ae20b09a7dfe6ab 100644 (file)
@@ -6,7 +6,7 @@
     email                : dae@chez.com
  ***************************************************************************/
 /***************************************************************************
-       shamelessly copied from noatun's excellent interface
+        shamelessly copied from noatun's excellent interface
 ****************************************************************************/
 #ifndef _KDE_SLIDER_H_
 #define _KDE_SLIDER_H_
  */
 class KVLCSlider : public QSlider
 {
-       Q_OBJECT
-       public:
-               KVLCSlider(QWidget * parent, const char * name=0);
-               KVLCSlider(Orientation, QWidget * parent, const char * name=0);
-               KVLCSlider(int minValue, int maxValue, int pageStep, int value,
-                       Orientation, QWidget * parent, const char * name=0);
+    Q_OBJECT
+    public:
+        KVLCSlider(QWidget * parent, const char * name=0);
+        KVLCSlider(Orientation, QWidget * parent, const char * name=0);
+        KVLCSlider(int minValue, int maxValue, int pageStep, int value,
+                   Orientation, QWidget * parent, const char * name=0);
 
-       signals:
-       /**
-        * emmited only when the user changes the value by hand
-        */
-       void userChanged( int value );
+    signals:
+    /**
+     * emmited only when the user changes the value by hand
+     */
+    void userChanged( int value );
 
-       public slots:
-               virtual void setValue( int );
+    public slots:
+        virtual void setValue( int );
 
-       protected:
-               virtual void mousePressEvent( QMouseEvent * e );
-               virtual void mouseReleaseEvent( QMouseEvent * e );
+    protected:
+        virtual void mousePressEvent( QMouseEvent * e );
+        virtual void mouseReleaseEvent( QMouseEvent * e );
 
-       private:
-               bool pressed; // set this to true when the user drags the slider
+    private:
+        bool pressed; // set this to true when the user drags the slider
 };
 
 #endif /* _KDE_SLIDER_H_ */
index 9c16bdc4f3e79b57e5d06b96e2b31392f7b9db0d..191187819a04cf6d0597bb968359ae545c716a18 100644 (file)
@@ -1,4 +1,4 @@
 memcpy_SOURCES = memcpy.c
-memcpymmx_SOURCES = memcpymmx.c
-memcpymmxext_SOURCES = memcpymmxext.c
-memcpy3dn_SOURCES = memcpy3dn.c
+memcpymmx_SOURCES = memcpy.c
+memcpymmxext_SOURCES = memcpy.c
+memcpy3dn_SOURCES = memcpy.c
index 165bb3720ef999faca43b33a64b445745f57bbe7..d573327bde14cbe5d6e9aafe741563b9b24dd652 100644 (file)
@@ -2,7 +2,7 @@
  * memcpy.c : classic memcpy module
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: memcpy.c,v 1.3 2001/12/30 07:09:55 sam Exp $
+ * $Id: memcpy.c,v 1.4 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
 
 #include <videolan/vlc.h>
 
+#undef HAVE_MMX
+#undef HAVE_MMX2
+#undef HAVE_SSE
+#undef HAVE_SSE2
+#undef HAVE_3DNOW
+
+#if defined( MODULE_NAME_IS_memcpy3dn )
+#   define HAVE_3DNOW
+#   include "fastmemcpy.h"
+#elif defined( MODULE_NAME_IS_memcpymmx )
+#   define HAVE_MMX
+#   include "fastmemcpy.h"
+#elif defined( MODULE_NAME_IS_memcpymmxext )
+#   define HAVE_MMX2
+#   include "fastmemcpy.h"
+#endif
+
 /*****************************************************************************
  * Local and extern prototypes.
  *****************************************************************************/
 static void memcpy_getfunctions( function_list_t * p_function_list );
 static int  memcpy_Probe       ( probedata_t *p_data );
+#ifndef MODULE_NAME_IS_memcpy
+void *      _M( fast_memcpy )  ( void * to, const void * from, size_t len );
+#endif
 
 /*****************************************************************************
  * Build configuration tree.
@@ -42,11 +62,33 @@ MODULE_CONFIG_START
 MODULE_CONFIG_STOP
 
 MODULE_INIT_START
+#ifdef MODULE_NAME_IS_memcpy
     SET_DESCRIPTION( "libc memcpy module" )
     ADD_CAPABILITY( MEMCPY, 50 )
     ADD_SHORTCUT( "c" )
     ADD_SHORTCUT( "libc" )
     ADD_SHORTCUT( "memcpy" )
+#elif defined( MODULE_NAME_IS_memcpy3dn )
+    SET_DESCRIPTION( "3D Now! memcpy module" )
+    ADD_CAPABILITY( MEMCPY, 100 )
+    ADD_REQUIREMENT( 3DNOW )
+    ADD_SHORTCUT( "3dn" )
+    ADD_SHORTCUT( "3dnow" )
+    ADD_SHORTCUT( "memcpy3dn" )
+    ADD_SHORTCUT( "memcpy3dnow" )
+#elif defined( MODULE_NAME_IS_memcpymmx )
+    SET_DESCRIPTION( "MMX memcpy module" )
+    ADD_CAPABILITY( MEMCPY, 100 )
+    ADD_REQUIREMENT( MMX )
+    ADD_SHORTCUT( "mmx" )
+    ADD_SHORTCUT( "memcpymmx" )
+#elif defined( MODULE_NAME_IS_memcpymmxext )
+    SET_DESCRIPTION( "MMX EXT memcpy module" )
+    ADD_CAPABILITY( MEMCPY, 200 )
+    ADD_REQUIREMENT( MMXEXT )
+    ADD_SHORTCUT( "mmxext" )
+    ADD_SHORTCUT( "memcpymmxext" )
+#endif
 MODULE_INIT_STOP
 
 MODULE_ACTIVATE_START
@@ -65,9 +107,11 @@ MODULE_DEACTIVATE_STOP
 static void memcpy_getfunctions( function_list_t * p_function_list )
 {
     p_function_list->pf_probe = memcpy_Probe;
-#define F p_function_list->functions.memcpy
-    F.fast_memcpy = memcpy;
-#undef F
+#ifdef MODULE_NAME_IS_memcpy
+    p_function_list->functions.memcpy.fast_memcpy = memcpy;
+#else
+    p_function_list->functions.memcpy.fast_memcpy = _M( fast_memcpy );
+#endif
 }
 
 /*****************************************************************************
@@ -75,6 +119,6 @@ static void memcpy_getfunctions( function_list_t * p_function_list )
  *****************************************************************************/
 static int memcpy_Probe( probedata_t *p_data )
 {
-    return( 50 );
+    return( 1 );
 }
 
diff --git a/plugins/memcpy/memcpy3dn.c b/plugins/memcpy/memcpy3dn.c
deleted file mode 100644 (file)
index 826d679..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/*****************************************************************************
- * memcpy3dn.c : 3D Now! memcpy module
- *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: memcpy3dn.c,v 1.3 2001/12/30 07:09:55 sam Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-
-#include <videolan/vlc.h>
-
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void memcpy_getfunctions( function_list_t * p_function_list );
-static int  memcpy_Probe       ( probedata_t *p_data );
-void *      _M( fast_memcpy )  ( void * to, const void * from, size_t len );
-
-#undef HAVE_MMX
-#undef HAVE_MMX2
-#undef HAVE_SSE
-#undef HAVE_SSE2
-#define HAVE_3DNOW
-#include "fastmemcpy.h"
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
-    SET_DESCRIPTION( "3D Now! memcpy module" )
-    ADD_CAPABILITY( MEMCPY, 100 )
-    ADD_REQUIREMENT( 3DNOW )
-    ADD_SHORTCUT( "3dnow" )
-    ADD_SHORTCUT( "3dn" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
-    memcpy_getfunctions( &p_module->p_functions->memcpy );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void memcpy_getfunctions( function_list_t * p_function_list )
-{
-    p_function_list->pf_probe = memcpy_Probe;
-#define F p_function_list->functions.memcpy
-    F.fast_memcpy = _M( fast_memcpy );
-#undef F
-}
-
-/*****************************************************************************
- * memcpy_Probe: returns a preference score
- *****************************************************************************/
-static int memcpy_Probe( probedata_t *p_data )
-{
-    /* This plugin always works */
-    return( 100 );
-}
-
diff --git a/plugins/memcpy/memcpymmx.c b/plugins/memcpy/memcpymmx.c
deleted file mode 100644 (file)
index f6ad370..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*****************************************************************************
- * memcpymmx.c : MMX memcpy module
- *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: memcpymmx.c,v 1.3 2001/12/30 07:09:55 sam Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-
-#include <videolan/vlc.h>
-
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void memcpy_getfunctions( function_list_t * p_function_list );
-static int  memcpy_Probe       ( probedata_t *p_data );
-void *      _M( fast_memcpy )  ( void * to, const void * from, size_t len );
-
-#define HAVE_MMX
-#undef HAVE_MMX2
-#undef HAVE_SSE
-#undef HAVE_SSE2
-#undef HAVE_3DNOW
-#include "fastmemcpy.h"
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
-    SET_DESCRIPTION( "MMX memcpy module" )
-    ADD_CAPABILITY( MEMCPY, 100 )
-    ADD_REQUIREMENT( MMX )
-    ADD_SHORTCUT( "mmx" )
-    ADD_SHORTCUT( "memcpymmx" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
-    memcpy_getfunctions( &p_module->p_functions->memcpy );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void memcpy_getfunctions( function_list_t * p_function_list )
-{
-    p_function_list->pf_probe = memcpy_Probe;
-#define F p_function_list->functions.memcpy
-    F.fast_memcpy = _M( fast_memcpy );
-#undef F
-}
-
-/*****************************************************************************
- * memcpy_Probe: returns a preference score
- *****************************************************************************/
-static int memcpy_Probe( probedata_t *p_data )
-{
-    return( 100 );
-}
-
diff --git a/plugins/memcpy/memcpymmxext.c b/plugins/memcpy/memcpymmxext.c
deleted file mode 100644 (file)
index ae27a1b..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*****************************************************************************
- * memcpymmxext.c : MMX EXT memcpy module
- *****************************************************************************
- * Copyright (C) 2001 VideoLAN
- * $Id: memcpymmxext.c,v 1.3 2001/12/30 07:09:55 sam Exp $
- *
- * Authors: Samuel Hocevar <sam@zoy.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
- *****************************************************************************/
-
-/*****************************************************************************
- * Preamble
- *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-
-#include <videolan/vlc.h>
-
-/*****************************************************************************
- * Local and extern prototypes.
- *****************************************************************************/
-static void memcpy_getfunctions( function_list_t * p_function_list );
-static int  memcpy_Probe       ( probedata_t *p_data );
-void *      _M( fast_memcpy )  ( void * to, const void * from, size_t len );
-
-#undef HAVE_MMX
-#define HAVE_MMX2
-#undef HAVE_SSE
-#undef HAVE_SSE2
-#undef HAVE_3DNOW
-#include "fastmemcpy.h"
-
-/*****************************************************************************
- * Build configuration tree.
- *****************************************************************************/
-MODULE_CONFIG_START
-MODULE_CONFIG_STOP
-
-MODULE_INIT_START
-    SET_DESCRIPTION( "MMX EXT memcpy module" )
-    ADD_CAPABILITY( MEMCPY, 200 )
-    ADD_REQUIREMENT( MMXEXT )
-    ADD_SHORTCUT( "memcpymmxext" )
-    ADD_SHORTCUT( "mmxext" )
-MODULE_INIT_STOP
-
-MODULE_ACTIVATE_START
-    memcpy_getfunctions( &p_module->p_functions->memcpy );
-MODULE_ACTIVATE_STOP
-
-MODULE_DEACTIVATE_START
-MODULE_DEACTIVATE_STOP
-
-/* Following functions are local */
-
-/*****************************************************************************
- * Functions exported as capabilities. They are declared as static so that
- * we don't pollute the namespace too much.
- *****************************************************************************/
-static void memcpy_getfunctions( function_list_t * p_function_list )
-{
-    p_function_list->pf_probe = memcpy_Probe;
-#define F p_function_list->functions.memcpy
-    F.fast_memcpy = _M( fast_memcpy );
-#undef F
-}
-
-/*****************************************************************************
- * memcpy_Probe: returns a preference score
- *****************************************************************************/
-static int memcpy_Probe( probedata_t *p_data )
-{
-    return( 200 );
-}
-
index e4e2893d4dabfa0e1028bbe9701571a249b94593..801d5533f475ffd145ce75dbdc73d4a66e9e2a36 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_blocks.c : blocks parsing
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: vpar_blocks.c,v 1.5 2001/12/30 07:09:56 sam Exp $
+ * $Id: vpar_blocks.c,v 1.6 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Michel Lespinasse <walken@zoy.org>
  *          Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
@@ -1814,20 +1814,20 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
         if( i_coding_type != I_CODING_TYPE || p_vpar->picture.b_concealment_mv )
         {
             p_f_motion->pppi_ref[1][0] =
-                pp_forward_ref[1]->P_Y + i_offset * 4 + i_width;
+                pp_forward_ref[1]->Y_PIXELS + i_offset * 4 + i_width;
             p_f_motion->pppi_ref[1][1] =
-                pp_forward_ref[1]->P_U + i_chroma_tmp;
+                pp_forward_ref[1]->U_PIXELS + i_chroma_tmp;
             p_f_motion->pppi_ref[1][2] =
-                pp_forward_ref[1]->P_V + i_chroma_tmp;
+                pp_forward_ref[1]->V_PIXELS + i_chroma_tmp;
         }
         if( i_coding_type == B_CODING_TYPE )
         {
             p_b_motion->pppi_ref[1][0] =
-                p_vpar->sequence.p_backward->P_Y + i_offset * 4 + i_width;
+                p_vpar->sequence.p_backward->Y_PIXELS + i_offset * 4 + i_width;
             p_b_motion->pppi_ref[1][1] =
-                p_vpar->sequence.p_backward->P_U + i_chroma_tmp;
+                p_vpar->sequence.p_backward->U_PIXELS + i_chroma_tmp;
             p_b_motion->pppi_ref[1][2] =
-                p_vpar->sequence.p_backward->P_V + i_chroma_tmp;
+                p_vpar->sequence.p_backward->V_PIXELS + i_chroma_tmp;
         }
     }
 
@@ -1836,9 +1836,9 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
                         * (2 - p_vpar->sequence.b_chroma_h_subsampled);
     if( i_coding_type != I_CODING_TYPE || p_vpar->picture.b_concealment_mv )
     {
-        p_f_motion->pppi_ref[0][0] = pp_forward_ref[0]->P_Y + i_offset * 4;
-        p_f_motion->pppi_ref[0][1] = pp_forward_ref[0]->P_U + i_chroma_tmp;
-        p_f_motion->pppi_ref[0][2] = pp_forward_ref[0]->P_V + i_chroma_tmp;
+        p_f_motion->pppi_ref[0][0] = pp_forward_ref[0]->Y_PIXELS + i_offset * 4;
+        p_f_motion->pppi_ref[0][1] = pp_forward_ref[0]->U_PIXELS + i_chroma_tmp;
+        p_f_motion->pppi_ref[0][2] = pp_forward_ref[0]->V_PIXELS + i_chroma_tmp;
         p_f_motion->pi_f_code[0] = p_vpar->picture.ppi_f_code[0][0];
         p_f_motion->pi_f_code[1] = p_vpar->picture.ppi_f_code[0][1];
         p_f_motion->ppi_pmv[0][0] = p_f_motion->ppi_pmv[0][1] = 0;
@@ -1847,12 +1847,12 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
 
     if( i_coding_type == B_CODING_TYPE )
     {
-        p_b_motion->pppi_ref[0][0] = p_vpar->sequence.p_backward->P_Y
+        p_b_motion->pppi_ref[0][0] = p_vpar->sequence.p_backward->Y_PIXELS
                                         + i_offset * 4;
-        p_b_motion->pppi_ref[0][1] = p_vpar->sequence.p_backward->P_U
-            + i_chroma_tmp;
-        p_b_motion->pppi_ref[0][2] = p_vpar->sequence.p_backward->P_V
-            + i_chroma_tmp;
+        p_b_motion->pppi_ref[0][1] = p_vpar->sequence.p_backward->U_PIXELS
+                                        + i_chroma_tmp;
+        p_b_motion->pppi_ref[0][2] = p_vpar->sequence.p_backward->V_PIXELS
+                                        + i_chroma_tmp;
         p_b_motion->pi_f_code[0] = p_vpar->picture.ppi_f_code[1][0];
         p_b_motion->pi_f_code[1] = p_vpar->picture.ppi_f_code[1][1];
         p_b_motion->ppi_pmv[0][0] = p_b_motion->ppi_pmv[0][1] = 0;
@@ -1860,9 +1860,9 @@ static __inline__ void ParseSlice( vpar_thread_t * p_vpar,
     }
 
     /* Initialize destination pointers. */
-    p_dest[0] = p_vpar->picture.p_picture->P_Y + i_offset * 4;
-    p_dest[1] = p_vpar->picture.p_picture->P_U + i_chroma_tmp;
-    p_dest[2] = p_vpar->picture.p_picture->P_V + i_chroma_tmp;
+    p_dest[0] = p_vpar->picture.p_picture->Y_PIXELS + i_offset * 4;
+    p_dest[1] = p_vpar->picture.p_picture->U_PIXELS + i_chroma_tmp;
+    p_dest[2] = p_vpar->picture.p_picture->V_PIXELS + i_chroma_tmp;
 
     if( i_structure == BOTTOM_FIELD )
     {
index 35f17474a6204f95aa8ac817a6254a28ff3dee8a..5ba0b40ab962394ad579162d605333d74fe6c534 100644 (file)
@@ -2,7 +2,7 @@
  * video_parser.h : Variable Length Codes
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_blocks.h,v 1.1 2001/11/13 12:09:18 henri Exp $
+ * $Id: vpar_blocks.h,v 1.2 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Jean-Marc Dressler <polux@via.ecp.fr>
@@ -111,7 +111,7 @@ static lookup_t MB_B [] = {
     {0,                 0}, {INTRA|QUANT,       6},
     {BWD|CODED|QUANT,   6}, {FWD|CODED|QUANT,   6},
     {INTER|CODED|QUANT, 5}, {INTER|CODED|QUANT, 5},
-                                       {INTRA,       5}, {INTRA,       5},
+                                        {INTRA,       5}, {INTRA,       5},
     {FWD,         4}, {FWD,         4}, {FWD,         4}, {FWD,         4},
     {FWD|CODED,   4}, {FWD|CODED,   4}, {FWD|CODED,   4}, {FWD|CODED,   4},
     {BWD,         3}, {BWD,         3}, {BWD,         3}, {BWD,         3},
@@ -300,7 +300,7 @@ static dct_lookup_t DCT_B14_8 [] = {
 };
 
 static dct_lookup_t DCT_B14AC_5 [] = {
-                {  1, 3, 5}, {  5, 1, 5}, {  4, 1, 5},
+                 {  1, 3, 5}, {  5, 1, 5}, {  4, 1, 5},
     {  1, 2, 4}, {  1, 2, 4}, {  3, 1, 4}, {  3, 1, 4},
     {  2, 1, 3}, {  2, 1, 3}, {  2, 1, 3}, {  2, 1, 3},
     {129, 0, 2}, {129, 0, 2}, {129, 0, 2}, {129, 0, 2},
@@ -310,7 +310,7 @@ static dct_lookup_t DCT_B14AC_5 [] = {
 };
 
 static dct_lookup_t DCT_B14DC_5 [] = {
-                {  1, 3, 5}, {  5, 1, 5}, {  4, 1, 5},
+                 {  1, 3, 5}, {  5, 1, 5}, {  4, 1, 5},
     {  1, 2, 4}, {  1, 2, 4}, {  3, 1, 4}, {  3, 1, 4},
     {  2, 1, 3}, {  2, 1, 3}, {  2, 1, 3}, {  2, 1, 3},
     {  1, 1, 1}, {  1, 1, 1}, {  1, 1, 1}, {  1, 1, 1},
@@ -396,7 +396,7 @@ static dct_lookup_t DCT_B15_8 [] = {
  *****************************************************************************/
 
 static lookup_t MBA_5 [] = {
-                   {6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4},
+                    {6, 5}, {5, 5}, {4, 4}, {4, 4}, {3, 4}, {3, 4},
     {2, 3}, {2, 3}, {2, 3}, {2, 3}, {1, 3}, {1, 3}, {1, 3}, {1, 3},
     {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1},
     {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}, {0, 1}
index 865766d4cd4dbaea6fbbd8882a58cb5d8afbf938..8d609fe1628b69037b6dcde6bfe4c28c8774d4a3 100644 (file)
@@ -2,7 +2,7 @@
  * aout_sdl.c : audio sdl functions library
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: aout_sdl.c,v 1.22 2001/12/30 07:09:56 sam Exp $
+ * $Id: aout_sdl.c,v 1.23 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Michel Kaempf <maxx@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -144,6 +144,11 @@ static int aout_Open( aout_thread_t *p_aout )
     SDL_AudioSpec desired;
     int i_channels = p_aout->b_stereo ? 2 : 1;
 
+    if( SDL_WasInit( SDL_INIT_AUDIO ) != 0 )
+    {
+        return( 0 );
+    }
+
     /* Allocate structure */
     p_aout->p_sys = malloc( sizeof( aout_sys_t ) );
 
index 1105c1362b00677b6ce88005553457122af0bf2e..41f3e423eb0df2eecd50a801acea893be526fd7b 100644 (file)
@@ -2,7 +2,7 @@
  * vout_sdl.c: SDL video output display method
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: vout_sdl.c,v 1.75 2002/01/02 14:37:42 sam Exp $
+ * $Id: vout_sdl.c,v 1.76 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *          Pierre Baillet <oct@zoy.org>
@@ -66,7 +66,14 @@ typedef struct vout_sys_s
     int i_width;
     int i_height;
 
+    /* For YUV output */
+    u32 i_chroma;                          /* The internally selected chroma */
+
+    /* For RGB output */
     int i_surfaces;
+    int i_red_mask;
+    int i_green_mask;
+    int i_blue_mask;
 
     boolean_t   b_cursor;
     boolean_t   b_cursor_autohidden;
@@ -86,6 +93,65 @@ typedef struct picture_sys_s
 
 } picture_sys_t;
 
+/*****************************************************************************
+ * Seeking function TODO: put this in a generic location !
+ *****************************************************************************/
+static __inline__ void vout_Seek( off_t i_seek )
+{
+#define area p_main->p_intf->p_input->stream.p_selected_area
+    off_t i_tell = area->i_tell;
+
+    i_tell += i_seek * (off_t)50 * p_main->p_intf->p_input->stream.i_mux_rate;
+
+    i_tell = ( i_tell <= area->i_start ) ? area->i_start
+           : ( i_tell >= area->i_size ) ? area->i_size
+           : i_tell;
+
+    input_Seek( p_main->p_intf->p_input, i_tell );
+#undef area
+}
+
+/*****************************************************************************
+ * Return the best suited FourCC value for a given chroma. We use this
+ * because a decoder may output FOURCC_IYUV, which is exactly the same as
+ * FOURCC_I420, but X servers usually know FOURCC_I420 and not FOURCC_IYUV.
+ *****************************************************************************/
+static __inline__ u32 BestChroma( u32 i_chroma )
+{
+    /* XXX: don't forget to update vout_Init if you change this */
+    switch( i_chroma )
+    {
+        /* These ones are almost the same */
+        case FOURCC_I420:
+        case FOURCC_IYUV:
+        case FOURCC_YV12:
+            return SDL_YV12_OVERLAY;
+
+        /* These ones are all the same */
+        case FOURCC_UYVY:
+        case FOURCC_UYNV:
+        case FOURCC_Y422:
+            return SDL_UYVY_OVERLAY;
+
+        /* These ones are all the same */
+        case FOURCC_YUY2:
+        case FOURCC_YUNV:
+            return SDL_YUY2_OVERLAY;
+
+        /* We know this one */
+        case FOURCC_YVYU:
+            return SDL_YVYU_OVERLAY;
+
+        /* This is seldom supported, but we know how to convert it */
+        case FOURCC_I422:
+            return SDL_YUY2_OVERLAY;
+
+        /* We don't know this chroma, but maybe SDL does */
+        default:
+            return i_chroma;
+    }
+}
+
 /*****************************************************************************
  * Local prototypes.
  *****************************************************************************/
@@ -95,6 +161,7 @@ static int  vout_Init       ( struct vout_thread_s * );
 static void vout_End        ( struct vout_thread_s * );
 static void vout_Destroy    ( struct vout_thread_s * );
 static int  vout_Manage     ( struct vout_thread_s * );
+static void vout_Render     ( struct vout_thread_s *, struct picture_s * );
 static void vout_Display    ( struct vout_thread_s *, struct picture_s * );
 
 static int  SDLOpenDisplay      ( vout_thread_t *p_vout );
@@ -113,6 +180,7 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
     p_function_list->functions.vout.pf_end        = vout_End;
     p_function_list->functions.vout.pf_destroy    = vout_Destroy;
     p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_render     = vout_Render;
     p_function_list->functions.vout.pf_display    = vout_Display;
     p_function_list->functions.vout.pf_setpalette = NULL;
 }
@@ -142,6 +210,11 @@ static int vout_Probe( probedata_t *p_data )
  *****************************************************************************/
 static int vout_Create( vout_thread_t *p_vout )
 {
+    if( SDL_WasInit( SDL_INIT_VIDEO ) != 0 )
+    {
+        return( 1 );
+    }
+
     /* Allocate structure */
     p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
     if( p_vout->p_sys == NULL )
@@ -168,7 +241,7 @@ static int vout_Create( vout_thread_t *p_vout )
         return( 1 );
     }
 
-    p_vout->p_sys->b_cursor = 1; /* TODO should be done with a main_GetInt.. */
+    p_vout->p_sys->b_cursor = 1;
     p_vout->p_sys->b_cursor_autohidden = 0;
     p_vout->p_sys->i_lastmoved = mdate();
 
@@ -225,26 +298,58 @@ static int vout_Init( vout_thread_t *p_vout )
     I_OUTPUTPICTURES = 0;
 
     /* Initialize the output structure */
-    switch( p_vout->render.i_chroma )
+    if( p_vout->p_sys->p_overlay == NULL )
+    {
+        /* All we have is an RGB image with square pixels */
+        p_vout->output.i_chroma = p_vout->p_sys->i_chroma;
+        p_vout->output.i_width  = p_vout->p_sys->i_width;
+        p_vout->output.i_height = p_vout->p_sys->i_height;
+        p_vout->output.i_aspect = p_vout->p_sys->i_width
+                                   * VOUT_ASPECT_FACTOR
+                                   / p_vout->p_sys->i_height;
+    }
+    else
     {
+        switch( p_vout->render.i_chroma )
+        {
         case FOURCC_I420:
         case FOURCC_IYUV:
         case FOURCC_YV12:
+
+        case FOURCC_UYVY:
+        case FOURCC_UYNV:
+        case FOURCC_Y422:
+
+        case FOURCC_YUY2:
+        case FOURCC_YUNV:
+
+        case FOURCC_YVYU:
+            /* We can directly handle all these chromas */
             p_vout->output.i_chroma = p_vout->render.i_chroma;
             p_vout->output.i_width  = p_vout->render.i_width;
             p_vout->output.i_height = p_vout->render.i_height;
             p_vout->output.i_aspect = p_vout->render.i_aspect;
             break;
 
+        case FOURCC_I422:
+            /* We need to convert this one, but at least we keep the
+             * aspect ratio */
+            p_vout->output.i_chroma = p_vout->p_sys->i_chroma;
+            p_vout->output.i_width  = p_vout->render.i_width;
+            p_vout->output.i_height = p_vout->render.i_height;
+            p_vout->output.i_aspect = p_vout->render.i_aspect;
+            break;
+
         default:
-            /* All we have is a 16bpp image with square pixels */
-            /* FIXME: and if screen depth != 16 ?! */
-            p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_16BPP;
-            p_vout->output.i_width = p_vout->p_sys->i_width;
+            /* All we have is an RGB image with square pixels */
+            p_vout->output.i_chroma = p_vout->p_sys->i_chroma;
+            p_vout->output.i_width  = p_vout->p_sys->i_width;
             p_vout->output.i_height = p_vout->p_sys->i_height;
             p_vout->output.i_aspect = p_vout->p_sys->i_width
-                             * VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
+                                       * VOUT_ASPECT_FACTOR
+                                       / p_vout->p_sys->i_height;
             break;
+        }
     }
 
     /* Try to initialize SDL_MAX_DIRECTBUFFERS direct buffers */
@@ -268,13 +373,8 @@ static int vout_Init( vout_thread_t *p_vout )
             break;
         }
 
-        p_pic->i_status        = DESTROYED_PICTURE;
-        p_pic->i_type          = DIRECT_PICTURE;
-
-        p_pic->i_left_margin   =
-        p_pic->i_right_margin  =
-        p_pic->i_top_margin    =
-        p_pic->i_bottom_margin = 0;
+        p_pic->i_status = DESTROYED_PICTURE;
+        p_pic->i_type   = DIRECT_PICTURE;
 
         PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
 
@@ -297,20 +397,16 @@ static void vout_End( vout_thread_t *p_vout )
     for( i_index = I_OUTPUTPICTURES ; i_index ; )
     {
         i_index--;
-        switch( p_vout->output.i_chroma )
+        if( p_vout->p_sys->p_overlay == NULL )
         {
-            case FOURCC_I420:
-            case FOURCC_IYUV:
-            case FOURCC_YV12:
-                SDL_UnlockYUVOverlay(
-                        PP_OUTPUTPICTURE[ i_index ]->p_sys->p_overlay );
-                SDL_FreeYUVOverlay(
-                        PP_OUTPUTPICTURE[ i_index ]->p_sys->p_overlay );
-                break;
-
-            default:
-                /* RGB picture */
-                break;
+            /* RGB picture */
+        }
+        else
+        {
+            SDL_UnlockYUVOverlay(
+                    PP_OUTPUTPICTURE[ i_index ]->p_sys->p_overlay );
+            SDL_FreeYUVOverlay(
+                    PP_OUTPUTPICTURE[ i_index ]->p_sys->p_overlay );
         }
         free( PP_OUTPUTPICTURE[ i_index ]->p_sys );
     }
@@ -330,21 +426,6 @@ static void vout_Destroy( vout_thread_t *p_vout )
     free( p_vout->p_sys );
 }
 
-static __inline__ void vout_Seek( off_t i_seek )
-{
-#define area p_main->p_intf->p_input->stream.p_selected_area
-    off_t i_tell = area->i_tell;
-
-    i_tell += i_seek * (off_t)50 * p_main->p_intf->p_input->stream.i_mux_rate;
-
-    i_tell = ( i_tell <= area->i_start ) ? area->i_start
-           : ( i_tell >= area->i_size ) ? area->i_size
-           : i_tell;
-
-    input_Seek( p_main->p_intf->p_input, i_tell );
-#undef area
-}
-
 /*****************************************************************************
  * vout_Manage: handle Sys events
  *****************************************************************************
@@ -421,7 +502,7 @@ static int vout_Manage( vout_thread_t *p_vout )
             switch( event.key.keysym.sym )
             {
             case SDLK_q:                                             /* quit */
-           case SDLK_ESCAPE:
+            case SDLK_ESCAPE:
                 p_main->p_intf->b_die = 1;
                 break;
 
@@ -517,6 +598,14 @@ static int vout_Manage( vout_thread_t *p_vout )
     return( 0 );
 }
 
+/*****************************************************************************
+ * vout_Render: render previously calculated output
+ *****************************************************************************/
+static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    ;
+}
+
 /*****************************************************************************
  * vout_Display: displays previously rendered output
  *****************************************************************************
@@ -534,20 +623,17 @@ static void vout_Display( vout_thread_t *p_vout, picture_t *p_pic )
     disp.w = w;
     disp.h = h;
 
-    switch( p_vout->output.i_chroma )
+    if( p_vout->p_sys->p_overlay == NULL )
     {
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-        case FOURCC_YV12:
-            SDL_UnlockYUVOverlay( p_pic->p_sys->p_overlay);
-            SDL_DisplayYUVOverlay( p_pic->p_sys->p_overlay , &disp );
-            SDL_LockYUVOverlay( p_pic->p_sys->p_overlay);
-            break;
-
-        default:
-            /* RGB picture */
-            SDL_Flip(p_vout->p_sys->p_display);
-            break;
+        /* RGB picture */
+        SDL_Flip( p_vout->p_sys->p_display );
+    }
+    else
+    {
+        /* Overlay picture */
+        SDL_UnlockYUVOverlay( p_pic->p_sys->p_overlay);
+        SDL_DisplayYUVOverlay( p_pic->p_sys->p_overlay , &disp );
+        SDL_LockYUVOverlay( p_pic->p_sys->p_overlay);
     }
 }
 
@@ -588,27 +674,62 @@ static int SDLOpenDisplay( vout_thread_t *p_vout )
 
     SDL_LockSurface( p_vout->p_sys->p_display );
 
+    /* Ask BestChroma what we should use as a chroma */
+    p_vout->p_sys->i_chroma = BestChroma( p_vout->render.i_chroma );
+
     p_vout->p_sys->p_overlay =
-        SDL_CreateYUVOverlay( 32, 32, SDL_YV12_OVERLAY,
+        SDL_CreateYUVOverlay( 32, 32, p_vout->p_sys->i_chroma,
                               p_vout->p_sys->p_display );
 
+    /* See if BestChroma's guess was valid */
     if( p_vout->p_sys->p_overlay == NULL )
     {
-        intf_ErrMsg( "vout error: cannot set overlay" );
-        SDL_UnlockSurface( p_vout->p_sys->p_display );
-        SDL_FreeSurface( p_vout->p_sys->p_display );
-        return( 1 );
-    }
+        intf_WarnMsg( 3, "vout warning: cannot set SDL overlay 0x%.8llx",
+                         p_vout->p_sys->i_chroma );
 
-    if( p_vout->p_sys->p_overlay->hw_overlay )
-    {
-        SDL_WM_SetCaption( VOUT_TITLE " (hardware SDL output)",
-                           VOUT_TITLE " (hardware SDL output)" );
+        switch( p_vout->p_sys->p_display->format->BitsPerPixel )
+        {
+            case 8:
+                p_vout->p_sys->i_chroma = FOURCC_BI_RGB;
+                break;
+            case 15:
+                p_vout->p_sys->i_chroma = FOURCC_RV15;
+                break;
+            case 16:
+                p_vout->p_sys->i_chroma = FOURCC_RV16;
+                break;
+            case 24:
+                p_vout->p_sys->i_chroma = FOURCC_BI_BITFIELDS;
+                break;
+            case 32:
+                p_vout->p_sys->i_chroma = FOURCC_BI_BITFIELDS;
+                break;
+            default:
+                intf_ErrMsg( "vout error: unknown screen depth" );
+                SDL_UnlockSurface( p_vout->p_sys->p_display );
+                SDL_FreeSurface( p_vout->p_sys->p_display );
+                return( -1 );
+        }
+
+        p_vout->p_sys->i_red_mask = p_vout->p_sys->p_display->format->Rmask;
+        p_vout->p_sys->i_green_mask = p_vout->p_sys->p_display->format->Gmask;
+        p_vout->p_sys->i_blue_mask = p_vout->p_sys->p_display->format->Bmask;
+
+        SDL_WM_SetCaption( VOUT_TITLE " (software RGB SDL output)",
+                           VOUT_TITLE " (software RGB SDL output)" );
     }
     else
     {
-        SDL_WM_SetCaption( VOUT_TITLE " (software SDL output)",
-                           VOUT_TITLE " (software SDL output)" );
+        if( p_vout->p_sys->p_overlay->hw_overlay )
+        {
+            SDL_WM_SetCaption( VOUT_TITLE " (hardware YUV SDL output)",
+                               VOUT_TITLE " (hardware YUV SDL output)" );
+        }
+        else
+        {
+            SDL_WM_SetCaption( VOUT_TITLE " (software YUV SDL output)",
+                               VOUT_TITLE " (software YUV SDL output)" );
+        }
     }
 
     SDL_EventState( SDL_KEYUP, SDL_IGNORE );               /* ignore keys up */
@@ -636,15 +757,16 @@ static void SDLCloseDisplay( vout_thread_t *p_vout )
  *****************************************************************************/
 static int SDLNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
-#define P p_pic->planes
     int i_width  = p_vout->output.i_width;
     int i_height = p_vout->output.i_height;
 
-    switch( p_vout->output.i_chroma )
+    switch( p_vout->p_sys->i_chroma )
     {
-        case FOURCC_I420:
-        case FOURCC_IYUV:
-        case FOURCC_YV12:
+        case SDL_YV12_OVERLAY:
+        case SDL_IYUV_OVERLAY:
+        case SDL_YUY2_OVERLAY:
+        case SDL_UYVY_OVERLAY:
+        case SDL_YVYU_OVERLAY:
             p_pic->p_sys = malloc( sizeof( picture_sys_t ) );
 
             if( p_pic->p_sys == NULL )
@@ -654,7 +776,7 @@ static int SDLNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
 
             p_pic->p_sys->p_overlay =
                 SDL_CreateYUVOverlay( i_width, i_height,
-                                      SDL_YV12_OVERLAY,
+                                      p_vout->p_sys->i_chroma,
                                       p_vout->p_sys->p_display );
 
             if( p_pic->p_sys->p_overlay == NULL )
@@ -665,24 +787,62 @@ static int SDLNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
 
             SDL_LockYUVOverlay( p_pic->p_sys->p_overlay );
 
-            /* FIXME: try to get the right i_bytes value from p_overlay */
-            P[ Y_PLANE ].p_data = p_pic->p_sys->p_overlay->pixels[ 0 ];
-            P[ Y_PLANE ].i_bytes = i_width * i_height;
-            P[ Y_PLANE ].i_line_bytes = i_width;
+            p_pic->Y_PIXELS = p_pic->p_sys->p_overlay->pixels[0];
+            p_pic->p[Y_PLANE].i_lines = p_pic->p_sys->p_overlay->h;
+            p_pic->p[Y_PLANE].i_pitch = p_pic->p_sys->p_overlay->pitches[0];
+
+            switch( p_vout->p_sys->i_chroma )
+            {
+            case SDL_YV12_OVERLAY:
+                p_pic->p[Y_PLANE].i_pixel_bytes = 1;
+                p_pic->p[Y_PLANE].b_margin = 0;
+
+                p_pic->U_PIXELS = p_pic->p_sys->p_overlay->pixels[2];
+                p_pic->p[U_PLANE].i_lines = p_pic->p_sys->p_overlay->h / 2;
+                p_pic->p[U_PLANE].i_pitch = p_pic->p_sys->p_overlay->pitches[2];
+                p_pic->p[U_PLANE].i_pixel_bytes = 1;
+                p_pic->p[U_PLANE].b_margin = 0;
+
+                p_pic->V_PIXELS = p_pic->p_sys->p_overlay->pixels[1];
+                p_pic->p[V_PLANE].i_lines = p_pic->p_sys->p_overlay->h / 2;
+                p_pic->p[V_PLANE].i_pitch = p_pic->p_sys->p_overlay->pitches[1];
+                p_pic->p[V_PLANE].i_pixel_bytes = 1;
+                p_pic->p[V_PLANE].b_margin = 0;
+
+                p_pic->i_planes = 3;
+                break;
 
-            P[ U_PLANE ].p_data = p_pic->p_sys->p_overlay->pixels[ 2 ];
-            P[ U_PLANE ].i_bytes = i_width * i_height / 4;
-            P[ U_PLANE ].i_line_bytes = i_width / 2;
+            case SDL_IYUV_OVERLAY:
+                p_pic->p[Y_PLANE].i_pixel_bytes = 1;
+                p_pic->p[Y_PLANE].b_margin = 0;
 
-            P[ V_PLANE ].p_data = p_pic->p_sys->p_overlay->pixels[ 1 ];
-            P[ V_PLANE ].i_bytes = i_width * i_height / 4;
-            P[ V_PLANE ].i_line_bytes = i_width / 2;
+                p_pic->U_PIXELS = p_pic->p_sys->p_overlay->pixels[1];
+                p_pic->p[U_PLANE].i_lines = p_pic->p_sys->p_overlay->h / 2;
+                p_pic->p[U_PLANE].i_pitch = p_pic->p_sys->p_overlay->pitches[1];
+                p_pic->p[U_PLANE].i_pixel_bytes = 1;
+                p_pic->p[U_PLANE].b_margin = 0;
 
-            p_pic->i_planes = 3;
+                p_pic->V_PIXELS = p_pic->p_sys->p_overlay->pixels[2];
+                p_pic->p[V_PLANE].i_lines = p_pic->p_sys->p_overlay->h / 2;
+                p_pic->p[V_PLANE].i_pitch = p_pic->p_sys->p_overlay->pitches[2];
+                p_pic->p[V_PLANE].i_pixel_bytes = 1;
+                p_pic->p[V_PLANE].b_margin = 0;
+
+                p_pic->i_planes = 3;
+                break;
+
+            default:
+                p_pic->p[Y_PLANE].i_pixel_bytes = 2;
+                p_pic->p[Y_PLANE].b_margin = 0;
+
+                p_pic->i_planes = 1;
+                break;
+            }
 
             return 0;
 
-        case FOURCC_BI_BITFIELDS | DEPTH_16BPP:
+        default:
+            /* RGB picture */
             if( p_vout->p_sys->i_surfaces )
             {
                 /* We already allocated this surface, return */
@@ -696,22 +856,27 @@ static int SDLNewPicture( vout_thread_t *p_vout, picture_t *p_pic )
                 return -1;
             }
 
-            P[ MAIN_PLANE ].p_data = p_vout->p_sys->p_display->pixels;
-            P[ MAIN_PLANE ].i_bytes = 2 * i_width * i_height;
-            P[ MAIN_PLANE ].i_line_bytes = 2 * i_width;
+            p_pic->p->p_pixels = p_vout->p_sys->p_display->pixels;
+            p_pic->p->i_lines = p_vout->p_sys->p_display->h;
+            p_pic->p->i_pitch = p_vout->p_sys->p_display->pitch;
+
+            p_pic->p->i_pixel_bytes = 2;
+            if( p_pic->p->i_pitch != 2 * p_vout->p_sys->p_display->w )
+            {
+              intf_ErrMsg("OOO XXX OOO --- Wooooooohoooo !! --- OOO XXX OOO");
+              intf_ErrMsg("%i != 2 * %i", p_pic->p->i_pitch, p_vout->p_sys->p_display->w );
+            }
+            p_pic->p->b_margin = 0;
+
+            p_pic->p->i_red_mask = p_vout->p_sys->p_display->format->Rmask;
+            p_pic->p->i_green_mask = p_vout->p_sys->p_display->format->Gmask;
+            p_pic->p->i_blue_mask = p_vout->p_sys->p_display->format->Bmask;
 
             p_vout->p_sys->i_surfaces++;
 
             p_pic->i_planes = 1;
 
             return 0;
-
-        default:
-            /* Unknown chroma, tell the guy to get lost */
-            p_pic->i_planes = 0;
-
-            return -1;
     }
-#undef P
 }
 
index 5a436033a338ab00db045ce4a7bd5ff5ae2cc64a..870a48f0e14d128258613b196571a9b6ec281e7a 100644 (file)
@@ -2,7 +2,7 @@
  * spu_decoder.c : spu decoder thread
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: spu_decoder.c,v 1.6 2001/12/30 07:09:56 sam Exp $
+ * $Id: spu_decoder.c,v 1.7 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -682,10 +682,10 @@ static int ParseRLE( spudec_thread_t *p_spudec,
 
         /* Skip them just in case */
         while( i_y < i_height )
-       {
+        {
             *p_dest++ = i_width << 2;
             i_y++;
-       }
+        }
 
         return( 1 );
     }
index 8dd8663a067b29dd65a03b0a7965c6d37a4e1abe..a9b2cc968c123c3d75038096193b721cbf84d2a8 100644 (file)
@@ -2,7 +2,7 @@
  * ncurses.c : NCurses plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: ncurses.c,v 1.9 2001/12/30 07:09:56 sam Exp $
+ * $Id: ncurses.c,v 1.10 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *      
@@ -161,7 +161,7 @@ static void intf_Run( intf_thread_t *p_intf )
         //mvaddstr( 5, 2, "No other keys are active yet." );
 
         while( (i_key = getch()) != -1 )
-       {
+        {
             switch( i_key )
             {
                 case 'q':
index 615521df80d5686dc28c7d07f71d3e88b029c24b..1073eab235eb6370e27ce7453195455c3322b128 100644 (file)
@@ -2,7 +2,7 @@
  * rc.c : remote control stdin/stdout plugin for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: rc.c,v 1.7 2001/12/30 07:09:56 sam Exp $
+ * $Id: rc.c,v 1.8 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Peter Surda <shurdeek@panorama.sth.ac.at>
  *
@@ -180,7 +180,7 @@ static void intf_Run( intf_thread_t *p_intf )
                                           S.p_selected_area->i_size ) );
                 }
             }
-       }
+        }
 #undef S
 
         b_complete = 0;
index 392aabb9311c3e6b4217989bb0a9f7b05ec02393..9f4fe75dc8f4fcc49748f575499c5b3f0b9a46b6 100644 (file)
@@ -2,7 +2,7 @@
  * xcommon.c: Functions common to the X11 and XVideo plugins
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.4 2002/01/02 14:37:42 sam Exp $
+ * $Id: xcommon.c,v 1.5 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -67,8 +67,8 @@
 
 #ifdef MODULE_NAME_IS_xvideo
 #   define IMAGE_TYPE     XvImage
-#   define EXTRA_ARGS     int i_xvport, int i_format
-#   define EXTRA_ARGS_SHM int i_xvport, int i_format, XShmSegmentInfo *p_shm
+#   define EXTRA_ARGS     int i_xvport, int i_chroma
+#   define EXTRA_ARGS_SHM int i_xvport, int i_chroma, XShmSegmentInfo *p_shm
 #   define DATA_SIZE(p)   (p)->data_size
 #   define IMAGE_FREE     XFree      /* There is nothing like XvDestroyImage */
 #else
@@ -85,6 +85,7 @@
 static int  vout_Probe     ( probedata_t * );
 static int  vout_Create    ( vout_thread_t * );
 static void vout_Destroy   ( vout_thread_t * );
+static void vout_Render    ( vout_thread_t *, picture_t * );
 static void vout_Display   ( vout_thread_t *, picture_t * );
 static int  vout_Manage    ( vout_thread_t * );
 static int  vout_Init      ( vout_thread_t * );
@@ -137,6 +138,7 @@ typedef struct vout_sys_s
     Window              yuv_window;   /* sub-window for displaying yuv video
                                                                         data */
     int                 i_xvport;
+    u32                 i_chroma;               /* the chroma we will select */
 #else
     Colormap            colormap;               /* colormap used (8bpp only) */
 
@@ -211,7 +213,6 @@ typedef struct mwmhints_s
  * Chroma defines
  *****************************************************************************/
 #ifdef MODULE_NAME_IS_xvideo
-#   define GUID_YUV12_PLANAR 0x32315659
 #   define MAX_DIRECTBUFFERS 5
 #else
 #   define MAX_DIRECTBUFFERS 2
@@ -235,6 +236,41 @@ static __inline__ void vout_Seek( off_t i_seek )
 #undef area
 }
 
+/*****************************************************************************
+ * Return the best suited FourCC value for a given chroma. We use this
+ * because a decoder may output FOURCC_IYUV, which is exactly the same as
+ * FOURCC_I420, but X servers usually know FOURCC_I420 and not FOURCC_IYUV.
+ *****************************************************************************/
+static __inline__ u32 BestChroma( u32 i_chroma )
+{
+    /* XXX: don't forget to update vout_Init if you change this */
+    switch( i_chroma )
+    {
+        /* These ones are all the same */
+        case FOURCC_I420:
+        case FOURCC_IYUV:
+        case FOURCC_YV12:
+            return FOURCC_I420;
+
+        /* These ones are all the same */
+        case FOURCC_YUY2:
+        case FOURCC_YUNV:
+            return FOURCC_YUY2;
+
+        /* We know this one */
+        case FOURCC_Y211:
+            return FOURCC_Y211;
+
+        /* This is seldom supported, but we know how to convert */
+        case FOURCC_I422:
+            return FOURCC_YUY2;
+
+        default:
+            return i_chroma;
+            break;
+    }
+}
+
 /*****************************************************************************
  * Functions exported as capabilities. They are declared as static so that
  * we don't pollute the namespace too much.
@@ -247,6 +283,7 @@ void _M( vout_getfunctions )( function_list_t * p_function_list )
     p_function_list->functions.vout.pf_end        = vout_End;
     p_function_list->functions.vout.pf_destroy    = vout_Destroy;
     p_function_list->functions.vout.pf_manage     = vout_Manage;
+    p_function_list->functions.vout.pf_render     = vout_Render;
     p_function_list->functions.vout.pf_display    = vout_Display;
     p_function_list->functions.vout.pf_setpalette = NULL;
 }
@@ -274,14 +311,19 @@ static int vout_Probe( probedata_t *p_data )
         return( 0 );
     }
 
-#ifdef MODULE_NAME_IS_xvideo 
+#ifdef MODULE_NAME_IS_xvideo
     /* Check that there is an available XVideo port */
-    i_xvport = XVideoGetPort( p_display, GUID_YUV12_PLANAR );
+    i_xvport = XVideoGetPort( p_display, BestChroma( p_data->vout.i_chroma ) );
     if( i_xvport < 0 )
     {
-        intf_WarnMsg( 3, "vout: no XVideo port available" );
-        XCloseDisplay( p_display );
-        return( 0 );
+        /* It failed, but it's not completely lost ! We try to open an
+         * XVideo port for a simple 16bpp RGB picture */
+        i_xvport = XVideoGetPort( p_display, FOURCC_RV16 );
+        if( i_xvport < 0 )
+        {
+            XCloseDisplay( p_display );
+            return( 0 );
+        }
     }
     XVideoReleasePort( p_display, i_xvport );
 #endif
@@ -328,15 +370,27 @@ static int vout_Create( vout_thread_t *p_vout )
     p_vout->p_sys->i_screen = DefaultScreen( p_vout->p_sys->p_display );
 
 #ifdef MODULE_NAME_IS_xvideo
-    /* Check that we have access to an XVideo port */
+    /* Try to guess the chroma format we will be using */
+    p_vout->p_sys->i_chroma = BestChroma( p_vout->render.i_chroma );
+
+    /* Check that we have access to an XVideo port providing this chroma */
     p_vout->p_sys->i_xvport = XVideoGetPort( p_vout->p_sys->p_display,
-                                             GUID_YUV12_PLANAR );
+                                             p_vout->p_sys->i_chroma );
     if( p_vout->p_sys->i_xvport < 0 )
     {
-        intf_ErrMsg( "vout error: cannot get XVideo port" );
-        XCloseDisplay( p_vout->p_sys->p_display );
-        free( p_vout->p_sys );
-        return 1;
+        /* It failed, but it's not completely lost ! We try to open an
+         * XVideo port for a simple 16bpp RGB picture */
+        p_vout->p_sys->i_xvport = XVideoGetPort( p_vout->p_sys->p_display,
+                                                 FOURCC_RV16 );
+        if( p_vout->p_sys->i_xvport < 0 )
+        {
+            XCloseDisplay( p_vout->p_sys->p_display );
+            free( p_vout->p_sys );
+            return 1;
+        }
+
+        /* This one worked ! That's better than nothing, it has HW scaling. */
+        p_vout->p_sys->i_chroma = FOURCC_RV16;
     }
 #endif
 
@@ -421,36 +475,65 @@ static int vout_Init( vout_thread_t *p_vout )
     I_OUTPUTPICTURES = 0;
 
 #ifdef MODULE_NAME_IS_xvideo
-    /* Initialize the output structure */
+    /* Initialize the output structure ; we already found an XVideo port,
+     * which either suits p_vout->render.i_chroma or p_vout->p_sys->i_chroma
+     * if nothing was found at the first attempt. */
     switch( p_vout->render.i_chroma )
     {
+        /* These ones are equivalent to what we chose instead, for instance
+         * we tell the video output we can do FOURCC_IYUV even though we
+         * actually do FOURCC_I420. */
         case FOURCC_I420:
         case FOURCC_IYUV:
         case FOURCC_YV12:
+
+        case FOURCC_YUY2:
+        case FOURCC_YUNV:
+
+        case FOURCC_Y211:
             p_vout->output.i_chroma = p_vout->render.i_chroma;
             p_vout->output.i_width  = p_vout->render.i_width;
             p_vout->output.i_height = p_vout->render.i_height;
             p_vout->output.i_aspect = p_vout->render.i_aspect;
             break;
 
+        /* These ones aren't equivalent to what we chose, so we need to
+         * warn the decoder that we chose another chroma and that it has
+         * conversion to do. */
+
+        /* At least for this one we can have the aspect ratio */
+        case FOURCC_I422:
+            p_vout->output.i_chroma = p_vout->p_sys->i_chroma;
+            p_vout->output.i_width  = p_vout->render.i_width;
+            p_vout->output.i_height = p_vout->render.i_height;
+            p_vout->output.i_aspect = p_vout->render.i_aspect;
+            break;
+
+        /* Here we don't even control the aspect ratio */
         default:
-            return( 0 );
+            p_vout->output.i_chroma = p_vout->p_sys->i_chroma;
+            p_vout->output.i_width  = p_vout->render.i_width;
+            p_vout->output.i_height = p_vout->render.i_height;
+            p_vout->output.i_aspect = p_vout->p_sys->i_width
+                               * VOUT_ASPECT_FACTOR / p_vout->p_sys->i_height;
+            break;
     }
+
 #else
     /* Initialize the output structure: RGB with square pixels, whatever
      * the input format is, since it's the only format we know */
     switch( p_vout->p_sys->i_screen_depth )
     {
         case 8: /* FIXME: set the palette */
-            p_vout->output.i_chroma = FOURCC_BI_RGB | DEPTH_8BPP; break;
+            p_vout->output.i_chroma = FOURCC_BI_RGB; break;
         case 15:
-            p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_15BPP; break;
+            p_vout->output.i_chroma = FOURCC_RV15; break;
         case 16:
-            p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_16BPP; break;
+            p_vout->output.i_chroma = FOURCC_RV16; break;
         case 24:
-            p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_24BPP; break;
+            p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break;
         case 32:
-            p_vout->output.i_chroma = FOURCC_BI_BITFIELDS | DEPTH_32BPP; break;
+            p_vout->output.i_chroma = FOURCC_BI_BITFIELDS; break;
         default:
             intf_ErrMsg( "vout error: unknown screen depth" );
             return( 0 );
@@ -485,13 +568,8 @@ static int vout_Init( vout_thread_t *p_vout )
             break;
         }
 
-        p_pic->i_status        = DESTROYED_PICTURE;
-        p_pic->i_type          = DIRECT_PICTURE;
-
-        p_pic->i_left_margin   =
-        p_pic->i_right_margin  =
-        p_pic->i_top_margin    = 
-        p_pic->i_bottom_margin = 0;
+        p_pic->i_status = DESTROYED_PICTURE;
+        p_pic->i_type   = DIRECT_PICTURE;
 
         PP_OUTPUTPICTURE[ I_OUTPUTPICTURES ] = p_pic;
 
@@ -502,6 +580,14 @@ static int vout_Init( vout_thread_t *p_vout )
 }
 
 /*****************************************************************************
+ * vout_Render: render previously calculated output
+ *****************************************************************************/
+static void vout_Render( vout_thread_t *p_vout, picture_t *p_pic )
+{
+    ;
+}
+
+ /*****************************************************************************
  * vout_Display: displays previously rendered output
  *****************************************************************************
  * This function sends the currently rendered image to X11 server.
@@ -1134,126 +1220,172 @@ static void DestroyWindow( vout_thread_t *p_vout )
  *****************************************************************************/
 static int NewPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
-#define P p_pic->planes
-    int i_width  = p_vout->output.i_width;
-    int i_height = p_vout->output.i_height;
-    
-    switch( ONLY_FOURCC( p_vout->output.i_chroma ) )
+    /* We know the chroma, allocate a buffer which will be used
+     * directly by the decoder */
+    p_pic->p_sys = malloc( sizeof( picture_sys_t ) );
+
+    if( p_pic->p_sys == NULL )
     {
+        return -1;
+    }
+
+    if( p_vout->p_sys->b_shm )
+    {
+        /* Create image using XShm extension */
+        p_pic->p_sys->p_image =
+            CreateShmImage( p_vout->p_sys->p_display,
 #ifdef MODULE_NAME_IS_xvideo
+                            p_vout->p_sys->i_xvport,
+                            p_vout->p_sys->i_chroma,
+#else
+                            p_vout->p_sys->p_visual,
+                            p_vout->p_sys->i_screen_depth,
+#endif
+                            &p_pic->p_sys->shminfo,
+                            p_vout->output.i_width, p_vout->output.i_height );
+    }
+    else
+    {
+        /* Create image without XShm extension */
+        p_pic->p_sys->p_image =
+            CreateImage( p_vout->p_sys->p_display,
+#ifdef MODULE_NAME_IS_xvideo
+                         p_vout->p_sys->i_xvport,
+                         p_vout->p_sys->i_chroma,
+#else
+                         p_vout->p_sys->p_visual,
+                         p_vout->p_sys->i_screen_depth, 
+                         p_vout->p_sys->i_bytes_per_pixel,
+#endif
+                         p_vout->output.i_width, p_vout->output.i_height );
+    }
+
+    if( p_pic->p_sys->p_image == NULL )
+    {
+        free( p_pic->p_sys );
+        return -1;
+    }
+
+#ifdef MODULE_NAME_IS_xvideo
+    switch( p_vout->p_sys->i_chroma )
+    {
         case FOURCC_I420:
-            /* We know this chroma, allocate a buffer which will be used
-             * directly by the decoder */
-            p_pic->p_sys = malloc( sizeof( picture_sys_t ) );
 
-            if( p_pic->p_sys == NULL )
-            {
-                return -1;
-            }
+            p_pic->Y_PIXELS = p_pic->p_sys->p_image->data
+                               + p_pic->p_sys->p_image->offsets[0];
+            p_pic->p[Y_PLANE].i_lines = p_vout->output.i_height;
+            p_pic->p[Y_PLANE].i_pitch = p_pic->p_sys->p_image->pitches[0];
+            p_pic->p[Y_PLANE].i_pixel_bytes = 1;
+            p_pic->p[Y_PLANE].b_margin = 0;
+
+            p_pic->U_PIXELS = p_pic->p_sys->p_image->data
+                               + p_pic->p_sys->p_image->offsets[1];
+            p_pic->p[U_PLANE].i_lines = p_vout->output.i_height / 2;
+            p_pic->p[U_PLANE].i_pitch = p_pic->p_sys->p_image->pitches[1];
+            p_pic->p[Y_PLANE].i_pixel_bytes = 1;
+            p_pic->p[Y_PLANE].b_margin = 0;
+
+            p_pic->V_PIXELS = p_pic->p_sys->p_image->data
+                               + p_pic->p_sys->p_image->offsets[2];
+            p_pic->p[V_PLANE].i_lines = p_vout->output.i_height / 2;
+            p_pic->p[V_PLANE].i_pitch = p_pic->p_sys->p_image->pitches[2];
+            p_pic->p[Y_PLANE].i_pixel_bytes = 1;
+            p_pic->p[Y_PLANE].b_margin = 0;
 
-            if( p_vout->p_sys->b_shm )
-            {
-                /* Create XvImage using XShm extension */
-                p_pic->p_sys->p_image =
-                    CreateShmImage( p_vout->p_sys->p_display,
-                                    p_vout->p_sys->i_xvport,
-                                    GUID_YUV12_PLANAR,
-                                    &p_pic->p_sys->shminfo,
-                                    p_vout->output.i_width,
-                                    p_vout->output.i_height );
-            }
-            else
-            {
-                /* Create XvImage using XShm extension */
-                p_pic->p_sys->p_image =
-                    CreateImage( p_vout->p_sys->p_display,
-                                 p_vout->p_sys->i_xvport,
-                                 GUID_YUV12_PLANAR,
-                                 p_vout->output.i_width,
-                                 p_vout->output.i_height );
-            }
+            p_pic->i_planes = 3;
+            break;
 
-            if( p_pic->p_sys->p_image == NULL )
-            {
-                free( p_pic->p_sys );
-                return -1;
-            }
+        case FOURCC_Y211:
 
-            /* FIXME: try to get the right i_bytes value from p_image */
-            P[Y_PLANE].p_data = p_pic->p_sys->p_image->data;
-            P[Y_PLANE].i_bytes = i_width * i_height;
-            P[Y_PLANE].i_line_bytes = i_width;
+            p_pic->p->p_pixels = p_pic->p_sys->p_image->data
+                                  + p_pic->p_sys->p_image->offsets[0];
+            p_pic->p->i_lines = p_vout->output.i_height;
+            p_pic->p->i_pitch = p_pic->p_sys->p_image->pitches[0];
+            p_pic->p->i_pixel_bytes = 1;
+            p_pic->p->b_margin = 0;
 
-            P[U_PLANE].p_data = P[Y_PLANE].p_data + i_width * i_height * 5 / 4;
-            P[U_PLANE].i_bytes = i_width * i_height / 4;
-            P[U_PLANE].i_line_bytes = i_width / 2;
+            p_pic->i_planes = 1;
+            break;
 
-            P[V_PLANE].p_data = P[Y_PLANE].p_data + i_width * i_height;
-            P[V_PLANE].i_bytes = i_width * i_height / 4;
-            P[V_PLANE].i_line_bytes = i_width / 2;
+        case FOURCC_YUY2:
 
-            p_pic->i_planes = 3;
+            p_pic->p->p_pixels = p_pic->p_sys->p_image->data
+                                  + p_pic->p_sys->p_image->offsets[0];
+            p_pic->p->i_lines = p_vout->output.i_height;
+            p_pic->p->i_pitch = p_pic->p_sys->p_image->pitches[0];
+            p_pic->p->i_pixel_bytes = 2;
+            p_pic->p->b_margin = 0;
 
-            return 0;
-#endif
+            p_pic->i_planes = 1;
+            break;
 
-#ifdef MODULE_NAME_IS_x11
-        case FOURCC_BI_BITFIELDS:
-            p_pic->p_sys = malloc( sizeof( picture_sys_t ) );
+        case FOURCC_RV16:
 
-            if( p_pic->p_sys == NULL )
-            {
-                return -1;
-            }
+            p_pic->p->p_pixels = p_pic->p_sys->p_image->data
+                                  + p_pic->p_sys->p_image->offsets[0];
+            p_pic->p->i_lines = p_vout->output.i_height;
+            p_pic->p->i_pitch = p_pic->p_sys->p_image->pitches[0];
+            p_pic->p->i_pixel_bytes = 2;
+            p_pic->p->b_margin = 0;
+
+            p_pic->p->i_red_mask   = 0x001f;
+            p_pic->p->i_green_mask = 0x03e0;
+            p_pic->p->i_blue_mask  = 0x7c00;
+
+            p_pic->i_planes = 1;
+            break;
 
-            if( p_vout->p_sys->b_shm )
+        default:
+            /* Unknown chroma, tell the guy to get lost */
+            IMAGE_FREE( p_pic->p_sys->p_image );
+            free( p_pic->p_sys );
+            intf_ErrMsg( "vout error: never heard of chroma 0x%.8x",
+                         p_vout->p_sys->i_chroma );
+            p_pic->i_planes = 0;
+            return -1;
+    }
+#else
+    switch( p_vout->output.i_chroma )
+    {
+        case FOURCC_RV16:
+
+            p_pic->p->p_pixels = p_pic->p_sys->p_image->data
+                                  + p_pic->p_sys->p_image->xoffset;
+            p_pic->p->i_lines = p_pic->p_sys->p_image->height;
+            p_pic->p->i_pitch = p_pic->p_sys->p_image->bytes_per_line;
+            p_pic->p->i_pixel_bytes = p_pic->p_sys->p_image->depth;
+
+            if( p_pic->p->i_pitch == 2 * p_pic->p_sys->p_image->width )
             {
-                p_pic->p_sys->p_image =
-                    CreateShmImage( p_vout->p_sys->p_display,
-                                    p_vout->p_sys->p_visual,
-                                    p_vout->p_sys->i_screen_depth,
-                                    &p_pic->p_sys->shminfo,
-                                    i_width, i_height );
+                p_pic->p->b_margin = 0;
             }
             else
             {
-                p_pic->p_sys->p_image =
-                    CreateImage( p_vout->p_sys->p_display,
-                                 p_vout->p_sys->p_visual,
-                                 p_vout->p_sys->i_screen_depth, 
-                                 p_vout->p_sys->i_bytes_per_pixel,
-                                 i_width, i_height );
+                p_pic->p->b_margin = 1;
+                p_pic->p->b_hidden = 1;
+                p_pic->p->i_visible_bytes = 2 * p_pic->p_sys->p_image->width;
             }
 
-            if( p_pic->p_sys->p_image == NULL )
-            {
-                free( p_pic->p_sys );
-                return -1;
-            }
-
-            /* FIXME: try to get the right i_bytes value from p_image */
-            P[ MAIN_PLANE ].p_data = p_pic->p_sys->p_image->data;
-            P[ MAIN_PLANE ].i_bytes = p_vout->p_sys->i_bytes_per_pixel
-                                       * i_width * i_height;
-            P[ MAIN_PLANE ].i_line_bytes = p_vout->p_sys->i_bytes_per_pixel
-                                            * i_width;
-
-            P[ MAIN_PLANE ].i_red_mask = p_vout->p_sys->i_red_mask;
-            P[ MAIN_PLANE ].i_green_mask = p_vout->p_sys->i_green_mask;
-            P[ MAIN_PLANE ].i_blue_mask = p_vout->p_sys->i_blue_mask;
+            p_pic->p->i_red_mask   = p_pic->p_sys->p_image->red_mask;
+            p_pic->p->i_green_mask = p_pic->p_sys->p_image->green_mask;
+            p_pic->p->i_blue_mask  = p_pic->p_sys->p_image->blue_mask;
 
             p_pic->i_planes = 1;
 
-            return 0;
-#endif
+            break;
 
         default:
             /* Unknown chroma, tell the guy to get lost */
+            IMAGE_FREE( p_pic->p_sys->p_image );
+            free( p_pic->p_sys );
+            intf_ErrMsg( "vout error: never heard of chroma 0x%.8x",
+                         p_vout->output.i_chroma );
             p_pic->i_planes = 0;
-
             return -1;
     }
-#undef P
+#endif
+
+    return 0;
 }
 
 /*****************************************************************************
@@ -1707,12 +1839,14 @@ static int XVideoGetPort( Display *dpy, int i_id )
     {
         if( i_requested_adaptor == -1 )
         {
-            intf_WarnMsg( 3, "vout: no free XVideo port found for %i", i_id );
+            intf_WarnMsg( 3, "vout: no free XVideo port found for format "
+                             "0x%.8x", i_id );
         }
         else
         {
             intf_WarnMsg( 3, "vout: XVideo adaptor %i does not have a free "
-                             "XVideo port for %i", i_requested_adaptor, i_id );
+                             "XVideo port for format 0x%.8x",
+                             i_requested_adaptor, i_id );
         }
     }
 
@@ -1854,7 +1988,7 @@ static IMAGE_TYPE * CreateShmImage( Display* p_display, EXTRA_ARGS_SHM,
 
     /* Create XImage / XvImage */
 #ifdef MODULE_NAME_IS_xvideo
-    p_image = XvShmCreateImage( p_display, i_xvport, i_format, 0,
+    p_image = XvShmCreateImage( p_display, i_xvport, i_chroma, 0,
                                 i_width, i_height, p_shm );
 #else
     p_image = XShmCreateImage( p_display, p_visual, i_depth, ZPixmap, 0,
@@ -1961,7 +2095,7 @@ static IMAGE_TYPE * CreateImage( Display *p_display, EXTRA_ARGS,
 
     /* Create XImage. p_data will be automatically freed */
 #ifdef MODULE_NAME_IS_xvideo
-    p_image = XvCreateImage( p_display, i_xvport, i_format,
+    p_image = XvCreateImage( p_display, i_xvport, i_chroma,
                              p_data, i_width, i_height );
 #else
     p_image = XCreateImage( p_display, p_visual, i_depth, ZPixmap, 0,
index 47045f86bea50e9b9d55652a81274ec194fcdb4a..0b18a898b791222ac74466381ed92a7288157a89 100644 (file)
@@ -2,7 +2,7 @@
  * mpeg_system.c: TS, PS and PES management
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: mpeg_system.c,v 1.77 2001/12/30 07:09:56 sam Exp $
+ * $Id: mpeg_system.c,v 1.78 2002/01/04 14:01:34 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Michel Lespinasse <walken@via.ecp.fr>
@@ -765,7 +765,6 @@ es_descriptor_t * input_ParsePS( input_thread_t * p_input,
                         p_es->i_type = LPCM_AUDIO_ES;
                         p_es->b_audio = 1;
                         p_es->i_cat = AUDIO_ES;
-                        /* FIXME : write the decoder */
                     }
                     else
                     {
index 9229262b39abba662bb608273d204f7e2fd7bba7..f36f9915a40073a44d03a929fc7765245b06e8ea 100644 (file)
@@ -4,7 +4,7 @@
  * interface, such as message output. See config.h for output configuration.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: intf_msg.c,v 1.41 2001/12/30 07:09:56 sam Exp $
+ * $Id: intf_msg.c,v 1.42 2002/01/04 14:01:35 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -706,7 +706,9 @@ static char *ConvertPrintfFormatString( char *psz_format )
   for( i=0; i <= (strlen(psz_format) - 4); i++ )
   {
       if( !strncmp( (char *)(psz_format + i), "%ll", 3 ) )
-         i_counter++;
+      {
+          i_counter++;
+      }
   }
 
   /* malloc the destination string */
@@ -727,7 +729,7 @@ static char *ConvertPrintfFormatString( char *psz_format )
           *(psz_dest+i+i_counter+1)='I';
           *(psz_dest+i+i_counter+2)='6';
           *(psz_dest+i+i_counter+3)='4';
-         i_pos = i+3;
+          i_pos = i+3;
           i_counter++;
       }
   }
index 476bc96bbdc3df72913b0be8d5f7769e4625f9ef..3fcbfe2896742819e0b151491d8dd50dce3b9710 100644 (file)
@@ -4,7 +4,7 @@
  * and spawn threads.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: main.c,v 1.141 2001/12/30 07:09:56 sam Exp $
+ * $Id: main.c,v 1.142 2002/01/04 14:01:35 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
 
 #define OPT_MPEG_ADEC           200
 
+#define OPT_NOMMX               201
+#define OPT_NO3DNOW             202
+#define OPT_NOMMXEXT            203
+#define OPT_NOSSE               204
+#define OPT_NOALTIVEC           205
+
 /* Usage fashion */
 #define USAGE                     0
 #define SHORT_HELP                1
@@ -203,6 +209,13 @@ static const struct option longopts[] =
     /* Decoder options */
     {   "mpeg_adec",        1,          0,      OPT_MPEG_ADEC },
 
+    /* CPU options */
+    {   "nommx",            0,          0,      OPT_NOMMX },
+    {   "no3dnow",          0,          0,      OPT_NO3DNOW },
+    {   "nommxext",         0,          0,      OPT_NOMMXEXT },
+    {   "nosse",            0,          0,      OPT_NOSSE },
+    {   "noaltivec",        0,          0,      OPT_NOALTIVEC },
+
     {   0,                  0,          0,      0 }
 };
 
@@ -229,14 +242,15 @@ static void Version                 ( void );
 static void InitSignalHandler       ( void );
 static void SimpleSignalHandler     ( int i_signal );
 static void FatalSignalHandler      ( int i_signal );
-static void InstructionSignalHandler( int i_signal );
+static void IllegalSignalHandler    ( int i_signal );
 static u32  CPUCapabilities         ( void );
 
 static int  RedirectSTDOUT          ( void );
 static void ShowConsole             ( void );
 
 static jmp_buf env;
-static int  i_illegal;
+static int     i_illegal;
+static char   *psz_capability;
 
 /*****************************************************************************
  * main: parse command line, start interface and spawn threads
@@ -352,7 +366,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
         PRINT_CAPABILITY( CPU_CAPABILITY_MMXEXT, "MMXEXT" );
         PRINT_CAPABILITY( CPU_CAPABILITY_SSE, "SSE" );
         PRINT_CAPABILITY( CPU_CAPABILITY_ALTIVEC, "Altivec" );
-       PRINT_CAPABILITY( CPU_CAPABILITY_FPU, "FPU" );
+        PRINT_CAPABILITY( CPU_CAPABILITY_FPU, "FPU" );
         intf_StatMsg( "info: CPU has capabilities : %s", p_capabilities );
     }
 
@@ -438,6 +452,17 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
         }
     }
 
+    /*
+     * Free aout and vout banks
+     */
+    vout_EndBank();
+    aout_EndBank();
+
+    /*
+     * Free playlist
+     */
+    intf_PlaylistDestroy( p_main->p_playlist );
+
     /*
      * Free memcpy module if it was allocated
      */
@@ -447,17 +472,10 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     }
 
     /*
-     * Free module, aout and vout banks
+     * Free module bank
      */
-    vout_EndBank();
-    aout_EndBank();
     module_EndBank();
 
-    /*
-     * Free playlist
-     */
-    intf_PlaylistDestroy( p_main->p_playlist );
-
     /*
      * System specific cleaning code
      */
@@ -469,7 +487,7 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
     /*
      * Terminate messages interface and program
      */
-    intf_Msg( "intf: program terminated" );
+    intf_WarnMsg( 1, "intf: program terminated" );
     intf_MsgDestroy();
 
     /*
@@ -833,6 +851,27 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
             main_PutPszVariable( ADEC_MPEG_VAR, optarg );
             break;
 
+        /* CPU options */
+        case OPT_NOMMX:
+            p_main->i_cpu_capabilities &= ~CPU_CAPABILITY_MMX;
+            break;
+
+        case OPT_NO3DNOW:
+            p_main->i_cpu_capabilities &= ~CPU_CAPABILITY_3DNOW;
+            break;
+
+        case OPT_NOMMXEXT:
+            p_main->i_cpu_capabilities &= ~CPU_CAPABILITY_MMXEXT;
+            break;
+
+        case OPT_NOSSE:
+            p_main->i_cpu_capabilities &= ~CPU_CAPABILITY_SSE;
+            break;
+
+        case OPT_NOALTIVEC:
+            p_main->i_cpu_capabilities &= ~CPU_CAPABILITY_ALTIVEC;
+            break;
+
         /* Internal error: unknown option */
         case '?':
         default:
@@ -947,6 +986,12 @@ static void Usage( int i_fashion )
           "\n"
           "\n      --mpeg_adec <builtin|mad>  \tchoose audio decoder"
           "\n"
+          "\n      --nommx                    \tdisable CPU's MMX support"
+          "\n      --no3dnow                  \tdisable CPU's 3D Now! support"
+          "\n      --nommxext                 \tdisable CPU's MMX EXT support"
+          "\n      --nosse                    \tdisable CPU's SSE support"
+          "\n      --noaltivec                \tdisable CPU's AltiVec support"
+          "\n"
           "\n  -h, --help                     \tprint help and exit"
           "\n  -H, --longhelp                 \tprint long help and exit"
           "\n      --version                  \toutput version information and exit"
@@ -1056,7 +1101,6 @@ static void InitSignalHandler( void )
 #endif
 }
 
-
 /*****************************************************************************
  * SimpleSignalHandler: system signal handler
  *****************************************************************************
@@ -1068,7 +1112,6 @@ static void SimpleSignalHandler( int i_signal )
     intf_WarnMsg( 0, "intf: ignoring signal %d", i_signal );
 }
 
-
 /*****************************************************************************
  * FatalSignalHandler: system signal handler
  *****************************************************************************
@@ -1095,24 +1138,28 @@ static void FatalSignalHandler( int i_signal )
 }
 
 /*****************************************************************************
- * InstructionSignalHandler: system signal handler
+ * IllegalSignalHandler: system signal handler
  *****************************************************************************
  * This function is called when a illegal instruction signal is received by
- * the program.
- * We use this function to test OS and CPU_Capabilities
+ * the program. We use this function to test OS and CPU capabilities
  *****************************************************************************/
-static void InstructionSignalHandler( int i_signal )
+static void IllegalSignalHandler( int i_signal )
 {
-    /* Once a signal has been trapped, the termination sequence will be
-     * armed and following signals will be ignored to avoid sending messages
-     * to an interface having been destroyed */
-
     /* Acknowledge the signal received */
     i_illegal = 1;
 
 #ifdef HAVE_SIGRELSE
     sigrelse( i_signal );
 #endif
+
+    fprintf( stderr, "warning: your CPU has %s instructions, but not your "
+                     "operating system.\n", psz_capability );
+    fprintf( stderr, "         some optimizations will be disabled unless "
+                     "you upgrade your OS\n" );
+#ifdef SYS_LINUX
+    fprintf( stderr, "         (for instance Linux kernel 2.4.x or later)" );
+#endif
+
     longjmp( env, 1 );
 }
 
@@ -1176,7 +1223,9 @@ static u32 CPUCapabilities( void )
 
     i_capabilities |= CPU_CAPABILITY_FPU;
 
-    signal( SIGILL, InstructionSignalHandler );
+#   if defined( CAN_COMPILE_SSE ) || defined ( CAN_COMPILE_3DNOW )
+    signal( SIGILL, IllegalSignalHandler );
+#   endif
 
     /* test for a 486 CPU */
     asm volatile ( "pushl %%ebx\n\t"
@@ -1197,7 +1246,9 @@ static u32 CPUCapabilities( void )
 
     if( i_eax == i_ebx )
     {
+#   if defined( CAN_COMPILE_SSE ) || defined ( CAN_COMPILE_3DNOW )
         signal( SIGILL, NULL );
+#   endif
         return( i_capabilities );
     }
 
@@ -1208,7 +1259,9 @@ static u32 CPUCapabilities( void )
 
     if( !i_eax )
     {
+#   if defined( CAN_COMPILE_SSE ) || defined ( CAN_COMPILE_3DNOW )
         signal( SIGILL, NULL );
+#   endif
         return( i_capabilities );
     }
 
@@ -1224,7 +1277,9 @@ static u32 CPUCapabilities( void )
 
     if( ! (i_edx & 0x00800000) )
     {
+#   if defined( CAN_COMPILE_SSE ) || defined ( CAN_COMPILE_3DNOW )
         signal( SIGILL, NULL );
+#   endif
         return( i_capabilities );
     }
 
@@ -1234,8 +1289,9 @@ static u32 CPUCapabilities( void )
     {
         i_capabilities |= CPU_CAPABILITY_MMXEXT;
 
-#ifdef CAN_COMPILE_SSE
+#   ifdef CAN_COMPILE_SSE
         /* We test if OS support the SSE instructions */
+        psz_capability = "SSE";
         i_illegal = 0;
         if( setjmp( env ) == 0 )
         {
@@ -1250,13 +1306,14 @@ static u32 CPUCapabilities( void )
         else
         {
             fprintf( stderr, "warning: your OS doesn't have support for "
-                             "SSE instructions, "
-                             "some optimizations\nwill be disabled\n" );
-#ifdef SYS_LINUX
-            fprintf( stderr, "(you will need Linux kernel 2.4.x or later)\n" );
-#endif
+                             "SSE instructions, some optimizations\n"
+                             "will be disabled"
+#      ifdef SYS_LINUX
+                             " (you will need Linux kernel 2.4.x or later)"
+#      endif
+                             "\n" );
         }
-#endif
+#   endif
     }
 
     /* test for additional capabilities */
@@ -1264,16 +1321,19 @@ static u32 CPUCapabilities( void )
 
     if( i_eax < 0x80000001 )
     {
+#   if defined( CAN_COMPILE_SSE ) || defined ( CAN_COMPILE_3DNOW )
         signal( SIGILL, NULL );
+#   endif
         return( i_capabilities );
     }
 
     /* list these additional capabilities */
     cpuid( 0x80000001 );
 
-#ifdef CAN_COMPILE_3DNOW
+#   ifdef CAN_COMPILE_3DNOW
     if( i_edx & 0x80000000 )
     {
+        psz_capability = "3D Now!";
         i_illegal = 0;
         if( setjmp( env ) == 0 )
         {
@@ -1286,24 +1346,26 @@ static u32 CPUCapabilities( void )
             i_capabilities |= CPU_CAPABILITY_3DNOW;
         }
     }
-#endif
+#   endif
 
     if( b_amd && ( i_edx & 0x00400000 ) )
     {
         i_capabilities |= CPU_CAPABILITY_MMXEXT;
     }
 
+#   if defined( CAN_COMPILE_SSE ) || defined ( CAN_COMPILE_3DNOW )
     signal( SIGILL, NULL );
+#   endif
     return( i_capabilities );
 
 #elif defined( __powerpc__ )
 
     i_capabilities |= CPU_CAPABILITY_FPU;
 
-    /* Test for Altivec */
-    signal( SIGILL, InstructionSignalHandler );
+#   ifdef CAN_COMPILE_ALTIVEC
+    signal( SIGILL, IllegalSignalHandler );
 
-#ifdef CAN_COMPILE_ALTIVEC
+    psz_capability = "AltiVec";
     i_illegal = 0;
     if( setjmp( env ) == 0 )
     {
@@ -1317,9 +1379,10 @@ static u32 CPUCapabilities( void )
     {
         i_capabilities |= CPU_CAPABILITY_ALTIVEC;
     }
-#endif
 
     signal( SIGILL, NULL );
+#   endif
+
     return( i_capabilities );
 
 #else
index 2d78da70c687e4056238dad527ef28aa72897eff..0cd4ae70ffab879661b62558cb004b12ab2f720b 100644 (file)
@@ -2,7 +2,7 @@
  * beos_init.cpp: Initialization for BeOS specific features 
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: beos_specific.cpp,v 1.14 2001/12/30 07:09:56 sam Exp $
+ * $Id: beos_specific.cpp,v 1.15 2002/01/04 14:01:35 sam Exp $
  *
  * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
  *
@@ -145,9 +145,11 @@ VlcApplication::~VlcApplication( )
  *****************************************************************************/
 void VlcApplication::AboutRequested( )
 {
-       BAlert *alert;
-       alert = new BAlert( VOUT_TITLE, "BeOS " VOUT_TITLE "\n\n<www.videolan.org>", "Ok" );
-       alert->Go( NULL );
+    BAlert *alert;
+    alert = new BAlert( VOUT_TITLE,
+                        "BeOS " VOUT_TITLE "\n\n<www.videolan.org>",
+                        "Ok" );
+    alert->Go( NULL );
 }
 
 /*****************************************************************************
index f16a6a1533c323fb0db13fb73571a77257dfa904..25a3cc5e7ff350be658d3fdadafb309485c8bfff 100644 (file)
@@ -2,7 +2,7 @@
  * modules_plugin.h : Plugin management functions used by the core application.
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: modules_plugin.h,v 1.1 2001/12/30 07:09:56 sam Exp $
+ * $Id: modules_plugin.h,v 1.2 2002/01/04 14:01:35 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@zoy.org>
  *
@@ -82,10 +82,8 @@ module_unload( module_handle_t handle )
  * module_getsymbol: get a symbol from a dynamic library
  *****************************************************************************
  * This function queries a loaded library for a symbol specified in a
- * string, and returns a pointer to it.
- * FIXME: under Unix we should maybe check for dlerror() instead of the
- * return value of dlsym, since we could have loaded a symbol really set
- * to NULL (quite unlikely, though).
+ * string, and returns a pointer to it. We don't check for dlerror() or
+ * similar functions, since we want a non-NULL symbol anyway.
  *****************************************************************************/
 static __inline__ void *
 module_getsymbol( module_handle_t handle, char * psz_function )
index 9af7a3a43dc8750da885d89d01c9b6e0a7461904..f87a0285681a42f7373f2fbbe9c5bc27e64802e3 100644 (file)
@@ -5,7 +5,7 @@
  * thread, and destroy a previously oppened video output thread.
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: video_output.c,v 1.151 2002/01/02 14:37:42 sam Exp $
+ * $Id: video_output.c,v 1.152 2002/01/04 14:01:35 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
@@ -89,12 +89,13 @@ void vout_EndBank ( void )
  *****************************************************************************/
 vout_thread_t * vout_CreateThread   ( int *pi_status,
                                       int i_width, int i_height,
-                                      u64 i_chroma, int i_aspect )
+                                      u32 i_chroma, int i_aspect )
 {
     vout_thread_t * p_vout;                             /* thread descriptor */
     int             i_status;                               /* thread status */
     int             i_index;                                /* loop variable */
     char          * psz_plugin;
+    probedata_t     data;
 
     /* Allocate descriptor */
     p_vout = (vout_thread_t *) malloc( sizeof(vout_thread_t) );
@@ -112,7 +113,9 @@ vout_thread_t * vout_CreateThread   ( int *pi_status,
         psz_plugin = main_GetPszVariable( VOUT_METHOD_VAR, "" );
     }
 
-    p_vout->p_module = module_Need( MODULE_CAPABILITY_VOUT, psz_plugin, NULL );
+    data.vout.i_chroma = i_chroma;
+    p_vout->p_module
+        = module_Need( MODULE_CAPABILITY_VOUT, psz_plugin, &data );
 
     if( p_vout->p_module == NULL )
     {
@@ -127,6 +130,7 @@ vout_thread_t * vout_CreateThread   ( int *pi_status,
     p_vout->pf_end        = f.pf_end;
     p_vout->pf_destroy    = f.pf_destroy;
     p_vout->pf_manage     = f.pf_manage;
+    p_vout->pf_render     = f.pf_render;
     p_vout->pf_display    = f.pf_display;
     p_vout->pf_setpalette = f.pf_setpalette;
 #undef f
@@ -275,14 +279,14 @@ static int InitThread( vout_thread_t *p_vout )
     intf_WarnMsg( 1, "vout info: got %i direct buffer(s)", I_OUTPUTPICTURES );
 
     i_pgcd = ReduceHeight( p_vout->render.i_aspect );
-    intf_WarnMsg( 1, "vout info: picture in %ix%i, chroma 0x%.16llx, "
+    intf_WarnMsg( 1, "vout info: picture in %ix%i, chroma 0x%.8x, "
                      "aspect ratio %i:%i",
                   p_vout->render.i_width, p_vout->render.i_height,
                   p_vout->render.i_chroma, p_vout->render.i_aspect / i_pgcd,
                   VOUT_ASPECT_FACTOR / i_pgcd );
 
     i_pgcd = ReduceHeight( p_vout->output.i_aspect );
-    intf_WarnMsg( 1, "vout info: picture out %ix%i, chroma 0x%.16llx, "
+    intf_WarnMsg( 1, "vout info: picture out %ix%i, chroma 0x%.8x, "
                      "aspect ratio %i:%i",
                   p_vout->output.i_width, p_vout->output.i_height,
                   p_vout->output.i_chroma, p_vout->output.i_aspect / i_pgcd,
@@ -495,6 +499,15 @@ static void RunThread( vout_thread_t *p_vout)
          */
         p_directbuffer = vout_RenderPicture( p_vout, p_picture, p_subpic );
 
+        /*
+         * Call the plugin-specific rendering method
+         */
+        if( p_picture != NULL )
+        {
+            /* Render the direct buffer returned by vout_RenderPicture */
+            p_vout->pf_render( p_vout, p_directbuffer );
+        }
+
         /*
          * Sleep, wake up
          */
@@ -630,7 +643,7 @@ static void EndThread( vout_thread_t *p_vout )
     {
         if ( p_vout->p_picture[i_index].i_type == MEMORY_PICTURE )
         {
-            free( p_vout->p_picture[i_index].planes[0].p_data );
+            free( p_vout->p_picture[i_index].p_data );
         }
     }
 
index 0eb310b077e9a77df52e964a7ee54fdd5ed851d5..be6be660a0c1f6ad1ce067625d643fc805238fa3 100644 (file)
@@ -2,7 +2,7 @@
  * vout_pictures.c : picture management functions
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: vout_pictures.c,v 1.7 2002/01/02 14:37:42 sam Exp $
+ * $Id: vout_pictures.c,v 1.8 2002/01/04 14:01:35 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
  * display. The picture won't be displayed until vout_DatePicture has been
  * called.
  *****************************************************************************/
-void vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_picture )
+void vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
     vlc_mutex_lock( &p_vout->picture_lock );
-    switch( p_picture->i_status )
+    switch( p_pic->i_status )
     {
     case RESERVED_PICTURE:
-        p_picture->i_status = RESERVED_DISP_PICTURE;
+        p_pic->i_status = RESERVED_DISP_PICTURE;
         break;
     case RESERVED_DATED_PICTURE:
-        p_picture->i_status = READY_PICTURE;
+        p_pic->i_status = READY_PICTURE;
         break;
 #ifdef DEBUG
     default:
-        intf_ErrMsg("error: picture %p has invalid status %d", p_picture, p_picture->i_status );
+        intf_ErrMsg( "error: picture %p has invalid status %d",
+                     p_pic, p_pic->i_status );
         break;
 #endif
     }
 
 #ifdef TRACE_VOUT
-    intf_DbgMsg("picture %p", p_picture);
+    intf_DbgMsg("picture %p", p_pic);
 #endif
     vlc_mutex_unlock( &p_vout->picture_lock );
 }
@@ -74,31 +75,33 @@ void vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_picture )
  * been called.
  *****************************************************************************/
 void vout_DatePicture( vout_thread_t *p_vout,
-                       picture_t *p_picture, mtime_t date )
+                       picture_t *p_pic, mtime_t date )
 {
 #ifdef TRACE_VOUT
     char        psz_date[ MSTRTIME_MAX_SIZE ];                       /* date */
 #endif
 
     vlc_mutex_lock( &p_vout->picture_lock );
-    p_picture->date = date;
-    switch( p_picture->i_status )
+    p_pic->date = date;
+    switch( p_pic->i_status )
     {
     case RESERVED_PICTURE:
-        p_picture->i_status = RESERVED_DATED_PICTURE;
+        p_pic->i_status = RESERVED_DATED_PICTURE;
         break;
     case RESERVED_DISP_PICTURE:
-        p_picture->i_status = READY_PICTURE;
+        p_pic->i_status = READY_PICTURE;
         break;
 #ifdef DEBUG
     default:
-        intf_ErrMsg("error: picture %p has invalid status %d", p_picture, p_picture->i_status );
+        intf_ErrMsg( "error: picture %p has invalid status %d",
+                     p_pic, p_pic->i_status );
         break;
 #endif
     }
 
 #ifdef TRACE_VOUT
-    intf_DbgMsg("picture %p, display date: %s", p_picture, mstrtime( psz_date, p_picture->date) );
+    intf_DbgMsg( "picture %p, display date: %s",
+                 p_pic, mstrtime( psz_date, p_pic->date) );
 #endif
     vlc_mutex_unlock( &p_vout->picture_lock );
 }
@@ -116,9 +119,9 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout,
                                boolean_t b_top_field_first,
                                boolean_t b_repeat_first_field )
 {
-    int         i_picture;                                  /* picture index */
-    picture_t * p_picture;
-    picture_t * p_free_picture = NULL;                 /* first free picture */
+    int         i_pic;                                      /* picture index */
+    picture_t * p_pic;
+    picture_t * p_freepic = NULL;                      /* first free picture */
 
     /* Get lock */
     vlc_mutex_lock( &p_vout->picture_lock );
@@ -127,41 +130,39 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout,
      * Look for an empty place. We start at 1 because the first
      * directbuffer is reserved for memcpy()ed pictures.
      */
-    for( i_picture = 0;
-         i_picture < I_RENDERPICTURES && p_free_picture == NULL;
-         i_picture++ )
+    for( i_pic = 0; i_pic < I_RENDERPICTURES && p_freepic == NULL; i_pic++ )
     {
-        p_picture = PP_RENDERPICTURE[ i_picture ];
+        p_pic = PP_RENDERPICTURE[ i_pic ];
 
         /* If the picture we found is a memory buffer, and we might have
          * enough room later for a direct buffer, skip it. If no other
          * pictures are found, the video decoder will try again later. */
         if( p_vout->b_direct && ( p_vout->output.i_pictures > 3 )
-             && ( p_picture->i_type != DIRECT_PICTURE ) )
+             && ( p_pic->i_type != DIRECT_PICTURE ) )
         {
             break;
         }
 
-        switch( p_picture->i_status )
+        switch( p_pic->i_status )
         {
             case DESTROYED_PICTURE:
                 /* Memory will not be reallocated, and function can end
                  * immediately - this is the best possible case, since no
                  * memory allocation needs to be done */
-                p_picture->i_status = RESERVED_PICTURE;
-                p_picture->i_refcount = 0;
+                p_pic->i_status   = RESERVED_PICTURE;
+                p_pic->i_refcount = 0;
 
-                p_picture->b_progressive = b_progressive;
-                p_picture->b_repeat_first_field = b_repeat_first_field;
-                p_picture->b_top_field_first = b_top_field_first;
+                p_pic->b_progressive        = b_progressive;
+                p_pic->b_repeat_first_field = b_repeat_first_field;
+                p_pic->b_top_field_first    = b_top_field_first;
 
                 p_vout->i_heap_size++;
                 vlc_mutex_unlock( &p_vout->picture_lock );
-                return( p_picture );
+                return( p_pic );
 
             case FREE_PICTURE:
                 /* Picture is empty and ready for allocation */
-                p_free_picture = p_picture;
+                p_freepic = p_pic;
                 break;
 
             default:
@@ -172,33 +173,33 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout,
     /*
      * Prepare picture
      */
-    if( p_free_picture != NULL )
+    if( p_freepic != NULL )
     {
-        vout_AllocatePicture( p_free_picture,
+        vout_AllocatePicture( p_freepic,
                               p_vout->render.i_width, p_vout->render.i_height,
                               p_vout->render.i_chroma );
 
-        if( p_free_picture->i_planes )
+        if( p_freepic->i_planes )
         {
             /* Copy picture information, set some default values */
-            p_free_picture->i_status = RESERVED_PICTURE;
-            p_free_picture->i_type = MEMORY_PICTURE;
+            p_freepic->i_status   = RESERVED_PICTURE;
+            p_freepic->i_type     = MEMORY_PICTURE;
 
-            p_free_picture->i_refcount = 0;
+            p_freepic->i_refcount = 0;
 
-            p_free_picture->b_progressive = b_progressive;
-            p_free_picture->b_repeat_first_field = b_repeat_first_field;
-            p_free_picture->b_top_field_first = b_top_field_first;
+            p_freepic->b_progressive        = b_progressive;
+            p_freepic->b_repeat_first_field = b_repeat_first_field;
+            p_freepic->b_top_field_first    = b_top_field_first;
 
-            p_free_picture->i_matrix_coefficients = 1;
+            p_freepic->i_matrix_coefficients = 1;
 
             p_vout->i_heap_size++;
         }
         else
         {
             /* Memory allocation failed : set picture as empty */
-            p_free_picture->i_status = FREE_PICTURE;
-            p_free_picture = NULL;
+            p_freepic->i_status = FREE_PICTURE;
+            p_freepic = NULL;
 
             intf_ErrMsg( "vout error: picture allocation failed" );
         }
@@ -206,9 +207,9 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout,
         vlc_mutex_unlock( &p_vout->picture_lock );
 
         /* Initialize mutex */
-        vlc_mutex_init( &(p_free_picture->lock_deccount) );
+        vlc_mutex_init( &(p_freepic->lock_deccount) );
 
-        return( p_free_picture );
+        return( p_freepic );
     }
 
     /* No free or destroyed picture could be found, but the decoder
@@ -225,26 +226,26 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout,
  * picture. It is meant to be used when the construction of a picture aborted.
  * Note that the picture will be destroyed even if it is linked !
  *****************************************************************************/
-void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_picture )
+void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
     vlc_mutex_lock( &p_vout->picture_lock );
 
 #ifdef DEBUG
     /* Check if picture status is valid */
-    if( (p_picture->i_status != RESERVED_PICTURE) &&
-        (p_picture->i_status != RESERVED_DATED_PICTURE) &&
-        (p_picture->i_status != RESERVED_DISP_PICTURE) )
+    if( (p_pic->i_status != RESERVED_PICTURE) &&
+        (p_pic->i_status != RESERVED_DATED_PICTURE) &&
+        (p_pic->i_status != RESERVED_DISP_PICTURE) )
     {
         intf_ErrMsg( "error: picture %p has invalid status %d",
-                     p_picture, p_picture->i_status );
+                     p_pic, p_pic->i_status );
     }
 #endif
 
-    p_picture->i_status = DESTROYED_PICTURE;
+    p_pic->i_status = DESTROYED_PICTURE;
     p_vout->i_heap_size--;
 
     /* destroy the lock that had been initialized in CreatePicture */
-    vlc_mutex_destroy( &(p_picture->lock_deccount) );
+    vlc_mutex_destroy( &(p_pic->lock_deccount) );
 
     vlc_mutex_unlock( &p_vout->picture_lock );
 }
@@ -255,13 +256,13 @@ void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_picture )
  * This function increments the reference counter of a picture in the video
  * heap. It needs a lock since several producer threads can access the picture.
  *****************************************************************************/
-void vout_LinkPicture( vout_thread_t *p_vout, picture_t *p_picture )
+void vout_LinkPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
     vlc_mutex_lock( &p_vout->picture_lock );
-    p_picture->i_refcount++;
+    p_pic->i_refcount++;
 
 #ifdef TRACE_VOUT
-    intf_DbgMsg( "picture %p refcount=%d", p_picture, p_picture->i_refcount );
+    intf_DbgMsg( "picture %p refcount=%d", p_pic, p_pic->i_refcount );
 #endif
 
     vlc_mutex_unlock( &p_vout->picture_lock );
@@ -272,28 +273,28 @@ void vout_LinkPicture( vout_thread_t *p_vout, picture_t *p_picture )
  *****************************************************************************
  * This function decrement the reference counter of a picture in the video heap.
  *****************************************************************************/
-void vout_UnlinkPicture( vout_thread_t *p_vout, picture_t *p_picture )
+void vout_UnlinkPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
     vlc_mutex_lock( &p_vout->picture_lock );
-    p_picture->i_refcount--;
+    p_pic->i_refcount--;
 
 #ifdef TRACE_VOUT
-    if( p_picture->i_refcount < 0 )
+    if( p_pic->i_refcount < 0 )
     {
         intf_DbgMsg( "error: refcount < 0" );
-        p_picture->i_refcount = 0;
+        p_pic->i_refcount = 0;
     }
 #endif
 
-    if( ( p_picture->i_refcount == 0 ) &&
-        ( p_picture->i_status == DISPLAYED_PICTURE ) )
+    if( ( p_pic->i_refcount == 0 ) &&
+        ( p_pic->i_status == DISPLAYED_PICTURE ) )
     {
-        p_picture->i_status = DESTROYED_PICTURE;
+        p_pic->i_status = DESTROYED_PICTURE;
         p_vout->i_heap_size--;
     }
 
 #ifdef TRACE_VOUT
-    intf_DbgMsg( "picture %p refcount=%d", p_picture, p_picture->i_refcount );
+    intf_DbgMsg( "picture %p refcount=%d", p_pic, p_pic->i_refcount );
 #endif
 
     vlc_mutex_unlock( &p_vout->picture_lock );
@@ -306,21 +307,19 @@ void vout_UnlinkPicture( vout_thread_t *p_vout, picture_t *p_picture )
  * before rendering, does the subpicture magic, and tells the video output
  * thread which direct buffer needs to be displayed.
  *****************************************************************************/
-picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_picture,
+picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
                                                        subpicture_t *p_subpic )
 {
-    int i_index;
-
-    if( p_picture == NULL )
+    if( p_pic == NULL )
     {
         /* XXX: subtitles */
 
         return NULL;
     }
 
-    if( p_picture->i_type == DIRECT_PICTURE )
+    if( p_pic->i_type == DIRECT_PICTURE )
     {
-        if( p_picture->i_refcount )
+        if( p_pic->i_refcount )
         {
             /* Picture is in a direct buffer and is still in use,
              * we need to copy it to another direct buffer before
@@ -331,13 +330,7 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_picture,
                 /* We have subtitles. First copy the picture to
                  * the spare direct buffer, then render the
                  * subtitles. */
-                for( i_index = 0 ; i_index < p_picture->i_planes ; i_index++ )
-                {
-                    FAST_MEMCPY(
-                        PP_OUTPUTPICTURE[0]->planes[ i_index ].p_data,
-                        p_picture->planes[ i_index ].p_data,
-                        p_picture->planes[ i_index ].i_bytes );
-                }
+                vout_CopyPicture( p_pic, PP_OUTPUTPICTURE[0] );
 
                 vout_RenderSubPictures( p_vout, PP_OUTPUTPICTURE[0], p_subpic );
 
@@ -348,16 +341,16 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_picture,
              * we can display it directly even if it is still
              * in use. */
                     //printf("direct (refcount == 0)\n");
-            return p_picture;
+            return p_pic;
         }
 
         /* Picture is in a direct buffer but isn't used by the
          * decoder. We can safely render subtitles on it and
          * display it. */
                     //printf("direct (refcount == 0)\n");
-        vout_RenderSubPictures( p_vout, p_picture, p_subpic );
+        vout_RenderSubPictures( p_vout, p_pic, p_subpic );
 
-        return p_picture;
+        return p_pic;
     }
 
     /* Not a direct buffer. We either need to copy it to a direct buffer,
@@ -368,12 +361,7 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_picture,
          * same size as the direct buffers. A memcpy() is enough,
          * then render the subtitles. */
                     //printf("memcpy (not a direct buffer)\n");
-        for( i_index = 0; i_index < p_picture->i_planes; i_index++ )
-        {
-            FAST_MEMCPY( PP_OUTPUTPICTURE[0]->planes[ i_index ].p_data,
-                         p_picture->planes[ i_index ].p_data,
-                         p_picture->planes[ i_index ].i_bytes );
-        }
+        vout_CopyPicture( p_pic, PP_OUTPUTPICTURE[0] );
 
         vout_RenderSubPictures( p_vout, PP_OUTPUTPICTURE[0], p_subpic );
 
@@ -389,9 +377,9 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_picture,
 
     /* XXX: render to the first direct buffer */
                     //printf("render (not a direct buffer)\n");
-    p_vout->chroma.pf_convert( p_vout, p_picture, &p_vout->p_picture[0] );
+    p_vout->chroma.pf_convert( p_vout, p_pic, &p_vout->p_picture[0] );
 
-    vout_RenderSubPictures( p_vout, p_picture, p_subpic );
+    vout_RenderSubPictures( p_vout, p_pic, p_subpic );
 
     return &p_vout->p_picture[0];
 }
@@ -448,71 +436,108 @@ void vout_PlacePicture( vout_thread_t *p_vout, int i_width, int i_height,
  * used exactly like a video buffer. The video output thread then manages
  * how it gets displayed.
  *****************************************************************************/
-void vout_AllocatePicture( picture_t *p_picture,
-                           int i_width, int i_height, int i_chroma )
+void vout_AllocatePicture( picture_t *p_pic,
+                           int i_width, int i_height, u32 i_chroma )
 {
-#define P p_picture->planes
     int i_bytes, i_index;
 
+    /* Store default values */
+    for( i_index = 0; i_index < VOUT_MAX_PLANES; i_index++ )
+    {
+        p_pic->p[i_index].p_pixels = NULL;
+        p_pic->p[i_index].b_margin = 0;
+        p_pic->p[i_index].i_pixel_bytes = 1;
+    }
+
     /* Calculate coordinates */
     switch( i_chroma )
     {
-        case FOURCC_YV12:            /* YUV 420: 1,1/4,1/4 samples per pixel */
+        case FOURCC_YV12:
         case FOURCC_I420:
         case FOURCC_IYUV:
-            P[ Y_PLANE ].i_bytes = i_width * i_height;
-            P[ Y_PLANE ].i_line_bytes = i_width;
-            P[ U_PLANE ].i_bytes = i_width * i_height / 4;
-            P[ U_PLANE ].i_line_bytes = i_width / 2;
-            P[ V_PLANE ].i_bytes = i_width * i_height / 4;
-            P[ V_PLANE ].i_line_bytes = i_width / 2;
-            p_picture->i_planes = 3;
+            p_pic->p[ Y_PLANE ].i_lines = i_height;
+            p_pic->p[ Y_PLANE ].i_pitch = i_width;
+            p_pic->p[ U_PLANE ].i_lines = i_height / 2;
+            p_pic->p[ U_PLANE ].i_pitch = i_width / 2;
+            p_pic->p[ V_PLANE ].i_lines = i_height / 2;
+            p_pic->p[ V_PLANE ].i_pitch = i_width / 2;
+            p_pic->i_planes = 3;
             break;
 
-        case FOURCC_I422:            /* YUV 422: 1,1/2,1/2 samples per pixel */
-            P[ Y_PLANE ].i_bytes = i_width * i_height;
-            P[ Y_PLANE ].i_line_bytes = i_width;
-            P[ U_PLANE ].i_bytes = i_width * i_height / 2;
-            P[ U_PLANE ].i_line_bytes = i_width / 2;
-            P[ V_PLANE ].i_bytes = i_width * i_height / 2;
-            P[ V_PLANE ].i_line_bytes = i_width / 2;
-            p_picture->i_planes = 3;
+        case FOURCC_I422:
+            p_pic->p[ Y_PLANE ].i_lines = i_height;
+            p_pic->p[ Y_PLANE ].i_pitch = i_width;
+            p_pic->p[ U_PLANE ].i_lines = i_height;
+            p_pic->p[ U_PLANE ].i_pitch = i_width / 2;
+            p_pic->p[ V_PLANE ].i_lines = i_height;
+            p_pic->p[ V_PLANE ].i_pitch = i_width / 2;
+            p_pic->i_planes = 3;
             break;
 
-        case FOURCC_I444:                /* YUV 444: 1,1,1 samples per pixel */
-            P[ Y_PLANE ].i_bytes = i_width * i_height;
-            P[ Y_PLANE ].i_line_bytes = i_width;
-            P[ U_PLANE ].i_bytes = i_width * i_height;
-            P[ U_PLANE ].i_line_bytes = i_width;
-            P[ V_PLANE ].i_bytes = i_width * i_height;
-            P[ V_PLANE ].i_line_bytes = i_width;
-            p_picture->i_planes = 3;
+        case FOURCC_I444:
+            p_pic->p[ Y_PLANE ].i_lines = i_height;
+            p_pic->p[ Y_PLANE ].i_pitch = i_width;
+            p_pic->p[ U_PLANE ].i_lines = i_height;
+            p_pic->p[ U_PLANE ].i_pitch = i_width;
+            p_pic->p[ V_PLANE ].i_lines = i_height;
+            p_pic->p[ V_PLANE ].i_pitch = i_width;
+            p_pic->i_planes = 3;
+            break;
+
+        case FOURCC_Y211:
+            p_pic->p->i_lines = i_height;
+            p_pic->p->i_pitch = i_width;
+            p_pic->i_planes = 1;
+            break;
+
+        case FOURCC_RV15:
+            p_pic->p->i_lines = i_height;
+            p_pic->p->i_pitch = i_width * 2;
+            p_pic->p->i_pixel_bytes = 2;
+            p_pic->p->i_red_mask =   0x001f;
+            p_pic->p->i_green_mask = 0x03e0;
+            p_pic->p->i_blue_mask =  0x7c00;
+            p_pic->i_planes = 1;
+            break;
+
+        case FOURCC_RV16:
+            p_pic->p->i_lines = i_height;
+            p_pic->p->i_pitch = i_width * 2;
+            p_pic->p->i_pixel_bytes = 2;
+            p_pic->p->i_red_mask =   0x001f;
+            p_pic->p->i_green_mask = 0x07e0;
+            p_pic->p->i_blue_mask =  0xf800;
+            p_pic->i_planes = 1;
             break;
 
         default:
-            intf_ErrMsg( "vout error: unknown chroma type %d", i_chroma );
-            p_picture->i_planes = 0;
+            intf_ErrMsg( "vout error: unknown chroma type %.8x", i_chroma );
+            p_pic->i_planes = 0;
             return;
     }
 
     /* Calculate how big the new image should be */
-    for( i_bytes = 0, i_index = 0; i_index < p_picture->i_planes; i_index++ )
+    for( i_bytes = 0, i_index = 0; i_index < p_pic->i_planes; i_index++ )
     {
-        i_bytes += P[ i_index ].i_bytes;
+        i_bytes += p_pic->p[ i_index ].i_lines * p_pic->p[ i_index ].i_pitch;
     }
 
-    P[ 0 ].p_data = memalign( 16, i_bytes );
+    p_pic->p_data = memalign( 16, i_bytes );
 
-    if( P[ 0 ].p_data == NULL )
+    if( p_pic->p_data == NULL )
     {
-        p_picture->i_planes = 0;
+        p_pic->i_planes = 0;
         return;
     }
 
-    /* Fill the p_data field for each plane */
-    for( i_index = 1; i_index < p_picture->i_planes; i_index++ )
+    /* Fill the p_pixels field for each plane */
+    p_pic->p[ 0 ].p_pixels = p_pic->p_data;
+
+    for( i_index = 1; i_index < p_pic->i_planes; i_index++ )
     {
-        P[ i_index ].p_data = P[ i_index-1 ].p_data + P[ i_index-1 ].i_bytes;
+        p_pic->p[i_index].p_pixels = p_pic->p[i_index-1].p_pixels
+                                          + p_pic->p[i_index-1].i_lines
+                                             * p_pic->p[i_index-1].i_pitch;
     }
 }
 
index d533ce38228989ba02bf73a207b84b36f2ecc576..4dbab1accdc84cb4b8d8d162356726a0d02c65b3 100644 (file)
@@ -2,7 +2,7 @@
  * vout_subpictures.c : subpicture management functions
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
- * $Id: vout_subpictures.c,v 1.4 2002/01/02 14:37:42 sam Exp $
+ * $Id: vout_subpictures.c,v 1.5 2002/01/04 14:01:35 sam Exp $
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *          Samuel Hocevar <sam@zoy.org>
@@ -530,7 +530,7 @@ static void vout_RenderYUVSPU( const vout_thread_t *p_vout, picture_t *p_pic,
 
     int i_x, i_y;
 
-    u8 *p_dest = p_pic->P_Y + p_spu->i_x + p_spu->i_width
+    u8 *p_dest = p_pic->p->p_pixels + p_spu->i_x + p_spu->i_width
                    + p_vout->output.i_width * ( p_spu->i_y + p_spu->i_height );
 
     /* Draw until we reach the bottom of the subtitle */