summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorsimonb <simonb>1999-09-13 03:33:32 +0000
committersimonb <simonb>1999-09-13 03:33:32 +0000
commit65012feafd39111c7b3c806086f3daf1f76ca053 (patch)
tree3d8791a8a467e7962e79141438900db475a146dd /audio
parentbdeb86e429d13e54921f77a41daff1d0f8e7ba2b (diff)
downloadpkgsrc-65012feafd39111c7b3c806086f3daf1f76ca053.tar.gz
Use the source-code version of bladeenc (0.82-stable2), which should
work on all architectures. Tested on pmax, i386 and alpha (no big-endian machines!) and gives identical results, although not identical to the binary-only 0.76. If there's any big-endian people who want to test this, please let me know. Lots of patches because 64-bit longs just "Don't Work(tm)" - just use ints everywhere. I'm in communication with the author on how to fix this at his end.
Diffstat (limited to 'audio')
-rw-r--r--audio/bladeenc/Makefile17
-rw-r--r--audio/bladeenc/files/md54
-rw-r--r--audio/bladeenc/patches/patch-aa34
-rw-r--r--audio/bladeenc/patches/patch-ab13
-rw-r--r--audio/bladeenc/patches/patch-ac22
-rw-r--r--audio/bladeenc/patches/patch-ad13
-rw-r--r--audio/bladeenc/patches/patch-ae25
-rw-r--r--audio/bladeenc/patches/patch-af13
-rw-r--r--audio/bladeenc/patches/patch-ag29
-rw-r--r--audio/bladeenc/patches/patch-ah25
-rw-r--r--audio/bladeenc/patches/patch-ai24
-rw-r--r--audio/bladeenc/patches/patch-aj80
-rw-r--r--audio/bladeenc/patches/patch-ak13
-rw-r--r--audio/bladeenc/patches/patch-al80
-rw-r--r--audio/bladeenc/patches/patch-am62
-rw-r--r--audio/bladeenc/patches/patch-an85
-rw-r--r--audio/bladeenc/patches/patch-ao18
-rw-r--r--audio/bladeenc/pkg/MESSAGE8
18 files changed, 545 insertions, 20 deletions
diff --git a/audio/bladeenc/Makefile b/audio/bladeenc/Makefile
index ef4352d5297..095cbc8020d 100644
--- a/audio/bladeenc/Makefile
+++ b/audio/bladeenc/Makefile
@@ -1,19 +1,16 @@
-# $NetBSD: Makefile,v 1.4 1999/06/07 16:16:17 hubertf Exp $
+# $NetBSD: Makefile,v 1.5 1999/09/13 03:33:32 simonb Exp $
#
-DISTNAME= BladeEnc-076-bsd-i386
-PKGNAME= bladeenc-0.76
+DISTNAME= bladeenc-082-src-stable-2
+PKGNAME= bladeenc-0.82pl2
CATEGORIES= audio
-MASTER_SITES= http://home.swipnet.se/~w-82625/encoder/binaries/
-ONLY_FOR_PLATFORM= NetBSD-*-i386
+MASTER_SITES= http://home.swipnet.se/~w-82625/encoder/source/
MAINTAINER= packages@netbsd.org
HOMEPAGE= http://bladeenc.cjb.net
-NO_BUILD=
-
-do-install:
- ${INSTALL_SCRIPT} ${WRKDIR}/bladeenc ${PREFIX}/bin/
- ${INSTALL_DATA} ${WRKDIR}/BladeEnc.html ${PREFIX}/share/doc/bladeenc.html
+#do-install:
+# ${INSTALL_SCRIPT} ${WRKDIR}/bladeenc ${PREFIX}/bin/
+# ${INSTALL_DATA} ${WRKDIR}/BladeEnc.html ${PREFIX}/share/doc/bladeenc.html
.include "../../mk/bsd.pkg.mk"
diff --git a/audio/bladeenc/files/md5 b/audio/bladeenc/files/md5
index b6ad30d949d..25d43273ce5 100644
--- a/audio/bladeenc/files/md5
+++ b/audio/bladeenc/files/md5
@@ -1,3 +1,3 @@
-$NetBSD: md5,v 1.1.1.1 1998/12/28 03:16:27 tv Exp $
+$NetBSD: md5,v 1.2 1999/09/13 03:33:33 simonb Exp $
-MD5 (BladeEnc-076-bsd-i386.tar.gz) = 0681d6962fb9e37861837955396f38ba
+MD5 (bladeenc-082-src-stable-2.tar.gz) = 338e6837b48ea17ed8264467062d77e6
diff --git a/audio/bladeenc/patches/patch-aa b/audio/bladeenc/patches/patch-aa
new file mode 100644
index 00000000000..7a4755cccb2
--- /dev/null
+++ b/audio/bladeenc/patches/patch-aa
@@ -0,0 +1,34 @@
+$NetBSD: patch-aa,v 1.1 1999/09/13 03:33:34 simonb Exp $
+
+--- Makefile.orig Sat Jul 24 07:50:33 1999
++++ Makefile Mon Sep 13 11:40:05 1999
+@@ -4,7 +4,7 @@
+ # Modified a number of times by Tord Jansson <tord.jansson@swipnet.se>
+
+ # >>> Compiler options for GCC on i586 <<<
+-CFLAGS=-O2 -m486 -malign-jumps=2 -malign-loops=2 -funroll-all-loops
++CFLAGS=-O2 -funroll-all-loops
+ LIBS=-lm
+
+ # >>> Compiler options for GCC on SuperSparc Solaris <<<
+@@ -21,11 +21,17 @@
+ huffman.o l3bitstream.o l3psy.o loop.o main.o mdct.o reservoir.o \
+ samplein.o strupr.o subs.o tables.o
+
++all: bladeenc
++
++install: all
++ $(BSD_INSTALL_PROGRAM) bladeenc $(BINDIR)
++ $(BSD_INSTALL_MAN) bladeenc.html $(PREFIX)/share/doc
++
+ bladeenc: $(OBJS)
+- gcc -o $@ $^ $(LIBS)
++ gcc -g -o $@ $> $(LIBS)
+
+ %.o: %.c
+- gcc $(CFLAGS) -c -o $@ $^
++ gcc $(CFLAGS) -c -o $@ $<
+
+ codec.o: codec.c
+- gcc -O1 -c -o $@ $^
++ gcc -g -c -o $@ $<
diff --git a/audio/bladeenc/patches/patch-ab b/audio/bladeenc/patches/patch-ab
new file mode 100644
index 00000000000..2348b2e25d8
--- /dev/null
+++ b/audio/bladeenc/patches/patch-ab
@@ -0,0 +1,13 @@
+$NetBSD: patch-ab,v 1.1 1999/09/13 03:33:34 simonb Exp $
+
+--- bladesys.c.orig Sat Jul 24 07:50:33 1999
++++ bladesys.c Mon Sep 13 12:54:54 1999
+@@ -294,7 +294,7 @@
+ #ifdef MSWIN
+
+ static struct _finddata_t sFind;
+-static long hFind;
++static int hFind;
+
+ /*____ findFirstMatch() - MSWIN version ______________________________________*/
+
diff --git a/audio/bladeenc/patches/patch-ac b/audio/bladeenc/patches/patch-ac
new file mode 100644
index 00000000000..497eec37240
--- /dev/null
+++ b/audio/bladeenc/patches/patch-ac
@@ -0,0 +1,22 @@
+$NetBSD: patch-ac,v 1.1 1999/09/13 03:33:34 simonb Exp $
+
+--- codec.c.orig Sat Jul 24 07:50:33 1999
++++ codec.c Mon Sep 13 12:52:18 1999
+@@ -54,7 +54,7 @@
+ double avg_slots_per_frame, frac_SpF, slot_lag;
+ int stereo, error_protection;
+
+- unsigned long samplesPerFrame;
++ unsigned int samplesPerFrame;
+
+
+ extern int fInit_L3psycho_anal;
+@@ -227,7 +227,7 @@
+ }
+
+
+-void rebuffer_audio( short buffer[2][1152], short * insamp, unsigned long samples_read, int stereo );
++void rebuffer_audio( short buffer[2][1152], short * insamp, unsigned int samples_read, int stereo );
+
+ /*____ codecEncodeChunk() _____________________________________________________*/
+
diff --git a/audio/bladeenc/patches/patch-ad b/audio/bladeenc/patches/patch-ad
new file mode 100644
index 00000000000..dcb7ed2c329
--- /dev/null
+++ b/audio/bladeenc/patches/patch-ad
@@ -0,0 +1,13 @@
+$NetBSD: patch-ad,v 1.1 1999/09/13 03:33:34 simonb Exp $
+
+--- common.c.orig Sat Jul 24 07:50:33 1999
++++ common.c Mon Sep 13 12:52:24 1999
+@@ -75,7 +75,7 @@
+ *
+ *******************************************************************************/
+
+-void *mem_alloc(unsigned long block, char *item)
++void *mem_alloc(unsigned int block, char *item)
+ {
+
+ void *ptr;
diff --git a/audio/bladeenc/patches/patch-ae b/audio/bladeenc/patches/patch-ae
new file mode 100644
index 00000000000..89d305161b4
--- /dev/null
+++ b/audio/bladeenc/patches/patch-ae
@@ -0,0 +1,25 @@
+$NetBSD: patch-ae,v 1.1 1999/09/13 03:33:35 simonb Exp $
+
+--- common.h.orig Sat Jul 24 07:50:33 1999
++++ common.h Mon Sep 13 12:54:56 1999
+@@ -175,9 +175,9 @@
+
+ typedef struct bit_stream_struc {
+ FILE *pt; /* pointer to bit stream device */
+- unsigned char *buf; /* bit stream buffer */
++ u_int8_t *buf; /* bit stream buffer */
+ int buf_size; /* size of buffer (in number of bytes) */
+- long totbit; /* bit counter of bit stream */
++ int totbit; /* bit counter of bit stream */
+
+ int buf_byte_idx; /* pointer to top byte in buffer */
+ int buf_bit_idx; /* pointer to top bit of top byte in buffer */
+@@ -212,7 +212,7 @@
+ /* The following functions are in the file "common.c" */
+
+ extern void hdr_to_frps(frame_params *fr_ps); /* interpret data in hdr str to fields in fr_ps */
+-extern void *mem_alloc(unsigned long block, char *item);
++extern void *mem_alloc(unsigned int block, char *item);
+ extern void mem_free( void **ptr_addr);
+ extern void read_absthr();
+
diff --git a/audio/bladeenc/patches/patch-af b/audio/bladeenc/patches/patch-af
new file mode 100644
index 00000000000..18e5df6be3c
--- /dev/null
+++ b/audio/bladeenc/patches/patch-af
@@ -0,0 +1,13 @@
+$NetBSD: patch-af,v 1.1 1999/09/13 03:33:35 simonb Exp $
+
+--- encode.c.orig Sat Jul 24 07:50:33 1999
++++ encode.c Mon Sep 13 12:52:31 1999
+@@ -25,7 +25,7 @@
+
+ /*____ rebuffer_audio() __________________________________________________*/
+
+-void rebuffer_audio( short buffer[2][1152], short * insamp, unsigned long samples_read, int stereo )
++void rebuffer_audio( short buffer[2][1152], short * insamp, unsigned int samples_read, int stereo )
+ {
+ int j;
+
diff --git a/audio/bladeenc/patches/patch-ag b/audio/bladeenc/patches/patch-ag
new file mode 100644
index 00000000000..8dc7af3af5f
--- /dev/null
+++ b/audio/bladeenc/patches/patch-ag
@@ -0,0 +1,29 @@
+$NetBSD: patch-ag,v 1.1 1999/09/13 03:33:35 simonb Exp $
+
+--- encoder.h.orig Sat Jul 24 07:50:33 1999
++++ encoder.h Mon Sep 13 12:52:54 1999
+@@ -118,9 +118,9 @@
+
+ /* The following functions are in the file "musicin.c" */
+
+-extern void obtain_parameters(frame_params*, int*, unsigned long*,
++extern void obtain_parameters(frame_params*, int*, unsigned int*,
+ char[MAX_NAME_SIZE], char[MAX_NAME_SIZE]);
+-extern void parse_args(int, char**, frame_params*, int*, unsigned long*,
++extern void parse_args(int, char**, frame_params*, int*, unsigned int*,
+ char[MAX_NAME_SIZE], char[MAX_NAME_SIZE]);
+ extern void print_config(frame_params*, int*,
+ char[MAX_NAME_SIZE], char[MAX_NAME_SIZE]);
+@@ -129,9 +129,9 @@
+
+ /* The following functions are in the file "encode.c" */
+
+-extern unsigned long read_samples(FILE*, short[2304], unsigned long,
+- unsigned long);
+-extern unsigned long get_audio(FILE*, short[2][1152], unsigned long,
++extern unsigned int read_samples(FILE*, short[2304], unsigned int,
++ unsigned int);
++extern unsigned int get_audio(FILE*, short[2][1152], unsigned int,
+ int, layer* info);
+ extern void read_ana_window(double[HAN_SIZE]);
+ extern void window_subband(short**, double[HAN_SIZE], int);
diff --git a/audio/bladeenc/patches/patch-ah b/audio/bladeenc/patches/patch-ah
new file mode 100644
index 00000000000..9e48e5da382
--- /dev/null
+++ b/audio/bladeenc/patches/patch-ah
@@ -0,0 +1,25 @@
+$NetBSD: patch-ah,v 1.1 1999/09/13 03:33:35 simonb Exp $
+
+--- huffman.c.orig Sat Jul 24 07:50:33 1999
++++ huffman.c Mon Sep 13 12:53:06 1999
+@@ -111,9 +111,9 @@
+ return (-4);
+ }
+ #ifdef NO_ZERO_CALLOC
+- ht[n].hlen=(unsigned char *) calloc((xl*yl)+1,sizeof(unsigned char));
++ ht[n].hlen=(u_int8_t *) calloc((xl*yl)+1,sizeof(u_int8_t));
+ #else
+- ht[n].hlen=(unsigned char *) calloc(xl*yl,sizeof(unsigned char));
++ ht[n].hlen=(u_int8_t *) calloc(xl*yl,sizeof(u_int8_t));
+ #endif
+ if (ht[n].hlen == NULL) {
+ fprintf(stderr,"unsufficient heap error\n");
+@@ -143,7 +143,7 @@
+ n,i,j);
+ };
+ ht[n].table[i*xl+j] = h;
+- ht[n].hlen[i*xl+j] = (unsigned char) len;
++ ht[n].hlen[i*xl+j] = (u_int8_t) len;
+ do {
+ strcpy( line, aHuffcode[index++] );
+ /* fgets(line,99,fi); */
diff --git a/audio/bladeenc/patches/patch-ai b/audio/bladeenc/patches/patch-ai
new file mode 100644
index 00000000000..d11227c667c
--- /dev/null
+++ b/audio/bladeenc/patches/patch-ai
@@ -0,0 +1,24 @@
+$NetBSD: patch-ai,v 1.1 1999/09/13 03:33:35 simonb Exp $
+
+--- huffman.h.orig Sat Jul 24 07:50:33 1999
++++ huffman.h Mon Sep 13 12:53:13 1999
+@@ -41,7 +41,7 @@
+ * removed *
+ *********************************************************************/
+
+-#define HUFFBITS unsigned long int
++#define HUFFBITS unsigned int
+ #define HTN 34
+ #define MXOFF 250
+
+@@ -53,8 +53,8 @@
+ unsigned int linmax; /*max number to be stored in linbits */
+ int ref; /*a positive value indicates a reference*/
+ HUFFBITS *table; /*pointer to array[xlen][ylen] */
+- unsigned char *hlen; /*pointer to array[xlen][ylen] */
+- unsigned char(*val)[2];/*decoder tree */
++ u_int8_t *hlen; /*pointer to array[xlen][ylen] */
++ u_int8_t(*val)[2];/*decoder tree */
+ unsigned int treelen; /*length of decoder tree */
+ };
+
diff --git a/audio/bladeenc/patches/patch-aj b/audio/bladeenc/patches/patch-aj
new file mode 100644
index 00000000000..7511ce5a277
--- /dev/null
+++ b/audio/bladeenc/patches/patch-aj
@@ -0,0 +1,80 @@
+$NetBSD: patch-aj,v 1.1 1999/09/13 03:33:35 simonb Exp $
+
+--- l3bitstream.c.orig Sat Jul 24 07:50:33 1999
++++ l3bitstream.c Mon Sep 13 12:53:24 1999
+@@ -160,8 +160,8 @@
+ /* BF_FlushBitstream( frameData, frameResults ); */
+ }
+
+-static unsigned slen1_tab[16] = { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 };
+-static unsigned slen2_tab[16] = { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 };
++static unsigned int slen1_tab[16] = { 0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4 };
++static unsigned int slen2_tab[16] = { 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3 };
+
+ static void encodeMainData( int l3_enc[2][2][576],
+ III_side_info_t *si,
+@@ -185,8 +185,8 @@
+ {
+ BitHolder **pph = &scaleFactorsPH[gr][ch];
+ gr_info *gi = &(si->gr[gr].ch[ch].tt);
+- unsigned slen1 = slen1_tab[ gi->scalefac_compress ];
+- unsigned slen2 = slen2_tab[ gi->scalefac_compress ];
++ unsigned int slen1 = slen1_tab[ gi->scalefac_compress ];
++ unsigned int slen2 = slen2_tab[ gi->scalefac_compress ];
+ int *ix = &l3_enc[gr][ch][0];
+
+ if ( (gi->window_switching_flag == 1) && (gi->block_type == 2) )
+@@ -349,7 +349,7 @@
+ */
+ int bytesToSend = lengthInBits / 8;
+ int remainingBits = lengthInBits % 8;
+- unsigned wrd;
++ unsigned int wrd;
+ int i;
+
+ userFrameDataPH->nrEntries = 0;
+@@ -436,7 +436,7 @@
+
+ for ( sfb = 0; sfb < 13; sfb++ )
+ {
+- unsigned tableindex = 100;
++ unsigned int tableindex = 100;
+ start = scalefac[ sfb ];
+ end = scalefac[ sfb+1 ];
+
+@@ -464,7 +464,7 @@
+ else if ( gi->mixed_block_flag && gi->block_type == 2 )
+ { /* Mixed blocks long, short */
+ int sfb, window, line, start, end;
+- unsigned tableindex;
++ unsigned int tableindex;
+ I192_3 *ix_s;
+ int *scalefac = &sfBandIndex[fr_ps->header->sampling_frequency].s[0];
+
+@@ -507,7 +507,7 @@
+ else
+ { /* Long blocks */
+ int *scalefac = &sfBandIndex[fr_ps->header->sampling_frequency].l[0];
+- unsigned scalefac_index = 100;
++ unsigned int scalefac_index = 100;
+
+ if ( gi->mixed_block_flag )
+ {
+@@ -523,7 +523,7 @@
+ }
+ for ( i = 0; i < bigvalues; i += 2 )
+ {
+- unsigned tableindex = 100;
++ unsigned int tableindex = 100;
+ /* get table pointer */
+ if ( i < region1Start )
+ {
+@@ -647,7 +647,7 @@
+ */
+ int HuffmanCode( int table_select, int x, int y, unsigned int *code, unsigned int *ext, int *cbits, int *xbits )
+ {
+- unsigned signx, signy, linbitsx, linbitsy, linbits, xlen, ylen, idx;
++ unsigned int signx, signy, linbitsx, linbitsy, linbits, xlen, ylen, idx;
+ struct huffcodetab *h;
+
+ *cbits = 0;
diff --git a/audio/bladeenc/patches/patch-ak b/audio/bladeenc/patches/patch-ak
new file mode 100644
index 00000000000..d7a4e15a80f
--- /dev/null
+++ b/audio/bladeenc/patches/patch-ak
@@ -0,0 +1,13 @@
+$NetBSD: patch-ak,v 1.1 1999/09/13 03:33:36 simonb Exp $
+
+--- l3bitstream.h.orig Sat Jul 24 07:50:33 1999
++++ l3bitstream.h Mon Sep 13 12:53:27 1999
+@@ -48,7 +48,7 @@
+ char *ancillary,
+ int anc_bits );
+
+-int HuffmanCode( int table_select, int x, int y, unsigned *code, unsigned int *extword, int *codebits, int *extbits );
++int HuffmanCode( int table_select, int x, int y, unsigned int *code, unsigned int *extword, int *codebits, int *extbits );
+ int HuffmanCode_tj( int table_select, int x, int y );
+
+
diff --git a/audio/bladeenc/patches/patch-al b/audio/bladeenc/patches/patch-al
new file mode 100644
index 00000000000..55129bd900d
--- /dev/null
+++ b/audio/bladeenc/patches/patch-al
@@ -0,0 +1,80 @@
+$NetBSD: patch-al,v 1.1 1999/09/13 03:33:36 simonb Exp $
+
+--- l3side.h.orig Sat Jul 24 07:50:33 1999
++++ l3side.h Mon Sep 13 12:53:43 1999
+@@ -56,8 +56,8 @@
+ typedef char C192_3[192][3];
+
+ typedef struct {
+- unsigned cbl_max;
+- unsigned cbs_start;
++ unsigned int cbl_max;
++ unsigned int cbs_start;
+ } III_cb_info;
+
+
+@@ -81,39 +81,39 @@
+ } III_input3; /* ch */
+
+ typedef struct {
+- unsigned part2_3_length;
+- unsigned big_values;
+- unsigned count1;
+- unsigned global_gain;
+- unsigned scalefac_compress;
+- unsigned window_switching_flag;
+- unsigned block_type;
+- unsigned mixed_block_flag;
+- unsigned table_select[3];
++ unsigned int part2_3_length;
++ unsigned int big_values;
++ unsigned int count1;
++ unsigned int global_gain;
++ unsigned int scalefac_compress;
++ unsigned int window_switching_flag;
++ unsigned int block_type;
++ unsigned int mixed_block_flag;
++ unsigned int table_select[3];
+ int /* unsigned */ subblock_gain[3];
+- unsigned region0_count;
+- unsigned region1_count;
+- unsigned preflag;
+- unsigned scalefac_scale;
+- unsigned count1table_select;
+-
+- unsigned part2_length;
+- unsigned sfb_lmax;
+- unsigned sfb_smax;
+- unsigned address1;
+- unsigned address2;
+- unsigned address3;
++ unsigned int region0_count;
++ unsigned int region1_count;
++ unsigned int preflag;
++ unsigned int scalefac_scale;
++ unsigned int count1table_select;
++
++ unsigned int part2_length;
++ unsigned int sfb_lmax;
++ unsigned int sfb_smax;
++ unsigned int address1;
++ unsigned int address2;
++ unsigned int address3;
+ double quantizerStepSize;
+ /* added for LSF */
+- unsigned *sfb_partition_table;
+- unsigned slen[4];
++ unsigned int *sfb_partition_table;
++ unsigned int slen[4];
+ } gr_info;
+
+ typedef struct {
+ int main_data_begin; /* unsigned -> int */
+- unsigned private_bits;
++ unsigned int private_bits;
+ int resvDrain;
+- unsigned scfsi[2][4];
++ unsigned int scfsi[2][4];
+ struct {
+ struct gr_info_s {
+ gr_info tt;
diff --git a/audio/bladeenc/patches/patch-am b/audio/bladeenc/patches/patch-am
new file mode 100644
index 00000000000..b7141120004
--- /dev/null
+++ b/audio/bladeenc/patches/patch-am
@@ -0,0 +1,62 @@
+$NetBSD: patch-am,v 1.1 1999/09/13 03:33:36 simonb Exp $
+
+--- loop.c.orig Sat Jul 24 07:50:33 1999
++++ loop.c Mon Sep 13 12:54:58 1999
+@@ -71,7 +71,7 @@
+
+ [table_number][row_in_table][column of nr_of_sfb]
+ */
+-static unsigned nr_of_sfb_block[6][3][4] =
++static unsigned int nr_of_sfb_block[6][3][4] =
+ {
+ {
+ {6, 5, 5, 5},
+@@ -445,7 +445,7 @@
+ int xm_scfsi_band_krit = 10;
+
+ int scfsi_band;
+- unsigned scfsi_set;
++ unsigned int scfsi_set;
+
+ int sfb, start, end, i;
+ int condition = 0;
+@@ -1395,8 +1395,8 @@
+
+ struct
+ {
+- unsigned region0_count;
+- unsigned region1_count;
++ unsigned int region0_count;
++ unsigned int region1_count;
+ } subdv_table[ 23 ] =
+ {
+ {0, 0}, /* 0 bands */
+@@ -1789,8 +1789,8 @@
+
+ for ( ; sfb < 13; sfb++ )
+ {
+- unsigned tableindex = 100;
+- unsigned idx;
++ unsigned int tableindex = 100;
++ unsigned int idx;
+ struct huffcodetab *h;
+
+ start = scalefac_band_short[ sfb ];
+@@ -1870,7 +1870,7 @@
+ int count_bit_tj( int abs_ix[576], unsigned int start, unsigned int end, unsigned int table )
+ {
+ int i, sum;
+- unsigned idx;
++ unsigned int idx;
+ struct huffcodetab *h;
+ int x, y;
+
+@@ -1951,7 +1951,7 @@
+ double
+
+ aint(double in) {
+- return((long) in);
++ return((int) in);
+ }
+ #endif
+
diff --git a/audio/bladeenc/patches/patch-an b/audio/bladeenc/patches/patch-an
new file mode 100644
index 00000000000..03d577ba786
--- /dev/null
+++ b/audio/bladeenc/patches/patch-an
@@ -0,0 +1,85 @@
+$NetBSD: patch-an,v 1.1 1999/09/13 03:33:36 simonb Exp $
+
+--- samplein.c.orig Sat Jul 24 07:50:33 1999
++++ samplein.c Mon Sep 13 12:55:39 1999
+@@ -52,11 +52,11 @@
+ static int initAIFF( SplIn * psInfo );
+ static uint readAIFFSamples( SplIn * psInfo, int nSamples, short * wpSamples );
+
+-static int myFseek( FILE * fp, long offset );
++static int myFseek( FILE * fp, int offset );
+
+
+-ulong INLINE intlLong( char iLong[4] );
+-ulong INLINE mcLong( char mcLong[4] );
++uint INLINE intlLong( char iLong[4] );
++uint INLINE mcLong( char mcLong[4] );
+ ushort INLINE intlShort( char iShort[2] );
+ ushort INLINE mcShort( char mcShort[2] );
+
+@@ -185,8 +185,8 @@
+ if( psInfo->bits == 8 )
+ {
+ for( i = readSamples-1 ; i > 0 ; i-- )
+- wpSamples[i] = ((short)((unsigned char *) wpSamples)[i]) << 8;
+- wpSamples[i] = ((short)((unsigned char *) wpSamples)[i]) << 8;
++ wpSamples[i] = ((short)((u_int8_t *) wpSamples)[i]) << 8;
++ wpSamples[i] = ((short)((u_int8_t *) wpSamples)[i]) << 8;
+ }
+
+ /* Convert unsigned to signed */
+@@ -256,8 +256,8 @@
+ {
+ short wFormatTag; /* Format category */
+ short wChannels; /* Number of channels */
+- long dwSamplesPerSec; /* Sampling rate */
+- long dwAvgBytesPerSec; /* For buffer estimation */
++ int dwSamplesPerSec; /* Sampling rate */
++ int dwAvgBytesPerSec; /* For buffer estimation */
+ short wBlockAlign; /* Data block size */
+ short bitsPerSample; /* Actually a PCM-specific additional byte... */
+ } sFmtChunk;
+@@ -366,7 +366,7 @@
+ struct
+ {
+ short numChannels;
+- unsigned long numSampleFrames;
++ unsigned int numSampleFrames;
+ short sampleSize;
+ /* char sampleRate[10]; */
+
+@@ -509,19 +509,19 @@
+
+ /*____ intlLong() _____________________________________________________________*/
+
+-ulong INLINE intlLong( char iLong[4] )
++uint INLINE intlLong( char iLong[4] )
+ {
+- return ((ulong)((uchar*)iLong)[0]) + (((ulong)((uchar*)iLong)[1]) << 8)
+- + (((ulong)((uchar*)iLong)[2]) << 16) + (((ulong)((uchar*)iLong)[3]) << 24);
++ return ((uint)((uchar*)iLong)[0]) + (((uint)((uchar*)iLong)[1]) << 8)
++ + (((uint)((uchar*)iLong)[2]) << 16) + (((uint)((uchar*)iLong)[3]) << 24);
+ }
+
+
+ /*____ mcLong() _______________________________________________________________*/
+
+-ulong INLINE mcLong( char mcLong[4] )
++uint INLINE mcLong( char mcLong[4] )
+ {
+- return ((ulong)((uchar*)mcLong)[3]) + (((ulong)((uchar*)mcLong)[2]) << 8 )
+- + (((ulong)((uchar*)mcLong)[1]) << 16) + (((ulong)((uchar*)mcLong)[0]) << 24);
++ return ((uint)((uchar*)mcLong)[3]) + (((uint)((uchar*)mcLong)[2]) << 8 )
++ + (((uint)((uchar*)mcLong)[1]) << 16) + (((uint)((uchar*)mcLong)[0]) << 24);
+ }
+
+
+@@ -544,7 +544,7 @@
+
+ /* We can't use the real fseek() since you can't seek in a stream (stdin) */
+
+-int myFseek( FILE * fp, long offset )
++int myFseek( FILE * fp, int offset )
+ {
+ char dummy[256];
+
diff --git a/audio/bladeenc/patches/patch-ao b/audio/bladeenc/patches/patch-ao
new file mode 100644
index 00000000000..82d97076344
--- /dev/null
+++ b/audio/bladeenc/patches/patch-ao
@@ -0,0 +1,18 @@
+$NetBSD: patch-ao,v 1.1 1999/09/13 03:33:36 simonb Exp $
+
+--- system.h.orig Sat Jul 24 07:50:33 1999
++++ system.h Mon Sep 13 12:55:43 1999
+@@ -183,12 +183,9 @@
+
+ typedef unsigned char uchar;
+
+-#ifndef _SYS_TYPES_H
++#if !defined(_SYS_TYPES_H) && !defined(_SYS_TYPES_H_)
+ typedef unsigned short ushort;
+-typedef unsigned long ulong;
+ typedef unsigned int uint;
+ #endif
+-
+-
+
+
diff --git a/audio/bladeenc/pkg/MESSAGE b/audio/bladeenc/pkg/MESSAGE
deleted file mode 100644
index a5ceb00163c..00000000000
--- a/audio/bladeenc/pkg/MESSAGE
+++ /dev/null
@@ -1,8 +0,0 @@
-==========================================================================
-$NetBSD: MESSAGE,v 1.2 1998/12/28 19:16:51 tv Exp $
-
-In order to run BladeEnc on i386, you need no compat libraries, but you
-must have all of COMPAT_43, COMPAT_NOMID, COMPAT_09, COMPAT_10, COMPAT_12
-(and COMPAT_13, if applicable) in your running kernel.
-
-==========================================================================