diff options
author | Monty <xiphmont@xiph.org> | 2003-04-10 12:03:13 +0000 |
---|---|---|
committer | Monty <xiphmont@xiph.org> | 2003-04-10 12:03:13 +0000 |
commit | 36454e10b79797e68f02287f277b78a6225da413 (patch) | |
tree | 84d5422323ba233ca5c74cbcf588c361bc739b10 | |
parent | 76bb18a1854d9293bec36238481fb54735cdd473 (diff) | |
download | tremor-36454e10b79797e68f02287f277b78a6225da413.tar.gz |
Correct a scaling bug in floor 1
git-svn-id: https://svn.xiph.org/branches/lowmem-branch/Tremor@4601 0101bb08-14d6-0310-b084-bc0e0c8e3800
-rw-r--r-- | backends.h | 4 | ||||
-rw-r--r-- | block.c | 2 | ||||
-rw-r--r-- | codebook.c | 8 | ||||
-rw-r--r-- | floor0.c | 16 | ||||
-rw-r--r-- | floor1.c | 6 | ||||
-rw-r--r-- | mapping0.c | 2 | ||||
-rw-r--r-- | misc.h | 4 |
7 files changed, 19 insertions, 23 deletions
@@ -6,7 +6,7 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 * * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * * * ******************************************************************** @@ -48,7 +48,7 @@ typedef struct{ int ampdB; int numbooks; /* <= 16 */ - int books[16]; + char books[16]; } vorbis_info_floor0; @@ -6,7 +6,7 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 * * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * * * ******************************************************************** @@ -15,6 +15,7 @@ ********************************************************************/ +#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> @@ -418,7 +419,7 @@ int vorbis_book_unpack(oggpack_buffer *opb,codebook *s){ s->dec_nodeb=_determine_node_bytes(s->used_entries,_ilog(s->entries)/8+1); s->dec_leafw=_determine_leaf_words(s->dec_nodeb,_ilog(s->entries)/8+1); s->dec_type=0; - + if(_make_decode_table(s,lengthlist,quantvals,opb,maptype)) goto _errout; break; @@ -529,6 +530,11 @@ int vorbis_book_unpack(oggpack_buffer *opb,codebook *s){ if(oggpack_eop(opb))goto _eofout; + fprintf(stderr,"%d/%d x%d b%d dec_type%d (%d/%d)\n", + s->used_entries,s->entries,s->dim,s->q_bits,s->dec_type, + s->dec_nodeb*8,s->dec_nodeb*s->dec_leafw*8); + + return 0; _errout: _eofout: @@ -6,7 +6,7 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 * * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * * * ******************************************************************** @@ -83,17 +83,6 @@ static const ogg_int32_t barklook[28]={ 15624,20397,27087,36554 }; -static const ogg_uint32_t barklook_igap[27]={ - 21474836, 21474836, 21262214, 20648881, - 19346700, 18046081, 16393005, 14708792, - 13015052, 11545611, 10082083, 8801162, - 7588281, 6507526, 5534752, 4638194, - 3848537, 3130443, 2505815, 1968363, - 1517656, 1147773, 852514, 623725, - 449923, 320999, 226839 -}; - - /* used in init only; interpolate the long way */ static inline ogg_int32_t toBARK(int n){ int i; @@ -103,7 +92,8 @@ static inline ogg_int32_t toBARK(int n){ if(i==27){ return 27<<15; }else{ - return (i<<15)+(((n-barklook[i])*barklook_igap[i])>>16); + return (i<<15)+(((n-barklook[i])* + ((1<<31)/(barklook[i+1]-barklook[i])))>>16); } } @@ -6,7 +6,7 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 * * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * * * ******************************************************************** @@ -80,7 +80,7 @@ static vorbis_info_floor *floor1_unpack (vorbis_info *vi,oggpack_buffer *opb){ } /* read the post list */ - info->mult=oggpack_read(opb,2); /* only 0,1,2,3 legal now */ + info->mult=oggpack_read(opb,2)+1; /* only 1,2,3,4 legal now */ rangebits=oggpack_read(opb,4); for(j=0,k=0;j<info->partitions;j++){ @@ -256,7 +256,7 @@ static void *floor1_inverse1(vorbis_block *vb,vorbis_info_floor *in){ int i,j,k; codebook *books=ci->book_param; - int quant_q=quant_look[info->mult]; + int quant_q=quant_look[info->mult-1]; /* unpack wrapped/predicted values from stream */ if(oggpack_read(&vb->opb,1)==1){ @@ -6,7 +6,7 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 * * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * * * ******************************************************************** @@ -6,7 +6,7 @@ * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * * * - * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * + * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2003 * * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * * * ******************************************************************** @@ -20,7 +20,7 @@ #include "ivorbiscodec.h" #include "os_types.h" -//#define _VDBG_GRAPHFILE "_0.m" +#define _VDBG_GRAPHFILE "_0.m" #ifdef _VDBG_GRAPHFILE |