changeset 11929:d870d266634e

allow using of float fixed_quant
author iive
date Fri, 06 Feb 2004 23:45:53 +0000
parents 7d603ceb4ac1
children f2a503cb70ba
files libmpcodecs/ve_xvid4.c
diffstat 1 files changed, 7 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/libmpcodecs/ve_xvid4.c	Fri Feb 06 20:44:09 2004 +0000
+++ b/libmpcodecs/ve_xvid4.c	Fri Feb 06 23:45:53 2004 +0000
@@ -987,22 +987,20 @@
 		/* Quantizer mode uses the same plugin, we have only to define
 		 * a constant quantizer zone beginning at frame 0 */
 		if(pass == MODE_QUANT) {
-			int base, incr;
-
-			base = 100;
-			incr = (int)xvidenc_quantizer*base;
+                        XVIDRational squant;
+			squant = xvid_d2q(xvidenc_quantizer,128);
 
 			create->zones[create->num_zones].mode      = XVID_ZONE_QUANT;
 			create->zones[create->num_zones].frame     = 0;
-			create->zones[create->num_zones].base      = base;
-			create->zones[create->num_zones].increment = incr;
+			create->zones[create->num_zones].base      = squant.num;
+			create->zones[create->num_zones].increment = squant.den;
 			create->num_zones++;
 
 			mp_msg(MSGT_MENCODER, MSGL_INFO,
 			       "xvid: Fixed Quant Rate Control -- quantizer=%d/%d=%2.2f\n",
-			       incr,
-			       base,
-			       (float)(incr)/(float)(base));
+			       squant.num,
+			       squant.den,
+			       (float)(squant.num)/(float)(squant.den));
 			
 		} else {
 			mp_msg(MSGT_MENCODER, MSGL_INFO,