[xiph-cvs] cvs commit: Tremor floor0.c

Monty xiphmont at xiph.org
Sun Apr 13 18:55:13 PDT 2003



xiphmont    03/04/13 21:55:13

  Modified:    .        Tag: lowmem-branch floor0.c
  Log:
  Low accuracy version of floor0.c fixed

Revision  Changes    Path
No                   revision

<p>No                   revision

<p>1.4.6.6   +20 -5     Tremor/floor0.c

Index: floor0.c
===================================================================
RCS file: /usr/local/cvsroot/Tremor/floor0.c,v
retrieving revision 1.4.6.5
retrieving revision 1.4.6.6
diff -u -r1.4.6.5 -r1.4.6.6
--- floor0.c	14 Apr 2003 01:13:44 -0000	1.4.6.5
+++ floor0.c	14 Apr 2003 01:55:13 -0000	1.4.6.6
@@ -141,7 +141,11 @@
   int fdy=nyq-fbase*fdx;
   int map=0;
 
+#ifdef _LOW_ACCURACY_
+  ogg_uint32_t nextbark=((tBnyq1<<11)/ln)>>12;
+#else
   ogg_uint32_t nextbark=MULT31(imap>>1,tBnyq1);
+#endif
   int nextf=barklook[nextbark>>14]+(((nextbark&0x3fff)*
             (barklook[(nextbark>>14)+1]-barklook[nextbark>>14]))>>14);
 
@@ -301,11 +305,22 @@
     while(1){
       map++;
 
-      nextbark=MULT31((map+1)*(imap>>1),tBnyq1);
-      nextf=barklook[nextbark>>14]+
-	(((nextbark&0x3fff)*
-	  (barklook[(nextbark>>14)+1]-barklook[nextbark>>14]))>>14);
-      if(f<=nextf)break;
+      if(map+1<ln){
+	
+#ifdef _LOW_ACCURACY_
+	nextbark=((tBnyq1<<11)/ln*(map+1))>>12;
+#else
+	nextbark=MULT31((map+1)*(imap>>1),tBnyq1);
+#endif
+	nextf=barklook[nextbark>>14]+
+	  (((nextbark&0x3fff)*
+	    (barklook[(nextbark>>14)+1]-barklook[nextbark>>14]))>>14);
+	if(f<=nextf)break;
+	
+      }else{
+	nextf=9999999;
+	break;
+      }
     }
     if(map>=ln){
       map=ln-1; /* guard against the approximation */      

<p><p>--- >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