From 742843458fee3ee4c930e3c848814fd80463be9a Mon Sep 17 00:00:00 2001 From: iive Date: Fri, 6 Feb 2004 23:45:53 +0000 Subject: [PATCH] allow using of float fixed_quant git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11930 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ve_xvid4.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libmpcodecs/ve_xvid4.c b/libmpcodecs/ve_xvid4.c index feaddd760f..137fa207af 100644 --- a/libmpcodecs/ve_xvid4.c +++ b/libmpcodecs/ve_xvid4.c @@ -987,22 +987,20 @@ static int set_create_struct(xvid_mplayer_module_t *mod) /* 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,