[MPlayer-dev-eng] [PATCH] ve_xvid4.c bitrate=NNNN behaviour

Dominik 'Rathann' Mierzejewski dominik at rangers.eu.org
Sun Oct 10 17:51:51 CEST 2004


Hi.

Bitrate setting option in ve_xvid4.c doesn't follow the rules described
in manpage (i.e. if bitrate > 16000, then it's in bits/s, not kbits),
unlike lavc and the old ve_xvid.c do.

Patch attached. If nobody speaks against it, I'll commit it in a few
days.

R.

-- 
MPlayer RPMs maintainer: http://greysector.rangers.eu.org/mplayer/
"I am Grey. I stand between the candle and the star. We are Grey.
 We stand between the darkness ... and the light."
        -- Delenn in Grey Council in Babylon 5:"Babylon Squared"
-------------- next part --------------
Index: libmpcodecs/ve_xvid4.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/ve_xvid4.c,v
retrieving revision 1.8
diff -u -r1.8 ve_xvid4.c
--- libmpcodecs/ve_xvid4.c	13 Jul 2004 18:09:58 -0000	1.8
+++ libmpcodecs/ve_xvid4.c	10 Oct 2004 15:47:43 -0000
@@ -712,7 +712,8 @@
 	 * The single pass plugin
 	 * ---------------------------------------------------------------- */
 
-	onepass->bitrate = xvidenc_bitrate;
+	if (xvidenc_bitrate > 16000) onepass->bitrate = xvidenc_bitrate;
+	else onepass->bitrate = xvidenc_bitrate*1000;
 	onepass->reaction_delay_factor = xvidenc_cbr_reaction_delay_factor;
 	onepass->averaging_period = xvidenc_cbr_averaging_period;
 	onepass->buffer = xvidenc_cbr_buffer;
@@ -983,7 +984,8 @@
 
 		/* There is not much left to initialize after dispatch settings */
 		onepass->version = XVID_VERSION;
-		onepass->bitrate = xvidenc_bitrate*1000;
+		if (xvidenc_bitrate > 16000) onepass->bitrate = xvidenc_bitrate;
+		else onepass->bitrate = xvidenc_bitrate*1000;
 
 		/* Quantizer mode uses the same plugin, we have only to define
 		 * a constant quantizer zone beginning at frame 0 */
@@ -1006,7 +1008,7 @@
 		} else {
 			mp_msg(MSGT_MENCODER, MSGL_INFO,
 			       "xvid: CBR Rate Control -- bitrate=%dkbit/s\n",
-			       xvidenc_bitrate);
+			       xvidenc_bitrate>16000?xvidenc_bitrate/1000:xvidenc_bitrate);
 		}
 
 		create->plugins[create->num_plugins].func  = xvid_plugin_single;
@@ -1042,10 +1044,11 @@
 		 * value is negative it is considered as being a total size
 		 * to reach (in kilobytes) */
 		if(xvidenc_bitrate > 0) {
-			pass2->bitrate  = xvidenc_bitrate*1000;
+			if(xvidenc_bitrate > 16000) pass2->bitrate = xvidenc_bitrate;
+			else pass2->bitrate = xvidenc_bitrate*1000;
 			mp_msg(MSGT_MENCODER, MSGL_INFO,
 			       "xvid: 2Pass Rate Control -- 2nd pass -- bitrate=%dkbit/s\n",
-			       xvidenc_bitrate);
+			       xvidenc_bitrate>16000?xvidenc_bitrate/1000:xvidenc_bitrate);
 		} else {
 			pass2->bitrate  = xvidenc_bitrate;
 			mp_msg(MSGT_MENCODER, MSGL_INFO,


More information about the MPlayer-dev-eng mailing list