From 548c5cd5ded1dd63dea5d121e6f7e4ec13d7da71 Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 14 Jun 2000 08:19:22 +0000 Subject: API change to stabilize psychoacoustic configuration for 1.0 beta. It would be nice, after all, to maintain binary compatability in the library... Monty svn path=/trunk/vorbis/; revision=446 --- include/vorbis/backends.h | 12 ++++++------ include/vorbis/modes.h | 29 +++++++++++++++++++++-------- include/vorbis/os_types.h | 6 +++--- lib/res0.c | 16 ++++++---------- 4 files changed, 36 insertions(+), 27 deletions(-) diff --git a/include/vorbis/backends.h b/include/vorbis/backends.h index 15a6524f..cf1068d7 100644 --- a/include/vorbis/backends.h +++ b/include/vorbis/backends.h @@ -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; diff --git a/include/vorbis/modes.h b/include/vorbis/modes.h index d5d9d221..c47428ef 100644 --- a/include/vorbis/modes.h +++ b/include/vorbis/modes.h @@ -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}}; diff --git a/include/vorbis/os_types.h b/include/vorbis/os_types.h index 9a63a869..bd719bbe 100644 --- a/include/vorbis/os_types.h +++ b/include/vorbis/os_types.h @@ -14,11 +14,11 @@ ******************************************************************** 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 #endif -#endif // _OS_TYPES_H +#endif diff --git a/lib/res0.c b/lib/res0.c index 674747b1..e821722a 100644 --- a/lib/res0.c +++ b/lib/res0.c @@ -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;isubgrp[i]]<=info->entmax[i] && + if(auxpartnumblimit[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;iend;i+=samples_per_partition,l++){ - int offset=((info->Bpoint==-1 || lBpoint)?0: - ((info->Cpoint==-1 || lCpoint)?auxperpart: - auxperpart*2)); - for(j=0;j