ref: 7592cc985f084dbfab7f941100d1f09b33a43e22
parent: ceb107d19c8719a75edd2be1fae4666cfbc91936
author: menno <menno>
date: Fri May 31 14:06:50 EDT 2002
VCB11 fix
--- a/libfaad/codebook/hcb.h
+++ b/libfaad/codebook/hcb.h
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: hcb.h,v 1.2 2002/02/18 10:01:05 menno Exp $
+** $Id: hcb.h,v 1.3 2002/05/31 18:06:50 menno Exp $
**/
#ifndef __HCB_H__
@@ -65,8 +65,7 @@
#define ESC_HCB 11
#define QUAD_LEN 4
#define PAIR_LEN 2
-#define NSPECBOOKS ESC_HCB + 1
-#define BOOKSCL NSPECBOOKS
+#define BOOKSCL 12
#define NOISE_HCB 13
#define INTENSITY_HCB2 14
#define INTENSITY_HCB 15
--- a/libfaad/huffman.h
+++ b/libfaad/huffman.h
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: huffman.h,v 1.6 2002/05/31 17:18:34 menno Exp $
+** $Id: huffman.h,v 1.7 2002/05/31 18:06:49 menno Exp $
**/
#ifndef __HUFFMAN_H__
@@ -188,12 +188,13 @@
return sp;
neg = 1;
} else {
- if(sp != +16)
+ if(sp != 16)
return sp;
neg = 0;
}
- for (i = 4; ; i++){
+ for (i = 4; ; i++)
+ {
if (faad_get1bit(ld
DEBUGVAR(1,6,"huffman_getescape(): escape size")) == 0)
{
@@ -201,19 +202,25 @@
}
}
- if (i > 16) {
+#if 0
+ if (i > 16)
+ {
off = faad_getbits(ld, i-16
DEBUGVAR(1,7,"huffman_getescape(): escape, first part")) << 16;
off |= faad_getbits(ld, 16
DEBUGVAR(1,8,"huffman_getescape(): escape, second part"));
} else {
+#endif
off = faad_getbits(ld, i
DEBUGVAR(1,9,"huffman_getescape(): escape"));
+#if 0
}
+#endif
j = off + (1<<i);
if (neg)
j = -j;
+
return j;
}
--- a/libfaad/syntax.c
+++ b/libfaad/syntax.c
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: syntax.c,v 1.15 2002/05/31 17:18:34 menno Exp $
+** $Id: syntax.c,v 1.16 2002/05/31 18:06:49 menno Exp $
**/
/*
@@ -1052,7 +1052,9 @@
/* defines whether a huffman codebook is unsigned or not */
/* Table 4.6.2 */
-static uint8_t unsigned_cb[] = { 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0 };
+static uint8_t unsigned_cb[] = { 0, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0,
+ /* codebook 16 to 31 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+};
/* Table 4.4.29 */
static uint8_t spectral_data(ic_stream *ics, bitfile *ld, int16_t *spectral_data,
@@ -1102,7 +1104,7 @@
huffman_sign_bits(ld, sp, inc);
k += inc;
p += inc;
- if (sect_cb == ESC_HCB)
+ if ((sect_cb == ESC_HCB) || (sect_cb >= 16))
{
sp[0] = huffman_getescape(ld, sp[0]);
sp[1] = huffman_getescape(ld, sp[1]);
--- a/libfaad/syntax.h
+++ b/libfaad/syntax.h
@@ -16,7 +16,7 @@
** along with this program; if not, write to the Free Software
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**
-** $Id: syntax.h,v 1.10 2002/05/31 17:18:34 menno Exp $
+** $Id: syntax.h,v 1.11 2002/05/31 18:06:50 menno Exp $
**/
#ifndef __SYNTAX_H__
@@ -76,8 +76,7 @@
#define ESC_HCB 11
#define QUAD_LEN 4
#define PAIR_LEN 2
-#define NSPECBOOKS ESC_HCB + 1
-#define BOOKSCL NSPECBOOKS
+#define BOOKSCL 12
#define NOISE_HCB 13
#define INTENSITY_HCB2 14
#define INTENSITY_HCB 15