From: Sam Hocevar Date: Thu, 8 Aug 2002 00:35:11 +0000 (+0000) Subject: * ./modules/audio_output/oss.c: compilation fixes. X-Git-Tag: 0.5.0~1133 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=7689bc9224e3d9516c56126980cb68eadca6fcaf;p=vlc * ./modules/audio_output/oss.c: compilation fixes. * ALL: lots of -ansi -pedantic fixes. --- diff --git a/Makefile b/Makefile index 373fc1dad0..072a60bdaa 100644 --- a/Makefile +++ b/Makefile @@ -148,7 +148,7 @@ mozilla-clean: distclean: clean -cd po && $(MAKE) maintainer-clean rm -f **/*.o **/*~ *.log - rm -f Makefile.opts Makefile.config + rm -f Makefile.opts Makefile.config vlc-config rm -f include/defs.h include/modules_builtin.h rm -f src/misc/modules_builtin.h rm -f config*status config*cache config*log conftest* diff --git a/Makefile.modules b/Makefile.modules index 3d9f603ec7..2dbdb788cf 100644 --- a/Makefile.modules +++ b/Makefile.modules @@ -55,7 +55,7 @@ all: clean: # rm -f $(PLUGIN_ALL) $(BUILTIN_ALL) - rm -f *.o *.o.* *.lo *.lo.* *.obj *.moc *.moc.* *.bak + rm -f *.a *.so *.o *.o.* *.lo.* *.obj *.moc *.moc.* *.bak rm -Rf .dep FORCE: diff --git a/Makefile.opts.in b/Makefile.opts.in index 520186cbc5..bb13371361 100644 --- a/Makefile.opts.in +++ b/Makefile.opts.in @@ -97,7 +97,6 @@ arts_LDFLAGS = @arts_LDFLAGS@ beos_LDFLAGS = @beos_LDFLAGS@ i420_rgb_LDFLAGS = @i420_rgb_LDFLAGS@ directx_LDFLAGS = @directx_LDFLAGS@ -dsp_LDFLAGS = @dsp_LDFLAGS@ dv_LDFLAGS = @dv_LDFLAGS@ dvd_LDFLAGS = @dvd_LDFLAGS@ dvdread_LDFLAGS = @dvdread_LDFLAGS@ @@ -124,12 +123,13 @@ macosx_LDFLAGS = @macosx_LDFLAGS@ mad_LDFLAGS = @mad_LDFLAGS@ memcpyaltivec_LDFLAGS = @memcpyaltivec_LDFLAGS@ motionaltivec_LDFLAGS = @motionaltivec_LDFLAGS@ -ts_dvbpsi_LDFLAGS = @ts_dvbpsi_LDFLAGS@ ncurses_LDFLAGS = @ncurses_LDFLAGS@ +oss_LDFLAGS = @oss_LDFLAGS@ qnx_LDFLAGS = @qnx_LDFLAGS@ qt_LDFLAGS = @qt_LDFLAGS@ rc_LDFLAGS = @rc_LDFLAGS@ sdl_LDFLAGS = @sdl_LDFLAGS@ +ts_dvbpsi_LDFLAGS = @ts_dvbpsi_LDFLAGS@ vcd_LDFLAGS = @vcd_LDFLAGS@ vorbis_LDFLAGS = @vorbis_LDFLAGS@ waveout_LDFLAGS = @waveout_LDFLAGS@ diff --git a/configure b/configure index 863ed05b25..93b952fd10 100755 --- a/configure +++ b/configure @@ -8040,7 +8040,7 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then #define $ac_tr_hdr 1 EOF - #PLUGINS="${PLUGINS} audio_output/oss" + PLUGINS="${PLUGINS} audio_output/oss" echo $ac_n "checking for main in -lossaudio""... $ac_c" 1>&6 echo "configure:8046: checking for main in -lossaudio" >&5 ac_lib_var=`echo ossaudio'_'main | sed 'y%./+-%__p_%'` @@ -8072,7 +8072,7 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio" + oss_LDFLAGS="${oss_LDFLAGS} -lossaudio" else echo "$ac_t""no" 1>&6 fi @@ -9421,7 +9421,7 @@ CFLAGS="${save_CFLAGS}" LDFLAGS="${save_LDFLAGS}" libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}" -for i in ${BUILTINS} ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done +for i in `echo ${BUILTINS} | sed -e 's#[^ ]*/##g'` ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done @@ -9781,7 +9781,6 @@ s%@arts_LDFLAGS@%$arts_LDFLAGS%g s%@beos_LDFLAGS@%$beos_LDFLAGS%g s%@i420_rgb_LDFLAGS@%$i420_rgb_LDFLAGS%g s%@directx_LDFLAGS@%$directx_LDFLAGS%g -s%@dsp_LDFLAGS@%$dsp_LDFLAGS%g s%@dv_LDFLAGS@%$dv_LDFLAGS%g s%@dvd_LDFLAGS@%$dvd_LDFLAGS%g s%@dvdread_LDFLAGS@%$dvdread_LDFLAGS%g @@ -9810,6 +9809,7 @@ s%@mad_LDFLAGS@%$mad_LDFLAGS%g s%@memcpyaltivec_LDFLAGS@%$memcpyaltivec_LDFLAGS%g s%@motionaltivec_LDFLAGS@%$motionaltivec_LDFLAGS%g s%@ncurses_LDFLAGS@%$ncurses_LDFLAGS%g +s%@oss_LDFLAGS@%$oss_LDFLAGS%g s%@qnx_LDFLAGS@%$qnx_LDFLAGS%g s%@qt_LDFLAGS@%$qt_LDFLAGS%g s%@rc_LDFLAGS@%$rc_LDFLAGS%g diff --git a/configure.in b/configure.in index e60ebcbeb3..2283b2ee54 100644 --- a/configure.in +++ b/configure.in @@ -1408,8 +1408,8 @@ if test "x${enable_oss}" != "xno" && (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes") then AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [ - #PLUGINS="${PLUGINS} audio_output/oss" - AC_CHECK_LIB(ossaudio,main,dsp_LDFLAGS="${dsp_LDFLAGS} -lossaudio") + PLUGINS="${PLUGINS} audio_output/oss" + AC_CHECK_LIB(ossaudio,main,oss_LDFLAGS="${oss_LDFLAGS} -lossaudio") ]) fi @@ -1909,7 +1909,7 @@ dnl dnl Create the vlc-config script dnl libvlc_LDFLAGS="${vlc_LDFLAGS} ${builtins_LDFLAGS}" -for i in ${BUILTINS} ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done +for i in `echo ${BUILTINS} | sed -e 's#[^ ]*/##g'` ; do libvlc_LDFLAGS="${libvlc_LDFLAGS} ${libdir}/vlc/${i}.a `eval echo '$'{${i}_LDFLAGS}`" ; done AC_SUBST(libvlc_LDFLAGS) dnl @@ -1981,7 +1981,6 @@ AC_SUBST(arts_LDFLAGS) AC_SUBST(beos_LDFLAGS) AC_SUBST(i420_rgb_LDFLAGS) AC_SUBST(directx_LDFLAGS) -AC_SUBST(dsp_LDFLAGS) AC_SUBST(dv_LDFLAGS) AC_SUBST(dvd_LDFLAGS) AC_SUBST(dvdread_LDFLAGS) @@ -2010,6 +2009,7 @@ AC_SUBST(mad_LDFLAGS) AC_SUBST(memcpyaltivec_LDFLAGS) AC_SUBST(motionaltivec_LDFLAGS) AC_SUBST(ncurses_LDFLAGS) +AC_SUBST(oss_LDFLAGS) AC_SUBST(qnx_LDFLAGS) AC_SUBST(qt_LDFLAGS) AC_SUBST(rc_LDFLAGS) diff --git a/debian/control b/debian/control index d863347840..ff6b832a80 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: vlc Section: graphics Priority: optional Maintainer: Samuel Hocevar -Build-Depends: debhelper (>=2.2.0), xlibs-dev, xlibs-pic, libgnome-dev, libggi2-dev, libglide2-dev [i386], libesd0-dev, libsdl1.2-dev (>=1.2.2-3.1), libqt-dev, libasound2-dev (>=0.9.0beta10a), libarts-dev, libmad0-dev, liblircclient-dev, a52dec-dev, aalib1-dev, libdvbpsi1-dev, mozilla-dev, kdelibs-dev +Build-Depends: debhelper (>=2.2.0), xlibs-dev, xlibs-pic, libgnome-dev, libggi2-dev, libglide2-dev [i386], libesd0-dev, libsdl1.2-dev (>=1.2.2-3.1), libqt-dev, libasound2-dev (>=0.9.0beta10a), libarts-dev, libmad0-dev, liblircclient-dev, a52dec-dev, aalib1-dev, libdvbpsi1-dev, mozilla-dev, kdelibs-dev, dvb-dev, libdv-dev Standards-Version: 3.5.6 Package: vlc @@ -23,7 +23,7 @@ Description: development files for the VideoLAN Client VideoLAN is a free MPEG, MPEG2, DVD and DivX software solution. . This package contains headers and a static library required to build plugins - for the Videolan Client, or standalone applications using VideoLAN Client. + for the VideoLAN Client, or standalone applications using VideoLAN Client. Package: gnome-vlc Architecture: any diff --git a/debian/rules b/debian/rules index 3313b95224..fc4a87d3a4 100755 --- a/debian/rules +++ b/debian/rules @@ -10,7 +10,7 @@ export DH_COMPAT=3 # Compilation options export FFMPEG_VERSION=cvs -export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-aa --enable-dvbpsi --enable-xosd --enable-mozilla --enable-kde --enable-ffmpeg --with-ffmpeg-tree=ffmpeg-$(FFMPEG_VERSION) --enable-mp4" +export CONFIG_FLAGS="--enable-release --prefix=/usr --enable-gnome --enable-gtk --enable-fb --enable-ggi --enable-sdl --enable-esd --enable-qt --enable-mad --enable-arts --enable-alsa --enable-lirc --enable-a52 --enable-aa --enable-dvbpsi --enable-xosd --enable-mozilla --enable-kde --enable-ffmpeg --with-ffmpeg-tree=ffmpeg-$(FFMPEG_VERSION) --enable-mp4 --enable-dvb --enable-dv" # Remove --without-dvdcss here in non-totalitarian countries export DVDCSS_FLAGS="--enable-dvd --without-dvdcss" diff --git a/include/aout_internal.h b/include/aout_internal.h index 0f4e97417a..bda41d08b2 100644 --- a/include/aout_internal.h +++ b/include/aout_internal.h @@ -2,7 +2,7 @@ * aout_internal.h : internal defines for audio output ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: aout_internal.h,v 1.1 2002/08/07 21:36:55 massiot Exp $ + * $Id: aout_internal.h,v 1.2 2002/08/08 00:35:10 sam Exp $ * * Authors: Christophe Massiot * @@ -57,7 +57,7 @@ typedef struct aout_alloc_t (p_new_buffer)->i_alloc_type = (p_alloc)->i_alloc_type; \ (p_new_buffer)->i_size = (u64)(p_alloc)->i_bytes_per_sec \ * i_nb_usec / 1000000 + 1; \ - (p_new_buffer)->p_buffer = (void *)(p_new_buffer) \ + (p_new_buffer)->p_buffer = (byte_t *)(p_new_buffer) \ + sizeof(aout_buffer_t); \ if ( (p_previous_buffer) != NULL ) \ { \ @@ -184,7 +184,7 @@ struct aout_input_t aout_fifo_t fifo; - char * p_first_byte_to_mix; + byte_t * p_first_byte_to_mix; }; /***************************************************************************** @@ -263,4 +263,3 @@ int aout_OutputNew( aout_instance_t * p_aout, void aout_OutputPlay( aout_instance_t * p_aout, aout_buffer_t * p_buffer ); void aout_OutputDelete( aout_instance_t * p_aout ); -int aout_FormatToBytes( audio_sample_format_t * p_format ); diff --git a/include/audio_output.h b/include/audio_output.h index 27779a3079..a6fc838a22 100644 --- a/include/audio_output.h +++ b/include/audio_output.h @@ -2,7 +2,7 @@ * audio_output.h : audio output interface ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: audio_output.h,v 1.52 2002/08/07 21:36:55 massiot Exp $ + * $Id: audio_output.h,v 1.53 2002/08/08 00:35:10 sam Exp $ * * Authors: Christophe Massiot * @@ -65,7 +65,7 @@ struct audio_sample_format_t *****************************************************************************/ struct aout_buffer_t { - char * p_buffer; + byte_t * p_buffer; int i_alloc_type; size_t i_size; int i_nb_samples; @@ -84,6 +84,7 @@ VLC_EXPORT( void, aout_DeleteInstance, ( aout_instance_t * ) ); VLC_EXPORT( aout_buffer_t *, aout_BufferNew, ( aout_instance_t *, aout_input_t *, size_t ) ); VLC_EXPORT( void, aout_BufferDelete, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ); VLC_EXPORT( void, aout_BufferPlay, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ); +VLC_EXPORT( int, aout_FormatToBytes, ( audio_sample_format_t * p_format ) ); /* From input.c : */ #define aout_InputNew(a,b,c) __aout_InputNew(VLC_OBJECT(a),b,c) diff --git a/include/defs.h.in b/include/defs.h.in index 7b55f68ef6..17bf78f6fe 100644 --- a/include/defs.h.in +++ b/include/defs.h.in @@ -1,401 +1,372 @@ -/* include/defs.h.in. Generated from configure.in by autoheader. */ +/* include/defs.h.in. Generated automatically from configure.in by autoheader 2.13. */ -/* Maximum supported data alignment */ -#undef ATTRIBUTE_ALIGNED_MAX - -/* Define if $CC groks 3D Now! inline assembly. */ -#undef CAN_COMPILE_3DNOW - -/* Define if $CC groks AltiVec inline assembly. */ -#undef CAN_COMPILE_ALTIVEC - -/* Define if your compiler groks C AltiVec extensions. */ -#undef CAN_COMPILE_C_ALTIVEC - -/* Define if $CC groks SSE inline assembly. */ -#undef CAN_COMPILE_SSE - -/* The ./configure command line */ -#undef CONFIGURE_LINE - -/* Copyright string */ -#undef COPYRIGHT_MESSAGE - -/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP - systems. This function is required for `alloca.c' support on those systems. - */ -#undef CRAY_STACKSEG_END - -/* Define to 1 if using `alloca.c'. */ +/* Define if using alloca.c. */ #undef C_ALLOCA -/* Define if defines DPMSInfo. */ -#undef DPMSINFO_IN_DPMS_H - -/* Define to 1 if translation of program messages to the user's native - language is requested. */ -#undef ENABLE_NLS +/* Define to empty if the keyword does not work. */ +#undef const -/* Define to 1 if you have the header file. */ -#undef HAVE_A52DEC_A52_H +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +#undef CRAY_STACKSEG_END -/* Define to 1 if you have `alloca', as a function or macro. */ +/* Define if you have alloca, as a function or macro. */ #undef HAVE_ALLOCA -/* Define to 1 if you have and it should be used (not on Ultrix). - */ +/* Define if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H -/* Define to 1 if you have the header file. */ -#undef HAVE_ARGZ_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_INET_H +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP -/* Define to 1 if you have the `atoll' function. */ -#undef HAVE_ATOLL +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline -/* Define to 1 if you have the header file. */ -#undef HAVE_COCOA_COCOA_H +/* Define to `long' if doesn't define. */ +#undef off_t -/* Define to 1 if you have the header file. */ -#undef HAVE_CTHREADS_H +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE -/* Define to 1 if you have the `dcgettext' function. */ -#undef HAVE_DCGETTEXT +/* Define to `unsigned' if doesn't define. */ +#undef size_t -/* Define to 1 if you have the header file. */ -#undef HAVE_DDRAW_H +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +#undef STACK_DIRECTION -/* Define if defines nanosleep. */ -#undef HAVE_DECL_NANOSLEEP +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H +/* Define if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME -/* Define to 1 if you have the header file. */ -#undef HAVE_DVBPSI_DR_H +/* Define if you have the __argz_count function. */ +#undef HAVE___ARGZ_COUNT -/* Define to 1 if you have the header file. */ -#undef HAVE_DVDCSS_DVDCSS_H +/* Define if you have the __argz_next function. */ +#undef HAVE___ARGZ_NEXT -/* Define to 1 if you have the header file. */ -#undef HAVE_DVDPLAY_DVDPLAY_H +/* Define if you have the __argz_stringify function. */ +#undef HAVE___ARGZ_STRINGIFY -/* Define to 1 if you have the header file. */ -#undef HAVE_DVDREAD_DVD_READER_H +/* Define if you have the atoll function. */ +#undef HAVE_ATOLL -/* Define to 1 if you have the header file. */ -#undef HAVE_FCNTL_H +/* Define if you have the dcgettext function. */ +#undef HAVE_DCGETTEXT -/* Define to 1 if you have the `feof_unlocked' function. */ +/* Define if you have the feof_unlocked function. */ #undef HAVE_FEOF_UNLOCKED -/* Define to 1 if you have the `fgets_unlocked' function. */ +/* Define if you have the fgets_unlocked function. */ #undef HAVE_FGETS_UNLOCKED -/* Define to 1 if you have the header file. */ -#undef HAVE_GDK_GDK_H - -/* Define to 1 if you have the `getcwd' function. */ +/* Define if you have the getcwd function. */ #undef HAVE_GETCWD -/* Define to 1 if you have the `getegid' function. */ +/* Define if you have the getegid function. */ #undef HAVE_GETEGID -/* Define to 1 if you have the `geteuid' function. */ +/* Define if you have the geteuid function. */ #undef HAVE_GETEUID -/* Define to 1 if you have the `getgid' function. */ +/* Define if you have the getgid function. */ #undef HAVE_GETGID -/* Define to 1 if you have the `gethostbyname2' function. */ +/* Define if you have the gethostbyname2 function. */ #undef HAVE_GETHOSTBYNAME2 -/* Define to 1 if you have the header file. */ -#undef HAVE_GETOPT_H - -/* getopt support */ -#undef HAVE_GETOPT_LONG - -/* Define to 1 if you have the `getpagesize' function. */ +/* Define if you have the getpagesize function. */ #undef HAVE_GETPAGESIZE -/* Define to 1 if you have the `getpwuid' function. */ +/* Define if you have the getpwuid function. */ #undef HAVE_GETPWUID -/* Define if the GNU gettext() function is already present or preinstalled. */ -#undef HAVE_GETTEXT - -/* Define to 1 if you have the `gettimeofday' function. */ +/* Define if you have the gettimeofday function. */ #undef HAVE_GETTIMEOFDAY -/* Define to 1 if you have the `getuid' function. */ +/* Define if you have the getuid function. */ #undef HAVE_GETUID -/* Define to 1 if you have the header file. */ -#undef HAVE_GLIB_H +/* Define if you have the isatty function. */ +#undef HAVE_ISATTY -/* Define to 1 if you have the header file. */ -#undef HAVE_GNOME_H +/* Define if you have the memalign function. */ +#undef HAVE_MEMALIGN -/* Define to 1 if you have the header file. */ -#undef HAVE_GTK_GTK_H +/* Define if you have the mempcpy function. */ +#undef HAVE_MEMPCPY -/* Define if you have the iconv() function. */ -#undef HAVE_ICONV +/* Define if you have the munmap function. */ +#undef HAVE_MUNMAP -/* Define to 1 if you have the header file. */ -#undef HAVE_IMAGE_H +/* Define if you have the posix_memalign function. */ +#undef HAVE_POSIX_MEMALIGN -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H +/* Define if you have the putenv function. */ +#undef HAVE_PUTENV -/* For FreeBSD VCD support */ -#undef HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H +/* Define if you have the select function. */ +#undef HAVE_SELECT -/* Define to 1 if you have the `isatty' function. */ -#undef HAVE_ISATTY +/* Define if you have the setenv function. */ +#undef HAVE_SETENV -/* Define to 1 if you have the header file. */ -#undef HAVE_KERNEL_OS_H +/* Define if you have the setlocale function. */ +#undef HAVE_SETLOCALE -/* Define to 1 if you have the header file. */ -#undef HAVE_KERNEL_SCHEDULER_H +/* Define if you have the sigrelse function. */ +#undef HAVE_SIGRELSE -/* Define if you have and nl_langinfo(CODESET). */ -#undef HAVE_LANGINFO_CODESET +/* Define if you have the stpcpy function. */ +#undef HAVE_STPCPY -/* Define if your file defines LC_MESSAGES. */ -#undef HAVE_LC_MESSAGES +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBDV_DV_H +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR -/* Define to 1 if you have the `pth' library (-lpth). */ -#undef HAVE_LIBPTH +/* Define if you have the strdup function. */ +#undef HAVE_STRDUP -/* Define to 1 if you have the `st' library (-lst). */ -#undef HAVE_LIBST +/* Define if you have the strerror function. */ +#undef HAVE_STRERROR -/* Define to 1 if you have the header file. */ -#undef HAVE_LIBV4L_V4L_H +/* Define if you have the strndup function. */ +#undef HAVE_STRNDUP -/* Define to 1 if you have the header file. */ -#undef HAVE_LIMITS_H +/* Define if you have the strtod function. */ +#undef HAVE_STRTOD -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_FB_H +/* Define if you have the strtol function. */ +#undef HAVE_STRTOL -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_VERSION_H +/* Define if you have the strtoul function. */ +#undef HAVE_STRTOUL -/* Define to 1 if you have the header file. */ -#undef HAVE_LOCALE_H +/* Define if you have the swab function. */ +#undef HAVE_SWAB -/* Define to 1 if you have the header file. */ -#undef HAVE_MACHINE_PARAM_H +/* Define if you have the tsearch function. */ +#undef HAVE_TSEARCH -/* Define to 1 if you have the header file. */ -#undef HAVE_MACHINE_SOUNDCARD_H +/* Define if you have the vasprintf function. */ +#undef HAVE_VASPRINTF -/* Define to 1 if you have the header file. */ -#undef HAVE_MAD_H +/* Define if you have the header file. */ +#undef HAVE_COCOA_COCOA_H -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H +/* Define if you have the header file. */ +#undef HAVE_PH_H -/* Define to 1 if you have the `memalign' function. */ -#undef HAVE_MEMALIGN +/* Define if you have the header file. */ +#undef HAVE_X11_XLIB_H -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H +/* Define if you have the header file. */ +#undef HAVE_X11_EXTENSIONS_XV_H -/* Define to 1 if you have the `mempcpy' function. */ -#undef HAVE_MEMPCPY +/* Define if you have the header file. */ +#undef HAVE_X11_EXTENSIONS_DPMS_H -/* Define to 1 if you have a working `mmap' system call. */ -#undef HAVE_MMAP +/* Define if you have the header file. */ +#undef HAVE_A52DEC_A52_H -/* Define to 1 if you have the `munmap' function. */ -#undef HAVE_MUNMAP +/* Define if you have the header file. */ +#undef HAVE_ARGZ_H -/* Define if nanosleep is available. */ -#undef HAVE_NANOSLEEP +/* Define if you have the header file. */ +#undef HAVE_ARPA_INET_H -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H +/* Define if you have the header file. */ +#undef HAVE_CTHREADS_H -/* Define to 1 if you have the header file. */ -#undef HAVE_NET_IF_H +/* Define if you have the header file. */ +#undef HAVE_DDRAW_H -/* Define to 1 if you have the header file. */ -#undef HAVE_NL_TYPES_H +/* Define if you have the header file. */ +#undef HAVE_DLFCN_H -/* Define to 1 if you have the header file. */ -#undef HAVE_OGG_OGG_H +/* Define if you have the header file. */ +#undef HAVE_DVBPSI_DR_H -/* Define to 1 if you have the header file. */ -#undef HAVE_PH_H +/* Define if you have the header file. */ +#undef HAVE_DVDCSS_DVDCSS_H -/* Define to 1 if you have the `posix_memalign' function. */ -#undef HAVE_POSIX_MEMALIGN +/* Define if you have the header file. */ +#undef HAVE_DVDPLAY_DVDPLAY_H -/* Define to 1 if you have the header file. */ -#undef HAVE_PTHREAD_H +/* Define if you have the header file. */ +#undef HAVE_DVDREAD_DVD_READER_H -/* Define to 1 if you have the `putenv' function. */ -#undef HAVE_PUTENV +/* Define if you have the header file. */ +#undef HAVE_FCNTL_H -/* Define to 1 if you have the `select' function. */ -#undef HAVE_SELECT +/* Define if you have the header file. */ +#undef HAVE_GDK_GDK_H -/* Define to 1 if you have the `setenv' function. */ -#undef HAVE_SETENV +/* Define if you have the header file. */ +#undef HAVE_GETOPT_H -/* Define to 1 if you have the `setlocale' function. */ -#undef HAVE_SETLOCALE +/* Define if you have the header file. */ +#undef HAVE_GLIB_H -/* Define to 1 if you have the `sigrelse' function. */ -#undef HAVE_SIGRELSE +/* Define if you have the header file. */ +#undef HAVE_GNOME_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SOUNDCARD_H +/* Define if you have the header file. */ +#undef HAVE_GTK_GTK_H -/* Define to 1 if you have the header file. */ -#undef HAVE_STDDEF_H +/* Define if you have the header file. */ +#undef HAVE_IMAGE_H -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H +/* Define if you have the header file. */ +#undef HAVE_INTTYPES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H +/* Define if you have the header file. */ +#undef HAVE_KERNEL_OS_H -/* Define to 1 if you have the `stpcpy' function. */ -#undef HAVE_STPCPY +/* Define if you have the header file. */ +#undef HAVE_KERNEL_SCHEDULER_H -/* Define to 1 if you have the `strcasecmp' function. */ -#undef HAVE_STRCASECMP +/* Define if you have the header file. */ +#undef HAVE_LIBDV_DV_H -/* Define to 1 if you have the `strchr' function. */ -#undef HAVE_STRCHR +/* Define if you have the header file. */ +#undef HAVE_LIBV4L_V4L_H -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP +/* Define if you have the header file. */ +#undef HAVE_LIMITS_H -/* Define to 1 if you have the `strerror' function. */ -#undef HAVE_STRERROR +/* Define if you have the header file. */ +#undef HAVE_LINUX_FB_H -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H +/* Define if you have the header file. */ +#undef HAVE_LINUX_VERSION_H -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H +/* Define if you have the header file. */ +#undef HAVE_LOCALE_H -/* Define to 1 if you have the `strndup' function. */ -#undef HAVE_STRNDUP +/* Define if you have the header file. */ +#undef HAVE_MACHINE_PARAM_H -/* Define to 1 if you have the `strtod' function. */ -#undef HAVE_STRTOD +/* Define if you have the header file. */ +#undef HAVE_MACHINE_SOUNDCARD_H -/* Define to 1 if you have the `strtol' function. */ -#undef HAVE_STRTOL +/* Define if you have the header file. */ +#undef HAVE_MAD_H -/* Define to 1 if you have the `strtoul' function. */ -#undef HAVE_STRTOUL +/* Define if you have the header file. */ +#undef HAVE_MALLOC_H -/* Define if defines struct timespec. */ -#undef HAVE_STRUCT_TIMESPEC +/* Define if you have the header file. */ +#undef HAVE_NET_IF_H -/* Define to 1 if you have the `swab' function. */ -#undef HAVE_SWAB +/* Define if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define if you have the header file. */ +#undef HAVE_NL_TYPES_H + +/* Define if you have the header file. */ +#undef HAVE_OGG_OGG_H + +/* Define if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define if you have the header file. */ +#undef HAVE_SOUNDCARD_H + +/* Define if you have the header file. */ +#undef HAVE_STDDEF_H -/* Define to 1 if you have the header file. */ +/* Define if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the header file. */ +#undef HAVE_STRING_H + +/* Define if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define if you have the header file. */ #undef HAVE_SYS_INT_TYPES_H -/* Define to 1 if you have the header file. */ +/* Define if you have the header file. */ #undef HAVE_SYS_PARAM_H -/* Define to 1 if you have the header file. */ +/* Define if you have the header file. */ #undef HAVE_SYS_SHM_H -/* Define to 1 if you have the header file. */ +/* Define if you have the header file. */ #undef HAVE_SYS_SOCKET_H -/* Define to 1 if you have the header file. */ +/* Define if you have the header file. */ #undef HAVE_SYS_SOCKIO_H -/* Define to 1 if you have the header file. */ +/* Define if you have the header file. */ #undef HAVE_SYS_SOUNDCARD_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H +/* Define if you have the header file. */ +#undef HAVE_SYS_TIME_H -/* Define to 1 if you have the header file. */ +/* Define if you have the header file. */ #undef HAVE_SYS_TIMES_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TIME_H - -/* Define to 1 if you have the header file. */ +/* Define if you have the header file. */ #undef HAVE_SYS_TYPES_H -/* Define to 1 if you have the `tsearch' function. */ -#undef HAVE_TSEARCH - -/* Define to 1 if you have the header file. */ +/* Define if you have the header file. */ #undef HAVE_UNISTD_H -/* Support for variadic macros */ -#undef HAVE_VARIADIC_MACROS - -/* Define to 1 if you have the `vasprintf' function. */ -#undef HAVE_VASPRINTF - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_DPMS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_EXTENSIONS_XV_H +/* Define if you have the pth library (-lpth). */ +#undef HAVE_LIBPTH -/* Define to 1 if you have the header file. */ -#undef HAVE_X11_XLIB_H +/* Define if you have the st library (-lst). */ +#undef HAVE_LIBST -/* Define to 1 if you have the `__argz_count' function. */ -#undef HAVE___ARGZ_COUNT +/* Package name */ +#undef VLC_PACKAGE -/* Define to 1 if you have the `__argz_next' function. */ -#undef HAVE___ARGZ_NEXT +/* Package version */ +#undef VLC_VERSION -/* Define to 1 if you have the `__argz_stringify' function. */ -#undef HAVE___ARGZ_STRINGIFY +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST -/* String suffix for module functions */ -#undef MODULE_SUFFIX - -/* Symbol suffix for module functions */ -#undef MODULE_SYMBOL +/* Define if you have and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET -/* Define if defines ntohl. */ -#undef NTOHL_IN_SYS_PARAM_H +/* Define if your file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT +/* Define to 1 if translation of program messages to the user's native language + is requested. */ +#undef ENABLE_NLS -/* Define to the full name of this package. */ -#undef PACKAGE_NAME +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING +/* Define if nanosleep is available. */ +#undef HAVE_NANOSLEEP -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME +/* long getopt support */ +#undef HAVE_GETOPT_LONG -/* Define to the version of this package. */ -#undef PACKAGE_VERSION +/* getopt support */ +#undef HAVE_GETOPT_LONG /* Define if defines pthread_cond_t. */ #undef PTHREAD_COND_T_IN_PTHREAD_H @@ -403,56 +374,66 @@ /* Define if defines pthread_once. */ #undef PTHREAD_ONCE_IN_PTHREAD_H -/* Define if defines pth_init */ -#undef PTH_INIT_IN_PTH_H +/* Define if defines strncasecmp. */ +#undef STRNCASECMP_IN_STRINGS_H -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE +/* Define if defines nanosleep. */ +#undef HAVE_DECL_NANOSLEEP -/* Indicate whether we should use SDL/SDL.h or SDL11/SDL.h */ -#undef SDL_INCLUDE_FILE +/* Define if defines struct timespec. */ +#undef HAVE_STRUCT_TIMESPEC -/* If using the C implementation of alloca, define if you know the - direction of stack growth for your system; otherwise it will be - automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ -#undef STACK_DIRECTION +/* Define if defines DPMSInfo. */ +#undef DPMSINFO_IN_DPMS_H -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS +/* Define if defines ntohl. */ +#undef NTOHL_IN_SYS_PARAM_H -/* Define if defines strncasecmp. */ -#undef STRNCASECMP_IN_STRINGS_H +/* Support for variadic macros */ +#undef HAVE_VARIADIC_MACROS -/* Define if defines st_init */ -#undef ST_INIT_IN_ST_H +/* Maximum supported data alignment */ +#undef ATTRIBUTE_ALIGNED_MAX -/* Define to 1 if you can safely include both and . */ -#undef TIME_WITH_SYS_TIME +/* Define if $CC groks 3D Now! inline assembly. */ +#undef CAN_COMPILE_3DNOW -/* Simple version string */ -#undef VERSION_MESSAGE +/* Define if $CC groks SSE inline assembly. */ +#undef CAN_COMPILE_SSE -/* Package name */ -#undef VLC_PACKAGE +/* Define if $CC groks AltiVec inline assembly. */ +#undef CAN_COMPILE_ALTIVEC -/* Package version */ -#undef VLC_VERSION +/* Define if your compiler groks C AltiVec extensions. */ +#undef CAN_COMPILE_C_ALTIVEC + +/* For FreeBSD VCD support */ +#undef HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H + +/* Indicate whether we should use SDL/SDL.h or SDL11/SDL.h */ +#undef SDL_INCLUDE_FILE /* big endian system */ #undef WORDS_BIGENDIAN -/* Define to empty if `const' does not conform to ANSI C. */ -#undef const +/* Define if defines pth_init */ +#undef PTH_INIT_IN_PTH_H -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ -#undef inline +/* Define if defines st_init */ +#undef ST_INIT_IN_ST_H -/* Define to `long' if does not define. */ -#undef off_t +/* Simple version string */ +#undef VERSION_MESSAGE + +/* Copyright string */ +#undef COPYRIGHT_MESSAGE + +/* The ./configure command line */ +#undef CONFIGURE_LINE + +/* String suffix for module functions */ +#undef MODULE_SUFFIX + +/* Symbol suffix for module functions */ +#undef MODULE_SYMBOL -/* Define to `unsigned' if does not define. */ -#undef size_t diff --git a/include/input_ext-dec.h b/include/input_ext-dec.h index 7c916bc885..2d43e785e3 100644 --- a/include/input_ext-dec.h +++ b/include/input_ext-dec.h @@ -2,7 +2,7 @@ * input_ext-dec.h: structures exported to the VideoLAN decoders ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_ext-dec.h,v 1.67 2002/08/07 00:29:36 sam Exp $ + * $Id: input_ext-dec.h,v 1.68 2002/08/08 00:35:10 sam Exp $ * * Authors: Christophe Massiot * Michel Kaempf @@ -312,7 +312,8 @@ static inline void RemoveBits( bit_stream_t * p_bit_stream, { p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte ) << ( -p_bit_stream->fifo.i_available ); - ((WORD_TYPE *)p_bit_stream->p_byte)++; + p_bit_stream->p_byte = + (byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 ); p_bit_stream->fifo.i_available += sizeof(WORD_TYPE) * 8; return; } @@ -333,11 +334,13 @@ static inline void RemoveBits32( bit_stream_t * p_bit_stream ) { p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte ) << (32 - p_bit_stream->fifo.i_available); - ((WORD_TYPE *)p_bit_stream->p_byte)++; + p_bit_stream->p_byte = + (byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 ); return; } - ((WORD_TYPE *)p_bit_stream->p_byte)++; + p_bit_stream->p_byte = + (byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 ); return; } @@ -371,7 +374,8 @@ static inline u32 GetBits( bit_stream_t * p_bit_stream, unsigned int i_bits ) i_result = p_bit_stream->fifo.buffer >> (8 * sizeof(WORD_TYPE) - i_bits); p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte ); - ((WORD_TYPE *)p_bit_stream->p_byte)++; + p_bit_stream->p_byte = + (byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 ); i_result |= p_bit_stream->fifo.buffer >> (8 * sizeof(WORD_TYPE) + p_bit_stream->fifo.i_available); @@ -429,7 +433,8 @@ static inline u32 GetBits32( bit_stream_t * p_bit_stream ) { i_result = p_bit_stream->fifo.buffer; p_bit_stream->fifo.buffer = WORD_AT( p_bit_stream->p_byte ); - ((WORD_TYPE *)p_bit_stream->p_byte)++; + p_bit_stream->p_byte = + (byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 ); i_result |= p_bit_stream->fifo.buffer >> (p_bit_stream->fifo.i_available); p_bit_stream->fifo.buffer <<= (32 - p_bit_stream->fifo.i_available); @@ -437,7 +442,8 @@ static inline u32 GetBits32( bit_stream_t * p_bit_stream ) } i_result = WORD_AT( p_bit_stream->p_byte ); - ((WORD_TYPE *)p_bit_stream->p_byte)++; + p_bit_stream->p_byte = + (byte_t *) ( ((WORD_TYPE *)p_bit_stream->p_byte) + 1 ); return( i_result ); } diff --git a/include/input_ext-plugins.h b/include/input_ext-plugins.h index d8d529307c..3ae2f927a0 100644 --- a/include/input_ext-plugins.h +++ b/include/input_ext-plugins.h @@ -3,7 +3,7 @@ * but exported to plug-ins ***************************************************************************** * Copyright (C) 1999-2002 VideoLAN - * $Id: input_ext-plugins.h,v 1.34 2002/08/07 00:29:36 sam Exp $ + * $Id: input_ext-plugins.h,v 1.35 2002/08/08 00:35:10 sam Exp $ * * Authors: Christophe Massiot * @@ -55,7 +55,6 @@ VLC_EXPORT( int, input_UnselectES,( input_thread_t *, es_descriptor_t * ) ); /***************************************************************************** * Prototypes from input_dec.c *****************************************************************************/ -//decoder_capabilities_t * input_ProbeDecoder( void ); decoder_fifo_t * input_RunDecoder( input_thread_t *, es_descriptor_t * ); void input_EndDecoder( input_thread_t *, es_descriptor_t * ); VLC_EXPORT( void, input_DecodePES, ( decoder_fifo_t *, pes_packet_t * ) ); diff --git a/include/modules_inner.h b/include/modules_inner.h index d9cc193622..40e1770357 100644 --- a/include/modules_inner.h +++ b/include/modules_inner.h @@ -2,7 +2,7 @@ * modules_inner.h : Macros used from within a module. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules_inner.h,v 1.27 2002/08/04 08:45:35 sam Exp $ + * $Id: modules_inner.h,v 1.28 2002/08/08 00:35:10 sam Exp $ * * Authors: Samuel Hocevar * @@ -55,13 +55,13 @@ #if defined( __BUILTIN__ ) # define E_( function ) CONCATENATE( function, MODULE_NAME ) # define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_NAME ) -# define DECLARE_SYMBOLS ; -# define STORE_SYMBOLS ; +# define DECLARE_SYMBOLS struct _u_n_u_s_e_d_ +# define STORE_SYMBOLS struct _u_n_u_s_e_d_ #elif defined( __PLUGIN__ ) # define E_( function ) function # define __VLC_SYMBOL( symbol ) CONCATENATE( symbol, MODULE_SYMBOL ) -# define DECLARE_SYMBOLS module_symbols_t* p_symbols; -# define STORE_SYMBOLS p_symbols = p_module->p_symbols; +# define DECLARE_SYMBOLS module_symbols_t* p_symbols +# define STORE_SYMBOLS p_symbols = p_module->p_symbols #endif #if defined( __cplusplus ) diff --git a/include/video_output.h b/include/video_output.h index 7759ce890d..71e577661d 100644 --- a/include/video_output.h +++ b/include/video_output.h @@ -5,7 +5,7 @@ * thread, and destroy a previously opened video output thread. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: video_output.h,v 1.82 2002/07/31 20:56:50 sam Exp $ + * $Id: video_output.h,v 1.83 2002/08/08 00:35:10 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -158,9 +158,6 @@ struct vout_thread_t #define VOUT_DEPTH_CHANGE 0x0400 /* depth changed */ #define VOUT_CHROMA_CHANGE 0x0800 /* change chroma tables */ -/* Disabled for thread deadlocks issues --Meuuh */ -//#define VOUT_NODISPLAY_CHANGE 0xff00 /* changes which forbidden display */ - #define MAX_JITTER_SAMPLES 20 /***************************************************************************** diff --git a/include/vlc/vlc.h b/include/vlc/vlc.h index d323ce3a99..01a629bff2 100644 --- a/include/vlc/vlc.h +++ b/include/vlc/vlc.h @@ -2,7 +2,7 @@ * vlc.h: global header for vlc ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: vlc.h,v 1.6 2002/07/20 18:01:42 sam Exp $ + * $Id: vlc.h,v 1.7 2002/08/08 00:35:10 sam Exp $ * * 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 @@ -29,10 +29,11 @@ extern "C" { /***************************************************************************** * Our custom types *****************************************************************************/ -#define VLC_DECLARE_STRUCT( name ) struct name; typedef struct name name; +struct vlc_t; +struct vlc_object_t; -VLC_DECLARE_STRUCT(vlc_t) -VLC_DECLARE_STRUCT(vlc_object_t) +typedef struct vlc_t vlc_t; +typedef struct vlc_object_t vlc_object_t; typedef signed int vlc_error_t; typedef int vlc_bool_t; diff --git a/include/vlc_common.h b/include/vlc_common.h index 78ffca901c..a0af073897 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -3,7 +3,7 @@ * Collection of useful common types and macros definitions ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: vlc_common.h,v 1.15 2002/08/07 21:36:55 massiot Exp $ + * $Id: vlc_common.h,v 1.16 2002/08/08 00:35:10 sam Exp $ * * Authors: Samuel Hocevar * Vincent Seguin @@ -135,80 +135,81 @@ typedef u32 vlc_fourcc_t; *****************************************************************************/ /* Messages */ -VLC_DECLARE_STRUCT(msg_bank_t) -VLC_DECLARE_STRUCT(msg_subscription_t) +typedef struct msg_bank_t msg_bank_t; +typedef struct msg_subscription_t msg_subscription_t; /* Playlist */ -VLC_DECLARE_STRUCT(playlist_t) -VLC_DECLARE_STRUCT(playlist_item_t) +typedef struct playlist_t playlist_t; +typedef struct playlist_item_t playlist_item_t; /* Modules */ -VLC_DECLARE_STRUCT(module_bank_t) -VLC_DECLARE_STRUCT(module_t) -VLC_DECLARE_STRUCT(module_config_t) -VLC_DECLARE_STRUCT(module_symbols_t) +typedef struct module_bank_t module_bank_t; +typedef struct module_t module_t; +typedef struct module_config_t module_config_t; +typedef struct module_symbols_t module_symbols_t; /* Interface */ -VLC_DECLARE_STRUCT(intf_thread_t) -VLC_DECLARE_STRUCT(intf_sys_t) -VLC_DECLARE_STRUCT(intf_console_t) -VLC_DECLARE_STRUCT(intf_msg_t) -VLC_DECLARE_STRUCT(intf_channel_t) +typedef struct intf_thread_t intf_thread_t; +typedef struct intf_sys_t intf_sys_t; +typedef struct intf_console_t intf_console_t; +typedef struct intf_msg_t intf_msg_t; +typedef struct intf_channel_t intf_channel_t; /* Input */ -VLC_DECLARE_STRUCT(input_thread_t) -VLC_DECLARE_STRUCT(input_channel_t) -VLC_DECLARE_STRUCT(input_area_t) -VLC_DECLARE_STRUCT(input_buffers_t) -VLC_DECLARE_STRUCT(input_socket_t) -VLC_DECLARE_STRUCT(input_info_t) -VLC_DECLARE_STRUCT(input_info_category_t) -VLC_DECLARE_STRUCT(access_sys_t) -VLC_DECLARE_STRUCT(demux_sys_t) -VLC_DECLARE_STRUCT(es_descriptor_t) -VLC_DECLARE_STRUCT(es_sys_t) -VLC_DECLARE_STRUCT(pgrm_descriptor_t) -VLC_DECLARE_STRUCT(pgrm_sys_t) -VLC_DECLARE_STRUCT(stream_descriptor_t) -VLC_DECLARE_STRUCT(stream_sys_t) +typedef struct input_thread_t input_thread_t; +typedef struct input_channel_t input_channel_t; +typedef struct input_area_t input_area_t; +typedef struct input_buffers_t input_buffers_t; +typedef struct input_socket_t input_socket_t; +typedef struct input_info_t input_info_t; +typedef struct input_info_category_t input_info_category_t; +typedef struct access_sys_t access_sys_t; +typedef struct demux_sys_t demux_sys_t; +typedef struct es_descriptor_t es_descriptor_t; +typedef struct es_sys_t es_sys_t; +typedef struct pgrm_descriptor_t pgrm_descriptor_t; +typedef struct pgrm_sys_t pgrm_sys_t; +typedef struct stream_descriptor_t stream_descriptor_t; +typedef struct stream_sys_t stream_sys_t; /* Audio */ -VLC_DECLARE_STRUCT(aout_instance_t) -VLC_DECLARE_STRUCT(aout_input_t) -VLC_DECLARE_STRUCT(aout_buffer_t) -VLC_DECLARE_STRUCT(audio_sample_format_t) +typedef struct aout_instance_t aout_instance_t; +typedef struct aout_sys_t aout_sys_t; +typedef struct aout_input_t aout_input_t; +typedef struct aout_buffer_t aout_buffer_t; +typedef struct audio_sample_format_t audio_sample_format_t; /* Video */ -VLC_DECLARE_STRUCT(vout_thread_t) -VLC_DECLARE_STRUCT(vout_font_t) -VLC_DECLARE_STRUCT(vout_sys_t) -VLC_DECLARE_STRUCT(chroma_sys_t) -VLC_DECLARE_STRUCT(picture_t) -VLC_DECLARE_STRUCT(picture_sys_t) -VLC_DECLARE_STRUCT(picture_heap_t) -VLC_DECLARE_STRUCT(subpicture_t) -VLC_DECLARE_STRUCT(subpicture_sys_t) +typedef struct vout_thread_t vout_thread_t; +typedef struct vout_font_t vout_font_t; +typedef struct vout_sys_t vout_sys_t; +typedef struct chroma_sys_t chroma_sys_t; +typedef struct picture_t picture_t; +typedef struct picture_sys_t picture_sys_t; +typedef struct picture_heap_t picture_heap_t; +typedef struct subpicture_t subpicture_t; +typedef struct subpicture_sys_t subpicture_sys_t; /* Decoders */ -VLC_DECLARE_STRUCT(decoder_fifo_t) +typedef struct decoder_fifo_t decoder_fifo_t; /* Misc */ -VLC_DECLARE_STRUCT(data_packet_t) -VLC_DECLARE_STRUCT(data_buffer_t) -VLC_DECLARE_STRUCT(stream_position_t) -VLC_DECLARE_STRUCT(stream_ctrl_t) -VLC_DECLARE_STRUCT(pes_packet_t) -VLC_DECLARE_STRUCT(bit_stream_t) -VLC_DECLARE_STRUCT(network_socket_t) -VLC_DECLARE_STRUCT(iso639_lang_t) +typedef struct data_packet_t data_packet_t; +typedef struct data_buffer_t data_buffer_t; +typedef struct stream_position_t stream_position_t; +typedef struct stream_ctrl_t stream_ctrl_t; +typedef struct pes_packet_t pes_packet_t; +typedef struct bit_stream_t bit_stream_t; +typedef struct network_socket_t network_socket_t; +typedef struct iso639_lang_t iso639_lang_t; /***************************************************************************** * Plug-in stuff *****************************************************************************/ #ifndef __PLUGIN__ -# define VLC_EXPORT( type, name, args ) type name args; +# define VLC_EXPORT( type, name, args ) type name args #else -# define VLC_EXPORT( type, name, args ) ; +# define VLC_EXPORT( type, name, args ) struct _u_n_u_s_e_d_ extern module_symbols_t* p_symbols; #endif diff --git a/include/vlc_symbols.h b/include/vlc_symbols.h index b83948e874..e9a71fa96a 100644 --- a/include/vlc_symbols.h +++ b/include/vlc_symbols.h @@ -36,6 +36,7 @@ struct module_symbols_t int (* __vlc_thread_create_inner) ( vlc_object_t *, char *, int, char *, void * ( * ) ( void * ), vlc_bool_t ) ; int (* __vlc_threads_end_inner) ( vlc_object_t * ) ; int (* __vlc_threads_init_inner) ( vlc_object_t * ) ; + int (* aout_FormatToBytes_inner) ( audio_sample_format_t * p_format ) ; int (* input_AccessInit_inner) ( input_thread_t * ) ; int (* input_AddInfo_inner) ( input_info_category_t *, char *, char *, ... ) ; int (* input_ChangeArea_inner) ( input_thread_t *, input_area_t * ) ; @@ -204,6 +205,7 @@ struct module_symbols_t # define aout_BufferNew p_symbols->aout_BufferNew_inner # define aout_BufferPlay p_symbols->aout_BufferPlay_inner # define aout_DeleteInstance p_symbols->aout_DeleteInstance_inner +# define aout_FormatToBytes p_symbols->aout_FormatToBytes_inner # define aout_InputDelete p_symbols->aout_InputDelete_inner # define aout_OutputNextBuffer p_symbols->aout_OutputNextBuffer_inner # define config_Duplicate p_symbols->config_Duplicate_inner diff --git a/include/vlc_threads.h b/include/vlc_threads.h index 8a24b4a854..58366043e0 100644 --- a/include/vlc_threads.h +++ b/include/vlc_threads.h @@ -3,7 +3,7 @@ * This header provides a portable threads implementation. ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: vlc_threads.h,v 1.8 2002/07/31 20:56:50 sam Exp $ + * $Id: vlc_threads.h,v 1.9 2002/08/08 00:35:10 sam Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -240,8 +240,10 @@ static inline int __vlc_mutex_lock( char * psz_file, int i_line, int i_return = pthread_mutex_lock( p_mutex ); if( i_return ) { -// msg_Err( "thread %d: mutex_lock failed at %s:%d (%s)", -// pthread_self(), psz_file, i_line, strerror(i_return) ); +#if 0 + msg_Err( "thread %d: mutex_lock failed at %s:%d (%s)", + pthread_self(), psz_file, i_line, strerror(i_return) ); +#endif } return i_return; @@ -303,8 +305,10 @@ static inline int __vlc_mutex_unlock( char * psz_file, int i_line, int i_return = pthread_mutex_unlock( p_mutex ); if( i_return ) { -// msg_Err( "thread %d: mutex_unlock failed at %s:%d (%s)", -// pthread_self(), psz_file, i_line, strerror(i_return) ); +#if 0 + msg_Err( "thread %d: mutex_unlock failed at %s:%d (%s)", + pthread_self(), psz_file, i_line, strerror(i_return) ); +#endif } return i_return; @@ -665,16 +669,20 @@ static inline int __vlc_cond_wait( char * psz_file, int i_line, if( i_result == ETIMEDOUT ) { -//X msg_Warn( "thread %d: possible deadlock detected " -//X "in cond_wait at %s:%d (%s)", pthread_self(), -//X psz_file, i_line, strerror(i_result) ); +#if 0 + msg_Warn( "thread %d: possible deadlock detected " + "in cond_wait at %s:%d (%s)", pthread_self(), + psz_file, i_line, strerror(i_result) ); +#endif continue; } if( i_result ) { -//X msg_Err( "thread %d: cond_wait failed at %s:%d (%s)", -//X pthread_self(), psz_file, i_line, strerror(i_result) ); +#if 0 + msg_Err( "thread %d: cond_wait failed at %s:%d (%s)", + pthread_self(), psz_file, i_line, strerror(i_result) ); +#endif } return( i_result ); } diff --git a/modules/access/dvd/ifo.c b/modules/access/dvd/ifo.c index 9eea56efd3..0013df60d9 100644 --- a/modules/access/dvd/ifo.c +++ b/modules/access/dvd/ifo.c @@ -2,7 +2,7 @@ * ifo.c: Functions for ifo parsing ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: ifo.c,v 1.1 2002/08/04 17:23:41 sam Exp $ + * $Id: ifo.c,v 1.2 2002/08/08 00:35:10 sam Exp $ * * Authors: Stéphane Borel * German Tischler @@ -91,7 +91,6 @@ int IfoCreate( thread_dvd_data_t * p_dvd ) p_dvd->p_ifo = malloc( sizeof(ifo_t) ); if( p_dvd->p_ifo == NULL ) { -//X intf_Err( p_input, "unable to allocate memory. aborting" ); return -1; } @@ -117,13 +116,13 @@ int IfoInit( ifo_t * p_ifo ) if( !p_ifo->i_start ) return -1; p_tmp = FillBuffer( p_ifo, p_buf, p_ifo->i_start ); - //i_start = p_ifo->i_pos; + /*i_start = p_ifo->i_pos; */ /* * read the video manager information table */ #define MGINF p_ifo->vmg.manager_inf - //fprintf( stderr, "VMGI\n" ); + /*fprintf( stderr, "VMGI\n" ); */ ReadBytes( p_ifo, p_buf, &p_tmp, MGINF.psz_id, 12 ); MGINF.psz_id[12] = '\0'; @@ -156,7 +155,7 @@ int IfoInit( ifo_t * p_ifo ) DumpBytes( p_ifo, p_buf, &p_tmp, 2 ); DumpBytes( p_ifo, p_buf, &p_tmp, 1 ); MGINF.i_audio_nb = ReadByte( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "vmgi audio nb : %d\n", MGINF.i_audio_nb ); + /*fprintf( stderr, "vmgi audio nb : %d\n", MGINF.i_audio_nb ); */ for( i = 0 ; i < 8 ; i++ ) { @@ -165,7 +164,7 @@ int IfoInit( ifo_t * p_ifo ) DumpBytes( p_ifo, p_buf, &p_tmp, 17 ); MGINF.i_spu_nb = ReadByte( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "vmgi subpic nb : %d\n", MGINF.i_spu_nb ); + /*fprintf( stderr, "vmgi subpic nb : %d\n", MGINF.i_spu_nb ); */ for( i = 0 ; i < MGINF.i_spu_nb ; i++ ) { @@ -176,7 +175,7 @@ int IfoInit( ifo_t * p_ifo ) /* * read first play title. */ - //fprintf(stderr,"readtitle %i\n", MGINF.i_first_play_title_start_byte & 0x7ff ); + /*fprintf(stderr,"readtitle %i\n", MGINF.i_first_play_title_start_byte & 0x7ff ); */ if( ReadTitle( p_ifo, &p_ifo->vmg.title, p_ifo->i_start + OFF2LB( MGINF.i_first_play_title_start_byte ), MGINF.i_first_play_title_start_byte & 0x7ff ) < 0 ) @@ -192,10 +191,10 @@ int IfoInit( ifo_t * p_ifo ) { p_tmp = FillBuffer( p_ifo, p_buf, p_ifo->i_start + MGINF.i_title_inf_start_sector ); - //fprintf( stderr, "title inf %d\n", p_ifo->i_pos ); + /*fprintf( stderr, "title inf %d\n", p_ifo->i_pos ); */ TITINF.i_title_nb = ReadWord( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "title_inf: TTU nb %d\n", TITINF.i_title_nb ); + /*fprintf( stderr, "title_inf: TTU nb %d\n", TITINF.i_title_nb ); */ DumpBytes( p_ifo, p_buf, &p_tmp, 2 ); TITINF.i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp ); @@ -203,7 +202,6 @@ int IfoInit( ifo_t * p_ifo ) TITINF.p_attr = malloc( TITINF.i_title_nb *sizeof(title_attr_t) ); if( TITINF.p_attr == NULL ) { -//X intf_Err( p_input, "out of memory in IfoInit" ); return -1; } @@ -216,7 +214,7 @@ int IfoInit( ifo_t * p_ifo ) TITINF.p_attr[i].i_title_set_num = ReadByte( p_ifo, p_buf, &p_tmp ); TITINF.p_attr[i].i_title_num = ReadByte( p_ifo, p_buf, &p_tmp ); TITINF.p_attr[i].i_start_sector = ReadDouble( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "title_inf: %d %d %d\n", TITINF.p_attr[i].i_chapter_nb, TITINF.p_attr[i].i_title_set_num, TITINF.p_attr[i].i_title_num ); + /*fprintf( stderr, "title_inf: %d %d %d\n", TITINF.p_attr[i].i_chapter_nb, TITINF.p_attr[i].i_title_set_num, TITINF.p_attr[i].i_title_num ); */ } } else @@ -247,7 +245,7 @@ int IfoInit( ifo_t * p_ifo ) MGINF.i_parental_inf_start_sector ); i_start = p_ifo->i_pos; - //fprintf( stderr, "PTL\n" ); + /*fprintf( stderr, "PTL\n" ); */ PARINF.i_country_nb = ReadWord( p_ifo, p_buf, &p_tmp ); PARINF.i_vts_nb = ReadWord( p_ifo, p_buf, &p_tmp ); @@ -257,7 +255,6 @@ int IfoInit( ifo_t * p_ifo ) * sizeof(parental_desc_t) ); if( PARINF.p_parental_desc == NULL ) { -//X intf_Err( p_input, "out of memory in IfoInit" ); return -1; } @@ -275,7 +272,6 @@ int IfoInit( ifo_t * p_ifo ) * sizeof(parental_mask_t) ); if( PARINF.p_parental_mask == NULL ) { -//X intf_Err( p_input, "out of memory in IfoInit" ); return -1; } @@ -292,7 +288,6 @@ int IfoInit( ifo_t * p_ifo ) if( PARINF.p_parental_mask[i].ppi_mask[j] == NULL ) { -//X intf_Err( p_input, "out of memory in IfoInit" ); return -1; } @@ -318,17 +313,16 @@ int IfoInit( ifo_t * p_ifo ) MGINF.i_vts_inf_start_sector ); i_start = p_ifo->i_pos; - //fprintf( stderr, "VTS ATTR\n" ); + /*fprintf( stderr, "VTS ATTR\n" ); */ VTSINF.i_vts_nb = ReadWord( p_ifo, p_buf, &p_tmp );; - //fprintf( stderr, "VTS ATTR Nb: %d\n", VTSINF.i_vts_nb ); + /*fprintf( stderr, "VTS ATTR Nb: %d\n", VTSINF.i_vts_nb ); */ DumpBytes( p_ifo, p_buf, &p_tmp, 2 ); VTSINF.i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp ); VTSINF.pi_vts_attr_start_byte = malloc( VTSINF.i_vts_nb * sizeof(u32) ); if( VTSINF.pi_vts_attr_start_byte == NULL ) { -//X intf_Err( p_input, "out of memory in IfoInit" ); return -1; } @@ -341,7 +335,6 @@ int IfoInit( ifo_t * p_ifo ) VTSINF.p_vts_attr = malloc( VTSINF.i_vts_nb * sizeof(vts_attr_t) ); if( VTSINF.p_vts_attr == NULL ) { -//X intf_Err( p_input, "out of memory in IfoInit" ); return -1; } @@ -359,7 +352,7 @@ int IfoInit( ifo_t * p_ifo ) DumpBytes( p_ifo, p_buf, &p_tmp, 1 ); VTSINF.p_vts_attr[i].i_vts_menu_audio_nb = ReadByte( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "m audio nb : %d\n", VTSINF.p_vts_attr[i].i_vts_menu_audio_nb ); + /*fprintf( stderr, "m audio nb : %d\n", VTSINF.p_vts_attr[i].i_vts_menu_audio_nb ); */ for( j = 0 ; j < 8 ; j++ ) { @@ -369,7 +362,7 @@ int IfoInit( ifo_t * p_ifo ) DumpBytes( p_ifo, p_buf, &p_tmp, 17 ); VTSINF.p_vts_attr[i].i_vts_menu_spu_nb = ReadByte( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "m subp nb : %d\n", VTSINF.p_vts_attr[i].i_vts_menu_spu_nb ); + /*fprintf( stderr, "m subp nb : %d\n", VTSINF.p_vts_attr[i].i_vts_menu_spu_nb ); */ for( j = 0 ; j < 28 ; j++ ) { @@ -382,7 +375,7 @@ int IfoInit( ifo_t * p_ifo ) DumpBytes( p_ifo, p_buf, &p_tmp, 1 ); VTSINF.p_vts_attr[i].i_vts_title_audio_nb = ReadDouble( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "tt audio nb : %d\n", VTSINF.p_vts_attr[i].i_vts_title_audio_nb ); + /*fprintf( stderr, "tt audio nb : %d\n", VTSINF.p_vts_attr[i].i_vts_title_audio_nb ); */ for( j = 0 ; j < 8 ; j++ ) { @@ -392,7 +385,7 @@ int IfoInit( ifo_t * p_ifo ) DumpBytes( p_ifo, p_buf, &p_tmp, 17 ); VTSINF.p_vts_attr[i].i_vts_title_spu_nb = ReadByte( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "tt subp nb : %d\n", VTSINF.p_vts_attr[i].i_vts_title_spu_nb ); + /*fprintf( stderr, "tt subp nb : %d\n", VTSINF.p_vts_attr[i].i_vts_title_spu_nb ); */ for( j = 0 ; j < 28 /*VTSINF.p_vts_vts_inf[i].i_vtstt_subpic_nb*/ ; j++ ) { @@ -430,8 +423,6 @@ int IfoInit( ifo_t * p_ifo ) p_ifo->vts.b_initialized = 0; -//X intf_Warn( p_input, 2, "vmg initialized" ); - return 0; } @@ -456,10 +447,10 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) i_off = p_ifo->vmg.title_inf.p_attr[i_title-1].i_start_sector + p_ifo->i_start; - //fprintf(stderr, "offset: %d\n" , i_off ); + /*fprintf(stderr, "offset: %d\n" , i_off ); */ p_tmp = FillBuffer( p_ifo, p_buf, i_off ); - //i_start = p_ifo->i_pos; + /*i_start = p_ifo->i_pos; */ p_ifo->vts.i_pos = p_ifo->i_pos; #define MGINF p_ifo->vts.manager_inf @@ -467,7 +458,7 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) /* * read manager information */ - //fprintf( stderr, "VTSI\n" ); + /*fprintf( stderr, "VTSI\n" ); */ ReadBytes( p_ifo, p_buf, &p_tmp, MGINF.psz_id , 12 ); MGINF.psz_id[12] = '\0'; @@ -533,12 +524,12 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) DumpBytes( p_ifo, p_buf, &p_tmp, 1 ); MGINF.i_audio_nb = ReadByte( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "vtsi audio nb : %d\n", MGINF.i_audio_nb ); + /*fprintf( stderr, "vtsi audio nb : %d\n", MGINF.i_audio_nb ); */ for( i = 0 ; i < 8 ; i++ ) { i_temp = ReadQuad( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "Audio %d: %llx\n", i, i_temp ); + /*fprintf( stderr, "Audio %d: %llx\n", i, i_temp ); */ i_temp >>= 8; MGINF.p_audio_attr[i].i_bar = i_temp & 0xff; i_temp >>= 8; @@ -567,13 +558,13 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) DumpBytes( p_ifo, p_buf, &p_tmp, 17 ); MGINF.i_spu_nb = ReadByte( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "vtsi subpic nb : %d\n", MGINF.i_spu_nb ); + /*fprintf( stderr, "vtsi subpic nb : %d\n", MGINF.i_spu_nb ); */ for( i=0 ; i> 16; - //fprintf( stderr, "Subpic %d: %llx\n", i, i_temp ); + /*fprintf( stderr, "Subpic %d: %llx\n", i, i_temp ); */ MGINF.p_spu_attr[i].i_caption = i_temp & 0xff; i_temp >>= 8; MGINF.p_spu_attr[i].i_foo = i_temp & 0xff; @@ -594,17 +585,16 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) i_start = p_ifo->i_pos; - //fprintf( stderr, "VTS PTR\n" ); + /*fprintf( stderr, "VTS PTR\n" ); */ TITINF.i_title_nb = ReadWord( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "VTS title_inf nb: %d\n", TITINF.i_title_nb ); + /*fprintf( stderr, "VTS title_inf nb: %d\n", TITINF.i_title_nb ); */ DumpBytes( p_ifo, p_buf, &p_tmp, 2 ); TITINF.i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp ); TITINF.pi_start_byte = malloc( TITINF.i_title_nb * sizeof(u32) ); if( TITINF.pi_start_byte == NULL ) { -//X intf_Err( p_input, "out of memory in IfoTitleSet" ); return -1; } @@ -618,7 +608,6 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) * sizeof(title_start_t) ); if( TITINF.p_title_start == NULL ) { -//X intf_Err( p_input, "out of memory in IfoTitleSet" ); return -1; } @@ -671,7 +660,7 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) p_tmp = FillBuffer( p_ifo, p_buf, p_ifo->vts.i_pos + MGINF.i_time_inf_start_sector ); - //fprintf( stderr, "TMAP\n" ); + /*fprintf( stderr, "TMAP\n" ); */ TIMINF.i_nb = ReadWord( p_ifo, p_buf, &p_tmp );; DumpBytes( p_ifo, p_buf, &p_tmp, 2 ); @@ -680,7 +669,6 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) TIMINF.pi_start_byte = malloc( TIMINF.i_nb * sizeof(u32) ); if( TIMINF.pi_start_byte == NULL ) { -//X intf_Err( p_input, "out of memory in IfoTitleSet" ); return -1; } @@ -692,7 +680,6 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) TIMINF.p_time_map = malloc( TIMINF.i_nb * sizeof(time_map_t) ); if( TIMINF.p_time_map == NULL ) { -//X intf_Err( p_input, "out of memory in IfoTitleSet" ); return -1; } @@ -708,7 +695,6 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) malloc( TIMINF.p_time_map[i].i_entry_nb * sizeof(u32) ); if( TIMINF.p_time_map[i].pi_sector == NULL ) { -//X msg_Err( p_input, "out of memory in IfoTitleSet" ); return -1; } @@ -751,8 +737,10 @@ int IfoTitleSet( ifo_t * p_ifo, int i_title ) } #undef MGINF -//X intf_Warn( p_input, 4, "vts %d initialized", -//X p_ifo->vmg.title_inf.p_attr[i_title-1].i_title_set_num ); +#if 0 + intf_Warn( p_input, 4, "vts %d initialized", + p_ifo->vmg.title_inf.p_attr[i_title-1].i_title_set_num ); +#endif p_ifo->vts.b_initialized = 1; @@ -902,12 +890,12 @@ static int ReadTitle( ifo_t * p_ifo, title_t * p_title, int i_block, int i_bytes i_start = p_ifo->i_pos; - //fprintf( stderr, "PGC @ %d + %d\n", p_ifo->i_pos, i_bytes ); + /*fprintf( stderr, "PGC @ %d + %d\n", p_ifo->i_pos, i_bytes ); */ DumpBytes( p_ifo, p_buf, &p_tmp, 2); p_title->i_chapter_nb = ReadByte( p_ifo, p_buf, &p_tmp ); p_title->i_cell_nb = ReadByte( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "title: Prg: %d Cell: %d\n",p_title->i_chapter_nb,p_title->i_cell_nb ); + /*fprintf( stderr, "title: Prg: %d Cell: %d\n",p_title->i_chapter_nb,p_title->i_cell_nb ); */ p_title->i_play_time = ReadDouble( p_ifo, p_buf, &p_tmp ); p_title->i_prohibited_user_op = ReadDouble( p_ifo, p_buf, &p_tmp ); @@ -974,7 +962,6 @@ static int ReadTitle( ifo_t * p_ifo, title_t * p_title, int i_block, int i_bytes if( p_title->command.p_pre_command == NULL ) { -//X intf_Err( p_input, "out of memory in ReadTitle" ); return -1; } @@ -998,7 +985,6 @@ static int ReadTitle( ifo_t * p_ifo, title_t * p_title, int i_block, int i_bytes if( p_title->command.p_post_command == NULL ) { -//X intf_Err( p_input, "out of memory in ReadTitle" ); return -1; } @@ -1022,7 +1008,6 @@ static int ReadTitle( ifo_t * p_ifo, title_t * p_title, int i_block, int i_bytes if( p_title->command.p_cell_command == NULL ) { -//X intf_Err( p_input, "out of memory in ReadTitle" ); return -1; } @@ -1050,7 +1035,6 @@ static int ReadTitle( ifo_t * p_ifo, title_t * p_title, int i_block, int i_bytes if( p_title->chapter_map.pi_start_cell == NULL ) { -//X intf_Err( p_input, "out of memory in Read Title" ); return -1; } @@ -1074,7 +1058,6 @@ static int ReadTitle( ifo_t * p_ifo, title_t * p_title, int i_block, int i_bytes if( p_title->p_cell_play == NULL ) { -//X intf_Err( p_input, "out of memory in ReadTitle" ); return -1; } @@ -1105,7 +1088,6 @@ static int ReadTitle( ifo_t * p_ifo, title_t * p_title, int i_block, int i_bytes if( p_title->p_cell_pos == NULL ) { -//X intf_Err( p_input, "out of memory" ); return -1; } @@ -1175,10 +1157,10 @@ static int ReadUnitInf( ifo_t * p_ifo, unit_inf_t * p_unit_inf, p_tmp = FillBuffer( p_ifo, p_buf, i_block ) + i_bytes; i_start = p_ifo->i_pos; - //fprintf( stderr, "Unit\n" ); + /*fprintf( stderr, "Unit\n" ); */ p_unit_inf->i_title_nb = ReadWord( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "Unit nb: %d\n", p_unit_inf->i_title_nb ); + /*fprintf( stderr, "Unit nb: %d\n", p_unit_inf->i_title_nb ); */ DumpBytes( p_ifo, p_buf, &p_tmp, 2 ); p_unit_inf->i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp ); @@ -1186,7 +1168,6 @@ static int ReadUnitInf( ifo_t * p_ifo, unit_inf_t * p_unit_inf, malloc( p_unit_inf->i_title_nb * sizeof(unit_title_t) ); if( p_unit_inf->p_title == NULL ) { -//X intf_Err( p_input, "out of memory in ReadUnit" ); return -1; } @@ -1195,7 +1176,7 @@ static int ReadUnitInf( ifo_t * p_ifo, unit_inf_t * p_unit_inf, #define TITLE p_unit_inf->p_title[i] TITLE.i_category_mask = ReadByte( p_ifo, p_buf, &p_tmp ); TITLE.i_category = ReadByte( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "cat mask %d: %x cat %x\n", i, TITLE.i_category_mask, TITLE.i_category ); + /*fprintf( stderr, "cat mask %d: %x cat %x\n", i, TITLE.i_category_mask, TITLE.i_category ); */ TITLE.i_parental_mask = ReadWord( p_ifo, p_buf, &p_tmp ); TITLE.i_title_start_byte = ReadDouble( p_ifo, p_buf, &p_tmp ); #undef TITLE @@ -1203,7 +1184,7 @@ static int ReadUnitInf( ifo_t * p_ifo, unit_inf_t * p_unit_inf, for( i = 0 ; i < p_unit_inf->i_title_nb ; i++ ) { - //fprintf( stderr, "Unit: PGC %d @ %d\n", i, p_ifo->i_pos ); + /*fprintf( stderr, "Unit: PGC %d @ %d\n", i, p_ifo->i_pos ); */ ReadTitle( p_ifo, &p_unit_inf->p_title[i].title, i_start + OFF2LB( p_unit_inf->p_title[i].i_title_start_byte + i_bytes ), (p_unit_inf->p_title[i].i_title_start_byte+i_bytes) & 0x7ff ); @@ -1246,26 +1227,25 @@ static int ReadTitleUnit( ifo_t * p_ifo, title_unit_t * p_title_unit, p_tmp = FillBuffer( p_ifo, p_buf, i_block ); i_start = p_ifo->i_pos; - //fprintf( stderr, "Unit Table\n" ); + /*fprintf( stderr, "Unit Table\n" ); */ p_title_unit->i_unit_nb = ReadWord( p_ifo, p_buf, &p_tmp ); DumpBytes( p_ifo, p_buf, &p_tmp, 2 ); p_title_unit->i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp ); - //fprintf(stderr, "Unit: nb %d last %d\n", p_title_unit->i_unit_nb, p_title_unit->i_last_byte ); + /*fprintf(stderr, "Unit: nb %d last %d\n", p_title_unit->i_unit_nb, p_title_unit->i_last_byte ); */ p_title_unit->p_unit = malloc( p_title_unit->i_unit_nb * sizeof(unit_t) ); if( p_title_unit->p_unit == NULL ) { -//X intf_Err( p_input, "out of memory in ReadTitleUnit" ); return -1; } for( i = 0 ; i < p_title_unit->i_unit_nb ; i++ ) { - //ReadBytes( p_ifo, p_buf, &p_tmp, p_title_unit->p_unit[i].ps_lang_code, 2 ); + /*ReadBytes( p_ifo, p_buf, &p_tmp, p_title_unit->p_unit[i].ps_lang_code, 2 ); */ p_title_unit->p_unit[i].i_lang_code = ReadWord( p_ifo, p_buf, &p_tmp ); - //fprintf( stderr, "lang %d %x\n", i,p_title_unit->p_unit[i].i_lang_code ); + /*fprintf( stderr, "lang %d %x\n", i,p_title_unit->p_unit[i].i_lang_code ); */ DumpBytes( p_ifo, p_buf, &p_tmp, 1 ); p_title_unit->p_unit[i].i_existence_mask = ReadByte( p_ifo, p_buf, &p_tmp ); @@ -1277,7 +1257,6 @@ static int ReadTitleUnit( ifo_t * p_ifo, title_unit_t * p_title_unit, malloc( p_title_unit->i_unit_nb * sizeof(unit_inf_t) ); if( p_title_unit->p_unit_inf == NULL ) { -//X intf_Err( p_input, "out of memory in ReadTitleUnit" ); return -1; } @@ -1323,7 +1302,7 @@ static int ReadCellInf( ifo_t * p_ifo, cell_inf_t * p_cell_inf, int i_block ) p_tmp = FillBuffer( p_ifo, p_buf, i_block ); i_start = p_ifo->i_pos; -// fprintf( stderr, "CELL ADD\n" ); +/* fprintf( stderr, "CELL ADD\n" ); */ p_cell_inf->i_vob_nb = ReadWord( p_ifo, p_buf, &p_tmp ); DumpBytes( p_ifo, p_buf, &p_tmp, 2 ); @@ -1337,7 +1316,6 @@ static int ReadCellInf( ifo_t * p_ifo, cell_inf_t * p_cell_inf, int i_block ) malloc( p_cell_inf->i_cell_nb *sizeof(cell_map_t) ); if( p_cell_inf->p_cell_map == NULL ) { -//X intf_Err( p_input, "out of memory in ReadCellInf" ); return -1; } @@ -1378,7 +1356,7 @@ static int ReadVobuMap( ifo_t * p_ifo, vobu_map_t * p_vobu_map, int i_block ) p_tmp = FillBuffer( p_ifo, p_buf, i_block ); i_start = p_ifo->i_pos; - //fprintf( stderr, "VOBU ADMAP\n" ); + /*fprintf( stderr, "VOBU ADMAP\n" ); */ p_vobu_map->i_last_byte = ReadDouble( p_ifo, p_buf, &p_tmp ); i_max = ( i_start + p_vobu_map->i_last_byte + 1 - p_ifo->i_pos ) @@ -1387,7 +1365,6 @@ static int ReadVobuMap( ifo_t * p_ifo, vobu_map_t * p_vobu_map, int i_block ) p_vobu_map->pi_vobu_start_sector = malloc( i_max * sizeof(u32) ); if( p_vobu_map->pi_vobu_start_sector == NULL ) { -//X intf_Err( p_input, "out of memory in ReadVobuMap" ); return -1; } @@ -1452,20 +1429,20 @@ static char * IfoMath( char val ) { "none", "=", - "<->", // swap + "<->", /* swap */ "+=", "-=", "*=", "/=", "%=", - "rnd", // rnd + "rnd", /* rnd */ "&=", "|=", "^=", - "??", // invalid - "??", // invalid - "??", // invalid - "??" // invalid + "??", /* invalid */ + "??", /* invalid */ + "??", /* invalid */ + "??" /* invalid */ }; return (char *) math_op[val & 0x0f]; @@ -1578,7 +1555,7 @@ static void IfoAdvanced( u8 *pi_code ) printf( "ReSuME %d", pi_code[7] ); } else if( ( i_cmd & 0x06) == 0x02 ) - { // XX01Y + { /* XX01Y */ printf ("Link to %s cell ", ( i_cmd & 0x01 ) ? "prev" : "next"); } else @@ -1673,10 +1650,10 @@ static void IfoJmp( ifo_command_t com ) break; } #else - // OP_VAL_8(2) is number of cell - // it is processed BEFORE switch - // under some conditions, it is ignored - // I don't understand exactly what it means + /* OP_VAL_8(2) is number of cell */ + /* it is processed BEFORE switch */ + /* under some conditions, it is ignored */ + /* I don't understand exactly what it means */ printf( " ( spec cell 0x%02X ) ", OP_VAL_8(2) ); switch( OP_VAL_8(3)>>6 ) @@ -1764,7 +1741,7 @@ void IfoSetSystem( ifo_command_t com ) if(OP_VAL_8(1]&0x80) printf ("s[%s] = 0x%02x;", reg_name[1], OP_VAL_8(1]&0xf); if(OP_VAL_8(2)&0x80) -//DENT: lwhat about 0x7f here ??? +/*DENT: lwhat about 0x7f here ??? */ printf ("s[%s] = 0x%02x;", reg_name[2], OP_VAL_8(2)&0x7f); if(OP_VAL_8(3)&0x80) printf ("s[%s] = 0x%02x;", reg_name[3], OP_VAL_8(3)&0xf); @@ -1804,7 +1781,7 @@ void IfoSetSystem( ifo_command_t com ) } break; case 4: - //actually only bits 00011100 00011100 are set + /*actually only bits 00011100 00011100 are set */ if( com.i_direct ) { printf ("s[%s] = 0x%02x", ifo_reg[11], OP_VAL_16(1)); @@ -1815,9 +1792,9 @@ void IfoSetSystem( ifo_command_t com ) } break; case 6: - //actually, - //s[%s]=(r[%s]&0x3FF) | (0x%02x << 0xA); - //but it is way too ugly + /*actually, */ + /*s[%s]=(r[%s]&0x3FF) | (0x%02x << 0xA); */ + /*but it is way too ugly */ if( com.i_direct ) { printf( "s[%s] = 0x%02x", ifo_reg[8], OP_VAL_8(2)>>2 ); @@ -2031,8 +2008,8 @@ void CommandRead( ifo_command_t com ) else { printf( "r[0x%X]", OP_VAL_8(3)&0x1F); - // 0x1F is either not a mistake, - // or Microsoft programmer's mistake!!! + /* 0x1F is either not a mistake, */ + /* or Microsoft programmer's mistake!!! */ } } @@ -2042,7 +2019,7 @@ void CommandRead( ifo_command_t com ) printf( "r[0x%X] ", pi_code[1] & 0xF ); printf( " %s ", IfoMath( com.i_cmd ) ); - if( com.i_cmd == 0x02 ) // swap + if( com.i_cmd == 0x02 ) /* swap */ { printf("r[0x%X] ", OP_VAL_8(0)&0x1F); } @@ -2105,7 +2082,9 @@ static void ReadBytes( ifo_t* p_ifo, u8* p_buf, u8** pp_tmp, { if( i_nb > DVD_LB_SIZE ) { -//X intf_Err( p_input, "excessive ReadBytes call (%i)", i_nb ); +#if 0 + intf_Err( p_input, "excessive ReadBytes call (%i)", i_nb ); +#endif } if( *pp_tmp + i_nb >= p_buf + DVD_LB_SIZE ) @@ -2131,7 +2110,9 @@ static void DumpBytes( ifo_t* p_ifo, u8* p_buf, u8** pp_tmp, int i_nb ) { if( i_nb > DVD_LB_SIZE ) { -//X intf_Err( p_input, "excessive DumpBytes call (%i)", i_nb ); +#if 0 + intf_Err( p_input, "excessive DumpBytes call (%i)", i_nb ); +#endif } *pp_tmp += i_nb; diff --git a/modules/access/dvd/ifo.h b/modules/access/dvd/ifo.h index e07a2dee40..67ac41bf8c 100644 --- a/modules/access/dvd/ifo.h +++ b/modules/access/dvd/ifo.h @@ -2,7 +2,7 @@ * dvd_ifo.h: Structures for ifo parsing ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: ifo.h,v 1.1 2002/08/04 17:23:41 sam Exp $ + * $Id: ifo.h,v 1.2 2002/08/08 00:35:10 sam Exp $ * * Author: Stéphane Borel * @@ -35,72 +35,72 @@ */ typedef struct ifo_video_s { - u8 i_compression ;// 2; - u8 i_system ;// 2; - u8 i_ratio ;// 2; - u8 i_perm_displ ;// 2; + u8 i_compression ;/* 2; */ + u8 i_system ;/* 2; */ + u8 i_ratio ;/* 2; */ + u8 i_perm_displ ;/* 2; */ - u8 i_line21_1 ;// 1; - u8 i_line21_2 ;// 1; - u8 i_source_res ;// 2; - u8 i_letterboxed ;// 1; - u8 i_mode ;// 1; + u8 i_line21_1 ;/* 1; */ + u8 i_line21_2 ;/* 1; */ + u8 i_source_res ;/* 2; */ + u8 i_letterboxed ;/* 1; */ + u8 i_mode ;/* 1; */ } ifo_video_t; /* Audio type information */ typedef struct ifo_audio_s { - u8 i_coding_mode ;// 3; - u8 i_multichannel_extension ;// 1; - u8 i_type ;// 2; - u8 i_appl_mode ;// 2; - - u8 i_quantization ;// 2; - u8 i_sample_freq ;// 2; - u8 i_test ;// 1; - u8 i_num_channels ;// 3; - u16 i_lang_code ;// 16; // description - u8 i_foo ;// 8; // 0x00000000 ? - u8 i_caption ;// 8; - u8 i_bar ;// 8; // 0x00000000 ? + u8 i_coding_mode ;/* 3; */ + u8 i_multichannel_extension ;/* 1; */ + u8 i_type ;/* 2; */ + u8 i_appl_mode ;/* 2; */ + + u8 i_quantization ;/* 2; */ + u8 i_sample_freq ;/* 2; */ + u8 i_test ;/* 1; */ + u8 i_num_channels ;/* 3; */ + u16 i_lang_code ;/* 16; // description */ + u8 i_foo ;/* 8; // 0x00000000 ? */ + u8 i_caption ;/* 8; */ + u8 i_bar ;/* 8; // 0x00000000 ? */ } ifo_audio_t; /* Audio Status */ typedef struct audio_status_s { - u8 i_available; // 1 - u8 i_position; // 7 - u8 i_foo; // 8 + u8 i_available; /* 1 */ + u8 i_position; /* 7 */ + u8 i_foo; /* 8 */ } audio_status_t; typedef struct ifo_spu_t { - u16 i_prefix ;// 16; // 0x0100 ? - u16 i_lang_code ;// 16; // description - u8 i_foo ;// 8; // dont know - u8 i_caption ;// 8; // 0x00 ? + u16 i_prefix ;/* 16; // 0x0100 ? */ + u16 i_lang_code ;/* 16; // description */ + u8 i_foo ;/* 8; // dont know */ + u8 i_caption ;/* 8; // 0x00 ? */ } ifo_spu_t; /* Subpicture status */ typedef struct spu_status_s { - u8 i_available; //1 - u8 i_position_43; //7 - u8 i_position_wide; //8 - u8 i_position_letter; //8 - u8 i_position_pan; //8 + u8 i_available; /*1*/ + u8 i_position_43; /*7*/ + u8 i_position_wide; /*8*/ + u8 i_position_letter; /*8*/ + u8 i_position_pan; /*8*/ } spu_status_t; /* Ifo vitual machine Commands */ typedef struct command_desc_s { - u8 i_type :3; - u8 i_direct :1; - u8 i_cmd :4; - u8 i_dir_cmp :1; - u8 i_cmp :3; - u8 i_sub_cmd :4; + unsigned int i_type :3; + unsigned int i_direct :1; + unsigned int i_cmd :4; + unsigned int i_dir_cmp :1; + unsigned int i_cmp :3; + unsigned int i_sub_cmd :4; union { u8 pi_8[6]; @@ -112,24 +112,24 @@ typedef struct command_desc_s - start at i_pgc_com_tab_sbyte */ typedef struct command_s { - u16 i_pre_command_nb; // 2 bytes - u16 i_post_command_nb; // 2 bytes - u16 i_cell_command_nb; // 2 bytes -// char[2] ??? - u64* p_pre_command; // i_pre_com_nb * 8 bytes - u64* p_post_command; // i_post_com_nb * 8 bytes - u64* p_cell_command; // i_pre_com_nb * 8 bytes - -// command_desc_t* p_cell_command; // i_cell_com_nb * 8 bytes -// command_desc_t* p_post_command; // i_post_com_nb * 8 bytes -// command_desc_t* p_cell_command; // i_cell_com_nb * 8 bytes + u16 i_pre_command_nb; /* 2 bytes */ + u16 i_post_command_nb; /* 2 bytes */ + u16 i_cell_command_nb; /* 2 bytes */ +/* char[2] ??? */ + u64* p_pre_command; /* i_pre_com_nb * 8 bytes */ + u64* p_post_command; /* i_post_com_nb * 8 bytes */ + u64* p_cell_command; /* i_pre_com_nb * 8 bytes */ + +/* command_desc_t* p_cell_command; // i_cell_com_nb * 8 bytes */ +/* command_desc_t* p_post_command; // i_post_com_nb * 8 bytes */ +/* command_desc_t* p_cell_command; // i_cell_com_nb * 8 bytes */ } command_t; /* Program Chain Map Table * - start at "i_pgc_prg_map_sbyte" */ typedef struct chapter_map_s { - u8* pi_start_cell; // i_prg_nb * 1 byte + u8* pi_start_cell; /* i_prg_nb * 1 byte */ } chapter_map_t; /* Cell Playback Information Table @@ -138,14 +138,14 @@ typedef struct chapter_map_s typedef struct cell_play_s { /* This information concerns the currently selected cell */ - u16 i_category; // 2 bytes - u8 i_still_time; // 1 byte; in seconds; ff=inf - u8 i_command_nb; // 1 byte; 0 = no com - u32 i_play_time; // 4 bytes - u32 i_first_sector; // 4 bytes - u32 i_first_ilvu_vobu_esector; // 4 bytes; ??? - u32 i_last_vobu_start_sector; // 4 bytes - u32 i_last_sector; // 4 bytes + u16 i_category; /* 2 bytes */ + u8 i_still_time; /* 1 byte; in seconds; ff=inf */ + u8 i_command_nb; /* 1 byte; 0 = no com */ + u32 i_play_time; /* 4 bytes */ + u32 i_first_sector; /* 4 bytes */ + u32 i_first_ilvu_vobu_esector; /* 4 bytes; ??? */ + u32 i_last_vobu_start_sector; /* 4 bytes */ + u32 i_last_sector; /* 4 bytes */ } cell_play_t; /* Cell Position Information Table @@ -154,9 +154,9 @@ typedef struct cell_play_s typedef struct cell_pos_s { /* This information concerns the currently selected cell */ - u16 i_vob_id; // 2 bytes -// char ??? - u8 i_cell_id; // 1 byte + u16 i_vob_id; /* 2 bytes */ +/* char ??? */ + u8 i_cell_id; /* 1 byte */ } cell_pos_t; /* Main structure for Program Chain @@ -165,31 +165,31 @@ typedef struct cell_pos_s typedef struct title_s { /* Global features of program chain */ -// char[2] ??? - u8 i_chapter_nb; // 1 byte - u8 i_cell_nb; // 1 byte - u32 i_play_time; // 4 bytes - u32 i_prohibited_user_op; // 4 bytes - audio_status_t pi_audio_status[8]; // 8*2 bytes - spu_status_t pi_spu_status[32]; // 32*4 bytes - u16 i_next_title_num; // 2 bytes - u16 i_prev_title_num; // 2 bytes - u16 i_go_up_title_num; // 2 bytes - u8 i_still_time; // 1 byte ; in seconds - u8 i_play_mode; // 1 byte +/* char[2] ??? */ + u8 i_chapter_nb; /* 1 byte */ + u8 i_cell_nb; /* 1 byte */ + u32 i_play_time; /* 4 bytes */ + u32 i_prohibited_user_op; /* 4 bytes */ + audio_status_t pi_audio_status[8]; /* 8*2 bytes */ + spu_status_t pi_spu_status[32]; /* 32*4 bytes */ + u16 i_next_title_num; /* 2 bytes */ + u16 i_prev_title_num; /* 2 bytes */ + u16 i_go_up_title_num; /* 2 bytes */ + u8 i_still_time; /* 1 byte ; in seconds */ + u8 i_play_mode; /* 1 byte */ /* In video_ts.ifo, the 3 significant bytes of each color are * preceded by 1 unsignificant byte */ - u32 pi_yuv_color[16]; // 16*3 bytes + u32 pi_yuv_color[16]; /* 16*3 bytes */ /* Here come the start bytes of the following structures */ - u16 i_command_start_byte; // 2 bytes - u16 i_chapter_map_start_byte; // 2 bytes - u16 i_cell_play_start_byte; // 2 bytes - u16 i_cell_pos_start_byte; // 2 bytes + u16 i_command_start_byte; /* 2 bytes */ + u16 i_chapter_map_start_byte; /* 2 bytes */ + u16 i_cell_play_start_byte; /* 2 bytes */ + u16 i_cell_pos_start_byte; /* 2 bytes */ /* Predefined structures */ command_t command; chapter_map_t chapter_map; - cell_play_t* p_cell_play; // i_cell_nb * 24 bytes - cell_pos_t* p_cell_pos; // i_cell_nb * 4 bytes + cell_play_t* p_cell_play; /* i_cell_nb * 24 bytes */ + cell_pos_t* p_cell_pos; /* i_cell_nb * 4 bytes */ } title_t; /* @@ -199,18 +199,18 @@ typedef struct title_s /* Menu PGCI Language unit Descriptor */ typedef struct unit_s { - u16 i_lang_code; // 2 bytes (ISO-xx) -// char ??? - u8 i_existence_mask; // 1 byte - u32 i_unit_inf_start_byte; // 4 bytes + u16 i_lang_code; /* 2 bytes (ISO-xx) */ +/* char ??? */ + u8 i_existence_mask; /* 1 byte */ + u32 i_unit_inf_start_byte; /* 4 bytes */ } unit_t; typedef struct unit_title_s { - u8 i_category_mask; // 1 byte - u8 i_category; // 1 byte - u16 i_parental_mask; // 2 bytes - u32 i_title_start_byte; // 4 bytes + u8 i_category_mask; /* 1 byte */ + u8 i_category; /* 1 byte */ + u16 i_parental_mask; /* 2 bytes */ + u32 i_title_start_byte; /* 4 bytes */ title_t title; } unit_title_t; @@ -218,21 +218,21 @@ typedef struct unit_title_s * - start at i_lu_sbyte */ typedef struct unit_inf_s { - u16 i_title_nb; // 2 bytes -// char[2] ??? - u32 i_last_byte; // 4 bytes - unit_title_t * p_title; // i_srp_nb * 8 bytes + u16 i_title_nb; /* 2 bytes */ +/* char[2] ??? */ + u32 i_last_byte; /* 4 bytes */ + unit_title_t * p_title; /* i_srp_nb * 8 bytes */ } unit_inf_t; /* Main Struct for Menu PGCI * - start at i_*_pgci_ut_ssector */ typedef struct title_unit_s { - u16 i_unit_nb; // 2 bytes; ??? -// char[2] ??? - u32 i_last_byte; // 4 bytes - unit_t* p_unit; // i_lu_nb * 8 bytes - unit_inf_t* p_unit_inf; // i_lu_nb * 8 bytes + u16 i_unit_nb; /* 2 bytes; ??? */ +/* char[2] ??? */ + u32 i_last_byte; /* 4 bytes */ + unit_t* p_unit; /* i_lu_nb * 8 bytes */ + unit_inf_t* p_unit_inf; /* i_lu_nb * 8 bytes */ } title_unit_t; /* @@ -240,20 +240,20 @@ typedef struct title_unit_s */ typedef struct cell_map_s { - u16 i_vob_id; // 2 bytes - u8 i_cell_id; // 1 byte -// char ??? - u32 i_first_sector; // 4 bytes - u32 i_last_sector; // 4 bytes + u16 i_vob_id; /* 2 bytes */ + u8 i_cell_id; /* 1 byte */ +/* char ??? */ + u32 i_first_sector; /* 4 bytes */ + u32 i_last_sector; /* 4 bytes */ } cell_map_t; typedef struct cell_inf_s { - u16 i_vob_nb; // 2 bytes -// char[2] ??? - u32 i_last_byte; // 4 bytes - u16 i_cell_nb; // not in ifo; computed - // with e_byte + u16 i_vob_nb; /* 2 bytes */ +/* char[2] ??? */ + u32 i_last_byte; /* 4 bytes */ + u16 i_cell_nb; /* not in ifo; computed */ + /* with e_byte */ cell_map_t* p_cell_map; } cell_inf_t; @@ -263,8 +263,8 @@ typedef struct cell_inf_s */ typedef struct vobu_map_s { - u32 i_last_byte; // 4 bytes - u32* pi_vobu_start_sector; // (nb of vobu) * 4 bytes + u32 i_last_byte; /* 4 bytes */ + u32* pi_vobu_start_sector; /* (nb of vobu) * 4 bytes */ } vobu_map_t; /***************************************************************************** @@ -276,40 +276,40 @@ typedef struct vobu_map_s */ typedef struct manager_inf_s { - char psz_id[13]; // 12 bytes (DVDVIDEO-VMG) - u32 i_vmg_end_sector; // 4 bytes -// char[12] ??? - u32 i_vmg_inf_end_sector; // 4 bytes -// char ??? - u8 i_spec_ver; // 1 byte - u32 i_cat; // 4 bytes - u16 i_volume_nb; // 2 bytes - u16 i_volume; // 2 bytes - u8 i_disc_side; // 1 bytes -// char[20] ??? - u16 i_title_set_nb; // 2 bytes - char ps_provider_id[32]; // 32 bytes - u64 i_pos_code; // 8 bytes -// char[24] ??? - u32 i_vmg_inf_end_byte; // 4 bytes - u32 i_first_play_title_start_byte; // 4 bytes -// char[56] ??? - u32 i_vob_start_sector; // 4 bytes - u32 i_title_inf_start_sector; // 4 bytes - u32 i_title_unit_start_sector; // 4 bytes - u32 i_parental_inf_start_sector; // 4 bytes - u32 i_vts_inf_start_sector; // 4 bytes - u32 i_text_data_start_sector; // 4 bytes - u32 i_cell_inf_start_sector; // 4 bytes - u32 i_vobu_map_start_sector; // 4 bytes -// char[2] ??? - ifo_video_t video_attr; // 2 bytes -// char ??? - u8 i_audio_nb; // 1 byte - ifo_audio_t p_audio_attr[8]; // i_vmgm_audio_nb * 8 bytes -// char[16] ??? - u8 i_spu_nb; // 1 byte - ifo_spu_t p_spu_attr[32]; // i_subpic_nb * 6 bytes + char psz_id[13]; /* 12 bytes (DVDVIDEO-VMG) */ + u32 i_vmg_end_sector; /* 4 bytes */ +/* char[12] ??? */ + u32 i_vmg_inf_end_sector; /* 4 bytes */ +/* char ??? */ + u8 i_spec_ver; /* 1 byte */ + u32 i_cat; /* 4 bytes */ + u16 i_volume_nb; /* 2 bytes */ + u16 i_volume; /* 2 bytes */ + u8 i_disc_side; /* 1 bytes */ +/* char[20] ??? */ + u16 i_title_set_nb; /* 2 bytes */ + char ps_provider_id[32]; /* 32 bytes */ + u64 i_pos_code; /* 8 bytes */ +/* char[24] ??? */ + u32 i_vmg_inf_end_byte; /* 4 bytes */ + u32 i_first_play_title_start_byte; /* 4 bytes */ +/* char[56] ??? */ + u32 i_vob_start_sector; /* 4 bytes */ + u32 i_title_inf_start_sector; /* 4 bytes */ + u32 i_title_unit_start_sector; /* 4 bytes */ + u32 i_parental_inf_start_sector; /* 4 bytes */ + u32 i_vts_inf_start_sector; /* 4 bytes */ + u32 i_text_data_start_sector; /* 4 bytes */ + u32 i_cell_inf_start_sector; /* 4 bytes */ + u32 i_vobu_map_start_sector; /* 4 bytes */ +/* char[2] ??? */ + ifo_video_t video_attr; /* 2 bytes */ +/* char ??? */ + u8 i_audio_nb; /* 1 byte */ + ifo_audio_t p_audio_attr[8]; /* i_vmgm_audio_nb * 8 bytes */ +/* char[16] ??? */ + u8 i_spu_nb; /* 1 byte */ + ifo_spu_t p_spu_attr[32]; /* i_subpic_nb * 6 bytes */ } manager_inf_t; @@ -321,23 +321,23 @@ typedef struct manager_inf_s * we have a pointer to this structure for each tts */ typedef struct title_attr_s { - u8 i_play_type; // 1 byte - u8 i_angle_nb; // 1 byte - u16 i_chapter_nb; // 2 bytes; Chapters/PGs - u16 i_parental_id; // 2 bytes - u8 i_title_set_num; // 1 byte (VTS#) - u8 i_title_num; // 1 byte ??? - u32 i_start_sector; // 4 bytes + u8 i_play_type; /* 1 byte */ + u8 i_angle_nb; /* 1 byte */ + u16 i_chapter_nb; /* 2 bytes; Chapters/PGs */ + u16 i_parental_id; /* 2 bytes */ + u8 i_title_set_num; /* 1 byte (VTS#) */ + u8 i_title_num; /* 1 byte ??? */ + u32 i_start_sector; /* 4 bytes */ } title_attr_t; /* Main struct for tts * - start at "i_vmg_ptt_srpt_ssector" */ typedef struct title_inf_s { - u16 i_title_nb; // 2 bytes -// char[2] ??? - u32 i_last_byte; // 4 bytes - title_attr_t * p_attr; // i_ttu_nb * 12 bytes + u16 i_title_nb; /* 2 bytes */ +/* char[2] ??? */ + u32 i_last_byte; /* 4 bytes */ + title_attr_t * p_attr; /* i_ttu_nb * 12 bytes */ } title_inf_t; /* @@ -345,26 +345,26 @@ typedef struct title_inf_s */ typedef struct parental_desc_s { - char ps_country_code[2]; // 2 bytes -// char[2] ??? - u16 i_parental_mask_start_byte; // 2 bytes -// char[2] ??? + char ps_country_code[2]; /* 2 bytes */ +/* char[2] ??? */ + u16 i_parental_mask_start_byte; /* 2 bytes */ +/* char[2] ??? */ } parental_desc_t; typedef struct parental_mask_s { - u16* ppi_mask[8]; // (i_vts_nb +1) * 8 * 2 bytes + u16* ppi_mask[8]; /* (i_vts_nb +1) * 8 * 2 bytes */ } parental_mask_t; /* Main struct for parental management * - start at i_vmg_ptl_mait_ssector */ typedef struct parental_inf_s { - u16 i_country_nb; // 2 bytes - u16 i_vts_nb; // 2 bytes - u32 i_last_byte; // 4 bytes - parental_desc_t* p_parental_desc; // i_country_nb * 8 bytes - parental_mask_t* p_parental_mask; // i_country_nb * sizeof(vmg_ptl_mask_t) + u16 i_country_nb; /* 2 bytes */ + u16 i_vts_nb; /* 2 bytes */ + u32 i_last_byte; /* 4 bytes */ + parental_desc_t* p_parental_desc; /* i_country_nb * 8 bytes */ + parental_mask_t* p_parental_mask; /* i_country_nb * sizeof(vmg_ptl_mask_t) */ } parental_inf_t; /* @@ -375,33 +375,33 @@ typedef struct parental_inf_s * - start at pi_atrt_sbyte */ typedef struct vts_attr_s { - u32 i_last_byte; // 4 bytes - u32 i_cat_app_type; // 4 bytes - ifo_video_t vts_menu_video_attr; // 2 bytes -// char ??? - u8 i_vts_menu_audio_nb; // 1 byte - ifo_audio_t p_vts_menu_audio_attr[8]; // 8 * 8 bytes -// char[17] ??? - u8 i_vts_menu_spu_nb; // 1 byte - ifo_spu_t p_vts_menu_spu_attr[28]; // i_vtsm_subpic_nb * 6 bytes -// char[2] ??? - ifo_video_t vts_title_video_attr; // 2 bytes -// char ??? - u8 i_vts_title_audio_nb; // 1 byte - ifo_audio_t p_vts_title_audio_attr[8]; // 8 * 8 bytes -// char[17] ??? - u8 i_vts_title_spu_nb; // 1 byte - ifo_spu_t p_vts_title_spu_attr[28]; // i_vtstt_subpic_nb * 6 bytes + u32 i_last_byte; /* 4 bytes */ + u32 i_cat_app_type; /* 4 bytes */ + ifo_video_t vts_menu_video_attr; /* 2 bytes */ +/* char ??? */ + u8 i_vts_menu_audio_nb; /* 1 byte */ + ifo_audio_t p_vts_menu_audio_attr[8]; /* 8 * 8 bytes */ +/* char[17] ??? */ + u8 i_vts_menu_spu_nb; /* 1 byte */ + ifo_spu_t p_vts_menu_spu_attr[28]; /* i_vtsm_subpic_nb * 6 bytes */ +/* char[2] ??? */ + ifo_video_t vts_title_video_attr; /* 2 bytes */ +/* char ??? */ + u8 i_vts_title_audio_nb; /* 1 byte */ + ifo_audio_t p_vts_title_audio_attr[8]; /* 8 * 8 bytes */ +/* char[17] ??? */ + u8 i_vts_title_spu_nb; /* 1 byte */ + ifo_spu_t p_vts_title_spu_attr[28]; /* i_vtstt_subpic_nb * 6 bytes */ } vts_attr_t; /* Main struct for vts attributes * - start at i_vmg_vts_atrt_ssector */ typedef struct vts_inf_s { - u16 i_vts_nb; // 2 bytes -// char[2] ??? - u32 i_last_byte; // 4 bytes - u32* pi_vts_attr_start_byte; // i_vts_nb * 4 bytes + u16 i_vts_nb; /* 2 bytes */ +/* char[2] ??? */ + u32 i_last_byte; /* 4 bytes */ + u32* pi_vts_attr_start_byte; /* i_vts_nb * 4 bytes */ vts_attr_t* p_vts_attr; } vts_inf_t; @@ -429,43 +429,43 @@ typedef struct vmg_s */ typedef struct vts_manager_s { - char psz_id[13]; // 12 bytes (DVDVIDEO-VTS) - u32 i_last_sector; // 4 bytes -// char[12] ??? - u32 i_inf_last_sector; // 4 bytes -// char ??? - u8 i_spec_ver; // 1 byte - u32 i_cat; // 4 bytes -// char[90] ??? - u32 i_inf_end_byte; // 4 bytes -// char[60] ??? - u32 i_menu_vob_start_sector; // 4 bytes - u32 i_title_vob_start_sector; // 4 bytes - u32 i_title_inf_start_sector; // 4 bytes - u32 i_title_unit_start_sector; // 4 bytes - u32 i_menu_unit_start_sector; // 4 bytes - u32 i_time_inf_start_sector; // 4 bytes - u32 i_menu_cell_inf_start_sector; // 4 bytes - u32 i_menu_vobu_map_start_sector; // 4 bytes - u32 i_cell_inf_start_sector; // 4 bytes - u32 i_vobu_map_start_sector; // 4 bytes -// char[24] ??? - ifo_video_t menu_video_attr; // 2 bytes -// char ??? - u8 i_menu_audio_nb; // 1 byte - ifo_audio_t p_menu_audio_attr[8]; // i_vmgm_audio_nb * 8 bytes -// char[16] ??? - u8 i_menu_spu_nb; // 1 byte - ifo_spu_t p_menu_spu_attr[32]; // i_subpic_nb * 6 bytes - // !!! only 28 subpics ??? -// char[2] ??? - ifo_video_t video_attr; // 2 bytes -// char ??? - u8 i_audio_nb; // 1 byte - ifo_audio_t p_audio_attr[8]; // i_vmgm_audio_nb * 8 bytes -// char[16] ??? - u8 i_spu_nb; // 1 byte - ifo_spu_t p_spu_attr[32]; // i_subpic_nb * 6 bytes + char psz_id[13]; /* 12 bytes (DVDVIDEO-VTS) */ + u32 i_last_sector; /* 4 bytes */ +/* char[12] ??? */ + u32 i_inf_last_sector; /* 4 bytes */ +/* char ??? */ + u8 i_spec_ver; /* 1 byte */ + u32 i_cat; /* 4 bytes */ +/* char[90] ??? */ + u32 i_inf_end_byte; /* 4 bytes */ +/* char[60] ??? */ + u32 i_menu_vob_start_sector; /* 4 bytes */ + u32 i_title_vob_start_sector; /* 4 bytes */ + u32 i_title_inf_start_sector; /* 4 bytes */ + u32 i_title_unit_start_sector; /* 4 bytes */ + u32 i_menu_unit_start_sector; /* 4 bytes */ + u32 i_time_inf_start_sector; /* 4 bytes */ + u32 i_menu_cell_inf_start_sector; /* 4 bytes */ + u32 i_menu_vobu_map_start_sector; /* 4 bytes */ + u32 i_cell_inf_start_sector; /* 4 bytes */ + u32 i_vobu_map_start_sector; /* 4 bytes */ +/* char[24] ??? */ + ifo_video_t menu_video_attr; /* 2 bytes */ +/* char ??? */ + u8 i_menu_audio_nb; /* 1 byte */ + ifo_audio_t p_menu_audio_attr[8]; /* i_vmgm_audio_nb * 8 bytes */ +/* char[16] ??? */ + u8 i_menu_spu_nb; /* 1 byte */ + ifo_spu_t p_menu_spu_attr[32]; /* i_subpic_nb * 6 bytes */ + /* !!! only 28 subpics ??? */ +/* char[2] ??? */ + ifo_video_t video_attr; /* 2 bytes */ +/* char ??? */ + u8 i_audio_nb; /* 1 byte */ + ifo_audio_t p_audio_attr[8]; /* i_vmgm_audio_nb * 8 bytes */ +/* char[16] ??? */ + u8 i_spu_nb; /* 1 byte */ + ifo_spu_t p_spu_attr[32]; /* i_subpic_nb * 6 bytes */ } vts_manager_t; /* @@ -476,19 +476,19 @@ typedef struct vts_manager_s * we have a pointer to this structure for each tts */ typedef struct title_start_s { - u16 i_title_id; // 2 bytes; Chapters/PGs - u16 i_chapter; // 2 bytes + u16 i_title_id; /* 2 bytes; Chapters/PGs */ + u16 i_chapter; /* 2 bytes */ } title_start_t; /* Main struct for tts * - start at "i_vts_ptt_srpt_ssector" */ typedef struct vts_title_s { - u16 i_title_nb; // 2 bytes -// char[2] ??? - u32 i_last_byte; // 4 bytes + u16 i_title_nb; /* 2 bytes */ +/* char[2] ??? */ + u32 i_last_byte; /* 4 bytes */ u32* pi_start_byte; - title_start_t * p_title_start; // i_ttu_nb * 4 bytes + title_start_t * p_title_start; /* i_ttu_nb * 4 bytes */ } vts_title_t; /* @@ -498,20 +498,20 @@ typedef struct vts_title_s /* Time Map structure */ typedef struct time_map_s { - u8 i_time_unit; // 1 byte -// char ??? - u16 i_entry_nb; // 2 bytes - u32* pi_sector; // i_entry_nb * 4 bytes + u8 i_time_unit; /* 1 byte */ +/* char ??? */ + u16 i_entry_nb; /* 2 bytes */ + u32* pi_sector; /* i_entry_nb * 4 bytes */ } time_map_t; /* Main structure for tmap_ti * - start at "i_tmap_ti_ssector" */ typedef struct time_inf_s { - u16 i_nb; // 2 bytes -// char[2] ??? - u32 i_last_byte; // 4 bytes - u32* pi_start_byte; // i_tmap_nb * 4 bytes + u16 i_nb; /* 2 bytes */ +/* char[2] ??? */ + u32 i_last_byte; /* 4 bytes */ + u32* pi_start_byte; /* i_tmap_nb * 4 bytes */ time_map_t* p_time_map; } time_inf_t; diff --git a/modules/access/dvd/seek.c b/modules/access/dvd/seek.c index 35524c26f5..89cc163e31 100644 --- a/modules/access/dvd/seek.c +++ b/modules/access/dvd/seek.c @@ -1,7 +1,7 @@ /* seek.c: functions to navigate through DVD. ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: seek.c,v 1.1 2002/08/04 17:23:41 sam Exp $ + * $Id: seek.c,v 1.2 2002/08/08 00:35:10 sam Exp $ * * Author: Stéphane Borel * @@ -223,8 +223,10 @@ int LbMaxOnce( thread_dvd_data_t * p_dvd ) p_dvd->i_vts_start + p_dvd->i_vts_lb, DVDCSS_SEEK_MPEG ) < 0 ) { -//X intf_ErrMsg( "dvd error: %s", -//X dvdcss_error( p_dvd->dvdhandle ) ); +#if 0 + intf_ErrMsg( "dvd error: %s", + dvdcss_error( p_dvd->dvdhandle ) ); +#endif return 0; } @@ -308,12 +310,16 @@ int DVDSetChapter( thread_dvd_data_t * p_dvd, int i_chapter ) p_dvd->i_vts_start + p_dvd->i_vts_lb, DVDCSS_SEEK_MPEG ) < 0 ) { -//X intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) ); +#if 0 + intf_ErrMsg( "dvd error: %s", dvdcss_error( p_dvd->dvdhandle ) ); +#endif return -1; } -//X intf_WarnMsg( 4, "dvd info: chapter %d prg_cell %d map_cell %d", -//X i_chapter, p_dvd->i_prg_cell, p_dvd->i_map_cell ); +#if 0 + intf_WarnMsg( 4, "dvd info: chapter %d prg_cell %d map_cell %d", + i_chapter, p_dvd->i_prg_cell, p_dvd->i_map_cell ); +#endif } return i_chapter; diff --git a/modules/access/dvd/summary.c b/modules/access/dvd/summary.c index f6837be007..90f5ba772e 100644 --- a/modules/access/dvd/summary.c +++ b/modules/access/dvd/summary.c @@ -3,7 +3,7 @@ * found in .ifo. ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: summary.c,v 1.1 2002/08/04 17:23:41 sam Exp $ + * $Id: summary.c,v 1.2 2002/08/08 00:35:10 sam Exp $ * * Author: Stéphane Borel * @@ -66,11 +66,13 @@ ****************************************************************************/ void IfoPrintTitle( thread_dvd_data_t * p_dvd ) { -//X intf_WarnMsg( 5, "dvd info: title %d, %d chapter%s, %d angle%s", -//X p_dvd->i_title, p_dvd->i_chapter_nb, -//X (p_dvd->i_chapter_nb == 1) ? "" : "s", -//X p_dvd->i_angle_nb, -//X (p_dvd->i_angle_nb == 1) ? "" : "s" ); +#if 0 + intf_WarnMsg( 5, "dvd info: title %d, %d chapter%s, %d angle%s", + p_dvd->i_title, p_dvd->i_chapter_nb, + (p_dvd->i_chapter_nb == 1) ? "" : "s", + p_dvd->i_angle_nb, + (p_dvd->i_angle_nb == 1) ? "" : "s" ); +#endif } /**************************************************************************** @@ -79,39 +81,41 @@ void IfoPrintTitle( thread_dvd_data_t * p_dvd ) #define video p_dvd->p_ifo->vts.manager_inf.video_attr void IfoPrintVideo( thread_dvd_data_t * p_dvd ) { -//X char* psz_perm_displ[4] = -//X { -//X "pan-scan & letterboxed", -//X "pan-scan", -//X "letterboxed", -//X "not specified" -//X }; -//X char* psz_source_res[4] = -//X { -//X "720x480 ntsc or 720x576 pal", -//X "704x480 ntsc or 704x576 pal", -//X "352x480 ntsc or 352x576 pal", -//X "352x240 ntsc or 352x288 pal" -//X }; - -//X intf_WarnMsg( 5, "dvd info: MPEG-%d video, %sHz, aspect ratio %s", -//X video.i_compression + 1, -//X video.i_system ? "pal 625 @50" : "ntsc 525 @60", -//X video.i_ratio ? (video.i_ratio == 3) ? "16:9" -//X : "unknown" -//X : "4:3" ); - -//X intf_WarnMsg( 5, "dvd info: display mode %s, %s, %s", -//X psz_perm_displ[video.i_perm_displ], -//X video.i_line21_1 ? "line21-1 data in GOP" -//X : "no line21-1 data", -//X video.i_line21_2 ? "line21-2 data in GOP" -//X : "no line21-2 data" ); - -//X intf_WarnMsg( 5, "dvd info: source is %s, %sletterboxed, %s mode", -//X psz_source_res[video.i_source_res], -//X video.i_letterboxed ? "" : "not ", -//X video.i_mode ? "film (625/50 only)" : "camera" ); +#if 0 + char* psz_perm_displ[4] = + { + "pan-scan & letterboxed", + "pan-scan", + "letterboxed", + "not specified" + }; + char* psz_source_res[4] = + { + "720x480 ntsc or 720x576 pal", + "704x480 ntsc or 704x576 pal", + "352x480 ntsc or 352x576 pal", + "352x240 ntsc or 352x288 pal" + }; + + intf_WarnMsg( 5, "dvd info: MPEG-%d video, %sHz, aspect ratio %s", + video.i_compression + 1, + video.i_system ? "pal 625 @50" : "ntsc 525 @60", + video.i_ratio ? (video.i_ratio == 3) ? "16:9" + : "unknown" + : "4:3" ); + + intf_WarnMsg( 5, "dvd info: display mode %s, %s, %s", + psz_perm_displ[video.i_perm_displ], + video.i_line21_1 ? "line21-1 data in GOP" + : "no line21-1 data", + video.i_line21_2 ? "line21-2 data in GOP" + : "no line21-2 data" ); + + intf_WarnMsg( 5, "dvd info: source is %s, %sletterboxed, %s mode", + psz_source_res[video.i_source_res], + video.i_letterboxed ? "" : "not ", + video.i_mode ? "film (625/50 only)" : "camera" ); +#endif } #undef video @@ -125,29 +129,31 @@ void IfoPrintAudio( thread_dvd_data_t * p_dvd, int i ) { if( audio_status.i_available ) { -//X char* ppsz_mode[8] = -//X { "A52", "unknown", "MPEG", "MPEG-2", "LPCM", "SDDS", "DTS", "" }; -//X char* ppsz_appl_mode[4] = -//X { "no application specified", "karaoke", "surround sound", "" }; -//X char* ppsz_quant[4] = -//X { "16 bits", "20 bits", "24 bits", "drc" }; - -//X intf_WarnMsg( 5, "dvd info: audio %d (%s) is %s, " -//X "%d%s channel%s, %dHz, %s", i, -//X DecodeLanguage( audio.i_lang_code ), -//X ppsz_mode[audio.i_coding_mode & 0x7], -//X audio.i_num_channels + 1, -//X audio.i_multichannel_extension ? " ext." : "", -//X audio.i_num_channels ? "s" : "", -//X audio.i_sample_freq ? 96000 : 48000, -//X ppsz_appl_mode[audio.i_appl_mode & 0x3] ); - -//X intf_WarnMsg( 5, "dvd info: %s, quantization %s, status %x", -//X (audio.i_caption == 1) ? "normal caption" -//X : (audio.i_caption == 3) ? "directors comments" -//X : "unknown caption", -//X ppsz_quant[audio.i_quantization & 0x3], -//X audio_status.i_position ); +#if 0 + char* ppsz_mode[8] = + { "A52", "unknown", "MPEG", "MPEG-2", "LPCM", "SDDS", "DTS", "" }; + char* ppsz_appl_mode[4] = + { "no application specified", "karaoke", "surround sound", "" }; + char* ppsz_quant[4] = + { "16 bits", "20 bits", "24 bits", "drc" }; + + intf_WarnMsg( 5, "dvd info: audio %d (%s) is %s, " + "%d%s channel%s, %dHz, %s", i, + DecodeLanguage( audio.i_lang_code ), + ppsz_mode[audio.i_coding_mode & 0x7], + audio.i_num_channels + 1, + audio.i_multichannel_extension ? " ext." : "", + audio.i_num_channels ? "s" : "", + audio.i_sample_freq ? 96000 : 48000, + ppsz_appl_mode[audio.i_appl_mode & 0x3] ); + + intf_WarnMsg( 5, "dvd info: %s, quantization %s, status %x", + (audio.i_caption == 1) ? "normal caption" + : (audio.i_caption == 3) ? "directors comments" + : "unknown caption", + ppsz_quant[audio.i_quantization & 0x3], + audio_status.i_position ); +#endif } } #undef audio_status @@ -164,14 +170,16 @@ void IfoPrintSpu( thread_dvd_data_t * p_dvd, int i ) { if( spu_status.i_available ) { -//X intf_WarnMsg( 5, "dvd info: spu %d (%s), caption %d " -//X "prefix %x, modes [%s%s%s%s ]", i, -//X DecodeLanguage( spu.i_lang_code ), -//X spu.i_caption, spu.i_prefix, -//X spu_status.i_position_43 ? " 4:3" : "", -//X spu_status.i_position_wide ? " wide" : "", -//X spu_status.i_position_letter ? " letter" : "", -//X spu_status.i_position_pan ? " pan" : "" ); +#if 0 + intf_WarnMsg( 5, "dvd info: spu %d (%s), caption %d " + "prefix %x, modes [%s%s%s%s ]", i, + DecodeLanguage( spu.i_lang_code ), + spu.i_caption, spu.i_prefix, + spu_status.i_position_43 ? " 4:3" : "", + spu_status.i_position_wide ? " wide" : "", + spu_status.i_position_letter ? " letter" : "", + spu_status.i_position_pan ? " pan" : "" ); +#endif } } #undef spu_status diff --git a/modules/access/dvd/udf.c b/modules/access/dvd/udf.c index 53e88db892..2c4521282c 100644 --- a/modules/access/dvd/udf.c +++ b/modules/access/dvd/udf.c @@ -5,7 +5,7 @@ * contains the basic udf handling functions ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: udf.c,v 1.1 2002/08/04 17:23:41 sam Exp $ + * $Id: udf.c,v 1.2 2002/08/08 00:35:10 sam Exp $ * * Author: Stéphane Borel * @@ -98,7 +98,9 @@ static int UDFReadLB( dvdcss_handle dvdhandle, off_t i_lba, { if( dvdcss_seek( dvdhandle, i_lba, DVDCSS_NOFLAGS ) < 0 ) { -//X intf_ErrMsg( "dvd error: block %i not found", i_lba ); +#if 0 + intf_ErrMsg( "dvd error: block %i not found", i_lba ); +#endif return 0; } @@ -256,13 +258,15 @@ static int UDFLogVolume(u8 * pi_data, char * p_volume_descriptor ) UDFDecode( &pi_data[84], 128, p_volume_descriptor ); - i_lb_size = GETN4( 212 ); // should be 2048 - i_MT_L = GETN4( 264 ); // should be 6 - i_N_PM = GETN4( 268 ); // should be 1 + i_lb_size = GETN4( 212 ); /* should be 2048 */ + i_MT_L = GETN4( 264 ); /* should be 6 */ + i_N_PM = GETN4( 268 ); /* should be 1 */ if( i_lb_size != DVD_LB_SIZE ) { -//X intf_ErrMsg( "dvd error: invalid UDF sector size (%d)", i_lb_size ); +#if 0 + intf_ErrMsg( "dvd error: invalid UDF sector size (%d)", i_lb_size ); +#endif return 1; } @@ -664,7 +668,9 @@ u32 DVDUDFFindFile( dvdcss_handle dvdhandle, char * psz_path ) i_partition = 0; if( !UDFFindPartition( i_partition, &partition ) ) { -//X intf_ErrMsg( "dvd error: partition 0 not found" ); +#if 0 + intf_ErrMsg( "dvd error: partition 0 not found" ); +#endif return 0; } @@ -693,26 +699,34 @@ u32 DVDUDFFindFile( dvdcss_handle dvdhandle, char * psz_path ) if( i_tag_id != 256 ) { -//X intf_ErrMsg( "dvd error: bad UDF descriptor" ); +#if 0 + intf_ErrMsg( "dvd error: bad UDF descriptor" ); +#endif return 0; } if( root_icb.i_partition != i_partition ) { -//X intf_ErrMsg( "dvd error: bad UDF partition" ); +#if 0 + intf_ErrMsg( "dvd error: bad UDF partition" ); +#endif return 0; } /* Find root dir */ if( !UDFMapICB( root_icb, &i_file_type, &file, partition ) ) { -//X intf_ErrMsg( "dvd error: can't find root dir" ); +#if 0 + intf_ErrMsg( "dvd error: can't find root dir" ); +#endif return 0; } /* root dir should be dir */ if( i_file_type != 4 ) { -//X intf_ErrMsg( "dvd error: root dir error" ); +#if 0 + intf_ErrMsg( "dvd error: root dir error" ); +#endif return 0; } @@ -722,13 +736,17 @@ u32 DVDUDFFindFile( dvdcss_handle dvdhandle, char * psz_path ) { if( !UDFScanDir( file, psz_token, &icb, partition ) ) { -//X intf_ErrMsg( "dvd error: scan dir error" ); +#if 0 + intf_ErrMsg( "dvd error: scan dir error" ); +#endif return 0; } if( !UDFMapICB ( icb, &i_file_type, &file, partition ) ) { -//X intf_ErrMsg( "dvd error: ICB error" ); +#if 0 + intf_ErrMsg( "dvd error: ICB error" ); +#endif return 0; } diff --git a/modules/access/http.c b/modules/access/http.c index 791fcbb2e4..3d87884df1 100644 --- a/modules/access/http.c +++ b/modules/access/http.c @@ -2,7 +2,7 @@ * http.c: HTTP access plug-in ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: http.c,v 1.2 2002/08/07 00:29:36 sam Exp $ + * $Id: http.c,v 1.3 2002/08/08 00:35:10 sam Exp $ * * Authors: Christophe Massiot * @@ -117,9 +117,10 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell ) { snprintf( psz_buffer, sizeof(psz_buffer), "%s" - "Range: bytes=%lld-\r\n" + "Range: bytes=%d%d-\r\n" HTTP_USERAGENT HTTP_END, - p_access_data->psz_buffer, i_tell ); + p_access_data->psz_buffer, + (u32)(i_tell>>32), (u32)i_tell ); } else { @@ -170,7 +171,7 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell ) strlen("HTTP/1.") ) ) { psz_parser += strlen("HTTP 1.") + 2; - i_returncode = atoi( psz_parser ); + i_returncode = atoi( (char*)psz_parser ); msg_Dbg( p_input, "HTTP server replied: %i", i_returncode ); psz_parser += 4; for ( i = 0; psz_parser[i] != '\r' || psz_parser[i+1] != '\n'; i++ ) @@ -216,11 +217,11 @@ static int HTTPConnect( input_thread_t * p_input, off_t i_tell ) psz_parser += strlen("Content-Length: "); vlc_mutex_lock( &p_input->stream.stream_lock ); #ifdef HAVE_ATOLL - p_input->stream.p_selected_area->i_size = atoll( psz_parser ) + p_input->stream.p_selected_area->i_size = atoll( (char*)psz_parser ) + i_tell; #else /* FIXME : this won't work for 64-bit lengths */ - p_input->stream.p_selected_area->i_size = atoi( psz_parser ) + p_input->stream.p_selected_area->i_size = atoi( (char*)psz_parser ) + i_tell; #endif vlc_mutex_unlock( &p_input->stream.stream_lock ); diff --git a/modules/access/v4l/.cvsignore b/modules/access/v4l/.cvsignore new file mode 100644 index 0000000000..435f39ed89 --- /dev/null +++ b/modules/access/v4l/.cvsignore @@ -0,0 +1,4 @@ +.dep +*.lo +*.o.* +*.lo.* diff --git a/modules/access/v4l/Makefile b/modules/access/v4l/Makefile new file mode 100644 index 0000000000..b6fbba52db --- /dev/null +++ b/modules/access/v4l/Makefile @@ -0,0 +1 @@ +v4l_SOURCES = v4l.c diff --git a/modules/access/v4l/v4l.c b/modules/access/v4l/v4l.c new file mode 100644 index 0000000000..0cfe12cd3d --- /dev/null +++ b/modules/access/v4l/v4l.c @@ -0,0 +1,134 @@ +/***************************************************************************** + * v4l.c : Video4Linux input module for vlc + ***************************************************************************** + * Copyright (C) 2002 VideoLAN + * $Id: v4l.c,v 1.1 2002/08/08 00:35:10 sam Exp $ + * + * Author: Samuel Hocevar + * + * 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 +#include + +#include +#include +#include + +/***************************************************************************** + * Local prototypes + *****************************************************************************/ +static int V4lOpen ( vlc_object_t * ); +static void V4lClose ( vlc_object_t * ); +static int V4lRead ( input_thread_t *, byte_t *, size_t ); + +/***************************************************************************** + * Module descriptior + *****************************************************************************/ +vlc_module_begin(); + set_description( _("Video4Linux input module") ); + set_capability( "access", 80 ); + set_callbacks( V4lOpen, V4lClose ); +vlc_module_end(); + +static int i_fd; + +/***************************************************************************** + * V4lOpen: open device + *****************************************************************************/ +static int V4lOpen( vlc_object_t *p_this ) +{ + input_thread_t * p_input = (input_thread_t *)p_this; + + p_input->pf_read = V4lRead; + p_input->pf_seek = NULL; + p_input->pf_set_area = NULL; + p_input->pf_set_program = NULL; + + vlc_mutex_lock( &p_input->stream.stream_lock ); + p_input->stream.b_pace_control = 0; + p_input->stream.b_seekable = 0; + p_input->stream.p_selected_area->i_size = 0; + p_input->stream.p_selected_area->i_tell = 0; + p_input->stream.i_method = INPUT_METHOD_FILE; + vlc_mutex_unlock( &p_input->stream.stream_lock ); + + i_fd = open( "/dev/v4l/video0", O_RDWR ); + + return 0; +} + +/***************************************************************************** + * V4lClose: close device + *****************************************************************************/ +static void V4lClose( vlc_object_t *p_this ) +{ + input_thread_t * p_input = (input_thread_t *)p_this; + //thread_data_t *p_data = (thread_data_t *)p_input->p_access_data; + + //close( p_data->i_handle ); + close( i_fd ); + //free( p_data ); +} + +/***************************************************************************** + * V4lRead: reads from the device into PES packets. + ***************************************************************************** + * Returns -1 in case of error, 0 in case of EOF, otherwise the number of + * bytes. + *****************************************************************************/ +#define WIDTH 640 +#define HEIGHT 480 + +static int V4lRead( input_thread_t * p_input, byte_t * p_buffer, + size_t i_len ) +{ + struct video_capability vid_caps; + struct video_mbuf vid_buf; + struct video_mmap vid_mmap; + + char *map = NULL; + + //thread_data_t * p_data; + int i_read = 0; + + if( ioctl( i_fd, VIDIOCGCAP, &vid_caps ) == -1 ) + { + printf("ioctl (VIDIOCGCAP) failed\n"); + return 0; + } + + if( ioctl( i_fd, VIDIOCGMBUF, &vid_buf ) == -1 ) + { + // to do a normal read() + map = malloc (WIDTH * HEIGHT * 3); + len = read (fd_webcam, map, WIDTH * HEIGHT * 3); + if (len <= 0) + { + free (map); + return (NULL); + } + *size = 0; + return (map); + } + + //p_data = (thread_data_t *)p_input->p_access_data; + return i_read; +} + diff --git a/modules/access/vcd/vcd.c b/modules/access/vcd/vcd.c index e0136c89fd..a7a73efd92 100644 --- a/modules/access/vcd/vcd.c +++ b/modules/access/vcd/vcd.c @@ -2,7 +2,7 @@ * vcd.c : VCD input module for vlc ***************************************************************************** * Copyright (C) 2000 VideoLAN - * $Id: vcd.c,v 1.2 2002/08/07 00:29:36 sam Exp $ + * $Id: vcd.c,v 1.3 2002/08/08 00:35:10 sam Exp $ * * Author: Johan Bilien * @@ -243,7 +243,7 @@ static int VCDOpen( vlc_object_t *p_this ) * (off_t)VCD_DATA_SIZE; /* Number of chapters */ - area[i]->i_part_nb = 0; // will be the entry points + area[i]->i_part_nb = 0; /* will be the entry points */ area[i]->i_part = 1; area[i]->i_plugin_data = p_vcd->p_sectors[i]; diff --git a/modules/audio_mixer/trivial.c b/modules/audio_mixer/trivial.c index 441f1f6c51..9a90c0d93d 100644 --- a/modules/audio_mixer/trivial.c +++ b/modules/audio_mixer/trivial.c @@ -2,7 +2,7 @@ * trivial.c : trivial mixer plug-in (1 input, no downmixing) ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: trivial.c,v 1.1 2002/08/07 21:36:55 massiot Exp $ + * $Id: trivial.c,v 1.2 2002/08/08 00:35:10 sam Exp $ * * Authors: Christophe Massiot * @@ -99,10 +99,10 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer ) { int i_nb_bytes = p_buffer->i_nb_samples * sizeof(u32) * p_input->input.i_channels; - char * p_in = (p_input->p_first_byte_to_mix == NULL) ? - p_input->fifo.p_first->p_buffer : - p_input->p_first_byte_to_mix; - char * p_out = p_buffer->p_buffer; + byte_t * p_in = (p_input->p_first_byte_to_mix == NULL) ? + p_input->fifo.p_first->p_buffer : + p_input->p_first_byte_to_mix; + byte_t * p_out = p_buffer->p_buffer; for ( ; ; ) { @@ -161,7 +161,7 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer ) for ( ; ; ) { ptrdiff_t i_available_bytes = (p_input->fifo.p_first->p_buffer - - (char *)p_in) + - (byte_t *)p_in) + p_input->fifo.p_first->i_nb_samples * sizeof(u32) * p_input->input.i_channels; @@ -195,7 +195,7 @@ static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer ) SparseCopy( p_out, p_in, i_nb_samples, p_aout->mixer.output.i_channels, p_input->input.i_channels ); - p_input->p_first_byte_to_mix = (char *)p_in + p_input->p_first_byte_to_mix = (byte_t *)p_in + i_nb_samples * p_input->input.i_channels * sizeof(u32); break; diff --git a/modules/audio_output/oss.c b/modules/audio_output/oss.c index 8d7302fdf9..352c7385e4 100644 --- a/modules/audio_output/oss.c +++ b/modules/audio_output/oss.c @@ -2,7 +2,7 @@ * oss.c : OSS /dev/dsp module for vlc ***************************************************************************** * Copyright (C) 2000-2002 VideoLAN - * $Id: oss.c,v 1.1 2002/08/07 21:36:55 massiot Exp $ + * $Id: oss.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Kaempf * Samuel Hocevar @@ -40,6 +40,7 @@ #endif #include + #include "aout_internal.h" /* SNDCTL_DSP_RESET, SNDCTL_DSP_SETFMT, SNDCTL_DSP_STEREO, SNDCTL_DSP_SPEED, @@ -62,6 +63,7 @@ struct aout_sys_t { int i_fd; volatile vlc_bool_t b_die; + volatile vlc_bool_t b_initialized; }; #define DEFAULT_FRAME_SIZE 2048 @@ -111,7 +113,7 @@ static int Open( vlc_object_t *p_this ) if( (psz_device = config_GetPsz( p_aout, "dspdev" )) == NULL ) { msg_Err( p_aout, "no audio device given (maybe /dev/dsp ?)" ); - free( p_aout->p_sys ); + free( p_sys ); return -1; } @@ -128,16 +130,17 @@ static int Open( vlc_object_t *p_this ) /* Create OSS thread and wait for its readiness. */ p_sys->b_die = 0; - if( vlc_thread_create( p_aout, "aout", OSSThread, VLC_TRUE ) ) + p_sys->b_initialized = VLC_FALSE; + if( vlc_thread_create( p_aout, "aout", OSSThread, VLC_FALSE ) ) { - msg_Err( p_input, "cannot create OSS thread (%s)", strerror(errno) ); - free( p_aout->p_sys->psz_device ); - free( p_aout->p_sys ); + msg_Err( p_aout, "cannot create OSS thread (%s)", strerror(errno) ); + free( psz_device ); + free( p_sys ); return -1; } - p_aout->pf_setformat = SetFormat; - p_aout->pf_play = Play; + p_aout->output.pf_setformat = SetFormat; + p_aout->output.pf_play = Play; return 0; } @@ -157,6 +160,8 @@ static int SetFormat( aout_instance_t *p_aout ) int i_rate; vlc_bool_t b_stereo; + p_sys->b_initialized = VLC_FALSE; + /* Reset the DSP device */ if( ioctl( p_sys->i_fd, SNDCTL_DSP_RESET, NULL ) < 0 ) { @@ -203,9 +208,10 @@ static int SetFormat( aout_instance_t *p_aout ) /* Set the output rate */ i_rate = p_aout->output.output.i_rate; - if( ioctl( p_aout->p_sys->i_fd, SNDCTL_DSP_SPEED, &i_rate ) < 0 ) + if( ioctl( p_sys->i_fd, SNDCTL_DSP_SPEED, &i_rate ) < 0 ) { - msg_Err( p_aout, "cannot set audio output rate (%i)", p_aout->i_rate ); + msg_Err( p_aout, "cannot set audio output rate (%i)", + p_aout->output.output.i_rate ); return -1; } @@ -218,6 +224,8 @@ static int SetFormat( aout_instance_t *p_aout ) p_aout->output.i_nb_samples = DEFAULT_FRAME_SIZE; + p_sys->b_initialized = VLC_TRUE; + return 0; } @@ -240,8 +248,8 @@ static void Close( vlc_object_t * p_this ) p_sys->b_die = 1; vlc_thread_join( p_aout ); - close( p_aout->p_sys->i_fd ); - free( p_aout->p_sys ); + close( p_sys->i_fd ); + free( p_sys ); } @@ -275,7 +283,7 @@ static int OSSThread( aout_instance_t * p_aout ) while ( !p_sys->b_die ) { - int i_bytes_per_sample = aout_FormatToBytes( &p_aout->output.output ); + int i_bytes_per_sample; aout_buffer_t * p_buffer; mtime_t next_date; int i_tmp; @@ -285,6 +293,13 @@ static int OSSThread( aout_instance_t * p_aout ) * is equal to the current date + duration of buffered samples. * Order is important here, since GetBufInfo is believed to take * more time than mdate(). */ + if( !p_sys->b_initialized ) + { + msleep( THREAD_SLEEP ); + continue; + } + + i_bytes_per_sample = aout_FormatToBytes( &p_aout->output.output ); next_date = (mtime_t)GetBufInfo( p_aout ) * 1000000 / i_bytes_per_sample / p_aout->output.output.i_rate; @@ -315,4 +330,6 @@ static int OSSThread( aout_instance_t * p_aout ) aout_BufferFree( p_buffer ); } } + + return 0; } diff --git a/modules/codec/a52old/adec.h b/modules/codec/a52old/adec.h index 8789a3de6d..376fb86b03 100644 --- a/modules/codec/a52old/adec.h +++ b/modules/codec/a52old/adec.h @@ -2,7 +2,7 @@ * adec.h : A52 decoder interface ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: adec.h,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: adec.h,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Kaempf * Renaud Dartus @@ -68,7 +68,7 @@ typedef struct syncinfo_s { /* Frame size in 16 bit words */ u16 frame_size; /* Bit rate in kilobits */ - //u16 bit_rate; + /*u16 bit_rate;*/ } syncinfo_t; typedef struct bsi_s { @@ -267,14 +267,14 @@ typedef struct audblk_s { u16 skipl; /* channel mantissas */ -// u16 chmant[5][256]; +/* u16 chmant[5][256]; */ /* coupling mantissas */ float cpl_flt[ 256 ]; -// u16 cplmant[256]; +/* u16 cplmant[256]; */ /* coupling mantissas */ -// u16 lfemant[7]; +/* u16 lfemant[7]; */ /* -- Information not in the bitstream, but derived thereof -- */ @@ -301,15 +301,15 @@ typedef struct audblk_s { u16 cplendmant; /* Decoded exponent info */ - u16 fbw_exp[5][256]; - u16 cpl_exp[256]; - u16 lfe_exp[7]; + s16 fbw_exp[5][256]; + s16 cpl_exp[256]; + s16 lfe_exp[7]; /* Bit allocation pointer results */ - u16 fbw_bap[5][256]; + s16 fbw_bap[5][256]; /* FIXME?? figure out exactly how many entries there should be (253-37?) */ - u16 cpl_bap[256]; - u16 lfe_bap[7]; + s16 cpl_bap[256]; + s16 lfe_bap[7]; } audblk_t; /* Everything you wanted to know about band structure */ diff --git a/modules/codec/a52old/downmix.h b/modules/codec/a52old/downmix.h index 4759b0efab..b999eb4c7d 100644 --- a/modules/codec/a52old/downmix.h +++ b/modules/codec/a52old/downmix.h @@ -2,7 +2,7 @@ * downmix.h : A52 downmix types ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: downmix.h,v 1.2 2002/08/07 00:29:36 sam Exp $ + * $Id: downmix.h,v 1.3 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Kaempf * Renaud Dartus @@ -22,17 +22,15 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -VLC_DECLARE_STRUCT(dm_par_t) -VLC_DECLARE_STRUCT(downmix_t) - -struct dm_par_t +typedef struct dm_par_t { float unit; float clev; float slev; -}; -struct downmix_t +} dm_par_t; + +typedef struct downmix_t { VLC_COMMON_MEMBERS @@ -45,5 +43,6 @@ struct downmix_t void (*pf_downmix_3f_0r_to_2ch)(float *, dm_par_t * dm_par); void (*pf_stream_sample_2ch_to_s16)(s16 *, float *left, float *right); void (*pf_stream_sample_1ch_to_s16)(s16 *, float *center); -}; + +} downmix_t; diff --git a/modules/codec/a52old/exponent.h b/modules/codec/a52old/exponent.h index 18f1978516..45a9b317c0 100644 --- a/modules/codec/a52old/exponent.h +++ b/modules/codec/a52old/exponent.h @@ -2,7 +2,7 @@ * exponent.h: A52 exponent calculations ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: exponent.h,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: exponent.h,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Kaempf * Michel Lespinasse @@ -59,7 +59,7 @@ static const s16 exps_3[128] = static inline int exp_unpack_ch( a52dec_t * p_a52dec, u16 type, u16 expstr, u16 ngrps, u16 initial_exp, - u16 exps[], u16 * dest ) + u16 exps[], s16 * dest ) { u16 i,j; s16 exp_acc; diff --git a/modules/codec/a52old/imdct.c b/modules/codec/a52old/imdct.c index f88e596dc9..8a74039da3 100644 --- a/modules/codec/a52old/imdct.c +++ b/modules/codec/a52old/imdct.c @@ -2,7 +2,7 @@ * imdct.c: A52 DCT ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: imdct.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: imdct.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Kaempf * Aaron Holtzman @@ -110,10 +110,10 @@ void imdct (a52dec_t * p_a52dec, s16 * buffer) case 2: break; default: /* 1/0 */ -// if (p_a52dec->bsi.acmod == 1) +/* if (p_a52dec->bsi.acmod == 1) */ center = p_a52dec->samples; -// else if (p_a52dec->bsi.acmod == 0) -// center = samples[config.dual_mono_ch_sel]; +/* else if (p_a52dec->bsi.acmod == 0) + center = samples[config.dual_mono_ch_sel]; */ do_imdct(p_a52dec->p_imdct, center, p_a52dec->p_imdct->delay); /* no downmix*/ p_a52dec->p_downmix->pf_stream_sample_1ch_to_s16 (buffer, center); diff --git a/modules/codec/a52old/imdct.h b/modules/codec/a52old/imdct.h index b12921b9f3..7a37c20c73 100644 --- a/modules/codec/a52old/imdct.h +++ b/modules/codec/a52old/imdct.h @@ -2,7 +2,7 @@ * imdct.h : A52 IMDCT types ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: imdct.h,v 1.2 2002/08/07 00:29:36 sam Exp $ + * $Id: imdct.h,v 1.3 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Kaempf * Renaud Dartus @@ -22,17 +22,17 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -VLC_DECLARE_STRUCT(complex_t) -VLC_DECLARE_STRUCT(imdct_t) - -struct complex_t +typedef struct complex_t { float real; float imag; -}; + +} complex_t; #define N 512 +typedef struct imdct_t imdct_t; + struct imdct_t { VLC_COMMON_MEMBERS @@ -77,10 +77,13 @@ struct imdct_t /* Module used and shortcuts */ module_t * p_module; void (*pf_imdct_init) ( imdct_t * ); - //void (*pf_fft_64p) (complex_t *a); +#if 0 + void (*pf_fft_64p) (complex_t *a); +#endif void (*pf_imdct_256) ( imdct_t *, float [], float [] ); void (*pf_imdct_256_nol) ( imdct_t *, float [], float [] ); void (*pf_imdct_512) ( imdct_t *, float [], float [] ); void (*pf_imdct_512_nol) ( imdct_t *, float [], float [] ); + }; diff --git a/modules/codec/a52old/parse.c b/modules/codec/a52old/parse.c index 7d8919f06a..5615cc2d36 100644 --- a/modules/codec/a52old/parse.c +++ b/modules/codec/a52old/parse.c @@ -2,7 +2,7 @@ * parse.c: A52 parsing procedures ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: parse.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: parse.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Kaempf * Aaron Holtzman @@ -738,8 +738,10 @@ int parse_audblk (a52dec_t * p_a52dec, int blknum) if (p_a52dec->audblk.deltbae[i] == DELTA_BIT_NEW) { p_a52dec->audblk.deltnseg[i] = GetBits (&p_a52dec->bit_stream,3); -// if (p_a52dec->audblk.deltnseg[i] >= 8) -// fprintf (stderr, "parse debug: p_a52dec->audblk.deltnseg[%i] == %i\n", i, p_a52dec->audblk.deltnseg[i]); +#if 0 + if (p_a52dec->audblk.deltnseg[i] >= 8) + fprintf (stderr, "parse debug: p_a52dec->audblk.deltnseg[%i] == %i\n", i, p_a52dec->audblk.deltnseg[i]); +#endif for (j = 0; j < p_a52dec->audblk.deltnseg[i] + 1; j++) { p_a52dec->audblk.deltoffst[i][j] = GetBits (&p_a52dec->bit_stream,5); diff --git a/modules/codec/mpeg_audio/layer1.c b/modules/codec/mpeg_audio/layer1.c index 18ebc77825..8f491ef92a 100644 --- a/modules/codec/mpeg_audio/layer1.c +++ b/modules/codec/mpeg_audio/layer1.c @@ -2,7 +2,7 @@ * layer1.c: MPEG Layer I audio decoder ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: layer1.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: layer1.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Kaempf * Michel Lespinasse @@ -92,9 +92,7 @@ int adec_layer1_mono( adec_thread_t * p_adec, s16 * buffer ) float offset[32]; float sample[32]; - int i_sb; - int s; - int i_read_bits = 0; + unsigned int i_sb, s, i_read_bits = 0; /* * Parse the allocation tables diff --git a/modules/codec/mpeg_audio/layer2.c b/modules/codec/mpeg_audio/layer2.c index eb66972ca2..2b90858270 100644 --- a/modules/codec/mpeg_audio/layer2.c +++ b/modules/codec/mpeg_audio/layer2.c @@ -2,7 +2,7 @@ * layer2.c: MPEG Layer II audio decoder ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: layer2.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: layer2.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Kaempf * Michel Lespinasse @@ -83,7 +83,7 @@ static int adec_bound_table[4] = { 4, 8, 12, 16 }; typedef struct { s8 nbal[32]; - u8 * alloc[32]; + s8 * alloc[32]; } alloc_table_t; #define L3 -1 @@ -209,7 +209,7 @@ int adec_layer2_mono( adec_thread_t * p_adec, s16 * buffer ) adec_layer2_get_table (p_adec->header, freq_table, &alloc_table, &sblimit); /* parse allocation */ - //sblimit=27; + /*sblimit=27;*/ for (sb = 0; sb < sblimit; sb++) { diff --git a/modules/codec/mpeg_audio/math.c b/modules/codec/mpeg_audio/math.c index 553339ac2f..59a739d4e1 100644 --- a/modules/codec/mpeg_audio/math.c +++ b/modules/codec/mpeg_audio/math.c @@ -2,7 +2,7 @@ * math.c: Inverse Discrete Cosine Transform and Pulse Code Modulation ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: math.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: math.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Kaempf * Michel Lespinasse @@ -481,12 +481,12 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) if ((tmp += *f++ * *v) > 32767) { /* ceiling saturation */ - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { /* floor saturation */ - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -518,11 +518,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -554,11 +554,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -590,11 +590,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -626,11 +626,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -662,11 +662,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -698,11 +698,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -734,11 +734,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -770,11 +770,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -806,11 +806,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -842,11 +842,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -878,11 +878,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -914,11 +914,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -950,11 +950,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -986,11 +986,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) v += 15; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { @@ -1021,11 +1021,11 @@ void PCM(adec_bank_t *b, s16 *p_pcm, int jump) tmp += *f++ * *v--; if ((tmp += *f++ * *v) > 32767) { - *p_pcm = 0x7FFF; + *p_pcm = 32767; /* 0x7ffff */ } else if (tmp < -32768) { - *p_pcm = 0x8000; + *p_pcm = -32768; /* 0x8000 */ } else { diff --git a/modules/codec/mpeg_video/blocks.c b/modules/codec/mpeg_video/blocks.c index f545d716bb..2eb33275f4 100644 --- a/modules/codec/mpeg_video/blocks.c +++ b/modules/codec/mpeg_video/blocks.c @@ -2,7 +2,7 @@ * blocks.c : blocks parsing ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: blocks.c,v 1.2 2002/08/04 18:39:41 sam Exp $ + * $Id: blocks.c,v 1.3 2002/08/08 00:35:11 sam Exp $ * * Authors: Michel Lespinasse * Aaron Holtzman @@ -161,9 +161,7 @@ static inline int GetChromaDCDiff( vpar_thread_t * p_vpar ) #define SATURATE(val) \ if ((u32)(val + 2048) > 4095) \ - { \ - val = (val > 0) ? 2047 : -2048; \ - } + val = (val > 0) ? 2047 : -2048 /***************************************************************************** * MPEG2IntraB14 : Decode an intra block according to ISO/IEC 13818-2 table B14 @@ -969,23 +967,23 @@ static inline void PSZ_NAME( vpar_thread_t * p_vpar, macroblock_t * p_mb ) \ p_mb->p_v_data = p_mb->pp_dest[2] + (p_vpar->mb.i_offset \ >> p_vpar->sequence.b_chroma_h_subsampled); \ \ - DECODE_LUMABLOCK( 0, PF_MBFUNC ); \ - DECODE_LUMABLOCK( 1, PF_MBFUNC ); \ - DECODE_LUMABLOCK( 2, PF_MBFUNC ); \ - DECODE_LUMABLOCK( 3, PF_MBFUNC ); \ + DECODE_LUMABLOCK( 0, PF_MBFUNC ) \ + DECODE_LUMABLOCK( 1, PF_MBFUNC ) \ + DECODE_LUMABLOCK( 2, PF_MBFUNC ) \ + DECODE_LUMABLOCK( 3, PF_MBFUNC ) \ \ do \ { \ - DECODE_CHROMABLOCK( i_b, PF_MBFUNC, 1 ); \ - DECODE_CHROMABLOCK( i_b + 1, PF_MBFUNC, 2 ); \ + DECODE_CHROMABLOCK( i_b, PF_MBFUNC, 1 ) \ + DECODE_CHROMABLOCK( i_b + 1, PF_MBFUNC, 2 ) \ i_b += 2; \ } \ while( i_b < 4 + p_vpar->sequence.i_chroma_nb_blocks ); \ } -DECLARE_INTRAMB( MPEG1IntraMB, MPEG1Intra ); -DECLARE_INTRAMB( MPEG2IntraB14MB, MPEG2IntraB14 ); -DECLARE_INTRAMB( MPEG2IntraB15MB, MPEG2IntraB15 ); +DECLARE_INTRAMB( MPEG1IntraMB, MPEG1Intra ) +DECLARE_INTRAMB( MPEG2IntraB14MB, MPEG2IntraB14 ) +DECLARE_INTRAMB( MPEG2IntraB15MB, MPEG2IntraB15 ) #undef DECLARE_INTRAMB #undef DECODE_LUMABLOCK @@ -1021,22 +1019,22 @@ static inline void PSZ_NAME( vpar_thread_t * p_vpar, macroblock_t * p_mb ) \ p_mb->p_v_data = p_mb->pp_dest[2] + (p_vpar->mb.i_offset \ >> p_vpar->sequence.b_chroma_h_subsampled); \ \ - DECODE_LUMABLOCK( 0, PF_MBFUNC ); \ - DECODE_LUMABLOCK( 1, PF_MBFUNC ); \ - DECODE_LUMABLOCK( 2, PF_MBFUNC ); \ - DECODE_LUMABLOCK( 3, PF_MBFUNC ); \ + DECODE_LUMABLOCK( 0, PF_MBFUNC ) \ + DECODE_LUMABLOCK( 1, PF_MBFUNC ) \ + DECODE_LUMABLOCK( 2, PF_MBFUNC ) \ + DECODE_LUMABLOCK( 3, PF_MBFUNC ) \ \ do \ { \ - DECODE_CHROMABLOCK( i_b, PF_MBFUNC ); \ - DECODE_CHROMABLOCK( i_b + 1, PF_MBFUNC ); \ + DECODE_CHROMABLOCK( i_b, PF_MBFUNC ) \ + DECODE_CHROMABLOCK( i_b + 1, PF_MBFUNC ) \ i_b += 2; \ } \ while( i_b < 4 + p_vpar->sequence.i_chroma_nb_blocks ); \ } -DECLARE_NONINTRAMB( MPEG1NonIntraMB, MPEG1NonIntra ); -DECLARE_NONINTRAMB( MPEG2NonIntraMB, MPEG2NonIntra ); +DECLARE_NONINTRAMB( MPEG1NonIntraMB, MPEG1NonIntra ) +DECLARE_NONINTRAMB( MPEG2NonIntraMB, MPEG2NonIntra ) #undef DECLARE_NONINTRAMB #undef DECODE_LUMABLOCK @@ -1147,7 +1145,7 @@ static inline int GetDMV( vpar_thread_t * p_vpar ) p_m_inner->i_height = i_hei; \ p_m_inner->b_second_half = b_s_half; \ p_mb->i_nb_motions++; \ - } while( 0 ); + } while( 0 ) /* MPEG-1 predictions. */ @@ -1198,7 +1196,7 @@ static void MotionMPEG1Reuse( vpar_thread_t * p_vpar, i_motion_y <<= 1; } - MOTION_BLOCK( b_average, p_motion->ppi_pmv[0][0], p_motion->ppi_pmv[0][1], + MOTION_BLOCK( b_average, p_motion->ppi_pmv[0][0], p_motion->ppi_pmv[0][1], i_offset, p_motion->pppi_ref[0], i_offset, i_width, 16, 0 ); } @@ -1981,7 +1979,7 @@ static inline void ParseSlice( vpar_thread_t * p_vpar, /* Non-intra MB without forward mv in a P picture. */ p_f_motion->ppi_pmv[0][0] = p_f_motion->ppi_pmv[0][1] = 0; p_f_motion->ppi_pmv[1][0] = p_f_motion->ppi_pmv[1][1] = 0; - MOTION( MotionFrameZero, MB_MOTION_FORWARD ); + MOTION( MotionFrameZero, MB_MOTION_FORWARD ) } } else if( i_structure == FRAME_STRUCTURE ) @@ -1989,22 +1987,22 @@ static inline void ParseSlice( vpar_thread_t * p_vpar, switch( i_mb_modes & MOTION_TYPE_MASK ) { case MC_FRAME: - MOTION( MotionFrameFrame, i_mb_modes ); + MOTION( MotionFrameFrame, i_mb_modes ) break; case MC_FIELD: - MOTION( MotionFrameField, i_mb_modes ); + MOTION( MotionFrameField, i_mb_modes ) break; case MC_DMV: - MOTION( MotionFrameDMV, MB_MOTION_FORWARD ); + MOTION( MotionFrameDMV, MB_MOTION_FORWARD ) break; case 0: /* Non-intra MB without forward mv in a P picture. */ p_f_motion->ppi_pmv[0][0] = p_f_motion->ppi_pmv[0][1] = 0; p_f_motion->ppi_pmv[1][0] = p_f_motion->ppi_pmv[1][1] = 0; - MOTION( MotionFrameZero, MB_MOTION_FORWARD ); + MOTION( MotionFrameZero, MB_MOTION_FORWARD ) } } else @@ -2013,22 +2011,22 @@ static inline void ParseSlice( vpar_thread_t * p_vpar, switch( i_mb_modes & MOTION_TYPE_MASK ) { case MC_FIELD: - MOTION( MotionFieldField, i_mb_modes ); + MOTION( MotionFieldField, i_mb_modes ) break; case MC_16X8: - MOTION( MotionField16x8, i_mb_modes ); + MOTION( MotionField16x8, i_mb_modes ) break; case MC_DMV: - MOTION( MotionFieldDMV, i_mb_modes ); + MOTION( MotionFieldDMV, i_mb_modes ) break; case 0: /* Non-intra MB without forward mv in a P picture. */ p_f_motion->ppi_pmv[0][0] = p_f_motion->ppi_pmv[0][1] = 0; p_f_motion->ppi_pmv[1][0] = p_f_motion->ppi_pmv[1][1] = 0; - MOTION( MotionFieldZero, MB_MOTION_FORWARD ); + MOTION( MotionFieldZero, MB_MOTION_FORWARD ) } } @@ -2102,11 +2100,11 @@ static inline void ParseSlice( vpar_thread_t * p_vpar, if( i_structure == FRAME_STRUCTURE ) { - MOTION( MotionFrameZero, MB_MOTION_FORWARD ); + MOTION( MotionFrameZero, MB_MOTION_FORWARD ) } else { - MOTION( MotionFieldZero, MB_MOTION_FORWARD ); + MOTION( MotionFieldZero, MB_MOTION_FORWARD ) } p_vpar->pool.pf_decode_mb( &p_vpar->pool, p_mb ); @@ -2127,15 +2125,15 @@ static inline void ParseSlice( vpar_thread_t * p_vpar, if( !b_mpeg2 ) { - MOTION( MotionMPEG1Reuse, i_mb_modes ); + MOTION( MotionMPEG1Reuse, i_mb_modes ) } else if( i_structure == FRAME_STRUCTURE ) { - MOTION( MotionFrameReuse, i_mb_modes ); + MOTION( MotionFrameReuse, i_mb_modes ) } else { - MOTION( MotionFieldReuse, i_mb_modes ); + MOTION( MotionFieldReuse, i_mb_modes ) } p_vpar->pool.pf_decode_mb( &p_vpar->pool, p_mb ); @@ -2181,23 +2179,23 @@ void FUNCNAME( vpar_thread_t * p_vpar ) \ } DECLARE_PICD( vpar_PictureDataGENERIC, p_vpar->sequence.b_mpeg2, - p_vpar->picture.i_coding_type, p_vpar->picture.i_structure ); + p_vpar->picture.i_coding_type, p_vpar->picture.i_structure ) #if (VPAR_OPTIM_LEVEL > 0) -DECLARE_PICD( vpar_PictureData2IF, 1, I_CODING_TYPE, FRAME_STRUCTURE ); -DECLARE_PICD( vpar_PictureData2PF, 1, P_CODING_TYPE, FRAME_STRUCTURE ); -DECLARE_PICD( vpar_PictureData2BF, 1, B_CODING_TYPE, FRAME_STRUCTURE ); +DECLARE_PICD( vpar_PictureData2IF, 1, I_CODING_TYPE, FRAME_STRUCTURE ) +DECLARE_PICD( vpar_PictureData2PF, 1, P_CODING_TYPE, FRAME_STRUCTURE ) +DECLARE_PICD( vpar_PictureData2BF, 1, B_CODING_TYPE, FRAME_STRUCTURE ) #endif #if (VPAR_OPTIM_LEVEL > 1) -DECLARE_PICD( vpar_PictureData2IT, 1, I_CODING_TYPE, TOP_FIELD ); -DECLARE_PICD( vpar_PictureData2PT, 1, P_CODING_TYPE, TOP_FIELD ); -DECLARE_PICD( vpar_PictureData2BT, 1, B_CODING_TYPE, TOP_FIELD ); -DECLARE_PICD( vpar_PictureData2IB, 1, I_CODING_TYPE, BOTTOM_FIELD ); -DECLARE_PICD( vpar_PictureData2PB, 1, P_CODING_TYPE, BOTTOM_FIELD ); -DECLARE_PICD( vpar_PictureData2BB, 1, B_CODING_TYPE, BOTTOM_FIELD ); -DECLARE_PICD( vpar_PictureData1I, 0, I_CODING_TYPE, FRAME_STRUCTURE ); -DECLARE_PICD( vpar_PictureData1P, 0, P_CODING_TYPE, FRAME_STRUCTURE ); -DECLARE_PICD( vpar_PictureData1B, 0, B_CODING_TYPE, FRAME_STRUCTURE ); -DECLARE_PICD( vpar_PictureData1D, 0, D_CODING_TYPE, FRAME_STRUCTURE ); +DECLARE_PICD( vpar_PictureData2IT, 1, I_CODING_TYPE, TOP_FIELD ) +DECLARE_PICD( vpar_PictureData2PT, 1, P_CODING_TYPE, TOP_FIELD ) +DECLARE_PICD( vpar_PictureData2BT, 1, B_CODING_TYPE, TOP_FIELD ) +DECLARE_PICD( vpar_PictureData2IB, 1, I_CODING_TYPE, BOTTOM_FIELD ) +DECLARE_PICD( vpar_PictureData2PB, 1, P_CODING_TYPE, BOTTOM_FIELD ) +DECLARE_PICD( vpar_PictureData2BB, 1, B_CODING_TYPE, BOTTOM_FIELD ) +DECLARE_PICD( vpar_PictureData1I, 0, I_CODING_TYPE, FRAME_STRUCTURE ) +DECLARE_PICD( vpar_PictureData1P, 0, P_CODING_TYPE, FRAME_STRUCTURE ) +DECLARE_PICD( vpar_PictureData1B, 0, B_CODING_TYPE, FRAME_STRUCTURE ) +DECLARE_PICD( vpar_PictureData1D, 0, D_CODING_TYPE, FRAME_STRUCTURE ) #endif #undef DECLARE_PICD diff --git a/modules/codec/mpeg_video/decoder.c b/modules/codec/mpeg_video/decoder.c index 6ed4f8120e..96397f4822 100644 --- a/modules/codec/mpeg_video/decoder.c +++ b/modules/codec/mpeg_video/decoder.c @@ -2,7 +2,7 @@ * video_decoder.c : video decoder thread ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: decoder.c,v 1.2 2002/08/04 18:39:41 sam Exp $ + * $Id: decoder.c,v 1.3 2002/08/08 00:35:11 sam Exp $ * * Authors: Christophe Massiot * Michel Lespinasse @@ -218,7 +218,7 @@ static inline void MotionBlock( vdec_pool_t * p_pool, vlc_bool_t b_average, #define DECODE_NONINTRA_BLOCK( i_b, p_dest ) \ if( p_mb->i_coded_block_pattern & (1 << (11 - (i_b))) ) \ { \ - DECODE_INTRA_BLOCK( i_b, p_dest ); \ + DECODE_INTRA_BLOCK( i_b, p_dest ) \ } #define DECLARE_DECODEMB( PSZ_NAME, I_CHROMA ) \ @@ -265,28 +265,28 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \ * adding prediction and coefficient data (ISO/IEC \ * 13818-2 section 7.6.8) \ */ \ - DECODE_NONINTRA_BLOCK( 0, p_mb->p_y_data ); \ - DECODE_NONINTRA_BLOCK( 1, p_mb->p_y_data + 8 ); \ - DECODE_NONINTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset ); \ - DECODE_NONINTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8 ); \ + DECODE_NONINTRA_BLOCK( 0, p_mb->p_y_data ) \ + DECODE_NONINTRA_BLOCK( 1, p_mb->p_y_data + 8 ) \ + DECODE_NONINTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset ) \ + DECODE_NONINTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8 ) \ if( I_CHROMA != CHROMA_NONE ) \ { \ - DECODE_NONINTRA_BLOCK( 4, p_mb->p_u_data ); \ - DECODE_NONINTRA_BLOCK( 5, p_mb->p_v_data ); \ + DECODE_NONINTRA_BLOCK( 4, p_mb->p_u_data ) \ + DECODE_NONINTRA_BLOCK( 5, p_mb->p_v_data ) \ if( I_CHROMA != CHROMA_420 ) \ { \ DECODE_NONINTRA_BLOCK( 6, p_mb->p_u_data \ - + i_chrom_dct_offset ); \ + + i_chrom_dct_offset ) \ DECODE_NONINTRA_BLOCK( 7, p_mb->p_v_data \ - + i_chrom_dct_offset ); \ + + i_chrom_dct_offset ) \ if( I_CHROMA == CHROMA_444 ) \ { \ - DECODE_NONINTRA_BLOCK( 8, p_mb->p_u_data + 8 ); \ - DECODE_NONINTRA_BLOCK( 9, p_mb->p_v_data + 8 ); \ + DECODE_NONINTRA_BLOCK( 8, p_mb->p_u_data + 8 ) \ + DECODE_NONINTRA_BLOCK( 9, p_mb->p_v_data + 8 ) \ DECODE_NONINTRA_BLOCK( 10, p_mb->p_u_data + 8 \ - + i_chrom_dct_offset ); \ + + i_chrom_dct_offset ) \ DECODE_NONINTRA_BLOCK( 11, p_mb->p_v_data + 8 \ - + i_chrom_dct_offset ); \ + + i_chrom_dct_offset ) \ } \ } \ } \ @@ -294,38 +294,38 @@ void PSZ_NAME ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) \ else \ { \ /* Intra macroblock */ \ - DECODE_INTRA_BLOCK( 0, p_mb->p_y_data ); \ - DECODE_INTRA_BLOCK( 1, p_mb->p_y_data + 8 ); \ - DECODE_INTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset ); \ - DECODE_INTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8 ); \ + DECODE_INTRA_BLOCK( 0, p_mb->p_y_data ) \ + DECODE_INTRA_BLOCK( 1, p_mb->p_y_data + 8 ) \ + DECODE_INTRA_BLOCK( 2, p_mb->p_y_data + i_lum_dct_offset ) \ + DECODE_INTRA_BLOCK( 3, p_mb->p_y_data + i_lum_dct_offset + 8 ) \ if( I_CHROMA != CHROMA_NONE ) \ { \ - DECODE_INTRA_BLOCK( 4, p_mb->p_u_data ); \ - DECODE_INTRA_BLOCK( 5, p_mb->p_v_data ); \ + DECODE_INTRA_BLOCK( 4, p_mb->p_u_data ) \ + DECODE_INTRA_BLOCK( 5, p_mb->p_v_data ) \ if( I_CHROMA != CHROMA_420 ) \ { \ DECODE_INTRA_BLOCK( 6, p_mb->p_u_data \ - + i_chrom_dct_offset ); \ + + i_chrom_dct_offset ) \ DECODE_INTRA_BLOCK( 7, p_mb->p_v_data \ - + i_chrom_dct_offset ); \ + + i_chrom_dct_offset ) \ if( I_CHROMA == CHROMA_444 ) \ { \ - DECODE_INTRA_BLOCK( 8, p_mb->p_u_data + 8 ); \ - DECODE_INTRA_BLOCK( 9, p_mb->p_v_data + 8 ); \ + DECODE_INTRA_BLOCK( 8, p_mb->p_u_data + 8 ) \ + DECODE_INTRA_BLOCK( 9, p_mb->p_v_data + 8 ) \ DECODE_INTRA_BLOCK( 10, p_mb->p_u_data + 8 \ - + i_chrom_dct_offset ); \ + + i_chrom_dct_offset ) \ DECODE_INTRA_BLOCK( 11, p_mb->p_v_data + 8 \ - + i_chrom_dct_offset ); \ + + i_chrom_dct_offset ) \ } \ } \ } \ } \ } -DECLARE_DECODEMB( vdec_DecodeMacroblockBW, CHROMA_NONE ); -DECLARE_DECODEMB( vdec_DecodeMacroblock420, CHROMA_420 ); -DECLARE_DECODEMB( vdec_DecodeMacroblock422, CHROMA_422 ); -DECLARE_DECODEMB( vdec_DecodeMacroblock444, CHROMA_444 ); +DECLARE_DECODEMB( vdec_DecodeMacroblockBW, CHROMA_NONE ) +DECLARE_DECODEMB( vdec_DecodeMacroblock420, CHROMA_420 ) +DECLARE_DECODEMB( vdec_DecodeMacroblock422, CHROMA_422 ) +DECLARE_DECODEMB( vdec_DecodeMacroblock444, CHROMA_444 ) #undef DECLARE_DECODEMB diff --git a/modules/codec/mpeg_video/decoder.h b/modules/codec/mpeg_video/decoder.h index a3d0d42178..9b2a0cdbb9 100644 --- a/modules/codec/mpeg_video/decoder.h +++ b/modules/codec/mpeg_video/decoder.h @@ -2,7 +2,7 @@ * decoder.h : video decoder thread ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: decoder.h,v 1.2 2002/08/07 00:29:36 sam Exp $ + * $Id: decoder.h,v 1.3 2002/08/08 00:35:11 sam Exp $ * * Authors: Christophe Massiot * @@ -21,14 +21,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -VLC_DECLARE_STRUCT(vpar_thread_t) -VLC_DECLARE_STRUCT(vdec_thread_t) -VLC_DECLARE_STRUCT(vdec_pool_t) +typedef struct vpar_thread_t vpar_thread_t; +typedef struct vdec_pool_t vdec_pool_t; /***************************************************************************** * vdec_thread_t: video decoder thread descriptor *****************************************************************************/ -struct vdec_thread_t +typedef struct vdec_thread_t { VLC_COMMON_MEMBERS @@ -37,7 +36,8 @@ struct vdec_thread_t /* Input properties */ vdec_pool_t * p_pool; -}; + +} vdec_thread_t; /***************************************************************************** * Prototypes diff --git a/modules/codec/mpeg_video/idct/idctmmx.c b/modules/codec/mpeg_video/idct/idctmmx.c index d5b4047196..3d2c8c4c2a 100644 --- a/modules/codec/mpeg_video/idct/idctmmx.c +++ b/modules/codec/mpeg_video/idct/idctmmx.c @@ -2,7 +2,7 @@ * idctmmx.c : MMX IDCT module ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: idctmmx.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: idctmmx.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Aaron Holtzman * Michel Lespinasse @@ -88,118 +88,118 @@ static void NormScan( u8 ppi_scan[2][64] ) static inline void RowHead( dctelem_t * row, int offset, dctelem_t * table ) { - movq_m2r (*(row+offset), mm2); // mm2 = x6 x4 x2 x0 + movq_m2r (*(row+offset), mm2); /* mm2 = x6 x4 x2 x0 */ - movq_m2r (*(row+offset+4), mm5); // mm5 = x7 x5 x3 x1 - movq_r2r (mm2, mm0); // mm0 = x6 x4 x2 x0 + movq_m2r (*(row+offset+4), mm5); /* mm5 = x7 x5 x3 x1 */ + movq_r2r (mm2, mm0); /* mm0 = x6 x4 x2 x0 */ - movq_m2r (*table, mm3); // mm3 = C6 C4 C2 C4 - movq_r2r (mm5, mm6); // mm6 = x7 x5 x3 x1 + movq_m2r (*table, mm3); /* mm3 = C6 C4 C2 C4 */ + movq_r2r (mm5, mm6); /* mm6 = x7 x5 x3 x1 */ - punpckldq_r2r (mm0, mm0); // mm0 = x2 x0 x2 x0 + punpckldq_r2r (mm0, mm0); /* mm0 = x2 x0 x2 x0 */ - movq_m2r (*(table+4), mm4); // mm4 = -C2 -C4 C6 C4 - pmaddwd_r2r (mm0, mm3); // mm3 = C4*x0+C6*x2 C4*x0+C2*x2 + movq_m2r (*(table+4), mm4); /* mm4 = -C2 -C4 C6 C4 */ + pmaddwd_r2r (mm0, mm3); /* mm3 = C4*x0+C6*x2 C4*x0+C2*x2 */ - movq_m2r (*(table+8), mm1); // mm1 = -C7 C3 C3 C1 - punpckhdq_r2r (mm2, mm2); // mm2 = x6 x4 x6 x4 + movq_m2r (*(table+8), mm1); /* mm1 = -C7 C3 C3 C1 */ + punpckhdq_r2r (mm2, mm2); /* mm2 = x6 x4 x6 x4 */ } static inline void Row( dctelem_t * table, s32 * rounder ) { - pmaddwd_r2r (mm2, mm4); // mm4 = -C4*x4-C2*x6 C4*x4+C6*x6 - punpckldq_r2r (mm5, mm5); // mm5 = x3 x1 x3 x1 + pmaddwd_r2r (mm2, mm4); /* mm4 = -C4*x4-C2*x6 C4*x4+C6*x6 */ + punpckldq_r2r (mm5, mm5); /* mm5 = x3 x1 x3 x1 */ - pmaddwd_m2r (*(table+16), mm0); // mm0 = C4*x0-C2*x2 C4*x0-C6*x2 - punpckhdq_r2r (mm6, mm6); // mm6 = x7 x5 x7 x5 + pmaddwd_m2r (*(table+16), mm0); /* mm0 = C4*x0-C2*x2 C4*x0-C6*x2 */ + punpckhdq_r2r (mm6, mm6); /* mm6 = x7 x5 x7 x5 */ - movq_m2r (*(table+12), mm7); // mm7 = -C5 -C1 C7 C5 - pmaddwd_r2r (mm5, mm1); // mm1 = C3*x1-C7*x3 C1*x1+C3*x3 + movq_m2r (*(table+12), mm7); /* mm7 = -C5 -C1 C7 C5 */ + pmaddwd_r2r (mm5, mm1); /* mm1 = C3*x1-C7*x3 C1*x1+C3*x3 */ - paddd_m2r (*rounder, mm3); // mm3 += rounder - pmaddwd_r2r (mm6, mm7); // mm7 = -C1*x5-C5*x7 C5*x5+C7*x7 + paddd_m2r (*rounder, mm3); /* mm3 += rounder */ + pmaddwd_r2r (mm6, mm7); /* mm7 = -C1*x5-C5*x7 C5*x5+C7*x7 */ - pmaddwd_m2r (*(table+20), mm2); // mm2 = C4*x4-C6*x6 -C4*x4+C2*x6 - paddd_r2r (mm4, mm3); // mm3 = a1 a0 + rounder + pmaddwd_m2r (*(table+20), mm2); /* mm2 = C4*x4-C6*x6 -C4*x4+C2*x6 */ + paddd_r2r (mm4, mm3); /* mm3 = a1 a0 + rounder */ - pmaddwd_m2r (*(table+24), mm5); // mm5 = C7*x1-C5*x3 C5*x1-C1*x3 - movq_r2r (mm3, mm4); // mm4 = a1 a0 + rounder + pmaddwd_m2r (*(table+24), mm5); /* mm5 = C7*x1-C5*x3 C5*x1-C1*x3 */ + movq_r2r (mm3, mm4); /* mm4 = a1 a0 + rounder */ - pmaddwd_m2r (*(table+28), mm6); // mm6 = C3*x5-C1*x7 C7*x5+C3*x7 - paddd_r2r (mm7, mm1); // mm1 = b1 b0 + pmaddwd_m2r (*(table+28), mm6); /* mm6 = C3*x5-C1*x7 C7*x5+C3*x7 */ + paddd_r2r (mm7, mm1); /* mm1 = b1 b0 */ - paddd_m2r (*rounder, mm0); // mm0 += rounder - psubd_r2r (mm1, mm3); // mm3 = a1-b1 a0-b0 + rounder + paddd_m2r (*rounder, mm0); /* mm0 += rounder */ + psubd_r2r (mm1, mm3); /* mm3 = a1-b1 a0-b0 + rounder */ - psrad_i2r (ROW_SHIFT, mm3); // mm3 = y6 y7 - paddd_r2r (mm4, mm1); // mm1 = a1+b1 a0+b0 + rounder + psrad_i2r (ROW_SHIFT, mm3); /* mm3 = y6 y7 */ + paddd_r2r (mm4, mm1); /* mm1 = a1+b1 a0+b0 + rounder */ - paddd_r2r (mm2, mm0); // mm0 = a3 a2 + rounder - psrad_i2r (ROW_SHIFT, mm1); // mm1 = y1 y0 + paddd_r2r (mm2, mm0); /* mm0 = a3 a2 + rounder */ + psrad_i2r (ROW_SHIFT, mm1); /* mm1 = y1 y0 */ - paddd_r2r (mm6, mm5); // mm5 = b3 b2 - movq_r2r (mm0, mm7); // mm7 = a3 a2 + rounder + paddd_r2r (mm6, mm5); /* mm5 = b3 b2 */ + movq_r2r (mm0, mm7); /* mm7 = a3 a2 + rounder */ - paddd_r2r (mm5, mm0); // mm0 = a3+b3 a2+b2 + rounder - psubd_r2r (mm5, mm7); // mm7 = a3-b3 a2-b2 + rounder + paddd_r2r (mm5, mm0); /* mm0 = a3+b3 a2+b2 + rounder */ + psubd_r2r (mm5, mm7); /* mm7 = a3-b3 a2-b2 + rounder */ } static inline void RowTail( dctelem_t * row, int store ) { - psrad_i2r (ROW_SHIFT, mm0); // mm0 = y3 y2 + psrad_i2r (ROW_SHIFT, mm0); /* mm0 = y3 y2 */ - psrad_i2r (ROW_SHIFT, mm7); // mm7 = y4 y5 + psrad_i2r (ROW_SHIFT, mm7); /* mm7 = y4 y5 */ - packssdw_r2r (mm0, mm1); // mm1 = y3 y2 y1 y0 + packssdw_r2r (mm0, mm1); /* mm1 = y3 y2 y1 y0 */ - packssdw_r2r (mm3, mm7); // mm7 = y6 y7 y4 y5 + packssdw_r2r (mm3, mm7); /* mm7 = y6 y7 y4 y5 */ - movq_r2m (mm1, *(row+store)); // save y3 y2 y1 y0 - movq_r2r (mm7, mm4); // mm4 = y6 y7 y4 y5 + movq_r2m (mm1, *(row+store)); /* save y3 y2 y1 y0 */ + movq_r2r (mm7, mm4); /* mm4 = y6 y7 y4 y5 */ - pslld_i2r (16, mm7); // mm7 = y7 0 y5 0 + pslld_i2r (16, mm7); /* mm7 = y7 0 y5 0 */ - psrld_i2r (16, mm4); // mm4 = 0 y6 0 y4 + psrld_i2r (16, mm4); /* mm4 = 0 y6 0 y4 */ - por_r2r (mm4, mm7); // mm7 = y7 y6 y5 y4 + por_r2r (mm4, mm7); /* mm7 = y7 y6 y5 y4 */ - // slot + /* slot */ - movq_r2m (mm7, *(row+store+4)); // save y7 y6 y5 y4 + movq_r2m (mm7, *(row+store+4)); /* save y7 y6 y5 y4 */ } static inline void RowMid( dctelem_t * row, int store, int offset, dctelem_t * table ) { - movq_m2r (*(row+offset), mm2); // mm2 = x6 x4 x2 x0 - psrad_i2r (ROW_SHIFT, mm0); // mm0 = y3 y2 + movq_m2r (*(row+offset), mm2); /* mm2 = x6 x4 x2 x0 */ + psrad_i2r (ROW_SHIFT, mm0); /* mm0 = y3 y2 */ - movq_m2r (*(row+offset+4), mm5); // mm5 = x7 x5 x3 x1 - psrad_i2r (ROW_SHIFT, mm7); // mm7 = y4 y5 + movq_m2r (*(row+offset+4), mm5); /* mm5 = x7 x5 x3 x1 */ + psrad_i2r (ROW_SHIFT, mm7); /* mm7 = y4 y5 */ - packssdw_r2r (mm0, mm1); // mm1 = y3 y2 y1 y0 - movq_r2r (mm5, mm6); // mm6 = x7 x5 x3 x1 + packssdw_r2r (mm0, mm1); /* mm1 = y3 y2 y1 y0 */ + movq_r2r (mm5, mm6); /* mm6 = x7 x5 x3 x1 */ - packssdw_r2r (mm3, mm7); // mm7 = y6 y7 y4 y5 - movq_r2r (mm2, mm0); // mm0 = x6 x4 x2 x0 + packssdw_r2r (mm3, mm7); /* mm7 = y6 y7 y4 y5 */ + movq_r2r (mm2, mm0); /* mm0 = x6 x4 x2 x0 */ - movq_r2m (mm1, *(row+store)); // save y3 y2 y1 y0 - movq_r2r (mm7, mm1); // mm1 = y6 y7 y4 y5 + movq_r2m (mm1, *(row+store)); /* save y3 y2 y1 y0 */ + movq_r2r (mm7, mm1); /* mm1 = y6 y7 y4 y5 */ - punpckldq_r2r (mm0, mm0); // mm0 = x2 x0 x2 x0 - psrld_i2r (16, mm7); // mm7 = 0 y6 0 y4 + punpckldq_r2r (mm0, mm0); /* mm0 = x2 x0 x2 x0 */ + psrld_i2r (16, mm7); /* mm7 = 0 y6 0 y4 */ - movq_m2r (*table, mm3); // mm3 = C6 C4 C2 C4 - pslld_i2r (16, mm1); // mm1 = y7 0 y5 0 + movq_m2r (*table, mm3); /* mm3 = C6 C4 C2 C4 */ + pslld_i2r (16, mm1); /* mm1 = y7 0 y5 0 */ - movq_m2r (*(table+4), mm4); // mm4 = -C2 -C4 C6 C4 - por_r2r (mm1, mm7); // mm7 = y7 y6 y5 y4 + movq_m2r (*(table+4), mm4); /* mm4 = -C2 -C4 C6 C4 */ + por_r2r (mm1, mm7); /* mm7 = y7 y6 y5 y4 */ - movq_m2r (*(table+8), mm1); // mm1 = -C7 C3 C3 C1 - punpckhdq_r2r (mm2, mm2); // mm2 = x6 x4 x6 x4 + movq_m2r (*(table+8), mm1); /* mm1 = -C7 C3 C3 C1 */ + punpckhdq_r2r (mm2, mm2); /* mm2 = x6 x4 x6 x4 */ - movq_r2m (mm7, *(row+store+4)); // save y7 y6 y5 y4 - pmaddwd_r2r (mm0, mm3); // mm3 = C4*x0+C6*x2 C4*x0+C2*x2 + movq_r2m (mm7, *(row+store+4)); /* save y7 y6 y5 y4 */ + pmaddwd_r2r (mm0, mm3); /* mm3 = C4*x0+C6*x2 C4*x0+C2*x2 */ } static inline void Col( dctelem_t * col, int offset ) @@ -218,132 +218,132 @@ static inline void Col( dctelem_t * col, int offset ) /* column code adapted from peter gubanov */ /* http://www.elecard.com/peter/idct.shtml */ - movq_m2r (*_T1, mm0); // mm0 = T1 + movq_m2r (*_T1, mm0); /* mm0 = T1 */ - movq_m2r (*(col+offset+1*8), mm1); // mm1 = x1 - movq_r2r (mm0, mm2); // mm2 = T1 + movq_m2r (*(col+offset+1*8), mm1); /* mm1 = x1 */ + movq_r2r (mm0, mm2); /* mm2 = T1 */ - movq_m2r (*(col+offset+7*8), mm4); // mm4 = x7 - pmulhw_r2r (mm1, mm0); // mm0 = T1*x1 + movq_m2r (*(col+offset+7*8), mm4); /* mm4 = x7 */ + pmulhw_r2r (mm1, mm0); /* mm0 = T1*x1 */ - movq_m2r (*_T3, mm5); // mm5 = T3 - pmulhw_r2r (mm4, mm2); // mm2 = T1*x7 + movq_m2r (*_T3, mm5); /* mm5 = T3 */ + pmulhw_r2r (mm4, mm2); /* mm2 = T1*x7 */ - movq_m2r (*(col+offset+5*8), mm6); // mm6 = x5 - movq_r2r (mm5, mm7); // mm7 = T3-1 + movq_m2r (*(col+offset+5*8), mm6); /* mm6 = x5 */ + movq_r2r (mm5, mm7); /* mm7 = T3-1 */ - movq_m2r (*(col+offset+3*8), mm3); // mm3 = x3 - psubsw_r2r (mm4, mm0); // mm0 = v17 + movq_m2r (*(col+offset+3*8), mm3); /* mm3 = x3 */ + psubsw_r2r (mm4, mm0); /* mm0 = v17 */ - movq_m2r (*_T2, mm4); // mm4 = T2 - pmulhw_r2r (mm3, mm5); // mm5 = (T3-1)*x3 + movq_m2r (*_T2, mm4); /* mm4 = T2 */ + pmulhw_r2r (mm3, mm5); /* mm5 = (T3-1)*x3 */ - paddsw_r2r (mm2, mm1); // mm1 = u17 - pmulhw_r2r (mm6, mm7); // mm7 = (T3-1)*x5 + paddsw_r2r (mm2, mm1); /* mm1 = u17 */ + pmulhw_r2r (mm6, mm7); /* mm7 = (T3-1)*x5 */ - //slot + /*slot*/ - movq_r2r (mm4, mm2); // mm2 = T2 - paddsw_r2r (mm3, mm5); // mm5 = T3*x3 + movq_r2r (mm4, mm2); /* mm2 = T2 */ + paddsw_r2r (mm3, mm5); /* mm5 = T3*x3 */ - pmulhw_m2r (*(col+offset+2*8), mm4);// mm4 = T2*x2 - paddsw_r2r (mm6, mm7); // mm7 = T3*x5 + pmulhw_m2r (*(col+offset+2*8), mm4);/* mm4 = T2*x2 */ + paddsw_r2r (mm6, mm7); /* mm7 = T3*x5 */ - psubsw_r2r (mm6, mm5); // mm5 = v35 - paddsw_r2r (mm3, mm7); // mm7 = u35 + psubsw_r2r (mm6, mm5); /* mm5 = v35 */ + paddsw_r2r (mm3, mm7); /* mm7 = u35 */ - movq_m2r (*(col+offset+6*8), mm3); // mm3 = x6 - movq_r2r (mm0, mm6); // mm6 = v17 + movq_m2r (*(col+offset+6*8), mm3); /* mm3 = x6 */ + movq_r2r (mm0, mm6); /* mm6 = v17 */ - pmulhw_r2r (mm3, mm2); // mm2 = T2*x6 - psubsw_r2r (mm5, mm0); // mm0 = b3 + pmulhw_r2r (mm3, mm2); /* mm2 = T2*x6 */ + psubsw_r2r (mm5, mm0); /* mm0 = b3 */ - psubsw_r2r (mm3, mm4); // mm4 = v26 - paddsw_r2r (mm6, mm5); // mm5 = v12 + psubsw_r2r (mm3, mm4); /* mm4 = v26 */ + paddsw_r2r (mm6, mm5); /* mm5 = v12 */ - movq_r2m (mm0, scratch0); // save b3 - movq_r2r (mm1, mm6); // mm6 = u17 + movq_r2m (mm0, scratch0); /* save b3 */ + movq_r2r (mm1, mm6); /* mm6 = u17 */ - paddsw_m2r (*(col+offset+2*8), mm2);// mm2 = u26 - paddsw_r2r (mm7, mm6); // mm6 = b0 + paddsw_m2r (*(col+offset+2*8), mm2);/* mm2 = u26 */ + paddsw_r2r (mm7, mm6); /* mm6 = b0 */ - psubsw_r2r (mm7, mm1); // mm1 = u12 - movq_r2r (mm1, mm7); // mm7 = u12 + psubsw_r2r (mm7, mm1); /* mm1 = u12 */ + movq_r2r (mm1, mm7); /* mm7 = u12 */ - movq_m2r (*(col+offset+0*8), mm3); // mm3 = x0 - paddsw_r2r (mm5, mm1); // mm1 = u12+v12 + movq_m2r (*(col+offset+0*8), mm3); /* mm3 = x0 */ + paddsw_r2r (mm5, mm1); /* mm1 = u12+v12 */ - movq_m2r (*_C4, mm0); // mm0 = C4/2 - psubsw_r2r (mm5, mm7); // mm7 = u12-v12 + movq_m2r (*_C4, mm0); /* mm0 = C4/2 */ + psubsw_r2r (mm5, mm7); /* mm7 = u12-v12 */ - movq_r2m (mm6, scratch1); // save b0 - pmulhw_r2r (mm0, mm1); // mm1 = b1/2 + movq_r2m (mm6, scratch1); /* save b0 */ + pmulhw_r2r (mm0, mm1); /* mm1 = b1/2 */ - movq_r2r (mm4, mm6); // mm6 = v26 - pmulhw_r2r (mm0, mm7); // mm7 = b2/2 + movq_r2r (mm4, mm6); /* mm6 = v26 */ + pmulhw_r2r (mm0, mm7); /* mm7 = b2/2 */ - movq_m2r (*(col+offset+4*8), mm5); // mm5 = x4 - movq_r2r (mm3, mm0); // mm0 = x0 + movq_m2r (*(col+offset+4*8), mm5); /* mm5 = x4 */ + movq_r2r (mm3, mm0); /* mm0 = x0 */ - psubsw_r2r (mm5, mm3); // mm3 = v04 - paddsw_r2r (mm5, mm0); // mm0 = u04 + psubsw_r2r (mm5, mm3); /* mm3 = v04 */ + paddsw_r2r (mm5, mm0); /* mm0 = u04 */ - paddsw_r2r (mm3, mm4); // mm4 = a1 - movq_r2r (mm0, mm5); // mm5 = u04 + paddsw_r2r (mm3, mm4); /* mm4 = a1 */ + movq_r2r (mm0, mm5); /* mm5 = u04 */ - psubsw_r2r (mm6, mm3); // mm3 = a2 - paddsw_r2r (mm2, mm5); // mm5 = a0 + psubsw_r2r (mm6, mm3); /* mm3 = a2 */ + paddsw_r2r (mm2, mm5); /* mm5 = a0 */ - paddsw_r2r (mm1, mm1); // mm1 = b1 - psubsw_r2r (mm2, mm0); // mm0 = a3 + paddsw_r2r (mm1, mm1); /* mm1 = b1 */ + psubsw_r2r (mm2, mm0); /* mm0 = a3 */ - paddsw_r2r (mm7, mm7); // mm7 = b2 - movq_r2r (mm3, mm2); // mm2 = a2 + paddsw_r2r (mm7, mm7); /* mm7 = b2 */ + movq_r2r (mm3, mm2); /* mm2 = a2 */ - movq_r2r (mm4, mm6); // mm6 = a1 - paddsw_r2r (mm7, mm3); // mm3 = a2+b2 + movq_r2r (mm4, mm6); /* mm6 = a1 */ + paddsw_r2r (mm7, mm3); /* mm3 = a2+b2 */ - psraw_i2r (COL_SHIFT, mm3); // mm3 = y2 - paddsw_r2r (mm1, mm4); // mm4 = a1+b1 + psraw_i2r (COL_SHIFT, mm3); /* mm3 = y2 */ + paddsw_r2r (mm1, mm4); /* mm4 = a1+b1 */ - psraw_i2r (COL_SHIFT, mm4); // mm4 = y1 - psubsw_r2r (mm1, mm6); // mm6 = a1-b1 + psraw_i2r (COL_SHIFT, mm4); /* mm4 = y1 */ + psubsw_r2r (mm1, mm6); /* mm6 = a1-b1 */ - movq_m2r (scratch1, mm1); // mm1 = b0 - psubsw_r2r (mm7, mm2); // mm2 = a2-b2 + movq_m2r (scratch1, mm1); /* mm1 = b0 */ + psubsw_r2r (mm7, mm2); /* mm2 = a2-b2 */ - psraw_i2r (COL_SHIFT, mm6); // mm6 = y6 - movq_r2r (mm5, mm7); // mm7 = a0 + psraw_i2r (COL_SHIFT, mm6); /* mm6 = y6 */ + movq_r2r (mm5, mm7); /* mm7 = a0 */ - movq_r2m (mm4, *(col+offset+1*8)); // save y1 - psraw_i2r (COL_SHIFT, mm2); // mm2 = y5 + movq_r2m (mm4, *(col+offset+1*8)); /* save y1 */ + psraw_i2r (COL_SHIFT, mm2); /* mm2 = y5 */ - movq_r2m (mm3, *(col+offset+2*8)); // save y2 - paddsw_r2r (mm1, mm5); // mm5 = a0+b0 + movq_r2m (mm3, *(col+offset+2*8)); /* save y2 */ + paddsw_r2r (mm1, mm5); /* mm5 = a0+b0 */ - movq_m2r (scratch0, mm4); // mm4 = b3 - psubsw_r2r (mm1, mm7); // mm7 = a0-b0 + movq_m2r (scratch0, mm4); /* mm4 = b3 */ + psubsw_r2r (mm1, mm7); /* mm7 = a0-b0 */ - psraw_i2r (COL_SHIFT, mm5); // mm5 = y0 - movq_r2r (mm0, mm3); // mm3 = a3 + psraw_i2r (COL_SHIFT, mm5); /* mm5 = y0 */ + movq_r2r (mm0, mm3); /* mm3 = a3 */ - movq_r2m (mm2, *(col+offset+5*8)); // save y5 - psubsw_r2r (mm4, mm3); // mm3 = a3-b3 + movq_r2m (mm2, *(col+offset+5*8)); /* save y5 */ + psubsw_r2r (mm4, mm3); /* mm3 = a3-b3 */ - psraw_i2r (COL_SHIFT, mm7); // mm7 = y7 - paddsw_r2r (mm0, mm4); // mm4 = a3+b3 + psraw_i2r (COL_SHIFT, mm7); /* mm7 = y7 */ + paddsw_r2r (mm0, mm4); /* mm4 = a3+b3 */ - movq_r2m (mm5, *(col+offset+0*8)); // save y0 - psraw_i2r (COL_SHIFT, mm3); // mm3 = y4 + movq_r2m (mm5, *(col+offset+0*8)); /* save y0 */ + psraw_i2r (COL_SHIFT, mm3); /* mm3 = y4 */ - movq_r2m (mm6, *(col+offset+6*8)); // save y6 - psraw_i2r (COL_SHIFT, mm4); // mm4 = y3 + movq_r2m (mm6, *(col+offset+6*8)); /* save y6 */ + psraw_i2r (COL_SHIFT, mm4); /* mm4 = y3 */ - movq_r2m (mm7, *(col+offset+7*8)); // save y7 + movq_r2m (mm7, *(col+offset+7*8)); /* save y7 */ - movq_r2m (mm3, *(col+offset+4*8)); // save y4 + movq_r2m (mm3, *(col+offset+4*8)); /* save y4 */ - movq_r2m (mm4, *(col+offset+3*8)); // save y3 + movq_r2m (mm4, *(col+offset+3*8)); /* save y3 */ } @@ -351,17 +351,17 @@ static s32 rounder0[] ATTR_ALIGN(8) = rounder ((1 << (COL_SHIFT - 1)) - 0.5); static s32 rounder4[] ATTR_ALIGN(8) = rounder (0); static s32 rounder1[] ATTR_ALIGN(8) = - rounder (1.25683487303); // C1*(C1/C4+C1+C7)/2 + rounder (1.25683487303); /* C1*(C1/C4+C1+C7)/2 */ static s32 rounder7[] ATTR_ALIGN(8) = - rounder (-0.25); // C1*(C7/C4+C7-C1)/2 + rounder (-0.25); /* C1*(C7/C4+C7-C1)/2 */ static s32 rounder2[] ATTR_ALIGN(8) = - rounder (0.60355339059); // C2 * (C6+C2)/2 + rounder (0.60355339059); /* C2 * (C6+C2)/2 */ static s32 rounder6[] ATTR_ALIGN(8) = - rounder (-0.25); // C2 * (C6-C2)/2 + rounder (-0.25); /* C2 * (C6-C2)/2 */ static s32 rounder3[] ATTR_ALIGN(8) = - rounder (0.087788325588); // C3*(-C3/C4+C3+C5)/2 + rounder (0.087788325588); /* C3*(-C3/C4+C3+C5)/2 */ static s32 rounder5[] ATTR_ALIGN(8) = - rounder (-0.441341716183); // C3*(-C5/C4+C5-C3)/2 + rounder (-0.441341716183); /* C3*(-C5/C4+C5-C3)/2 */ static void IDCT( dctelem_t * p_block ) { diff --git a/modules/codec/mpeg_video/idct/idctmmxext.c b/modules/codec/mpeg_video/idct/idctmmxext.c index 229fc2c68a..7317857c97 100644 --- a/modules/codec/mpeg_video/idct/idctmmxext.c +++ b/modules/codec/mpeg_video/idct/idctmmxext.c @@ -2,7 +2,7 @@ * idctmmxext.c : MMX EXT IDCT module ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: idctmmxext.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: idctmmxext.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Aaron Holtzman * Michel Lespinasse @@ -88,101 +88,101 @@ static void NormScan( u8 ppi_scan[2][64] ) static inline void RowHead( dctelem_t * row, int offset, dctelem_t * table ) { - movq_m2r (*(row+offset), mm2); // mm2 = x6 x4 x2 x0 + movq_m2r (*(row+offset), mm2); /* mm2 = x6 x4 x2 x0 */ - movq_m2r (*(row+offset+4), mm5); // mm5 = x7 x5 x3 x1 - movq_r2r (mm2, mm0); // mm0 = x6 x4 x2 x0 + movq_m2r (*(row+offset+4), mm5); /* mm5 = x7 x5 x3 x1 */ + movq_r2r (mm2, mm0); /* mm0 = x6 x4 x2 x0 */ - movq_m2r (*table, mm3); // mm3 = -C2 -C4 C2 C4 - movq_r2r (mm5, mm6); // mm6 = x7 x5 x3 x1 + movq_m2r (*table, mm3); /* mm3 = -C2 -C4 C2 C4 */ + movq_r2r (mm5, mm6); /* mm6 = x7 x5 x3 x1 */ - movq_m2r (*(table+4), mm4); // mm4 = C6 C4 C6 C4 - pmaddwd_r2r (mm0, mm3); // mm3 = -C4*x4-C2*x6 C4*x0+C2*x2 + movq_m2r (*(table+4), mm4); /* mm4 = C6 C4 C6 C4 */ + pmaddwd_r2r (mm0, mm3); /* mm3 = -C4*x4-C2*x6 C4*x0+C2*x2 */ - pshufw_r2r (mm2, mm2, 0x4e); // mm2 = x2 x0 x6 x4 + pshufw_r2r (mm2, mm2, 0x4e); /* mm2 = x2 x0 x6 x4 */ } static inline void Row( dctelem_t * table, s32 * rounder ) { - movq_m2r (*(table+8), mm1); // mm1 = -C5 -C1 C3 C1 - pmaddwd_r2r (mm2, mm4); // mm4 = C4*x0+C6*x2 C4*x4+C6*x6 + movq_m2r (*(table+8), mm1); /* mm1 = -C5 -C1 C3 C1 */ + pmaddwd_r2r (mm2, mm4); /* mm4 = C4*x0+C6*x2 C4*x4+C6*x6 */ - pmaddwd_m2r (*(table+16), mm0); // mm0 = C4*x4-C6*x6 C4*x0-C6*x2 - pshufw_r2r (mm6, mm6, 0x4e); // mm6 = x3 x1 x7 x5 + pmaddwd_m2r (*(table+16), mm0); /* mm0 = C4*x4-C6*x6 C4*x0-C6*x2 */ + pshufw_r2r (mm6, mm6, 0x4e); /* mm6 = x3 x1 x7 x5 */ - movq_m2r (*(table+12), mm7); // mm7 = -C7 C3 C7 C5 - pmaddwd_r2r (mm5, mm1); // mm1 = -C1*x5-C5*x7 C1*x1+C3*x3 + movq_m2r (*(table+12), mm7); /* mm7 = -C7 C3 C7 C5 */ + pmaddwd_r2r (mm5, mm1); /* mm1 = -C1*x5-C5*x7 C1*x1+C3*x3 */ - paddd_m2r (*rounder, mm3); // mm3 += rounder - pmaddwd_r2r (mm6, mm7); // mm7 = C3*x1-C7*x3 C5*x5+C7*x7 + paddd_m2r (*rounder, mm3); /* mm3 += rounder */ + pmaddwd_r2r (mm6, mm7); /* mm7 = C3*x1-C7*x3 C5*x5+C7*x7 */ - pmaddwd_m2r (*(table+20), mm2); // mm2 = C4*x0-C2*x2 -C4*x4+C2*x6 - paddd_r2r (mm4, mm3); // mm3 = a1 a0 + rounder + pmaddwd_m2r (*(table+20), mm2); /* mm2 = C4*x0-C2*x2 -C4*x4+C2*x6 */ + paddd_r2r (mm4, mm3); /* mm3 = a1 a0 + rounder */ - pmaddwd_m2r (*(table+24), mm5); // mm5 = C3*x5-C1*x7 C5*x1-C1*x3 - movq_r2r (mm3, mm4); // mm4 = a1 a0 + rounder + pmaddwd_m2r (*(table+24), mm5); /* mm5 = C3*x5-C1*x7 C5*x1-C1*x3 */ + movq_r2r (mm3, mm4); /* mm4 = a1 a0 + rounder */ - pmaddwd_m2r (*(table+28), mm6); // mm6 = C7*x1-C5*x3 C7*x5+C3*x7 - paddd_r2r (mm7, mm1); // mm1 = b1 b0 + pmaddwd_m2r (*(table+28), mm6); /* mm6 = C7*x1-C5*x3 C7*x5+C3*x7 */ + paddd_r2r (mm7, mm1); /* mm1 = b1 b0 */ - paddd_m2r (*rounder, mm0); // mm0 += rounder - psubd_r2r (mm1, mm3); // mm3 = a1-b1 a0-b0 + rounder + paddd_m2r (*rounder, mm0); /* mm0 += rounder */ + psubd_r2r (mm1, mm3); /* mm3 = a1-b1 a0-b0 + rounder */ - psrad_i2r (ROW_SHIFT, mm3); // mm3 = y6 y7 - paddd_r2r (mm4, mm1); // mm1 = a1+b1 a0+b0 + rounder + psrad_i2r (ROW_SHIFT, mm3); /* mm3 = y6 y7 */ + paddd_r2r (mm4, mm1); /* mm1 = a1+b1 a0+b0 + rounder */ - paddd_r2r (mm2, mm0); // mm0 = a3 a2 + rounder - psrad_i2r (ROW_SHIFT, mm1); // mm1 = y1 y0 + paddd_r2r (mm2, mm0); /* mm0 = a3 a2 + rounder */ + psrad_i2r (ROW_SHIFT, mm1); /* mm1 = y1 y0 */ - paddd_r2r (mm6, mm5); // mm5 = b3 b2 - movq_r2r (mm0, mm4); // mm4 = a3 a2 + rounder + paddd_r2r (mm6, mm5); /* mm5 = b3 b2 */ + movq_r2r (mm0, mm4); /* mm4 = a3 a2 + rounder */ - paddd_r2r (mm5, mm0); // mm0 = a3+b3 a2+b2 + rounder - psubd_r2r (mm5, mm4); // mm4 = a3-b3 a2-b2 + rounder + paddd_r2r (mm5, mm0); /* mm0 = a3+b3 a2+b2 + rounder */ + psubd_r2r (mm5, mm4); /* mm4 = a3-b3 a2-b2 + rounder */ } static inline void RowTail( dctelem_t * row, int store ) { - psrad_i2r (ROW_SHIFT, mm0); // mm0 = y3 y2 + psrad_i2r (ROW_SHIFT, mm0); /* mm0 = y3 y2 */ - psrad_i2r (ROW_SHIFT, mm4); // mm4 = y4 y5 + psrad_i2r (ROW_SHIFT, mm4); /* mm4 = y4 y5 */ - packssdw_r2r (mm0, mm1); // mm1 = y3 y2 y1 y0 + packssdw_r2r (mm0, mm1); /* mm1 = y3 y2 y1 y0 */ - packssdw_r2r (mm3, mm4); // mm4 = y6 y7 y4 y5 + packssdw_r2r (mm3, mm4); /* mm4 = y6 y7 y4 y5 */ - movq_r2m (mm1, *(row+store)); // save y3 y2 y1 y0 - pshufw_r2r (mm4, mm4, 0xb1); // mm4 = y7 y6 y5 y4 + movq_r2m (mm1, *(row+store)); /* save y3 y2 y1 y0 */ + pshufw_r2r (mm4, mm4, 0xb1); /* mm4 = y7 y6 y5 y4 */ - // slot - movq_r2m (mm4, *(row+store+4)); // save y7 y6 y5 y4 + /* slot */ + movq_r2m (mm4, *(row+store+4)); /* save y7 y6 y5 y4 */ } static inline void RowMid( dctelem_t * row, int store, int offset, dctelem_t * table) { - movq_m2r (*(row+offset), mm2); // mm2 = x6 x4 x2 x0 - psrad_i2r (ROW_SHIFT, mm0); // mm0 = y3 y2 + movq_m2r (*(row+offset), mm2); /* mm2 = x6 x4 x2 x0 */ + psrad_i2r (ROW_SHIFT, mm0); /* mm0 = y3 y2 */ - movq_m2r (*(row+offset+4), mm5); // mm5 = x7 x5 x3 x1 - psrad_i2r (ROW_SHIFT, mm4); // mm4 = y4 y5 + movq_m2r (*(row+offset+4), mm5); /* mm5 = x7 x5 x3 x1 */ + psrad_i2r (ROW_SHIFT, mm4); /* mm4 = y4 y5 */ - packssdw_r2r (mm0, mm1); // mm1 = y3 y2 y1 y0 - movq_r2r (mm5, mm6); // mm6 = x7 x5 x3 x1 + packssdw_r2r (mm0, mm1); /* mm1 = y3 y2 y1 y0 */ + movq_r2r (mm5, mm6); /* mm6 = x7 x5 x3 x1 */ - packssdw_r2r (mm3, mm4); // mm4 = y6 y7 y4 y5 - movq_r2r (mm2, mm0); // mm0 = x6 x4 x2 x0 + packssdw_r2r (mm3, mm4); /* mm4 = y6 y7 y4 y5 */ + movq_r2r (mm2, mm0); /* mm0 = x6 x4 x2 x0 */ - movq_r2m (mm1, *(row+store)); // save y3 y2 y1 y0 - pshufw_r2r (mm4, mm4, 0xb1); // mm4 = y7 y6 y5 y4 + movq_r2m (mm1, *(row+store)); /* save y3 y2 y1 y0 */ + pshufw_r2r (mm4, mm4, 0xb1); /* mm4 = y7 y6 y5 y4 */ - movq_m2r (*table, mm3); // mm3 = -C2 -C4 C2 C4 - movq_r2m (mm4, *(row+store+4)); // save y7 y6 y5 y4 + movq_m2r (*table, mm3); /* mm3 = -C2 -C4 C2 C4 */ + movq_r2m (mm4, *(row+store+4)); /* save y7 y6 y5 y4 */ - pmaddwd_r2r (mm0, mm3); // mm3 = -C4*x4-C2*x6 C4*x0+C2*x2 + pmaddwd_r2r (mm0, mm3); /* mm3 = -C4*x4-C2*x6 C4*x0+C2*x2 */ - movq_m2r (*(table+4), mm4); // mm4 = C6 C4 C6 C4 - pshufw_r2r (mm2, mm2, 0x4e); // mm2 = x2 x0 x6 x4 + movq_m2r (*(table+4), mm4); /* mm4 = C6 C4 C6 C4 */ + pshufw_r2r (mm2, mm2, 0x4e); /* mm2 = x2 x0 x6 x4 */ } static inline void Col( dctelem_t * col, int offset ) @@ -201,132 +201,132 @@ static inline void Col( dctelem_t * col, int offset ) /* column code adapted from peter gubanov */ /* http://www.elecard.com/peter/idct.shtml */ - movq_m2r (*_T1, mm0); // mm0 = T1 + movq_m2r (*_T1, mm0); /* mm0 = T1 */ - movq_m2r (*(col+offset+1*8), mm1); // mm1 = x1 - movq_r2r (mm0, mm2); // mm2 = T1 + movq_m2r (*(col+offset+1*8), mm1); /* mm1 = x1 */ + movq_r2r (mm0, mm2); /* mm2 = T1 */ - movq_m2r (*(col+offset+7*8), mm4); // mm4 = x7 - pmulhw_r2r (mm1, mm0); // mm0 = T1*x1 + movq_m2r (*(col+offset+7*8), mm4); /* mm4 = x7 */ + pmulhw_r2r (mm1, mm0); /* mm0 = T1*x1 */ - movq_m2r (*_T3, mm5); // mm5 = T3 - pmulhw_r2r (mm4, mm2); // mm2 = T1*x7 + movq_m2r (*_T3, mm5); /* mm5 = T3 */ + pmulhw_r2r (mm4, mm2); /* mm2 = T1*x7 */ - movq_m2r (*(col+offset+5*8), mm6); // mm6 = x5 - movq_r2r (mm5, mm7); // mm7 = T3-1 + movq_m2r (*(col+offset+5*8), mm6); /* mm6 = x5 */ + movq_r2r (mm5, mm7); /* mm7 = T3-1 */ - movq_m2r (*(col+offset+3*8), mm3); // mm3 = x3 - psubsw_r2r (mm4, mm0); // mm0 = v17 + movq_m2r (*(col+offset+3*8), mm3); /* mm3 = x3 */ + psubsw_r2r (mm4, mm0); /* mm0 = v17 */ - movq_m2r (*_T2, mm4); // mm4 = T2 - pmulhw_r2r (mm3, mm5); // mm5 = (T3-1)*x3 + movq_m2r (*_T2, mm4); /* mm4 = T2 */ + pmulhw_r2r (mm3, mm5); /* mm5 = (T3-1)*x3 */ - paddsw_r2r (mm2, mm1); // mm1 = u17 - pmulhw_r2r (mm6, mm7); // mm7 = (T3-1)*x5 + paddsw_r2r (mm2, mm1); /* mm1 = u17 */ + pmulhw_r2r (mm6, mm7); /* mm7 = (T3-1)*x5 */ - //slot + /*slot*/ - movq_r2r (mm4, mm2); // mm2 = T2 - paddsw_r2r (mm3, mm5); // mm5 = T3*x3 + movq_r2r (mm4, mm2); /* mm2 = T2 */ + paddsw_r2r (mm3, mm5); /* mm5 = T3*x3 */ - pmulhw_m2r (*(col+offset+2*8), mm4);// mm4 = T2*x2 - paddsw_r2r (mm6, mm7); // mm7 = T3*x5 + pmulhw_m2r (*(col+offset+2*8), mm4);/* mm4 = T2*x2 */ + paddsw_r2r (mm6, mm7); /* mm7 = T3*x5 */ - psubsw_r2r (mm6, mm5); // mm5 = v35 - paddsw_r2r (mm3, mm7); // mm7 = u35 + psubsw_r2r (mm6, mm5); /* mm5 = v35 */ + paddsw_r2r (mm3, mm7); /* mm7 = u35 */ - movq_m2r (*(col+offset+6*8), mm3); // mm3 = x6 - movq_r2r (mm0, mm6); // mm6 = v17 + movq_m2r (*(col+offset+6*8), mm3); /* mm3 = x6 */ + movq_r2r (mm0, mm6); /* mm6 = v17 */ - pmulhw_r2r (mm3, mm2); // mm2 = T2*x6 - psubsw_r2r (mm5, mm0); // mm0 = b3 + pmulhw_r2r (mm3, mm2); /* mm2 = T2*x6 */ + psubsw_r2r (mm5, mm0); /* mm0 = b3 */ - psubsw_r2r (mm3, mm4); // mm4 = v26 - paddsw_r2r (mm6, mm5); // mm5 = v12 + psubsw_r2r (mm3, mm4); /* mm4 = v26 */ + paddsw_r2r (mm6, mm5); /* mm5 = v12 */ - movq_r2m (mm0, scratch0); // save b3 - movq_r2r (mm1, mm6); // mm6 = u17 + movq_r2m (mm0, scratch0); /* save b3 */ + movq_r2r (mm1, mm6); /* mm6 = u17 */ - paddsw_m2r (*(col+offset+2*8), mm2);// mm2 = u26 - paddsw_r2r (mm7, mm6); // mm6 = b0 + paddsw_m2r (*(col+offset+2*8), mm2);/* mm2 = u26 */ + paddsw_r2r (mm7, mm6); /* mm6 = b0 */ - psubsw_r2r (mm7, mm1); // mm1 = u12 - movq_r2r (mm1, mm7); // mm7 = u12 + psubsw_r2r (mm7, mm1); /* mm1 = u12 */ + movq_r2r (mm1, mm7); /* mm7 = u12 */ - movq_m2r (*(col+offset+0*8), mm3); // mm3 = x0 - paddsw_r2r (mm5, mm1); // mm1 = u12+v12 + movq_m2r (*(col+offset+0*8), mm3); /* mm3 = x0 */ + paddsw_r2r (mm5, mm1); /* mm1 = u12+v12 */ - movq_m2r (*_C4, mm0); // mm0 = C4/2 - psubsw_r2r (mm5, mm7); // mm7 = u12-v12 + movq_m2r (*_C4, mm0); /* mm0 = C4/2 */ + psubsw_r2r (mm5, mm7); /* mm7 = u12-v12 */ - movq_r2m (mm6, scratch1); // save b0 - pmulhw_r2r (mm0, mm1); // mm1 = b1/2 + movq_r2m (mm6, scratch1); /* save b0 */ + pmulhw_r2r (mm0, mm1); /* mm1 = b1/2 */ - movq_r2r (mm4, mm6); // mm6 = v26 - pmulhw_r2r (mm0, mm7); // mm7 = b2/2 + movq_r2r (mm4, mm6); /* mm6 = v26 */ + pmulhw_r2r (mm0, mm7); /* mm7 = b2/2 */ - movq_m2r (*(col+offset+4*8), mm5); // mm5 = x4 - movq_r2r (mm3, mm0); // mm0 = x0 + movq_m2r (*(col+offset+4*8), mm5); /* mm5 = x4 */ + movq_r2r (mm3, mm0); /* mm0 = x0 */ - psubsw_r2r (mm5, mm3); // mm3 = v04 - paddsw_r2r (mm5, mm0); // mm0 = u04 + psubsw_r2r (mm5, mm3); /* mm3 = v04 */ + paddsw_r2r (mm5, mm0); /* mm0 = u04 */ - paddsw_r2r (mm3, mm4); // mm4 = a1 - movq_r2r (mm0, mm5); // mm5 = u04 + paddsw_r2r (mm3, mm4); /* mm4 = a1 */ + movq_r2r (mm0, mm5); /* mm5 = u04 */ - psubsw_r2r (mm6, mm3); // mm3 = a2 - paddsw_r2r (mm2, mm5); // mm5 = a0 + psubsw_r2r (mm6, mm3); /* mm3 = a2 */ + paddsw_r2r (mm2, mm5); /* mm5 = a0 */ - paddsw_r2r (mm1, mm1); // mm1 = b1 - psubsw_r2r (mm2, mm0); // mm0 = a3 + paddsw_r2r (mm1, mm1); /* mm1 = b1 */ + psubsw_r2r (mm2, mm0); /* mm0 = a3 */ - paddsw_r2r (mm7, mm7); // mm7 = b2 - movq_r2r (mm3, mm2); // mm2 = a2 + paddsw_r2r (mm7, mm7); /* mm7 = b2 */ + movq_r2r (mm3, mm2); /* mm2 = a2 */ - movq_r2r (mm4, mm6); // mm6 = a1 - paddsw_r2r (mm7, mm3); // mm3 = a2+b2 + movq_r2r (mm4, mm6); /* mm6 = a1 */ + paddsw_r2r (mm7, mm3); /* mm3 = a2+b2 */ - psraw_i2r (COL_SHIFT, mm3); // mm3 = y2 - paddsw_r2r (mm1, mm4); // mm4 = a1+b1 + psraw_i2r (COL_SHIFT, mm3); /* mm3 = y2 */ + paddsw_r2r (mm1, mm4); /* mm4 = a1+b1 */ - psraw_i2r (COL_SHIFT, mm4); // mm4 = y1 - psubsw_r2r (mm1, mm6); // mm6 = a1-b1 + psraw_i2r (COL_SHIFT, mm4); /* mm4 = y1 */ + psubsw_r2r (mm1, mm6); /* mm6 = a1-b1 */ - movq_m2r (scratch1, mm1); // mm1 = b0 - psubsw_r2r (mm7, mm2); // mm2 = a2-b2 + movq_m2r (scratch1, mm1); /* mm1 = b0 */ + psubsw_r2r (mm7, mm2); /* mm2 = a2-b2 */ - psraw_i2r (COL_SHIFT, mm6); // mm6 = y6 - movq_r2r (mm5, mm7); // mm7 = a0 + psraw_i2r (COL_SHIFT, mm6); /* mm6 = y6 */ + movq_r2r (mm5, mm7); /* mm7 = a0 */ - movq_r2m (mm4, *(col+offset+1*8)); // save y1 - psraw_i2r (COL_SHIFT, mm2); // mm2 = y5 + movq_r2m (mm4, *(col+offset+1*8)); /* save y1 */ + psraw_i2r (COL_SHIFT, mm2); /* mm2 = y5 */ - movq_r2m (mm3, *(col+offset+2*8)); // save y2 - paddsw_r2r (mm1, mm5); // mm5 = a0+b0 + movq_r2m (mm3, *(col+offset+2*8)); /* save y2 */ + paddsw_r2r (mm1, mm5); /* mm5 = a0+b0 */ - movq_m2r (scratch0, mm4); // mm4 = b3 - psubsw_r2r (mm1, mm7); // mm7 = a0-b0 + movq_m2r (scratch0, mm4); /* mm4 = b3 */ + psubsw_r2r (mm1, mm7); /* mm7 = a0-b0 */ - psraw_i2r (COL_SHIFT, mm5); // mm5 = y0 - movq_r2r (mm0, mm3); // mm3 = a3 + psraw_i2r (COL_SHIFT, mm5); /* mm5 = y0 */ + movq_r2r (mm0, mm3); /* mm3 = a3 */ - movq_r2m (mm2, *(col+offset+5*8)); // save y5 - psubsw_r2r (mm4, mm3); // mm3 = a3-b3 + movq_r2m (mm2, *(col+offset+5*8)); /* save y5 */ + psubsw_r2r (mm4, mm3); /* mm3 = a3-b3 */ - psraw_i2r (COL_SHIFT, mm7); // mm7 = y7 - paddsw_r2r (mm0, mm4); // mm4 = a3+b3 + psraw_i2r (COL_SHIFT, mm7); /* mm7 = y7 */ + paddsw_r2r (mm0, mm4); /* mm4 = a3+b3 */ - movq_r2m (mm5, *(col+offset+0*8)); // save y0 - psraw_i2r (COL_SHIFT, mm3); // mm3 = y4 + movq_r2m (mm5, *(col+offset+0*8)); /* save y0 */ + psraw_i2r (COL_SHIFT, mm3); /* mm3 = y4 */ - movq_r2m (mm6, *(col+offset+6*8)); // save y6 - psraw_i2r (COL_SHIFT, mm4); // mm4 = y3 + movq_r2m (mm6, *(col+offset+6*8)); /* save y6 */ + psraw_i2r (COL_SHIFT, mm4); /* mm4 = y3 */ - movq_r2m (mm7, *(col+offset+7*8)); // save y7 + movq_r2m (mm7, *(col+offset+7*8)); /* save y7 */ - movq_r2m (mm3, *(col+offset+4*8)); // save y4 + movq_r2m (mm3, *(col+offset+4*8)); /* save y4 */ - movq_r2m (mm4, *(col+offset+3*8)); // save y3 + movq_r2m (mm4, *(col+offset+3*8)); /* save y3 */ } @@ -334,17 +334,17 @@ static s32 rounder0[] ATTR_ALIGN(8) = rounder ((1 << (COL_SHIFT - 1)) - 0.5); static s32 rounder4[] ATTR_ALIGN(8) = rounder (0); static s32 rounder1[] ATTR_ALIGN(8) = - rounder (1.25683487303); // C1*(C1/C4+C1+C7)/2 + rounder (1.25683487303); /* C1*(C1/C4+C1+C7)/2 */ static s32 rounder7[] ATTR_ALIGN(8) = - rounder (-0.25); // C1*(C7/C4+C7-C1)/2 + rounder (-0.25); /* C1*(C7/C4+C7-C1)/2 */ static s32 rounder2[] ATTR_ALIGN(8) = - rounder (0.60355339059); // C2 * (C6+C2)/2 + rounder (0.60355339059); /* C2 * (C6+C2)/2 */ static s32 rounder6[] ATTR_ALIGN(8) = - rounder (-0.25); // C2 * (C6-C2)/2 + rounder (-0.25); /* C2 * (C6-C2)/2 */ static s32 rounder3[] ATTR_ALIGN(8) = - rounder (0.087788325588); // C3*(-C3/C4+C3+C5)/2 + rounder (0.087788325588); /* C3*(-C3/C4+C3+C5)/2 */ static s32 rounder5[] ATTR_ALIGN(8) = - rounder (-0.441341716183); // C3*(-C5/C4+C5-C3)/2 + rounder (-0.441341716183); /* C3*(-C5/C4+C5-C3)/2 */ static void IDCT( dctelem_t * p_block ) { diff --git a/modules/codec/mpeg_video/motion/motion.c b/modules/codec/mpeg_video/motion/motion.c index 8d3603d153..b53c6c7936 100644 --- a/modules/codec/mpeg_video/motion/motion.c +++ b/modules/codec/mpeg_video/motion/motion.c @@ -2,7 +2,7 @@ * motion.c : C motion compensation module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: motion.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: motion.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Aaron Holtzman * Michel Lespinasse @@ -60,7 +60,7 @@ vlc_module_end(); #define put(predictor,i) dest[i] = predictor (i) #define avg(predictor,i) dest[i] = avg2 (predictor (i), dest[i]) -// mc function template +/* mc function template */ #define MC_FUNC(op,xy) \ static void MC_##op##_##xy##16_c (yuv_data_t * dest, yuv_data_t * ref, \ @@ -104,7 +104,7 @@ static void MC_##op##_##xy##8_c (yuv_data_t * dest, yuv_data_t * ref, \ } while (--height); \ } -// definitions of the actual mc functions +/* definitions of the actual mc functions */ MC_FUNC (put,o) MC_FUNC (avg,o) diff --git a/modules/codec/mpeg_video/motion/motionmmx.c b/modules/codec/mpeg_video/motion/motionmmx.c index 097fa3e61b..72a53d2cdd 100644 --- a/modules/codec/mpeg_video/motion/motionmmx.c +++ b/modules/codec/mpeg_video/motion/motionmmx.c @@ -2,7 +2,7 @@ * motionmmx.c : MMX motion compensation module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: motionmmx.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: motionmmx.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Aaron Holtzman * Michel Lespinasse @@ -53,7 +53,7 @@ vlc_module_end(); * Motion compensation in MMX *****************************************************************************/ -// some rounding constants +/* some rounding constants */ mmx_t round1 = {0x0001000100010001LL}; mmx_t round4 = {0x0002000200020002LL}; @@ -67,25 +67,25 @@ mmx_t round4 = {0x0002000200020002LL}; static inline void mmx_zero_reg () { - // load 0 into mm0 + /* load 0 into mm0 */ pxor_r2r (mm0, mm0); } static inline void mmx_average_2_U8 (yuv_data_t * dest, yuv_data_t * src1, yuv_data_t * src2) { - // - // *dest = (*src1 + *src2 + 1)/ 2; - // + /* + * *dest = (*src1 + *src2 + 1)/ 2; + */ static mmx_t mask1 = {0x0101010101010101LL}; static mmx_t mask7f = {0x7f7f7f7f7f7f7f7fLL}; - movq_m2r (*src1, mm1); // load 8 src1 bytes + movq_m2r (*src1, mm1); /* load 8 src1 bytes */ movq_r2r (mm1, mm2); psrlq_i2r (1, mm1); pand_m2r (mask7f, mm1); - movq_m2r (*src2, mm3); // load 8 src2 bytes + movq_m2r (*src2, mm3); /* load 8 src2 bytes */ por_r2r (mm3, mm2); psrlq_i2r (1, mm3); pand_m2r (mask7f, mm3); @@ -93,179 +93,179 @@ static inline void mmx_average_2_U8 (yuv_data_t * dest, paddb_r2r (mm1, mm3); pand_m2r (mask1, mm2); paddb_r2r (mm3, mm2); - movq_r2m (mm2, *dest); // store result in dest + movq_r2m (mm2, *dest); /* store result in dest */ } static inline void mmx_interp_average_2_U8 (yuv_data_t * dest, yuv_data_t * src1, yuv_data_t * src2) { - // - // *dest = (*dest + (*src1 + *src2 + 1)/ 2 + 1)/ 2; - // + /* + * *dest = (*dest + (*src1 + *src2 + 1)/ 2 + 1)/ 2; + */ - movq_m2r (*dest, mm1); // load 8 dest bytes - movq_r2r (mm1, mm2); // copy 8 dest bytes + movq_m2r (*dest, mm1); /* load 8 dest bytes */ + movq_r2r (mm1, mm2); /* copy 8 dest bytes */ - movq_m2r (*src1, mm3); // load 8 src1 bytes - movq_r2r (mm3, mm4); // copy 8 src1 bytes + movq_m2r (*src1, mm3); /* load 8 src1 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src1 bytes */ - movq_m2r (*src2, mm5); // load 8 src2 bytes - movq_r2r (mm5, mm6); // copy 8 src2 bytes + movq_m2r (*src2, mm5); /* load 8 src2 bytes */ + movq_r2r (mm5, mm6); /* copy 8 src2 bytes */ - punpcklbw_r2r (mm0, mm1); // unpack low dest bytes - punpckhbw_r2r (mm0, mm2); // unpack high dest bytes + punpcklbw_r2r (mm0, mm1); /* unpack low dest bytes */ + punpckhbw_r2r (mm0, mm2); /* unpack high dest bytes */ - punpcklbw_r2r (mm0, mm3); // unpack low src1 bytes - punpckhbw_r2r (mm0, mm4); // unpack high src1 bytes + punpcklbw_r2r (mm0, mm3); /* unpack low src1 bytes */ + punpckhbw_r2r (mm0, mm4); /* unpack high src1 bytes */ - punpcklbw_r2r (mm0, mm5); // unpack low src2 bytes - punpckhbw_r2r (mm0, mm6); // unpack high src2 bytes + punpcklbw_r2r (mm0, mm5); /* unpack low src2 bytes */ + punpckhbw_r2r (mm0, mm6); /* unpack high src2 bytes */ - paddw_r2r (mm5, mm3); // add lows + paddw_r2r (mm5, mm3); /* add lows */ paddw_m2r (round1, mm3); - psraw_i2r (1, mm3); // /2 + psraw_i2r (1, mm3); /* /2 */ - paddw_r2r (mm6, mm4); // add highs + paddw_r2r (mm6, mm4); /* add highs */ paddw_m2r (round1, mm4); - psraw_i2r (1, mm4); // /2 + psraw_i2r (1, mm4); /* /2 */ - paddw_r2r (mm3, mm1); // add lows + paddw_r2r (mm3, mm1); /* add lows */ paddw_m2r (round1, mm1); - psraw_i2r (1, mm1); // /2 + psraw_i2r (1, mm1); /* /2 */ - paddw_r2r (mm4, mm2); // add highs + paddw_r2r (mm4, mm2); /* add highs */ paddw_m2r (round1, mm2); - psraw_i2r (1, mm2); // /2 + psraw_i2r (1, mm2); /* /2 */ - packuswb_r2r (mm2, mm1); // pack (w/ saturation) - movq_r2m (mm1, *dest); // store result in dest + packuswb_r2r (mm2, mm1); /* pack (w/ saturation) */ + movq_r2m (mm1, *dest); /* store result in dest */ } static inline void mmx_average_4_U8 (yuv_data_t * dest, yuv_data_t * src1, yuv_data_t * src2, yuv_data_t * src3, yuv_data_t * src4) { - // - // *dest = (*src1 + *src2 + *src3 + *src4 + 2)/ 4; - // + /* + * *dest = (*src1 + *src2 + *src3 + *src4 + 2)/ 4; + */ - movq_m2r (*src1, mm1); // load 8 src1 bytes - movq_r2r (mm1, mm2); // copy 8 src1 bytes + movq_m2r (*src1, mm1); /* load 8 src1 bytes */ + movq_r2r (mm1, mm2); /* copy 8 src1 bytes */ - punpcklbw_r2r (mm0, mm1); // unpack low src1 bytes - punpckhbw_r2r (mm0, mm2); // unpack high src1 bytes + punpcklbw_r2r (mm0, mm1); /* unpack low src1 bytes */ + punpckhbw_r2r (mm0, mm2); /* unpack high src1 bytes */ - movq_m2r (*src2, mm3); // load 8 src2 bytes - movq_r2r (mm3, mm4); // copy 8 src2 bytes + movq_m2r (*src2, mm3); /* load 8 src2 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src2 bytes */ - punpcklbw_r2r (mm0, mm3); // unpack low src2 bytes - punpckhbw_r2r (mm0, mm4); // unpack high src2 bytes + punpcklbw_r2r (mm0, mm3); /* unpack low src2 bytes */ + punpckhbw_r2r (mm0, mm4); /* unpack high src2 bytes */ - paddw_r2r (mm3, mm1); // add lows - paddw_r2r (mm4, mm2); // add highs + paddw_r2r (mm3, mm1); /* add lows */ + paddw_r2r (mm4, mm2); /* add highs */ - // now have partials in mm1 and mm2 + /* now have partials in mm1 and mm2 */ - movq_m2r (*src3, mm3); // load 8 src3 bytes - movq_r2r (mm3, mm4); // copy 8 src3 bytes + movq_m2r (*src3, mm3); /* load 8 src3 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src3 bytes */ - punpcklbw_r2r (mm0, mm3); // unpack low src3 bytes - punpckhbw_r2r (mm0, mm4); // unpack high src3 bytes + punpcklbw_r2r (mm0, mm3); /* unpack low src3 bytes */ + punpckhbw_r2r (mm0, mm4); /* unpack high src3 bytes */ - paddw_r2r (mm3, mm1); // add lows - paddw_r2r (mm4, mm2); // add highs + paddw_r2r (mm3, mm1); /* add lows */ + paddw_r2r (mm4, mm2); /* add highs */ - movq_m2r (*src4, mm5); // load 8 src4 bytes - movq_r2r (mm5, mm6); // copy 8 src4 bytes + movq_m2r (*src4, mm5); /* load 8 src4 bytes */ + movq_r2r (mm5, mm6); /* copy 8 src4 bytes */ - punpcklbw_r2r (mm0, mm5); // unpack low src4 bytes - punpckhbw_r2r (mm0, mm6); // unpack high src4 bytes + punpcklbw_r2r (mm0, mm5); /* unpack low src4 bytes */ + punpckhbw_r2r (mm0, mm6); /* unpack high src4 bytes */ - paddw_r2r (mm5, mm1); // add lows - paddw_r2r (mm6, mm2); // add highs + paddw_r2r (mm5, mm1); /* add lows */ + paddw_r2r (mm6, mm2); /* add highs */ - // now have subtotal in mm1 and mm2 + /* now have subtotal in mm1 and mm2 */ paddw_m2r (round4, mm1); - psraw_i2r (2, mm1); // /4 + psraw_i2r (2, mm1); /* /4 */ paddw_m2r (round4, mm2); - psraw_i2r (2, mm2); // /4 + psraw_i2r (2, mm2); /* /4 */ - packuswb_r2r (mm2, mm1); // pack (w/ saturation) - movq_r2m (mm1, *dest); // store result in dest + packuswb_r2r (mm2, mm1); /* pack (w/ saturation) */ + movq_r2m (mm1, *dest); /* store result in dest */ } static inline void mmx_interp_average_4_U8 (yuv_data_t * dest, yuv_data_t * src1, yuv_data_t * src2, yuv_data_t * src3, yuv_data_t * src4) { - // - // *dest = (*dest + (*src1 + *src2 + *src3 + *src4 + 2)/ 4 + 1)/ 2; - // + /* + * *dest = (*dest + (*src1 + *src2 + *src3 + *src4 + 2)/ 4 + 1)/ 2; + */ - movq_m2r (*src1, mm1); // load 8 src1 bytes - movq_r2r (mm1, mm2); // copy 8 src1 bytes + movq_m2r (*src1, mm1); /* load 8 src1 bytes */ + movq_r2r (mm1, mm2); /* copy 8 src1 bytes */ - punpcklbw_r2r (mm0, mm1); // unpack low src1 bytes - punpckhbw_r2r (mm0, mm2); // unpack high src1 bytes + punpcklbw_r2r (mm0, mm1); /* unpack low src1 bytes */ + punpckhbw_r2r (mm0, mm2); /* unpack high src1 bytes */ - movq_m2r (*src2, mm3); // load 8 src2 bytes - movq_r2r (mm3, mm4); // copy 8 src2 bytes + movq_m2r (*src2, mm3); /* load 8 src2 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src2 bytes */ - punpcklbw_r2r (mm0, mm3); // unpack low src2 bytes - punpckhbw_r2r (mm0, mm4); // unpack high src2 bytes + punpcklbw_r2r (mm0, mm3); /* unpack low src2 bytes */ + punpckhbw_r2r (mm0, mm4); /* unpack high src2 bytes */ - paddw_r2r (mm3, mm1); // add lows - paddw_r2r (mm4, mm2); // add highs + paddw_r2r (mm3, mm1); /* add lows */ + paddw_r2r (mm4, mm2); /* add highs */ - // now have partials in mm1 and mm2 + /* now have partials in mm1 and mm2 */ - movq_m2r (*src3, mm3); // load 8 src3 bytes - movq_r2r (mm3, mm4); // copy 8 src3 bytes + movq_m2r (*src3, mm3); /* load 8 src3 bytes */ + movq_r2r (mm3, mm4); /* copy 8 src3 bytes */ - punpcklbw_r2r (mm0, mm3); // unpack low src3 bytes - punpckhbw_r2r (mm0, mm4); // unpack high src3 bytes + punpcklbw_r2r (mm0, mm3); /* unpack low src3 bytes */ + punpckhbw_r2r (mm0, mm4); /* unpack high src3 bytes */ - paddw_r2r (mm3, mm1); // add lows - paddw_r2r (mm4, mm2); // add highs + paddw_r2r (mm3, mm1); /* add lows */ + paddw_r2r (mm4, mm2); /* add highs */ - movq_m2r (*src4, mm5); // load 8 src4 bytes - movq_r2r (mm5, mm6); // copy 8 src4 bytes + movq_m2r (*src4, mm5); /* load 8 src4 bytes */ + movq_r2r (mm5, mm6); /* copy 8 src4 bytes */ - punpcklbw_r2r (mm0, mm5); // unpack low src4 bytes - punpckhbw_r2r (mm0, mm6); // unpack high src4 bytes + punpcklbw_r2r (mm0, mm5); /* unpack low src4 bytes */ + punpckhbw_r2r (mm0, mm6); /* unpack high src4 bytes */ - paddw_r2r (mm5, mm1); // add lows - paddw_r2r (mm6, mm2); // add highs + paddw_r2r (mm5, mm1); /* add lows */ + paddw_r2r (mm6, mm2); /* add highs */ paddw_m2r (round4, mm1); - psraw_i2r (2, mm1); // /4 + psraw_i2r (2, mm1); /* /4 */ paddw_m2r (round4, mm2); - psraw_i2r (2, mm2); // /4 + psraw_i2r (2, mm2); /* /4 */ - // now have subtotal/4 in mm1 and mm2 + /* now have subtotal/4 in mm1 and mm2 */ - movq_m2r (*dest, mm3); // load 8 dest bytes - movq_r2r (mm3, mm4); // copy 8 dest bytes + movq_m2r (*dest, mm3); /* load 8 dest bytes */ + movq_r2r (mm3, mm4); /* copy 8 dest bytes */ - punpcklbw_r2r (mm0, mm3); // unpack low dest bytes - punpckhbw_r2r (mm0, mm4); // unpack high dest bytes + punpcklbw_r2r (mm0, mm3); /* unpack low dest bytes */ + punpckhbw_r2r (mm0, mm4); /* unpack high dest bytes */ - paddw_r2r (mm3, mm1); // add lows - paddw_r2r (mm4, mm2); // add highs + paddw_r2r (mm3, mm1); /* add lows */ + paddw_r2r (mm4, mm2); /* add highs */ paddw_m2r (round1, mm1); - psraw_i2r (1, mm1); // /2 + psraw_i2r (1, mm1); /* /2 */ paddw_m2r (round1, mm2); - psraw_i2r (1, mm2); // /2 + psraw_i2r (1, mm2); /* /2 */ - // now have end value in mm1 and mm2 + /* now have end value in mm1 and mm2 */ - packuswb_r2r (mm2, mm1); // pack (w/ saturation) - movq_r2m (mm1,*dest); // store result in dest + packuswb_r2r (mm2, mm1); /* pack (w/ saturation) */ + movq_r2m (mm1,*dest); /* store result in dest */ } -//----------------------------------------------------------------------- +/*-----------------------------------------------------------------------*/ static inline void MC_avg_mmx (int width, int height, yuv_data_t * dest, yuv_data_t * ref, int stride) @@ -295,7 +295,7 @@ static void MC_avg_8_mmx (yuv_data_t * dest, yuv_data_t * ref, MC_avg_mmx (8, height, dest, ref, stride); } -//----------------------------------------------------------------------- +/*-----------------------------------------------------------------------*/ static inline void MC_put_mmx (int width, int height, yuv_data_t * dest, yuv_data_t * ref, int stride) @@ -303,13 +303,13 @@ static inline void MC_put_mmx (int width, int height, mmx_zero_reg (); do { - movq_m2r (* ref, mm1); // load 8 ref bytes - movq_r2m (mm1,* dest); // store 8 bytes at curr + movq_m2r (* ref, mm1); /* load 8 ref bytes */ + movq_r2m (mm1,* dest); /* store 8 bytes at curr */ if (width == 16) { - movq_m2r (* (ref+8), mm1); // load 8 ref bytes - movq_r2m (mm1,* (dest+8)); // store 8 bytes at curr + movq_m2r (* (ref+8), mm1); /* load 8 ref bytes */ + movq_r2m (mm1,* (dest+8)); /* store 8 bytes at curr */ } dest += stride; @@ -329,9 +329,9 @@ static void MC_put_8_mmx (yuv_data_t * dest, yuv_data_t * ref, MC_put_mmx (8, height, dest, ref, stride); } -//----------------------------------------------------------------------- +/*-----------------------------------------------------------------------*/ -// Half pixel interpolation in the x direction +/* Half pixel interpolation in the x direction */ static inline void MC_avg_x_mmx (int width, int height, yuv_data_t * dest, yuv_data_t * ref, int stride) { @@ -360,7 +360,7 @@ static void MC_avg_x8_mmx (yuv_data_t * dest, yuv_data_t * ref, MC_avg_x_mmx (8, height, dest, ref, stride); } -//----------------------------------------------------------------------- +/*-----------------------------------------------------------------------*/ static inline void MC_put_x_mmx (int width, int height, yuv_data_t * dest, yuv_data_t * ref, int stride) @@ -390,7 +390,7 @@ static void MC_put_x8_mmx (yuv_data_t * dest, yuv_data_t * ref, MC_put_x_mmx (8, height, dest, ref, stride); } -//----------------------------------------------------------------------- +/*-----------------------------------------------------------------------*/ static inline void MC_avg_xy_8wide_mmx (int height, yuv_data_t * dest, yuv_data_t * ref, int stride) @@ -398,7 +398,7 @@ static inline void MC_avg_xy_8wide_mmx (int height, yuv_data_t * dest, pxor_r2r (mm0, mm0); movq_m2r (round4, mm7); - movq_m2r (*ref, mm1); // calculate first row ref[0] + ref[1] + movq_m2r (*ref, mm1); /* calculate first row ref[0] + ref[1] */ movq_r2r (mm1, mm2); punpcklbw_r2r (mm0, mm1); @@ -417,7 +417,7 @@ static inline void MC_avg_xy_8wide_mmx (int height, yuv_data_t * dest, do { - movq_m2r (*ref, mm5); // calculate next row ref[0] + ref[1] + movq_m2r (*ref, mm5); /* calculate next row ref[0] + ref[1] */ movq_r2r (mm5, mm6); punpcklbw_r2r (mm0, mm5); @@ -432,7 +432,7 @@ static inline void MC_avg_xy_8wide_mmx (int height, yuv_data_t * dest, paddw_r2r (mm3, mm5); paddw_r2r (mm4, mm6); - movq_r2r (mm7, mm3); // calculate round4 + previous row + current row + movq_r2r (mm7, mm3); /* calculate round4 + previous row + current row */ movq_r2r (mm7, mm4); paddw_r2r (mm1, mm3); @@ -441,10 +441,10 @@ static inline void MC_avg_xy_8wide_mmx (int height, yuv_data_t * dest, paddw_r2r (mm5, mm3); paddw_r2r (mm6, mm4); - psraw_i2r (2, mm3); // /4 - psraw_i2r (2, mm4); // /4 + psraw_i2r (2, mm3); /* /4 */ + psraw_i2r (2, mm4); /* /4 */ - movq_m2r (*dest, mm1); // calculate (subtotal + dest[0] + round1) / 2 + movq_m2r (*dest, mm1); /* calculate (subtotal + dest[0] + round1) / 2 */ movq_r2r (mm1, mm2); punpcklbw_r2r (mm0, mm1); @@ -456,13 +456,13 @@ static inline void MC_avg_xy_8wide_mmx (int height, yuv_data_t * dest, paddw_m2r (round1, mm3); paddw_m2r (round1, mm4); - psraw_i2r (1, mm3); // /2 - psraw_i2r (1, mm4); // /2 + psraw_i2r (1, mm3); /* /2 */ + psraw_i2r (1, mm4); /* /2 */ - packuswb_r2r (mm4, mm3); // pack (w/ saturation) - movq_r2m (mm3, *dest); // store result in dest + packuswb_r2r (mm4, mm3); /* pack (w/ saturation) */ + movq_r2m (mm3, *dest); /* store result in dest */ - movq_r2r (mm5, mm1); // remember current row for the next pass + movq_r2r (mm5, mm1); /* remember current row for the next pass */ movq_r2r (mm6, mm2); ref += stride; @@ -484,7 +484,7 @@ static void MC_avg_xy8_mmx (yuv_data_t * dest, yuv_data_t * ref, MC_avg_xy_8wide_mmx(height, dest, ref, stride); } -//----------------------------------------------------------------------- +/*-----------------------------------------------------------------------*/ static inline void MC_put_xy_8wide_mmx (int height, yuv_data_t * dest, yuv_data_t * ref, int stride) @@ -492,7 +492,7 @@ static inline void MC_put_xy_8wide_mmx (int height, yuv_data_t * dest, pxor_r2r (mm0, mm0); movq_m2r (round4, mm7); - movq_m2r (*ref, mm1); // calculate first row ref[0] + ref[1] + movq_m2r (*ref, mm1); /* calculate first row ref[0] + ref[1] */ movq_r2r (mm1, mm2); punpcklbw_r2r (mm0, mm1); @@ -511,7 +511,7 @@ static inline void MC_put_xy_8wide_mmx (int height, yuv_data_t * dest, do { - movq_m2r (*ref, mm5); // calculate next row ref[0] + ref[1] + movq_m2r (*ref, mm5); /* calculate next row ref[0] + ref[1] */ movq_r2r (mm5, mm6); punpcklbw_r2r (mm0, mm5); @@ -526,7 +526,7 @@ static inline void MC_put_xy_8wide_mmx (int height, yuv_data_t * dest, paddw_r2r (mm3, mm5); paddw_r2r (mm4, mm6); - movq_r2r (mm7, mm3); // calculate round4 + previous row + current row + movq_r2r (mm7, mm3); /* calculate round4 + previous row + current row */ movq_r2r (mm7, mm4); paddw_r2r (mm1, mm3); @@ -535,13 +535,13 @@ static inline void MC_put_xy_8wide_mmx (int height, yuv_data_t * dest, paddw_r2r (mm5, mm3); paddw_r2r (mm6, mm4); - psraw_i2r (2, mm3); // /4 - psraw_i2r (2, mm4); // /4 + psraw_i2r (2, mm3); /* /4 */ + psraw_i2r (2, mm4); /* /4 */ - packuswb_r2r (mm4, mm3); // pack (w/ saturation) - movq_r2m (mm3, *dest); // store result in dest + packuswb_r2r (mm4, mm3); /* pack (w/ saturation) */ + movq_r2m (mm3, *dest); /* store result in dest */ - movq_r2r (mm5, mm1); // advance to the next row + movq_r2r (mm5, mm1); /* advance to the next row */ movq_r2r (mm6, mm2); ref += stride; @@ -563,7 +563,7 @@ static void MC_put_xy8_mmx (yuv_data_t * dest, yuv_data_t * ref, MC_put_xy_8wide_mmx(height, dest, ref, stride); } -//----------------------------------------------------------------------- +/*-----------------------------------------------------------------------*/ static inline void MC_avg_y_mmx (int width, int height, yuv_data_t * dest, yuv_data_t * ref, int stride) @@ -596,7 +596,7 @@ static void MC_avg_y8_mmx (yuv_data_t * dest, yuv_data_t * ref, MC_avg_y_mmx (8, height, dest, ref, stride); } -//----------------------------------------------------------------------- +/*-----------------------------------------------------------------------*/ static inline void MC_put_y_mmx (int width, int height, yuv_data_t * dest, yuv_data_t * ref, int stride) diff --git a/modules/codec/mpeg_video/motion/motionmmxext.c b/modules/codec/mpeg_video/motion/motionmmxext.c index a33b63a135..93dc5d2968 100644 --- a/modules/codec/mpeg_video/motion/motionmmxext.c +++ b/modules/codec/mpeg_video/motion/motionmmxext.c @@ -2,7 +2,7 @@ * motionmmxext.c : MMX EXT motion compensation module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: motionmmxext.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: motionmmxext.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Aaron Holtzman * Michel Lespinasse @@ -56,7 +56,7 @@ vlc_module_end(); #define CPU_3DNOW 1 -//CPU_MMXEXT/CPU_3DNOW adaptation layer +/* CPU_MMXEXT/CPU_3DNOW adaptation layer */ #define pavg_r2r(src,dest) \ do { \ @@ -75,7 +75,7 @@ do { \ } while (0) -//CPU_MMXEXT code +/* CPU_MMXEXT code */ static inline void MC_put1_8 (int height, yuv_data_t * dest, yuv_data_t * ref, @@ -222,8 +222,8 @@ static inline void MC_put4_8 (int height, yuv_data_t * dest, yuv_data_t * ref, movq_r2m (mm0, *dest); dest += stride; - movq_r2r (mm6, mm7); // unroll ! - movq_r2r (mm2, mm0); // unroll ! + movq_r2r (mm6, mm7); /* unroll ! */ + movq_r2r (mm2, mm0); /* unroll ! */ } while (--height); } diff --git a/modules/codec/spdif/spdif.c b/modules/codec/spdif/spdif.c index 353a7bc4c8..1aadb2abf0 100644 --- a/modules/codec/spdif/spdif.c +++ b/modules/codec/spdif/spdif.c @@ -2,7 +2,7 @@ * spdif.c: A52 pass-through to external decoder with enabled soundcard ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: spdif.c,v 1.1 2002/08/04 17:23:42 sam Exp $ + * $Id: spdif.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Stéphane Borel * Juha Yrjola @@ -195,7 +195,7 @@ static int RunDecoder( decoder_fifo_t *p_fifo ) i_current_pts += i_frame_time; } - // wait a little to avoid an input flood from the a52 input + /* wait a little to avoid an input flood from the a52 input */ mwait( i_current_pts - 500000 ); vlc_mutex_lock (&p_spdif->p_aout_fifo->data_lock); diff --git a/modules/demux/mpeg/audio.c b/modules/demux/mpeg/audio.c index 4240897d97..55a6b0a9ef 100644 --- a/modules/demux/mpeg/audio.c +++ b/modules/demux/mpeg/audio.c @@ -2,7 +2,7 @@ * mpeg_audio.c : mpeg_audio Stream input module for vlc ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: audio.c,v 1.2 2002/08/07 00:29:36 sam Exp $ + * $Id: audio.c,v 1.3 2002/08/08 00:35:11 sam Exp $ * * Authors: Laurent Aimar * @@ -272,7 +272,7 @@ static int MPEGAudio_SkipID3Tag( input_thread_t *p_input ) i_size = (p_peek[6] << 21) + (p_peek[7] << 14) + (p_peek[8] << 7) + - p_peek[9]; //Is this safe? + p_peek[9]; /* Is this safe? */ if ( b_footer ) { i_size += 10; @@ -285,7 +285,7 @@ static int MPEGAudio_SkipID3Tag( input_thread_t *p_input ) return( -1 ); } - p_input->p_current_data += i_size; //seek passed end of ID3 tag + p_input->p_current_data += i_size; /* seek passed end of ID3 tag */ return (0); } diff --git a/modules/gui/win32/win32_common.h b/modules/gui/win32/win32_common.h index 63f956c1d3..e71fabd797 100644 --- a/modules/gui/win32/win32_common.h +++ b/modules/gui/win32/win32_common.h @@ -29,8 +29,6 @@ #include "playlist.h" #include "preferences.h" -VLC_DECLARE_STRUCT(es_descriptor_t) - /***************************************************************************** * The TrackBar is graduated from 0 to SLIDER_MAX_VALUE. * SLIDER_MAX_VALUE is set to the higher acceptable value (2^31 - 1), in order diff --git a/modules/misc/memcpy/fastmemcpy.h b/modules/misc/memcpy/fastmemcpy.h index 07068e98d7..d65ca2d2db 100644 --- a/modules/misc/memcpy/fastmemcpy.h +++ b/modules/misc/memcpy/fastmemcpy.h @@ -1,7 +1,7 @@ /***************************************************************************** * fastmemcpy.h : fast memcpy routines ***************************************************************************** - * $Id: fastmemcpy.h,v 1.1 2002/08/04 17:23:43 sam Exp $ + * $Id: fastmemcpy.h,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: various Linux kernel hackers * various MPlayer hackers @@ -29,9 +29,9 @@ #define BLOCK_SIZE 4096 #define CONFUSION_FACTOR 0 -//Feel free to fine-tune the above 2, it might be possible to get some speedup with them :) +/*Feel free to fine-tune the above 2, it might be possible to get some speedup with them :)*/ -//#define STATISTICS +/*#define STATISTICS*/ #ifndef HAVE_SSE2 /* @@ -90,8 +90,8 @@ data. If you have questions please contact with me: Nick Kurshev: nickols_k@mail.ru. */ -// 3dnow memcpy support from kernel 2.4.2 -// by Pontscho/fresh!mindworkz +/* 3dnow memcpy support from kernel 2.4.2 */ +/* by Pontscho/fresh!mindworkz */ #if defined( HAVE_MMX2 ) || defined( HAVE_3DNOW ) || defined( HAVE_MMX ) @@ -128,7 +128,7 @@ __asm__ __volatile__(\ #ifdef HAVE_SSE #define MMREG_SIZE 16 #else -#define MMREG_SIZE 64 //8 +#define MMREG_SIZE 64 /*8*/ #endif /* Small defines (for readability only) ;) */ @@ -245,7 +245,7 @@ void * fast_memcpy(void * to, const void * from, size_t len) ((unsigned char *)to)+=64; } #else - // Align destination at BLOCK_SIZE boundary + /* Align destination at BLOCK_SIZE boundary */ for(; ((int)to & (BLOCK_SIZE-1)) && i>0; i--) { __asm__ __volatile__ ( @@ -269,12 +269,12 @@ void * fast_memcpy(void * to, const void * from, size_t len) MOVNTQ" %%mm6, 48(%1)\n" MOVNTQ" %%mm7, 56(%1)\n" :: "r" (from), "r" (to) : "memory"); - ((const unsigned char *)from)+=64; - ((unsigned char *)to)+=64; + from = (const void *) (((const unsigned char *)from)+64); + to = (void *) (((unsigned char *)to)+64); } -// printf(" %d %d\n", (int)from&1023, (int)to&1023); - // Pure Assembly cuz gcc is a bit unpredictable ;) +/* printf(" %d %d\n", (int)from&1023, (int)to&1023); */ + /* Pure Assembly cuz gcc is a bit unpredictable ;) */ # if 0 if(i>=BLOCK_SIZE/64) asm volatile( @@ -314,7 +314,7 @@ void * fast_memcpy(void * to, const void * from, size_t len) "jb 2b \n\t" #if CONFUSION_FACTOR > 0 - // a few percent speedup on out of order executing CPUs + /* a few percent speedup on out of order executing CPUs */ "movl %5, %%eax \n\t" "2: \n\t" "movl (%0), %%ebx \n\t" @@ -360,8 +360,8 @@ void * fast_memcpy(void * to, const void * from, size_t len) MOVNTQ" %%mm6, 48(%1)\n" MOVNTQ" %%mm7, 56(%1)\n" :: "r" (from), "r" (to) : "memory"); - ((const unsigned char *)from)+=64; - ((unsigned char *)to)+=64; + from = (const void *) (((const unsigned char *)from)+64); + to = (void *) (((unsigned char *)to)+64); } #endif /* Have SSE */ diff --git a/modules/misc/network/ipv4.c b/modules/misc/network/ipv4.c index 83ba7cde0b..7c5188f249 100644 --- a/modules/misc/network/ipv4.c +++ b/modules/misc/network/ipv4.c @@ -2,7 +2,7 @@ * ipv4.c: IPv4 network abstraction layer ***************************************************************************** * Copyright (C) 2001, 2002 VideoLAN - * $Id: ipv4.c,v 1.1 2002/08/04 17:23:43 sam Exp $ + * $Id: ipv4.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Christophe Massiot * Mathias Kretschmer @@ -100,7 +100,6 @@ static int BuildAddr( struct sockaddr_in * p_socket, /* We have a fqdn, try to find its address */ if ( (p_hostent = gethostbyname( psz_address )) == NULL ) { -//X intf_ErrMsg( "BuildLocalAddr: unknown host %s", psz_address ); return( -1 ); } diff --git a/modules/misc/network/ipv6.c b/modules/misc/network/ipv6.c index e2323bde6e..e76b52a95b 100644 --- a/modules/misc/network/ipv6.c +++ b/modules/misc/network/ipv6.c @@ -2,7 +2,7 @@ * ipv6.c: IPv6 network abstraction layer ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: ipv6.c,v 1.1 2002/08/04 17:23:43 sam Exp $ + * $Id: ipv6.c,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Alexis Guillard * Christophe Massiot @@ -111,7 +111,7 @@ static int BuildAddr( struct sockaddr_in6 * p_socket, } if( !_getaddrinfo || !_freeaddrinfo ) { -//X msg_Err( p_this, "no IPv6 stack installed" ); + /* msg_Err( p_this, "no IPv6 stack installed" ); */ if( wship6_dll ) FreeLibrary( wship6_dll ); return( -1 ); } @@ -134,17 +134,20 @@ static int BuildAddr( struct sockaddr_in6 * p_socket, { *psz_multicast_interface = '\0'; psz_multicast_interface++; -//X msg_Dbg( p_this, "Interface name specified: \"%s\"", -// psz_multicast_interface ); +#if 0 + msg_Dbg( p_this, "Interface name specified: \"%s\"", + psz_multicast_interface ); +#endif /* now convert that interface name to an index */ #if !defined( WIN32 ) p_socket->sin6_scope_id = if_nametoindex(psz_multicast_interface); #else /* FIXME: for now we always use the default interface */ p_socket->sin6_scope_id = 0; -//X msg_Warn( 3, "Using default interface. This has to be FIXED!"); #endif -//X msg_Warn( p_this, " = #%i\n", p_socket->sin6_scope_id ); +#if 0 + msg_Warn( p_this, " = #%i\n", p_socket->sin6_scope_id ); +#endif } psz_address[strlen(psz_address) - 1] = '\0' ; @@ -176,7 +179,9 @@ static int BuildAddr( struct sockaddr_in6 * p_socket, /* We have a fqdn, try to find its address */ if ( (p_hostent = gethostbyname2( psz_address, AF_INET6 )) == NULL ) { -//X intf_ErrMsg( "ipv6 error: unknown host %s", psz_address ); +#if 0 + intf_ErrMsg( "ipv6 error: unknown host %s", psz_address ); +#endif return( -1 ); } @@ -196,7 +201,9 @@ static int BuildAddr( struct sockaddr_in6 * p_socket, _freeaddrinfo( res ); #else -//X intf_ErrMsg( "ipv6 error: IPv6 address %s is invalid", psz_address ); +#if 0 + intf_ErrMsg( "ipv6 error: IPv6 address %s is invalid", psz_address ); +#endif return( -1 ); #endif } @@ -228,14 +235,10 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket ) char * psz_server_addr = p_socket->psz_server_addr; int i_server_port = p_socket->i_server_port; - int i_handle, i_opt, i_opt_size; + int i_handle, i_opt; + unsigned int i_opt_size; struct sockaddr_in6 sock; - if( i_bind_port == 0 ) - { -//X i_bind_port = config_GetInt( "server-port" ); - } - /* Open a SOCK_DGRAM (UDP) socket, in the AF_INET6 domain, automatic (0) * protocol */ if( (i_handle = socket( AF_INET6, SOCK_DGRAM, 0 )) == -1 ) @@ -322,7 +325,7 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket ) if( res == -1 ) { -//X intf_ErrMsg( "ipv6 error: setsockopt JOIN_GROUP failed" ); + msg_Err( p_this, "setsockopt JOIN_GROUP failed" ); } } diff --git a/modules/video_chroma/i420_rgb_mmx.h b/modules/video_chroma/i420_rgb_mmx.h index 252c47c376..d021dd49e0 100644 --- a/modules/video_chroma/i420_rgb_mmx.h +++ b/modules/video_chroma/i420_rgb_mmx.h @@ -2,7 +2,7 @@ * transforms_yuvmmx.h: MMX YUV transformation assembly ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: i420_rgb_mmx.h,v 1.1 2002/08/04 17:23:43 sam Exp $ + * $Id: i420_rgb_mmx.h,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Olie Lho * Gaël Hendryckx @@ -25,21 +25,21 @@ *****************************************************************************/ /* hope these constant values are cache line aligned */ -#define UNUSED_LONGLONG(foo) \ - static const 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; +#define UNUSED_U64(foo) \ + static const u64 foo __asm__ (#foo) __attribute__((unused)) +UNUSED_U64(mmx_80w) = 0x0080008000800080; +UNUSED_U64(mmx_10w) = 0x1010101010101010; +UNUSED_U64(mmx_00ffw) = 0x00ff00ff00ff00ff; +UNUSED_U64(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_U64(mmx_U_green) = 0xf37df37df37df37d; +UNUSED_U64(mmx_U_blue) = 0x4093409340934093; +UNUSED_U64(mmx_V_red) = 0x3312331233123312; +UNUSED_U64(mmx_V_green) = 0xe5fce5fce5fce5fc; -UNUSED_LONGLONG(mmx_mask_f8) = 0xf8f8f8f8f8f8f8f8; -UNUSED_LONGLONG(mmx_mask_fc) = 0xfcfcfcfcfcfcfcfc; -#undef UNUSED_LONGLONG +UNUSED_U64(mmx_mask_f8) = 0xf8f8f8f8f8f8f8f8; +UNUSED_U64(mmx_mask_fc) = 0xfcfcfcfcfcfcfcfc; +#undef UNUSED_U64 #define MMX_INIT_16 " \n\ movd (%1), %%mm0 # Load 4 Cb 00 00 00 00 u3 u2 u1 u0 \n\ diff --git a/modules/video_output/x11/xcommon.h b/modules/video_output/x11/xcommon.h index 179958d3ea..99e60dde2c 100644 --- a/modules/video_output/x11/xcommon.h +++ b/modules/video_output/x11/xcommon.h @@ -2,7 +2,7 @@ * xcommon.h: Defines common to the X11 and XVideo plugins ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: xcommon.h,v 1.1 2002/08/04 17:23:44 sam Exp $ + * $Id: xcommon.h,v 1.2 2002/08/08 00:35:11 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -41,14 +41,12 @@ # define IMAGE_FREE XDestroyImage #endif -VLC_DECLARE_STRUCT(x11_window_t) - /***************************************************************************** * x11_window_t: X11 window descriptor ***************************************************************************** * This structure contains all the data necessary to describe an X11 window. *****************************************************************************/ -struct x11_window_t +typedef struct x11_window_t { Window base_window; /* base window */ Window video_window; /* sub-window for displaying video */ @@ -57,7 +55,8 @@ struct x11_window_t int i_height; /* height of main window */ Atom wm_protocols; Atom wm_delete_window; -}; + +} x11_window_t; /***************************************************************************** * vout_sys_t: video output method descriptor diff --git a/src/audio_output/aout_ext-dec.c b/src/audio_output/aout_ext-dec.c new file mode 100644 index 0000000000..cbdf1c5f58 --- /dev/null +++ b/src/audio_output/aout_ext-dec.c @@ -0,0 +1,194 @@ +/***************************************************************************** + * aout_ext-dec.c : exported fifo management functions + ***************************************************************************** + * Copyright (C) 1999-2001 VideoLAN + * $Id: aout_ext-dec.c,v 1.20 2002/08/08 00:35:11 sam Exp $ + * + * Authors: Michel Kaempf + * Cyril Deguet + * + * 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 /* calloc(), malloc(), free() */ +#include + +#include + +#include "audio_output.h" + +/***************************************************************************** + * aout_CreateFifo + *****************************************************************************/ +aout_fifo_t * __aout_CreateFifo( vlc_object_t *p_this, int i_format, + int i_channels, int i_rate, int i_frame_size, + void *p_buffer ) +{ + aout_thread_t *p_aout; + aout_fifo_t *p_fifo = NULL; + int i_index; + + /* Spawn an audio output if there is none */ + p_aout = vlc_object_find( p_this, VLC_OBJECT_AOUT, FIND_ANYWHERE ); + + if( p_aout ) + { + if( p_aout->fifo[0].i_format != i_format ) + { + msg_Dbg( p_this, "changing aout type" ); + vlc_object_detach_all( p_aout ); + vlc_object_release( p_aout ); + aout_DestroyThread( p_aout ); + p_aout = NULL; + } + } + + if( p_aout == NULL ) + { + msg_Dbg( p_this, "no aout present, spawning one" ); + + p_aout = aout_CreateThread( p_this, i_channels, i_rate ); + /* Everything failed */ + if( p_aout == NULL ) + { + return NULL; + } + } + + /* temporary hack to switch output type (mainly for spdif) + * FIXME: to be adapted when several output are available */ + /* Take the fifos lock */ + vlc_mutex_lock( &p_aout->fifos_lock ); + + /* Look for a free fifo structure */ + for( i_index = 0; i_index < AOUT_MAX_FIFOS; i_index++ ) + { + if( p_aout->fifo[i_index].i_format == AOUT_FIFO_NONE ) + { + p_fifo = &p_aout->fifo[i_index]; + p_fifo->i_fifo = i_index; + break; + } + } + + if( p_fifo == NULL ) + { + msg_Err( p_aout, "no fifo available" ); + vlc_mutex_unlock( &p_aout->fifos_lock ); + return NULL; + } + + /* Initialize the new fifo structure */ + switch ( p_fifo->i_format = i_format ) + { + case AOUT_FIFO_PCM: + case AOUT_FIFO_SPDIF: + p_fifo->b_die = 0; + + p_fifo->i_channels = i_channels; + p_fifo->i_rate = i_rate; + p_fifo->i_frame_size = i_frame_size; + + p_fifo->i_unit_limit = (AOUT_FIFO_SIZE + 1) + * (i_frame_size / i_channels); + + /* Allocate the memory needed to store the audio frames and their + * dates. As the fifo is a rotative fifo, we must be able to find + * out whether the fifo is full or empty, that's why we must in + * fact allocate memory for (AOUT_FIFO_SIZE+1) audio frames. */ + p_fifo->date = malloc( ( sizeof(s16) * i_frame_size + + sizeof(mtime_t) ) + * ( AOUT_FIFO_SIZE + 1 ) ); + if ( p_fifo->date == NULL ) + { + msg_Err( p_aout, "out of memory" ); + p_fifo->i_format = AOUT_FIFO_NONE; + vlc_mutex_unlock( &p_aout->fifos_lock ); + return NULL; + } + + p_fifo->buffer = (u8 *)p_fifo->date + sizeof(mtime_t) + * ( AOUT_FIFO_SIZE + 1 ); + + /* Set the fifo's buffer as empty (the first frame that is to be + * played is also the first frame that is not to be played) */ + p_fifo->i_start_frame = 0; + /* p_fifo->i_next_frame = 0; */ + p_fifo->i_end_frame = 0; + + /* Waiting for the audio decoder to compute enough frames to work + * out the fifo's current rate (as soon as the decoder has decoded + * enough frames, the members of the fifo structure that are not + * initialized now will be calculated) */ + p_fifo->b_start_frame = 0; + p_fifo->b_next_frame = 0; + break; + + default: + msg_Err( p_aout, "unknown fifo type 0x%x", p_fifo->i_format ); + p_fifo->i_format = AOUT_FIFO_NONE; + vlc_mutex_unlock( &p_aout->fifos_lock ); + return NULL; + } + + /* Release the fifos lock */ + vlc_mutex_unlock( &p_aout->fifos_lock ); + + msg_Dbg( p_aout, "fifo #%i allocated, %i channels, rate %li, " + "frame size %i", p_fifo->i_fifo, p_fifo->i_channels, + p_fifo->i_rate, p_fifo->i_frame_size ); + + /* Return the pointer to the fifo structure */ + return p_fifo; +} + +/***************************************************************************** + * aout_DestroyFifo + *****************************************************************************/ +void aout_DestroyFifo( aout_fifo_t * p_fifo ) +{ + vlc_mutex_lock( &p_fifo->data_lock ); + p_fifo->b_die = 1; + vlc_mutex_unlock( &p_fifo->data_lock ); +} + +/***************************************************************************** + * aout_FreeFifo + *****************************************************************************/ +void aout_FreeFifo( aout_fifo_t * p_fifo ) +{ + switch ( p_fifo->i_format ) + { + case AOUT_FIFO_NONE: + + break; + + case AOUT_FIFO_PCM: + case AOUT_FIFO_SPDIF: + + free( p_fifo->date ); + p_fifo->i_format = AOUT_FIFO_NONE; + + break; + + default: + + break; + } +} + diff --git a/src/input/input_dec.c b/src/input/input_dec.c index a4e8eaf80e..22844b093e 100644 --- a/src/input/input_dec.c +++ b/src/input/input_dec.c @@ -2,7 +2,7 @@ * input_dec.c: Functions for the management of decoders ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: input_dec.c,v 1.42 2002/08/04 20:04:11 sam Exp $ + * $Id: input_dec.c,v 1.43 2002/08/08 00:35:11 sam Exp $ * * Authors: Christophe Massiot * @@ -106,9 +106,9 @@ void input_EndDecoder( input_thread_t * p_input, es_descriptor_t * p_es ) /* Waiting for the thread to exit */ /* I thought that unlocking was better since thread join can be long * but it actually creates late pictures and freezes --stef */ -// vlc_mutex_unlock( &p_input->stream.stream_lock ); + /* vlc_mutex_unlock( &p_input->stream.stream_lock ); */ vlc_thread_join( p_es->p_decoder_fifo ); -// vlc_mutex_lock( &p_input->stream.stream_lock ); + /* vlc_mutex_lock( &p_input->stream.stream_lock ); */ /* Delete decoder configuration */ DeleteDecoderFifo( p_es->p_decoder_fifo ); diff --git a/src/libvlc.c b/src/libvlc.c index 5c89a12d8a..6d0bef0606 100644 --- a/src/libvlc.c +++ b/src/libvlc.c @@ -2,7 +2,7 @@ * libvlc.c: main libvlc source ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: libvlc.c,v 1.21 2002/08/07 21:36:56 massiot Exp $ + * $Id: libvlc.c,v 1.22 2002/08/08 00:35:11 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -765,7 +765,7 @@ vlc_error_t vlc_destroy_r( vlc_t *p_vlc ) if( i_index == i_vlc ) { fprintf( stderr, "error: trying to unregister %p which is not in " - "the list\n", p_vlc ); + "the list\n", (void *)p_vlc ); vlc_mutex_unlock( p_vlc->p_global_lock ); vlc_object_destroy( p_vlc ); return VLC_EGENERIC; diff --git a/src/libvlc.h b/src/libvlc.h index ea8fdf5d2c..5011f38ae9 100644 --- a/src/libvlc.h +++ b/src/libvlc.h @@ -2,7 +2,7 @@ * libvlc.h: main libvlc header ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: libvlc.h,v 1.11 2002/08/07 21:36:56 massiot Exp $ + * $Id: libvlc.h,v 1.12 2002/08/08 00:35:11 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -312,8 +312,6 @@ "\n VCD device" \ "\n udpstream:[@[][:]]" \ "\n UDP stream sent by VLS" \ - "\n vlc:loop loop execution of the " \ - "playlist" \ "\n vlc:pause pause execution of " \ "playlist items" \ "\n vlc:quit quit VLC" \ diff --git a/src/misc/configuration.c b/src/misc/configuration.c index 160550e959..95bc13217c 100644 --- a/src/misc/configuration.c +++ b/src/misc/configuration.c @@ -2,7 +2,7 @@ * configuration.c management of the modules configuration ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: configuration.c,v 1.34 2002/08/07 00:29:37 sam Exp $ + * $Id: configuration.c,v 1.35 2002/08/08 00:35:11 sam Exp $ * * Authors: Gildas Bazin * @@ -511,8 +511,10 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) !memcmp( &line[1], p_module->psz_object_name, strlen(p_module->psz_object_name) ) ) { - //msg_Dbg( p_this, "loading config for module \"%s\"", - // p_module->psz_object_name ); +#if 0 + msg_Dbg( p_this, "loading config for module \"%s\"", + p_module->psz_object_name ); +#endif break; } @@ -560,16 +562,20 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) if( !*psz_option_value ) break; /* ignore empty option */ p_item->i_value = atoi( psz_option_value); - //msg_Dbg( p_this, "option \"%s\", value %i", - // p_item->psz_name, p_item->i_value ); +#if 0 + msg_Dbg( p_this, "option \"%s\", value %i", + p_item->psz_name, p_item->i_value ); +#endif break; case CONFIG_ITEM_FLOAT: if( !*psz_option_value ) break; /* ignore empty option */ p_item->f_value = (float)atof( psz_option_value); - //msg_Dbg( p_this, "option \"%s\", value %f", - // p_item->psz_name, (double)p_item->f_value ); +#if O + msg_Dbg( p_this, "option \"%s\", value %f", + p_item->psz_name, (double)p_item->f_value ); +#endif break; default: @@ -584,9 +590,11 @@ int __config_LoadConfigFile( vlc_object_t *p_this, const char *psz_module_name ) vlc_mutex_unlock( p_item->p_lock ); - //msg_Dbg( p_this, "option \"%s\", value \"%s\"", - // p_item->psz_name, - // p_item->psz_value ? p_item->psz_value : "" ); +#if 0 + msg_Dbg( p_this, "option \"%s\", value \"%s\"", + p_item->psz_name, + p_item->psz_value ? p_item->psz_value : "" ); +#endif break; } } @@ -1128,7 +1136,6 @@ char *config_GetHomeDir( void ) p_homedir = (char *)malloc( MAX_PATH ); if( !p_homedir ) { -//X intf_ErrMsg( "config error: couldn't malloc p_homedir" ); return NULL; } @@ -1155,15 +1162,11 @@ char *config_GetHomeDir( void ) { if( ( p_tmp = getenv( "TMP" ) ) == NULL ) { - p_homedir = strdup( "/tmp" ); + p_tmp = "/tmp"; } - else p_homedir = strdup( p_tmp ); - -//X intf_ErrMsg( "config error: unable to get home directory, " -//X "using %s instead", p_homedir ); - } - else p_homedir = strdup( p_tmp ); + + p_homedir = strdup( p_tmp ); } #if defined(HAVE_GETPWUID) else diff --git a/src/misc/messages.c b/src/misc/messages.c index 9795bb00b0..0c978a4859 100644 --- a/src/misc/messages.c +++ b/src/misc/messages.c @@ -4,7 +4,7 @@ * modules, especially intf modules. See config.h for output configuration. ***************************************************************************** * Copyright (C) 1998-2002 VideoLAN - * $Id: messages.c,v 1.6 2002/07/31 20:56:53 sam Exp $ + * $Id: messages.c,v 1.7 2002/08/08 00:35:11 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -231,7 +231,8 @@ void __msg_Generic( vlc_object_t *p_this, int i_type, const char *psz_module, QueueMsg( (vlc_object_t *)p_this, FN_TYPE, "unknown", \ psz_format, args ); \ va_end( args ); \ - } + } \ + struct _ DECLARE_MSG_FN( __msg_Info, VLC_MSG_INFO ); DECLARE_MSG_FN( __msg_Err, VLC_MSG_ERR ); diff --git a/src/misc/modules.c b/src/misc/modules.c index 3795cb574d..9ec6de2cb5 100644 --- a/src/misc/modules.c +++ b/src/misc/modules.c @@ -2,7 +2,7 @@ * modules.c : Builtin and plugin modules management functions ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules.c,v 1.81 2002/08/07 00:29:37 sam Exp $ + * $Id: modules.c,v 1.82 2002/08/08 00:35:11 sam Exp $ * * Authors: Samuel Hocevar * Ethan C. Baldridge @@ -770,8 +770,8 @@ static int AllocatePluginFile( vlc_object_t * p_this, char * psz_file ) p_this->p_vlc->p_module_bank->first = p_module; p_this->p_vlc->p_module_bank->i_count++; - //msg_Dbg( p_this, "plugin \"%s\", %s", - // p_module->psz_object_name, p_module->psz_longname ); + /* msg_Dbg( p_this, "plugin \"%s\", %s", + p_module->psz_object_name, p_module->psz_longname ); */ vlc_object_attach( p_module, p_this->p_vlc->p_module_bank ); @@ -888,8 +888,8 @@ static int AllocateBuiltinModule( vlc_object_t * p_this, p_this->p_vlc->p_module_bank->first = p_module; p_this->p_vlc->p_module_bank->i_count++; - //msg_Dbg( p_this, "builtin \"%s\", %s", - // p_module->psz_object_name, p_module->psz_longname ); + /* msg_Dbg( p_this, "builtin \"%s\", %s", + p_module->psz_object_name, p_module->psz_longname ); */ vlc_object_attach( p_module, p_this->p_vlc->p_module_bank ); @@ -1113,7 +1113,8 @@ static int CallEntry( module_t * p_module ) int (* pf_symbol) ( module_t * p_module ); /* Try to resolve the symbol */ - pf_symbol = module_getsymbol( p_module->handle, psz_name ); + pf_symbol = (int (*)(module_t *)) module_getsymbol( p_module->handle, + psz_name ); if( pf_symbol == NULL ) { diff --git a/src/misc/modules_plugin.h b/src/misc/modules_plugin.h index 4bd86bccd7..00d4963a6d 100644 --- a/src/misc/modules_plugin.h +++ b/src/misc/modules_plugin.h @@ -31,8 +31,7 @@ * This function loads a dynamically linked library using a system dependant * method, and returns a non-zero value on error, zero otherwise. *****************************************************************************/ -static inline int module_load( const char * psz_filename, - module_handle_t * handle ) +static int module_load( const char * psz_filename, module_handle_t * handle ) { #ifdef SYS_BEOS *handle = load_add_on( psz_filename ); @@ -70,7 +69,7 @@ static inline int module_load( const char * psz_filename, * using a system dependant method. No return value is taken in consideration, * since some libraries sometimes refuse to close properly. *****************************************************************************/ -static inline void module_unload( module_handle_t handle ) +static void module_unload( module_handle_t handle ) { #ifdef SYS_BEOS unload_add_on( handle ); @@ -92,8 +91,8 @@ static inline void module_unload( module_handle_t handle ) * 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, - const char * psz_function ) +static void * _module_getsymbol( module_handle_t handle, + const char * psz_function ) { #ifdef SYS_BEOS void * p_symbol; @@ -116,8 +115,8 @@ static inline void * _module_getsymbol( module_handle_t handle, #endif } -static inline void * module_getsymbol( module_handle_t handle, - const char * psz_function ) +static void * module_getsymbol( module_handle_t handle, + const char * psz_function ) { void * p_symbol = _module_getsymbol( handle, psz_function ); @@ -145,7 +144,7 @@ static inline void * module_getsymbol( module_handle_t handle, * function. psz_buffer can be used to store temporary data, it is guaranteed * to be kept intact until the return value of module_error has been used. *****************************************************************************/ -static inline const char * module_error( char *psz_buffer ) +static const char * module_error( char *psz_buffer ) { #if defined(SYS_BEOS) return( "failed" ); @@ -185,6 +184,7 @@ static inline const char * module_error( char *psz_buffer ) (p_symbols)->aout_BufferNew_inner = aout_BufferNew; \ (p_symbols)->aout_BufferDelete_inner = aout_BufferDelete; \ (p_symbols)->aout_BufferPlay_inner = aout_BufferPlay; \ + (p_symbols)->aout_FormatToBytes_inner = aout_FormatToBytes; \ (p_symbols)->__aout_InputNew_inner = __aout_InputNew; \ (p_symbols)->aout_InputDelete_inner = aout_InputDelete; \ (p_symbols)->aout_OutputNextBuffer_inner = aout_OutputNextBuffer; \ diff --git a/src/misc/modules_plugin.h.in b/src/misc/modules_plugin.h.in index 5eb609b10d..873f4c39a7 100644 --- a/src/misc/modules_plugin.h.in +++ b/src/misc/modules_plugin.h.in @@ -2,7 +2,7 @@ * modules_plugin.h : Plugin management functions used by the core application. ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules_plugin.h.in,v 1.2 2002/08/04 12:18:41 sam Exp $ + * $Id: modules_plugin.h.in,v 1.3 2002/08/08 00:35:11 sam Exp $ * * Authors: Samuel Hocevar * @@ -31,8 +31,7 @@ * This function loads a dynamically linked library using a system dependant * method, and returns a non-zero value on error, zero otherwise. *****************************************************************************/ -static inline int module_load( const char * psz_filename, - module_handle_t * handle ) +static int module_load( const char * psz_filename, module_handle_t * handle ) { #ifdef SYS_BEOS *handle = load_add_on( psz_filename ); @@ -70,7 +69,7 @@ static inline int module_load( const char * psz_filename, * using a system dependant method. No return value is taken in consideration, * since some libraries sometimes refuse to close properly. *****************************************************************************/ -static inline void module_unload( module_handle_t handle ) +static void module_unload( module_handle_t handle ) { #ifdef SYS_BEOS unload_add_on( handle ); @@ -92,8 +91,8 @@ static inline void module_unload( module_handle_t handle ) * 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, - const char * psz_function ) +static void * _module_getsymbol( module_handle_t handle, + const char * psz_function ) { #ifdef SYS_BEOS void * p_symbol; @@ -116,8 +115,8 @@ static inline void * _module_getsymbol( module_handle_t handle, #endif } -static inline void * module_getsymbol( module_handle_t handle, - const char * psz_function ) +static void * module_getsymbol( module_handle_t handle, + const char * psz_function ) { void * p_symbol = _module_getsymbol( handle, psz_function ); @@ -145,7 +144,7 @@ static inline void * module_getsymbol( module_handle_t handle, * function. psz_buffer can be used to store temporary data, it is guaranteed * to be kept intact until the return value of module_error has been used. *****************************************************************************/ -static inline const char * module_error( char *psz_buffer ) +static const char * module_error( char *psz_buffer ) { #if defined(SYS_BEOS) return( "failed" ); diff --git a/src/misc/mtime.c b/src/misc/mtime.c index 1d2ae6b947..f084941f89 100644 --- a/src/misc/mtime.c +++ b/src/misc/mtime.c @@ -3,7 +3,7 @@ * Functions are prototyped in mtime.h. ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: mtime.c,v 1.33 2002/07/12 21:57:25 massiot Exp $ + * $Id: mtime.c,v 1.34 2002/08/08 00:35:11 sam Exp $ * * Authors: Vincent Seguin * @@ -73,12 +73,14 @@ int nanosleep(struct timespec *, struct timespec *); *****************************************************************************/ char *mstrtime( char *psz_buffer, mtime_t date ) { + static mtime_t ll1000 = 1000, ll60 = 60, ll24 = 24; + sprintf( psz_buffer, "%02d:%02d:%02d-%03d.%03d", - (int) (date / (I64C(1000) * I64C(1000) * I64C(60) * I64C(60)) % I64C(24)), - (int) (date / (I64C(1000) * I64C(1000) * I64C(60)) % I64C(60)), - (int) (date / (I64C(1000) * I64C(1000)) % I64C(60)), - (int) (date / I64C(1000) % I64C(1000)), - (int) (date % I64C(1000)) ); + (int) (date / (ll1000 * ll1000 * ll60 * ll60) % ll24), + (int) (date / (ll1000 * ll1000 * ll60) % ll60), + (int) (date / (ll1000 * ll1000) % ll60), + (int) (date / ll1000 % ll1000), + (int) (date % ll1000) ); return( psz_buffer ); } diff --git a/src/misc/objects.c b/src/misc/objects.c index 276293fed3..bdfcd999c2 100644 --- a/src/misc/objects.c +++ b/src/misc/objects.c @@ -2,7 +2,7 @@ * objects.c: vlc_object_t handling ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: objects.c,v 1.14 2002/08/07 21:36:56 massiot Exp $ + * $Id: objects.c,v 1.15 2002/08/08 00:35:11 sam Exp $ * * Authors: Samuel Hocevar * @@ -150,8 +150,6 @@ void * __vlc_object_create( vlc_object_t *p_this, int i_type ) vlc_mutex_init( p_new, &p_new->object_lock ); vlc_cond_init( p_new, &p_new->object_wait ); - //msg_Dbg( p_new, "created object" ); - return p_new; } @@ -204,8 +202,6 @@ void __vlc_object_destroy( vlc_object_t *p_this ) msleep( 100000 ); } - //msg_Dbg( p_this, "destroyed object" ); - vlc_mutex_destroy( &p_this->object_lock ); vlc_cond_destroy( &p_this->object_wait ); diff --git a/src/misc/threads.c b/src/misc/threads.c index b65aa9f9ee..ac8a3f008a 100644 --- a/src/misc/threads.c +++ b/src/misc/threads.c @@ -2,7 +2,7 @@ * threads.c : threads implementation for the VideoLAN client ***************************************************************************** * Copyright (C) 1999, 2000, 2001, 2002 VideoLAN - * $Id: threads.c,v 1.11 2002/07/29 19:05:47 gbazin Exp $ + * $Id: threads.c,v 1.12 2002/08/08 00:35:11 sam Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -312,8 +312,10 @@ int __vlc_mutex_destroy( char * psz_file, int i_line, vlc_mutex_t *p_mutex ) int i_return = pthread_mutex_destroy( p_mutex ); if( i_return ) { -//X intf_ErrMsg( "thread %d error: mutex_destroy failed at %s:%d (%s)", -//X pthread_self(), psz_file, i_line, strerror(i_return) ); +#if 0 + intf_ErrMsg( "thread %d error: mutex_destroy failed at %s:%d (%s)", + pthread_self(), psz_file, i_line, strerror(i_return) ); +#endif } return i_return; @@ -434,8 +436,10 @@ int __vlc_cond_destroy( char * psz_file, int i_line, vlc_cond_t *p_condvar ) int i_result = pthread_cond_destroy( p_condvar ); if( i_result ) { -//X intf_ErrMsg( "thread %d error: cond_destroy failed at %s:%d (%s)", -//X pthread_self(), psz_file, i_line, strerror(i_result) ); +#if 0 + intf_ErrMsg( "thread %d error: cond_destroy failed at %s:%d (%s)", + pthread_self(), psz_file, i_line, strerror(i_result) ); +#endif } return i_result; diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index 833df04b8e..f49e81d1ad 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -5,7 +5,7 @@ * thread, and destroy a previously oppened video output thread. ***************************************************************************** * Copyright (C) 2000-2001 VideoLAN - * $Id: video_output.c,v 1.188 2002/07/31 20:56:53 sam Exp $ + * $Id: video_output.c,v 1.189 2002/08/08 00:35:11 sam Exp $ * * Authors: Vincent Seguin * @@ -548,7 +548,7 @@ static void RunThread( vout_thread_t *p_vout) } else { - //intf_WarnMsg( 6, "vout info: duplicating picture" ); + /*intf_WarnMsg( 6, "vout info: duplicating picture" );*/ } } } diff --git a/src/video_output/video_text.c b/src/video_output/video_text.c index 2e74653afd..7ed2e31c43 100644 --- a/src/video_output/video_text.c +++ b/src/video_output/video_text.c @@ -2,7 +2,7 @@ * video_text.c : text manipulation functions ***************************************************************************** * Copyright (C) 1999-2001 VideoLAN - * $Id: video_text.c,v 1.36 2002/07/20 18:01:43 sam Exp $ + * $Id: video_text.c,v 1.37 2002/08/08 00:35:11 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -467,7 +467,7 @@ void vout_Print( vout_font_t *p_font, byte_t *p_pic, int i_bytes_per_pixel, int p_font->i_interspacing); /* compute where to stop... */ - i_end = (int) (i_percent * strlen(psz_text) / I64C(100)); + i_end = (int) (i_percent * strlen(psz_text) / (s64)100); if(i_end > strlen(psz_text)) i_end = strlen(psz_text); diff --git a/src/vlc.c b/src/vlc.c index 5147b8f665..5adc5fe877 100644 --- a/src/vlc.c +++ b/src/vlc.c @@ -2,7 +2,7 @@ * vlc.c: the vlc player ***************************************************************************** * Copyright (C) 1998-2001 VideoLAN - * $Id: vlc.c,v 1.7 2002/07/23 00:39:17 sam Exp $ + * $Id: vlc.c,v 1.8 2002/08/08 00:35:11 sam Exp $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -31,7 +31,7 @@ /***************************************************************************** * main: parse command line, start interface and spawn threads *****************************************************************************/ -int main(int i_argc, char *ppsz_argv[], char *ppsz_env[]) +int main(int i_argc, char *ppsz_argv[]) { vlc_error_t err; @@ -64,13 +64,15 @@ int main(int i_argc, char *ppsz_argv[], char *ppsz_env[]) err = vlc_run(); /* Add background interfaces */ - //{ int i; for( i=10; i--; ) vlc_add_intf( NULL, "dummy", 0 ); } - //vlc_add_intf( NULL, "dummy", VLC_FALSE ); - //vlc_add_intf( NULL, "logger", VLC_FALSE ); - //vlc_add_intf( NULL, "xosd", VLC_FALSE ); - //vlc_add_intf( NULL, "gtk", VLC_FALSE ); - //vlc_add_intf( NULL, "kde", VLC_FALSE ); - //vlc_add_intf( "rc", VLC_FALSE ); +#if 0 + { int i; for( i=10; i--; ) vlc_add_intf( NULL, "dummy", 0 ); } + vlc_add_intf( NULL, "dummy", VLC_FALSE ); + vlc_add_intf( NULL, "logger", VLC_FALSE ); + vlc_add_intf( NULL, "xosd", VLC_FALSE ); + vlc_add_intf( NULL, "gtk", VLC_FALSE ); + vlc_add_intf( NULL, "kde", VLC_FALSE ); + vlc_add_intf( "rc", VLC_FALSE ); +#endif /* Add a blocking interface and keep the return value */ err = vlc_add_intf( NULL, VLC_TRUE ); diff --git a/vlc.spec b/vlc.spec index a4952a3564..8adcd6957d 100644 --- a/vlc.spec +++ b/vlc.spec @@ -277,7 +277,6 @@ rm -fr %buildroot %dir %{_libdir}/videolan/vlc %{_libdir}/videolan/vlc/ac3_spdif.so %{_libdir}/videolan/vlc/avi.so -%{_libdir}/videolan/vlc/dsp.so %{_libdir}/videolan/vlc/dummy.so %{_libdir}/videolan/vlc/dvd.so %{_libdir}/videolan/vlc/fb.so @@ -301,6 +300,7 @@ rm -fr %buildroot %{_libdir}/videolan/vlc/mpeg_ps.so %{_libdir}/videolan/vlc/mpeg_ts.so %{_libdir}/videolan/vlc/null.so +%{_libdir}/videolan/vlc/oss.so %{_libdir}/videolan/vlc/rc.so %{_libdir}/videolan/vlc/spudec.so %{_libdir}/videolan/vlc/udp.so