********************************************************************
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 $
********************************************************************/
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,
{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}};
********************************************************************
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 $
********************************************************************/
/* 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.;
}
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;
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;
}
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