[xiph-cvs] cvs commit: vorbis/lib/modes mode_44c_A.h

Monty xiphmont at xiph.org
Wed Nov 21 23:54:42 PST 2001



xiphmont    01/11/21 23:54:42

  Modified:    lib      Tag: branch_monty_20011009 bitrate.c
               lib/modes Tag: branch_monty_20011009 mode_44c_A.h
  Log:
  ongoing fixes to bitrate management
  
  Monty

Revision  Changes    Path
No                   revision

No                   revision

1.1.2.3   +7 -8      vorbis/lib/Attic/bitrate.c

Index: bitrate.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/Attic/bitrate.c,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- bitrate.c	2001/11/22 06:21:07	1.1.2.2
+++ bitrate.c	2001/11/22 07:54:41	1.1.2.3
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: bitrate tracking and management
- last mod: $Id: bitrate.c,v 1.1.2.2 2001/11/22 06:21:07 xiphmont Exp $
+ last mod: $Id: bitrate.c,v 1.1.2.3 2001/11/22 07:54:41 xiphmont Exp $
 
  ********************************************************************/
 
@@ -98,7 +98,7 @@
                  bi->queue_minmax_time)+bm->avg_centerdesired;
   
   if(maxlatency>0){
-    long maxpackets=maxlatency/ci->blocksizes[0]+3;
+    long maxpackets=maxlatency/(ci->blocksizes[0]>>1)+3;
     long bins=BITTRACK_DIVISOR*ci->passlimit[ci->coupling_passes-1];
     
     bm->queue_size=maxpackets;
@@ -311,7 +311,7 @@
       
       /* apply the average floater to new blocks */
       bin=bm->avgfloat*BITTRACK_DIVISOR; /* truncate on purpose */
-      //fprintf(stderr,"float:%d ",bin);
+      fprintf(stderr,"float:%d ",bin);
       while(bm->avg_centeracc>desired_center){
         int samples=
           samples=ci->blocksizes[bm->queue_actual[bm->avg_center]&
@@ -428,7 +428,7 @@
       double bitrate=(double)bm->minmax_acctotal/bm->minmax_sampleacc*vi->rate;
       int limit=0;
       
-      //fprintf(stderr,"prelimit:%dkbps ",(int)bitrate);
+      fprintf(stderr,"prelimit:%dkbps ",(int)bitrate/1000);
       if(bitrate>bi->queue_hardmax || bitrate<bi->queue_hardmin){
         int newstack;
         int stackctr;
@@ -450,6 +450,7 @@
             bitrate=(double)bitsum/bm->minmax_sampleacc*vi->rate;
             if(bitrate>=bi->queue_hardmin)break;
           }
+	  if(bitrate>bi->queue_hardmax)limit--;
         }
 
         /* trace the limit backward, stop when we see a lower limit */
@@ -477,7 +478,7 @@
         stackctr++;
         bm->minmax_posstack[stackctr]=bm->minmax_posstack[bm->minmax_stackptr];
         bm->minmax_limitstack[stackctr]=limit;
-	//fprintf(stderr,"limit:%d\n",limit);
+	fprintf(stderr,"limit:%d\n",limit);
 
         /* set up new blank stack entry */
         stackctr++;
@@ -552,22 +553,20 @@
     bm->queue_head=0;
 
   }else{
+    long bins=bm->queue_bins;
     long bin;
     long bytes;
 
-    fprintf(stderr,"in ");
     if(bm->next_to_flush==bm->last_to_flush)return(0);
 
     bin=bm->queue_actual[bm->next_to_flush];
-    bytes=(bm->queue_binned[bm->queue_bins*bm->next_to_flush+bin]+7)/8;
+    bytes=(BINBITS(bm->next_to_flush,bin)+7)/8;
     
     memcpy(op,bm->queue_packets+bm->next_to_flush,sizeof(*op));
     if(bytes<op->bytes)op->bytes=bytes;
 
     bm->next_to_flush++;
     if(bm->next_to_flush>=bm->queue_size)bm->next_to_flush=0;
-
-    fprintf(stderr,"eof %d %ld\n",op->e_o_s,(long)op->granulepos);
 
   }
 

No                   revision

No                   revision

1.4.2.10  +2 -2      vorbis/lib/modes/mode_44c_A.h

Index: mode_44c_A.h
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/modes/mode_44c_A.h,v
retrieving revision 1.4.2.9
retrieving revision 1.4.2.10
diff -u -r1.4.2.9 -r1.4.2.10
--- mode_44c_A.h	2001/11/22 06:21:11	1.4.2.9
+++ mode_44c_A.h	2001/11/22 07:54:41	1.4.2.10
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: predefined encoding modes; 44kHz stereo ~64kbps true VBR
- last mod: $Id: mode_44c_A.h,v 1.4.2.9 2001/11/22 06:21:11 xiphmont Exp $
+ last mod: $Id: mode_44c_A.h,v 1.4.2.10 2001/11/22 07:54:41 xiphmont Exp $
 
  ********************************************************************/
 
@@ -84,8 +84,8 @@
   /* progressive coding and bitrate controls */
             110000,90000,     -1,-1,
   2.,.5,
-  1.,       112000,           140000,  
-            124000,           128000,
+  2.,       128000,           128000,  
+            128000,           128000,
            
   4.0, 0.,  -1.,              .05, 
             -.05,             .05,

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list