From 33687bb4acf1099dfaa26d07110c37857f638005 Mon Sep 17 00:00:00 2001 From: Christophe Massiot Date: Wed, 18 Jul 2001 17:05:39 +0000 Subject: [PATCH] * Updated documentation with recent changes ; * Decoders are niced again, for it is really better. --- doc/developer/.cvsignore | 7 +++++ doc/developer/Makefile | 22 +++++++------- doc/developer/decoders.xml | 49 ++++++++++++++++++++++++------- doc/developer/overview.xml | 3 +- include/config.h.in | 5 +++- src/video_decoder/video_decoder.c | 14 ++++++++- src/video_decoder/vpar_blocks.c | 5 +++- 7 files changed, 80 insertions(+), 25 deletions(-) create mode 100644 doc/developer/.cvsignore diff --git a/doc/developer/.cvsignore b/doc/developer/.cvsignore new file mode 100644 index 0000000000..682e4979be --- /dev/null +++ b/doc/developer/.cvsignore @@ -0,0 +1,7 @@ +manual.aux +manual.dvi +manual.html +manual.log +manual.ps +manual.tex +manual.txt diff --git a/doc/developer/Makefile b/doc/developer/Makefile index c1d693f578..19ecf07cf8 100644 --- a/doc/developer/Makefile +++ b/doc/developer/Makefile @@ -18,25 +18,25 @@ JADE=jade manual: manual.txt manual.ps manual.html -%.tex: %.xml - $(JADE) -t tex -V %section-autolabel% -d $(PRINT_SS) $(XML_DECL) $< +manual.tex: audio_output.xml debugging.xml decoders.xml gfdl.xml glossary.xml history.xml input.xml interface.xml manual.xml overview.xml ports.xml video_output.xml + $(JADE) -t tex -V %section-autolabel% -d $(PRINT_SS) $(XML_DECL) manual.xml perl -i.bak -pe 's/\000//g' $@ && rm $*.tex.bak # No it's not a joke -%.html: %.xml +manual.html: audio_output.xml debugging.xml decoders.xml gfdl.xml glossary.xml history.xml input.xml interface.xml manual.xml overview.xml ports.xml video_output.xml $(JADE) -t sgml -V %section-autolabel% -V nochunks \ - -d $(HTML_SS) $(XML_DECL) $< > $@ + -d $(HTML_SS) $(XML_DECL) manual.xml > $@ -%.dvi: %.tex - jadetex $< - jadetex $< - jadetex $< +manual.dvi: manual.tex modules.eps ps.eps stream.eps ts.eps + jadetex manual.tex + jadetex manual.tex + jadetex manual.tex -%.ps: %.dvi +manual.ps: manual.dvi dvips -f $< > $@ -%.txt: %.xml - $(JADE) -t sgml -V nochunks -d $(HTML_SS) $(XML_DECL) $< > dump.html +manual.txt: audio_output.xml debugging.xml decoders.xml gfdl.xml glossary.xml history.xml input.xml interface.xml manual.xml overview.xml ports.xml video_output.xml + $(JADE) -t sgml -V nochunks -d $(HTML_SS) $(XML_DECL) manual.xml > dump.html lynx -force_html -dump dump.html > $@ -rm -f dump.html diff --git a/doc/developer/decoders.xml b/doc/developer/decoders.xml index f382346d6e..354de019eb 100644 --- a/doc/developer/decoders.xml +++ b/doc/developer/decoders.xml @@ -310,16 +310,13 @@ be described in the following section. VideoLAN Client provides an MPEG-1, and an MPEG-2 Main Profile @ Main Level decoder. It has been natively written for VLC, and is quite mature. Its status is a bit special, since it is splitted between two -modules : video parser and video decoder [this is subject to change]. +logicial entities : video parser and video decoder. The initial goal is to separate bit stream parsing functions from highly parallelizable mathematical algorithms. In theory, there can be one video parser thread (and only one, otherwise we would have race -conditions reading the bit stream), along with several video decoder +conditions reading the bit stream), along with a pool of video decoder threads, which do IDCT and motion compensation on several blocks -at once [practically, -multi-threaded mode hasn't been tested for a while, still needs some -work, and was actually slower than mono-threaded mode ; the -multi-threaded mode won't be documented for the moment]. +at once. @@ -375,7 +372,9 @@ Note also that the DMV algorithm is untested and is probably buggy. Just like motion compensation, IDCT is platform-specific. So we moved it -to plugins/idct. You need to define four methods : +to plugins/idct. This module does the IDCT +calculation, and copies the data to the final picture. You need to define +seven methods : @@ -407,6 +406,25 @@ to plugins/idct. You need to define four methods : some IDCT (MMX) need to invert certain coefficients in the MPEG scan matrices (see ISO/IEC 13818-2). + + vdec_InitDecode + ( struct vdec_thread_s * p_vdec ) : + Initializes the IDCT and optional crop tables. + + + vdec_DecodeMacroblockC + ( struct vdec_thread_s *p_vdec, + struct macroblock_s * p_mb ); : + Decodes an entire macroblock and copies its data to the final + picture, including chromatic information. + + + vdec_DecodeMacroblockBW + ( struct vdec_thread_s *p_vdec, + struct macroblock_s * p_mb ); : + Decodes an entire macroblock and copies its data to the final + picture, except chromatic information (used in grayscale mode). + @@ -417,10 +435,21 @@ and the simple 1-D separation IDCT from the ISO reference decoder (idctclassic.c). + + + Symmetrical Multiprocessing + -[In the future, the IDCT plug-in will include vdec_AddBlock - and vdec_CopyBlock , which are -often architecture-specific.] +The MPEG video decoder of VLC can take advantage of several processors if +necessary. The idea is to launch a pool of decoders, which will do +IDCT/motion compensation on several macroblocks at once. + + + +The functions managing the pool are in +src/video_decoder/vpar_pool.c. Its use on non-SMP machines is +not recommanded, since it is actually slower than the monothread version. +Even on SMP machines sometimes... diff --git a/doc/developer/overview.xml b/doc/developer/overview.xml index 21593a4709..562e99a7ec 100644 --- a/doc/developer/overview.xml +++ b/doc/developer/overview.xml @@ -92,6 +92,7 @@ reasons, we don't call pthread_* functions directly, but use a similar wrapper, made of vlc_thread_create, vlc_thread_exit, vlc_thread_join, vlc_mutex_init, vlc_mutex_lock, vlc_mutex_unlock, vlc_mutex_destroy, vlc_cond_init, vlc_cond_signal, +vlc_cond_broadcast, vlc_cond_wait, vlc_cond_destroy, and structures vlc_thread_t, vlc_mutex_t, and vlc_cond_t. @@ -165,7 +166,7 @@ don't need usage of the module name. Variable naming -Hungarian notations used, that means we have the following prefixes : +Hungarian notations are used, that means we have the following prefixes : diff --git a/include/config.h.in b/include/config.h.in index e918f0005f..a4fc4a7fd2 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -458,7 +458,10 @@ #define VDEC_SMP_VAR "vlc_smp" /* No SMP by default, since it slows down things on non-smp machines. */ -#define VDEC_SMP_DEFAULT 0 +#define VDEC_SMP_DEFAULT 0 + +/* Nice increments for decoders -- necessary for x11 scheduling */ +#define VDEC_NICE 3 /***************************************************************************** * Messages and console interfaces configuration diff --git a/src/video_decoder/video_decoder.c b/src/video_decoder/video_decoder.c index 8acd39680d..731edca35e 100644 --- a/src/video_decoder/video_decoder.c +++ b/src/video_decoder/video_decoder.c @@ -2,7 +2,7 @@ * video_decoder.c : video decoder thread ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: video_decoder.c,v 1.54 2001/07/18 14:21:00 massiot Exp $ + * $Id: video_decoder.c,v 1.55 2001/07/18 17:05:39 massiot Exp $ * * Authors: Christophe Massiot * Gaël Hendryckx @@ -130,6 +130,18 @@ void vdec_InitThread( vdec_thread_t *p_vdec ) { intf_DbgMsg("vdec debug: initializing video decoder thread %p", p_vdec); +#if !defined(SYS_BEOS) && !defined(WIN32) +# if VDEC_NICE + /* Re-nice ourself - otherwise we would steal CPU time from the video + * output, which would make a poor display. */ + if( nice(VDEC_NICE) == -1 ) + { + intf_WarnMsg( 2, "vpar warning : couldn't nice() (%s)", + strerror(errno) ); + } +# endif +#endif + p_vdec->p_idct_data = NULL; p_vdec->p_pool->pf_decode_init( p_vdec ); diff --git a/src/video_decoder/vpar_blocks.c b/src/video_decoder/vpar_blocks.c index 6af8a573f9..42734fb995 100644 --- a/src/video_decoder/vpar_blocks.c +++ b/src/video_decoder/vpar_blocks.c @@ -2,7 +2,7 @@ * vpar_blocks.c : blocks parsing ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: vpar_blocks.c,v 1.3 2001/07/18 14:21:00 massiot Exp $ + * $Id: vpar_blocks.c,v 1.4 2001/07/18 17:05:39 massiot Exp $ * * Authors: Christophe Massiot * Jean-Marc Dressler @@ -1347,6 +1347,9 @@ static __inline__ void MotionVector( vpar_thread_t * p_vpar, } /* Dual Prime Arithmetic (ISO/IEC 13818-2 section 7.6.3.6). */ + /* FIXME */ + intf_Msg( "Your stream uses Dual Prime Arithmetic. Please send a mail" + "to massiot@via.ecp.fr for debugging purposes. Thank you." ); #define i_mv_x p_mb->pppi_motion_vectors[0][0][0] if( i_structure == FRAME_STRUCTURE )