summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty <xiphmont@xiph.org>2003-04-10 12:03:13 +0000
committerMonty <xiphmont@xiph.org>2003-04-10 12:03:13 +0000
commit36454e10b79797e68f02287f277b78a6225da413 (patch)
tree84d5422323ba233ca5c74cbcf588c361bc739b10
parent76bb18a1854d9293bec36238481fb54735cdd473 (diff)
downloadtremor-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.h4
-rw-r--r--block.c2
-rw-r--r--codebook.c8
-rw-r--r--floor0.c16
-rw-r--r--floor1.c6
-rw-r--r--mapping0.c2
-rw-r--r--misc.h4
7 files changed, 19 insertions, 23 deletions
diff --git a/backends.h b/backends.h
index 32657c2..6afe3ca 100644
--- a/backends.h
+++ b/backends.h
@@ -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;
diff --git a/block.c b/block.c
index 645d3a5..53e7eb0 100644
--- a/block.c
+++ b/block.c
@@ -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/ *
* *
********************************************************************
diff --git a/codebook.c b/codebook.c
index 4c00eaa..5997f50 100644
--- a/codebook.c
+++ b/codebook.c
@@ -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:
diff --git a/floor0.c b/floor0.c
index b475a97..3966a03 100644
--- a/floor0.c
+++ b/floor0.c
@@ -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);
}
}
diff --git a/floor1.c b/floor1.c
index 1943483..46117f8 100644
--- a/floor1.c
+++ b/floor1.c
@@ -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){
diff --git a/mapping0.c b/mapping0.c
index 6222141..095a0af 100644
--- a/mapping0.c
+++ b/mapping0.c
@@ -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/ *
* *
********************************************************************
diff --git a/misc.h b/misc.h
index 32ecc0a..6640790 100644
--- a/misc.h
+++ b/misc.h
@@ -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