changeset 707:c0a914cc90c0 libavcodec

renaming variable
author michaelni
date Sun, 29 Sep 2002 23:21:13 +0000
parents e65798d228ea
children 1aa1cbb8c3c1
files mpegvideo.h ratecontrol.c
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mpegvideo.h	Sun Sep 29 22:44:22 2002 +0000
+++ b/mpegvideo.h	Sun Sep 29 23:21:13 2002 +0000
@@ -76,7 +76,7 @@
     Predictor pred[5];
     double short_term_qsum;   /* sum of recent qscales */
     double short_term_qcount; /* count of recent qscales */
-    double pass1_bits;        /* bits outputted by the pass1 code (including complexity init) */
+    double pass1_rc_eq_output_sum;/* sum of the output of the rc equation, this is used for normalization  */
     double pass1_wanted_bits; /* bits which should have been outputed by the pass1 code (including complexity init) */
     double last_qscale;
     double last_qscale_for[5]; /* last qscale for a specific pict type, used for max_diff & ipb factor stuff */
--- a/ratecontrol.c	Sun Sep 29 22:44:22 2002 +0000
+++ b/ratecontrol.c	Sun Sep 29 23:21:13 2002 +0000
@@ -123,7 +123,7 @@
         rcc->short_term_qsum=0.001;
         rcc->short_term_qcount=0.001;
     
-        rcc->pass1_bits       =0.001;
+        rcc->pass1_rc_eq_output_sum= 0.001;
         rcc->pass1_wanted_bits=0.001;
         
         /* init stuff with the user specified complexity */
@@ -163,7 +163,7 @@
 
                 bits= rce.i_tex_bits + rce.p_tex_bits;
 
-                q= get_qscale(s, &rce, rcc->pass1_wanted_bits/rcc->pass1_bits, i);
+                q= get_qscale(s, &rce, rcc->pass1_wanted_bits/rcc->pass1_rc_eq_output_sum, i);
                 rcc->pass1_wanted_bits+= s->bit_rate/(s->frame_rate / (double)FRAME_RATE_BASE);
             }
         }
@@ -296,7 +296,7 @@
 
     bits= ff_eval(s->avctx->rc_eq, const_values, const_names, func1, func1_names, NULL, NULL, rce);
     
-    rcc->pass1_bits+= bits;
+    rcc->pass1_rc_eq_output_sum+= bits;
     bits*=rate_factor;
     if(bits<0.0) bits=0.0;
     bits+= 1.0; //avoid 1/0 issues
@@ -628,7 +628,7 @@
         rcc->frame_count[pict_type] ++;
 
         bits= rce->i_tex_bits + rce->p_tex_bits;
-        rate_factor= rcc->pass1_wanted_bits/rcc->pass1_bits * br_compensation;
+        rate_factor= rcc->pass1_wanted_bits/rcc->pass1_rc_eq_output_sum * br_compensation;
     
         q= get_qscale(s, rce, rate_factor, picture_number);