API change to stabilize psychoacoustic configuration for 1.0 beta. It
authorMonty <xiphmont@xiph.org>
Wed, 14 Jun 2000 08:19:22 +0000 (08:19 +0000)
committerMonty <xiphmont@xiph.org>
Wed, 14 Jun 2000 08:19:22 +0000 (08:19 +0000)
would be nice, after all, to maintain binary compatability in the
library...

Monty

svn path=/trunk/vorbis/; revision=446

include/vorbis/backends.h
include/vorbis/modes.h
include/vorbis/os_types.h
lib/res0.c

index 15a6524..cf1068d 100644 (file)
@@ -13,7 +13,7 @@
 
  function: libvorbis backend and mapping structures; needed for 
            static mode headers
- last mod: $Id: backends.h,v 1.9 2000/06/14 01:38:27 xiphmont Exp $
+ last mod: $Id: backends.h,v 1.10 2000/06/14 08:19:22 xiphmont Exp $
 
  ********************************************************************/
 
@@ -102,11 +102,11 @@ typedef struct vorbis_info_residue0{
   int    secondstages[64]; /* expanded out to pointers in lookup */
   int    booklist[256];    /* list of second stage books */
 
-  double entmax[64];       /* book entropy threshholds for *encode* */
-  double ampmax[64];       /* book amp threshholds for *encode* */
-  int    subgrp[64];       /* book subgroup size for *encode* */
-  long   Bpoint;
-  long   Cpoint;
+  /* encode-only heuristic settings */
+  double entmax[64];       /* book entropy threshholds*/
+  double ampmax[64];       /* book amp threshholds*/
+  int    subgrp[64];       /* book heuristic subgroup size */
+  int    blimit[64];       /* subgroup position limits */
 
 } vorbis_info_residue0;
 
index d5d9d22..c47428e 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: predefined encoding modes
- last mod: $Id: modes.h,v 1.11 2000/06/14 01:38:27 xiphmont Exp $
+ last mod: $Id: modes.h,v 1.12 2000/06/14 08:19:22 xiphmont Exp $
 
  ********************************************************************/
 
@@ -105,13 +105,13 @@ static vorbis_info_floor0 _floor_set1={30, 44100, 256, 12,150, 1, {1} };
 static vorbis_info_residue0 _residue_set0={0,128, 64,14,2,
                                           {0,1,1,1,1,1,1,1,1,1,1,1,1,1,
                                            0,1,1,1,1,1,1,1,1,1,1,1,1,1},
-                                          {4,5,6,7,8,9,10,11,12,13,14,15,16,
-                                           17,18,19,20,21,22,23,24,25,26,27,28,29},
+                                          {4,5,6,7,8,9,10,11,12,13,14,15,16},
 
                                           {0,16,9999,30,9999,41,9999,47,9999,60,9999,128,9999},
                                           {1.5,1.5,1.5,2.5,2.5,3.5,3.5,5,5,9,9,18,18},
                                           {6,6,6,6,6,6,6,6,6,6,6,6,6},
-                                          -1,-1};
+                                          {99,99,99,99,99,99,99,
+                                           99,99,99,99,99,99,99}};
 
 static vorbis_info_residue0 _residue_set1={0,768, 64,28,3,
                                           {0,1,1,1,1,1,1,1,1,1,1,1,1,1,
@@ -119,10 +119,23 @@ static vorbis_info_residue0 _residue_set1={0,768, 64,28,3,
                                           {4,5,6,7,8,9,10,11,12,13,14,15,16,
                                            17,18,19,20,21,22,23,24,25,26,27,28,29},
                                           
-                                          {0,16,9999,30,9999,41,9999,47,9999,60,9999,128,9999},
-                                          {1.5,1.5,1.5,2.5,2.5,3.5,3.5,5,5,9,9,18,18},
-                                          {6,6,6,6,6,6,6,6,6,6,6,6,6},/*6==64*/
-                                          2,-1};
+                                          {0, 16,9999, 30,9999, 41,9999,
+                                           47,9999,60,9999,128,9999,9999,
+                                           0, 16,9999, 30,9999, 41,9999,
+                                           47,9999,60,9999,128,9999},
+
+                                          {1.5, 1.5,1.5, 2.5,2.5, 3.5,3.5,
+                                           5,5, 9,9, 18,18, 9999,
+                                          1.5, 1.5,1.5, 2.5,2.5, 3.5,3.5,
+                                           5,5, 9,9, 18,18},
+
+                                          {6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+                                          6,6,6,6,6,6,6,6,6,6,6,6,6},/*6==64*/
+
+                                          {2,2,2,2,2,2,2,
+                                           2,2,2,2,2,2,2,
+                                           99,99,99,99,99,99,99,
+                                           99,99,99,99,99,99}};
 
 static vorbis_info_mapping0 _mapping_set0={1, {0,0}, {0}, {0}, {0}, {0}};
 static vorbis_info_mapping0 _mapping_set1={1, {0,0}, {0}, {1}, {1}, {0}};
index 9a63a86..bd719bb 100644 (file)
  ********************************************************************
 
  function: #ifdef jail to whip a few platforms into the UNIX ideal.
- last mod: $Id: os_types.h,v 1.2 2000/05/10 23:22:35 xiphmont Exp $
+ last mod: $Id: os_types.h,v 1.3 2000/06/14 08:19:22 xiphmont Exp $
 
  ********************************************************************/
 
-#ifdef _WIN32
+#if defined (_WIN32) && !defined(__GNUC__)
 typedef __int64 int64_t;
 typedef unsigned int u_int32_t;
 #endif
@@ -27,5 +27,5 @@ typedef unsigned int u_int32_t;
 #include <inttypes.h>
 #endif
 
-#endif // _OS_TYPES_H
+#endif 
 
index 674747b..e821722 100644 (file)
@@ -12,7 +12,7 @@
  ********************************************************************
 
  function: residue backend 0 implementation
- last mod: $Id: res0.c,v 1.13 2000/06/14 01:38:31 xiphmont Exp $
+ last mod: $Id: res0.c,v 1.14 2000/06/14 08:19:22 xiphmont Exp $
 
  ********************************************************************/
 
@@ -154,7 +154,8 @@ vorbis_look_residue *look (vorbis_dsp_state *vd,vorbis_info_mode *vm,
 
 /* does not guard against invalid settings; eg, a subn of 16 and a
    subgroup request of 32.  Max subn of 128 */
-static int _testhack(double *vec,int n,vorbis_look_residue0 *look,int auxparts){
+static int _testhack(double *vec,int n,vorbis_look_residue0 *look,
+                    int auxparts,int auxpartnum){
   vorbis_info_residue0 *info=look->info;
   int i,j=0;
   double max,localmax=0.;
@@ -184,7 +185,8 @@ static int _testhack(double *vec,int n,vorbis_look_residue0 *look,int auxparts){
   }
 
   for(i=0;i<auxparts-1;i++)
-    if(entropy[info->subgrp[i]]<=info->entmax[i] &&
+    if(auxpartnum<info->blimit[i] &&
+       entropy[info->subgrp[i]]<=info->entmax[i] &&
        max<=info->ampmax[i])
       break;
 
@@ -242,8 +244,6 @@ int forward(vorbis_block *vb,vorbis_look_residue *vl,
   int partvals=n/samples_per_partition;
   int partwords=(partvals+partitions_per_word-1)/partitions_per_word;
   long **partword=_vorbis_block_alloc(vb,ch*sizeof(long *));
-  long auxperpart=(info->Bpoint==-1?look->parts:
-                  (info->Cpoint==-1?look->parts/2:look->parts/3));
 
   partvals=partwords*partitions_per_word;
 
@@ -260,15 +260,11 @@ int forward(vorbis_block *vb,vorbis_look_residue *vl,
   }
 
   for(i=info->begin,l=0;i<info->end;i+=samples_per_partition,l++){
-    int offset=((info->Bpoint==-1 || l<info->Bpoint)?0:
-               ((info->Cpoint==-1 || l<info->Cpoint)?auxperpart:
-                auxperpart*2));
-    
     for(j=0;j<ch;j++)
       /* do the partition decision based on the number of 'bits'
          needed to encode the block */
       partword[j][l]=
-       _testhack(in[j]+i,samples_per_partition,look,auxperpart)+offset;
+       _testhack(in[j]+i,samples_per_partition,look,possible_partitions,l);
   
   }
   /* we code the partition words for each channel, then the residual