mjpegtools 1.9rc1

Mark Nauwelaerts <[email protected]>
Newsgroups gmane.comp.video.mjpeg.devel
Message-ID <[email protected]>
I have given this release candidate a try, and noticed the following
(all of which equally apply to CVS head):

* building libmpeg2enc fails on Cygwin (and perhaps ??), as mjpegutils is not
included in _LIBADD for libmpeg2enc

* there is also a problem building against this release as a library;
as it does not install 2 header files (mpeg2enc/mpeg2syntaxcodes.h and
mpeg2enc/imageplanes.hh), see also tracker item on the former header
[http://sourceforge.net/tracker/index.php?func=detail&aid=1433968&group_id=5776&atid=105776]

A small patch is attached as a possible solution for the above items.

[some bitpicking; in some cases, gcc might complain about use of the -mcpu flag,
which seems to come from configure.ac]

Not so bitpicking is that valgrind has quite some complaints about uninitialised
values; see attached log (which has most occurrences caused by logging
uninitialised values suppressed).
Though I do not know about their full impact, valgrind at least seems to be
right.  For instance, OnTheFlyPass1::Init chooses whether or not to complain
about buffer sizes based on (a.o.) per_bits_pict, which is only set later on in
InitSeq.  Similarly, OnTheFlyPass1::Init fills ratectl_vbuf based on (a.o.)
fb_gain, which is only set some lines further down.
A small hack-fix is attached that mitigates some of these, but that may very
well not be appropriate or enough (e.g. there is LookaheadRCPass1 and so on as
well).

Mark.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Mjpeg-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mjpeg-developer
mjpeg-build.patch (text/x-patch, 1.4 KB)
Index: mpeg2enc/Makefile.am
===================================================================
RCS file: /cvsroot/mjpeg/mjpeg_play/mpeg2enc/Makefile.am,v
retrieving revision 1.98
diff -u -r1.98 Makefile.am
--- mpeg2enc/Makefile.am	9 Nov 2006 00:39:37 -0000	1.98
+++ mpeg2enc/Makefile.am	17 Feb 2007 18:01:46 -0000
@@ -59,8 +59,8 @@
 		$(SIMD_INLINE) ontheflyratectl.cc pass2ratectl.cc pass1ratectl.cc \
 	rate_complexity_model.cc
 
-noinst_HEADERS = channel.hh mpeg2syntaxcodes.h quantize_precomp.h simd.h \
-	tables.h $(mpeg2enc_noinst_header_REF) imageplanes.hh rate_complexity_model.hh
+noinst_HEADERS = channel.hh quantize_precomp.h simd.h \
+	tables.h $(mpeg2enc_noinst_header_REF) rate_complexity_model.hh
 
 libmpeg2encpp_includedir = $(pkgincludedir)/mpeg2enc
 
@@ -68,7 +68,8 @@
 	encodertypes.h macroblock.hh mpeg2coder.hh mpeg2encoder.hh mpeg2encoptions.hh \
 	mpeg2encparams.h picture.hh picturereader.hh quantize.hh quantize_ref.h ratectl.hh \
 	streamstate.h seqencoder.hh synchrolib.h syntaxconsts.h $(mpeg2enc_inst_header_REF) \
-	ontheflyratectl.hh pass1ratectl.hh pass2ratectl.hh
+	ontheflyratectl.hh pass1ratectl.hh pass2ratectl.hh \
+	mpeg2syntaxcodes.h imageplanes.hh
 
 libmpeg2encpp_la_LDFLAGS = \
 	${LT_STATIC} \
@@ -77,7 +78,7 @@
 
 libmpeg2encpp_la_DEPENDENCIES = $(LIBMJPEGUTILS)
 
-libmpeg2encpp_la_LIBADD = 
+libmpeg2encpp_la_LIBADD = $(LIBMJPEGUTILS)
 
 mpeg2enc_DEPENDENCIES = \
 	$(LIBMJPEGUTILS) \
mjpeg-init.patch (text/x-patch, 1.9 KB)
Index: mpeg2enc/ontheflyratectl.cc
===================================================================
RCS file: /cvsroot/mjpeg/mjpeg_play/mpeg2enc/ontheflyratectl.cc,v
retrieving revision 1.7
diff -u -r1.7 ontheflyratectl.cc
--- mpeg2enc/ontheflyratectl.cc	12 Aug 2006 20:55:53 -0000	1.7
+++ mpeg2enc/ontheflyratectl.cc	17 Feb 2007 18:03:15 -0000
@@ -97,6 +97,24 @@
        or a "reasonable" quantisation (6.0) if not.
     */
 
+    /* need per_pict_bits */
+    InitSeq();
+
+    /*
+    Reaction paramer - i.e. quantisation feedback gain relative
+    to bit over/undershoot.
+    For normal frames it is fairly modest as we can compensate
+    over multiple frames and can average out variations in image
+    complexity.
+
+    For stills we set it a higher so corrections take place
+    more rapidly *within* a single frame.
+    */
+    if( encparams.still_size > 0 )
+        fb_gain = (int)floor(2.0*encparams.bit_rate/encparams.decode_frame_rate);
+    else
+        fb_gain = (int)floor(4.0*encparams.bit_rate/encparams.decode_frame_rate);
+
     double init_quant = (encparams.quant_floor > 0.0 ? encparams.quant_floor : 6.0);
     int i;
     for( i = FIRST_PICT_TYPE; i <= LAST_PICT_TYPE; ++i )
@@ -149,22 +167,6 @@
         overshoot_gain =  encparams.bit_rate / (encparams.video_buffer_size-buffer_safe);
     }
 
-    /*
-      Reaction paramer - i.e. quantisation feedback gain relative
-      to bit over/undershoot.
-      For normal frames it is fairly modest as we can compensate
-      over multiple frames and can average out variations in image
-      complexity.
-
-      For stills we set it a higher so corrections take place
-      more rapidly *within* a single frame.
-    */
-    if( encparams.still_size > 0 )
-        fb_gain = (int)floor(2.0*encparams.bit_rate/encparams.decode_frame_rate);
-    else
-        fb_gain = (int)floor(4.0*encparams.bit_rate/encparams.decode_frame_rate);
-
-
     next_ip_delay = 0.0;
     decoding_time = 0.0;
 }
valgrind.log.gz (application/x-gzip, 2.7 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.