Hi, Andreas and others. On Jul 27 2011, Andres Mejia wrote: > 2011/7/27 Rogério Brito <rbr...@ime.usp.br>: > > Oh, shit. I'll take a look at that... I thought that the code were > > ifdef'ed... Isn't it? > > I have a patch here with some changes we do to the build system.
OK. > We outright disable the use of the GTK frontend, since it requires a very > old version of GTK. I think there are better tools out now (audacity > maybe). Perhaps the GTK frontend should be removed from lame entirely. Sure, it has not compiled for ages and I think that killing it leaves us with less cruft. If someone happens to want to port it forward to GTK2 or GTK3, though, we may reinstate it... > The other change simply changes how the debian directory is included > in the generated tarball. The debian directory still gets included, > but there's no need to have any "Makefile*" files in the debian > directory. This would remove our need to patch the build system for > each release of lame. (...) > > CLEANFILES = lclint.txt $(EXTRA_PROGRAMS) Can you please send "git format-patch/git send-email" patches against my github tree (branch origin), with one topic per patch? Your patches came foo-bared and they are changing at least two things (the GTK stuff and the debian subdir). > I've started replacing frontend/portableio.* code. I should have > something available later on tonight. Please see the attached patch to kill portableio.c if you are using libsndfile (which we should be in debian, anyway). It *is* dirty and there's one function (the one to read stuff) that is not used, but works for the purpose of decoding some files (I tested). I should probably adapt something from a patch that I once wrote to mplayer ages ago when I was trying to make the generated PCM files works for little and big-endian arches (hey, I *care* about PowerPC). Or if libsdnfile does that already, that's even better. But for the sake of just shipping a first package in unstable, I am very anxious... :-) I want to see this darn thing in Debian proper! :-) > One final thing, I delete the "LICENSE" file from the upstream tarball > since the "COPYING" file has the actual license text and the contents > of "LICENSE" seem to what is already said in the "README" file. > Perhaps you might want to look into that too. Will look into that for the next release. Please, *do* ping me if I forget about this. Thanks, -- Rogério Brito : rbrito@{ime.usp.br,gmail.com} : GPG key 4096R/BCFCAAAA http://rb.doesntexist.org : Packages for LaTeX : algorithms.berlios.de DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br
diff --git a/frontend/Makefile.am b/frontend/Makefile.am index 0ce4a64..215cdce 100644 --- a/frontend/Makefile.am +++ b/frontend/Makefile.am @@ -17,7 +17,6 @@ common_sources = \ get_audio.c \ lametime.c \ parse.c \ - portableio.c \ timestatus.c noinst_HEADERS = \ @@ -29,7 +28,6 @@ noinst_HEADERS = \ lametime.h \ main.h \ parse.h \ - portableio.h \ timestatus.h lame_SOURCES = lame_main.c $(common_sources) diff --git a/frontend/Makefile.in b/frontend/Makefile.in index 11d242a..7e415c4 100644 --- a/frontend/Makefile.in +++ b/frontend/Makefile.in @@ -54,7 +54,7 @@ am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__objects_1 = main$U.$(OBJEXT) brhist$U.$(OBJEXT) \ console$U.$(OBJEXT) get_audio$U.$(OBJEXT) lametime$U.$(OBJEXT) \ - parse$U.$(OBJEXT) portableio$U.$(OBJEXT) \ + parse$U.$(OBJEXT) \ timestatus$U.$(OBJEXT) am_lame_OBJECTS = lame_main$U.$(OBJEXT) $(am__objects_1) lame_OBJECTS = $(am_lame_OBJECTS) @@ -247,7 +247,6 @@ common_sources = \ get_audio.c \ lametime.c \ parse.c \ - portableio.c \ timestatus.c noinst_HEADERS = \ @@ -259,7 +258,6 @@ noinst_HEADERS = \ lametime.h \ main.h \ parse.h \ - portableio.h \ timestatus.h lame_SOURCES = lame_main.c $(common_sources) @@ -386,7 +384,6 @@ mostlyclean-kr: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp3rtp$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mp3x$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse$U.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/portableio$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rtp$U.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timestatus$U.Po@am__quote@ @@ -432,8 +429,6 @@ mp3x_.c: mp3x.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/mp3x.c; then echo $(srcdir)/mp3x.c; else echo mp3x.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ parse_.c: parse.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/parse.c; then echo $(srcdir)/parse.c; else echo parse.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ -portableio_.c: portableio.c $(ANSI2KNR) - $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/portableio.c; then echo $(srcdir)/portableio.c; else echo portableio.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ rtp_.c: rtp.c $(ANSI2KNR) $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/rtp.c; then echo $(srcdir)/rtp.c; else echo rtp.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@ timestatus_.c: timestatus.c $(ANSI2KNR) @@ -443,7 +438,7 @@ get_audio_.$(OBJEXT) get_audio_.lo gpkplotting_.$(OBJEXT) \ gpkplotting_.lo gtkanal_.$(OBJEXT) gtkanal_.lo lame_main_.$(OBJEXT) \ lame_main_.lo lametime_.$(OBJEXT) lametime_.lo main_.$(OBJEXT) \ main_.lo mp3rtp_.$(OBJEXT) mp3rtp_.lo mp3x_.$(OBJEXT) mp3x_.lo \ -parse_.$(OBJEXT) parse_.lo portableio_.$(OBJEXT) portableio_.lo \ +parse_.$(OBJEXT) parse_.lo \ rtp_.$(OBJEXT) rtp_.lo timestatus_.$(OBJEXT) timestatus_.lo : \ $(ANSI2KNR) diff --git a/frontend/get_audio.c b/frontend/get_audio.c index 07eab14..67e0804 100644 --- a/frontend/get_audio.c +++ b/frontend/get_audio.c @@ -74,7 +74,6 @@ char *strchr(), *strrchr(); #include "lame.h" #include "main.h" #include "get_audio.h" -#include "portableio.h" #include "lametime.h" #include "console.h" @@ -88,39 +87,8 @@ char *strchr(), *strrchr(); #define __LOC__ __FILE__ "("STR(__LINE__)") : " #endif - -#ifdef LIBSNDFILE - #include <sndfile.h> - -#else -/***************************************************************** - * LAME/ISO built in audio file I/O routines - *******************************************************************/ -#include "portableio.h" - - -typedef struct blockAlign_struct { - unsigned long offset; - unsigned long blockSize; -} blockAlign; - -typedef struct IFF_AIFF_struct { - short numChannels; - unsigned long numSampleFrames; - short sampleSize; - double sampleRate; - unsigned long sampleType; - blockAlign blkAlgn; -} IFF_AIFF; - -typedef void SNDFILE; - -#endif /* ifdef LIBSNDFILE */ - - - struct PcmBuffer { void* ch[2]; /* buffer for each channel */ @@ -763,6 +731,73 @@ read_samples_mp3(lame_t gfp, FILE * musicin, short int mpg123pcm[2][1152]) return out; } +/* Input: a standard C file "descriptor" fp. + Output: an 2-byte int read from `fp` with the input in big-endian order. + + Reads a pair of bytes from `fp` with the first one being the + higher-significant one and the second one being the + lower-significant one. + + In more details: this function reads 2 bytes from the file + pointed to by `fp` with: + + - the second one read makes up the least significant byte of + the integer returned. + - the first one read makes up the most significan byte of + the integer returned. + + We don't treat errors (yet). +*/ +int Read16BitsHighLow(FILE *fp) +{ + int hi = getc(fp) & 0xff; + int lo = getc(fp) & 0xff; + + return (hi << 8) | lo; +} + +/* Input: a common C-language file "descriptor" `fp` and an integer `n`. + + Writes the integer `n` (masked to 0xff) to `fp` in the order + least significant-byte, higher significant-byte. + + No further bytes from `n` are considered. + + We don't treat errors (yet). +*/ +void Write16BitsLowHigh(FILE *fp, int n) +{ + int hi = (n >> 8) & 0xff; + int lo = (n ) & 0xff; + + putc(lo, fp); + putc(hi, fp); +} + +/* Input: a common C-language file "descriptor" `fp` and an integer `n`. + + Writes the integer `n` (masked to 0xff) to `fp` in the order + least significant-byte, higher significant-byte. + + No further bytes from `n` are considered. + + We don't treat errors (yet). +*/ +void Write32BitsLowHigh(FILE *fp, int n) +{ + int b0 = (n ) & 0xff; + int b1 = (n >> 8) & 0xff; + int b2 = (n >> 16) & 0xff; + int b3 = (n >> 24) & 0xff; + + putc(b0, fp); + putc(b1, fp); + putc(b2, fp); + putc(b3, fp); +} + + + int WriteWaveHeader(FILE * const fp, int pcmbytes, int freq, int channels, int bits) diff --git a/frontend/portableio.c b/frontend/portableio.c deleted file mode 100644 index c890e16..0000000 --- a/frontend/portableio.c +++ /dev/null @@ -1,490 +0,0 @@ -/* Copyright (C) 1988-1991 Apple Computer, Inc. - * All Rights Reserved. - * - * Warranty Information - * Even though Apple has reviewed this software, Apple makes no warranty - * or representation, either express or implied, with respect to this - * software, its quality, accuracy, merchantability, or fitness for a - * particular purpose. As a result, this software is provided "as is," - * and you, its user, are assuming the entire risk as to its quality - * and accuracy. - * - * This code may be used and freely distributed as long as it includes - * this copyright notice and the warranty information. - * - * - * Motorola processors (Macintosh, Sun, Sparc, MIPS, etc) - * pack bytes from high to low (they are big-endian). - * Use the HighLow routines to match the native format - * of these machines. - * - * Intel-like machines (PCs, Sequent) - * pack bytes from low to high (the are little-endian). - * Use the LowHigh routines to match the native format - * of these machines. - * - * These routines have been tested on the following machines: - * Apple Macintosh, MPW 3.1 C compiler - * Apple Macintosh, THINK C compiler - * Silicon Graphics IRIS, MIPS compiler - * Cray X/MP and Y/MP - * Digital Equipment VAX - * - * - * Implemented by Malcolm Slaney and Ken Turkowski. - * - * Malcolm Slaney contributions during 1988-1990 include big- and little- - * endian file I/O, conversion to and from Motorola's extended 80-bit - * floating-point format, and conversions to and from IEEE single- - * precision floating-point format. - * - * In 1991, Ken Turkowski implemented the conversions to and from - * IEEE double-precision format, added more precision to the extended - * conversions, and accommodated conversions involving +/- infinity, - * NaN's, and denormalized numbers. - * - * $Id$ - */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <stdio.h> -#if defined(__riscos__) && defined(FPA10) -#include "ymath.h" -#else -#include <math.h> -#endif -#include "portableio.h" - -#ifdef WITH_DMALLOC -#include <dmalloc.h> -#endif - -/**************************************************************** - * Big/little-endian independent I/O routines. - ****************************************************************/ - -/* - * It is a hoax to call this code portable-IO: - * - * - It doesn't work on machines with CHAR_BIT != 8 - * - it also don't test this error condition - * - otherwise it tries to handle CHAR_BIT != 8 by things like - * masking 'putc(i&0xff,fp)' - * - It doesn't handle EOF in any way - * - it only works with ints with 32 or more bits - * - It is a collection of initial buggy code with patching the known errors - * instead of CORRECTING them! - * For that see comments on the old Read16BitsHighLow() - */ - -#ifdef KLEMM_36 - -signed int -ReadByte(FILE * fp) -{ - int result = getc(fp); - return result == EOF ? 0 : (signed char) (result & 0xFF); -} - -unsigned int -ReadByteUnsigned(FILE * fp) -{ - int result = getc(fp); - return result == EOF ? 0 : (unsigned char) (result & 0xFF); -} - -#else - -int -ReadByte(FILE * fp) -{ - int result; - - result = getc(fp) & 0xff; - if (result & 0x80) - result = result - 0x100; - return result; -} - -#endif - -#ifdef KLEMM_36 - -int -Read16BitsLowHigh(FILE * fp) -{ - int low = ReadByteUnsigned(fp); - int high = ReadByte(fp); - - return (high << 8) | low; -} - -#else -int -Read16BitsLowHigh(FILE * fp) -{ - int first, second, result; - - first = 0xff & getc(fp); - second = 0xff & getc(fp); - - result = (second << 8) + first; -#ifndef THINK_C42 - if (result & 0x8000) - result = result - 0x10000; -#endif /* THINK_C */ - return (result); -} -#endif - - -#ifdef KLEMM_36 - -int -Read16BitsHighLow(FILE * fp) -{ - int high = ReadByte(fp); - int low = ReadByteUnsigned(fp); - - return (high << 8) | low; -} - -#else -int -Read16BitsHighLow(FILE * fp) -{ - int first, second, result; - - /* Reads the High bits, the value is -128...127 - * (which gave after upscaling the -32768...+32512 - * Why this value is not converted to signed char? - */ - first = 0xff & getc(fp); - /* Reads the Lows bits, the value is 0...255 - * This is correct. This value gives an additional offset - * for the High bits - */ - second = 0xff & getc(fp); - - /* This is right */ - result = (first << 8) + second; - - /* Now we are starting to correct the nasty bug of the first instruction - * The value of the high bits is wrong. Always. So we must correct this - * value. This seems to be not necessary for THINK_C42. This is either - * a 16 bit compiler with 16 bit ints (where this bug is hidden and 0x10000 - * is not in the scope of an int) or it is not a C compiler, but only a - * C like compiler. In the first case the '#ifndef THINK_C42' is wrong - * because it's not a property of the THINK_C42 compiler, but of all compilers - * with sizeof(int)*CHAR_BIT < 18. - * Another nasty thing is that the rest of the code doesn't work for 16 bit ints, - * so this patch don't solve the 16 bit problem. - */ -#ifndef THINK_C42 - if (result & 0x8000) - result = result - 0x10000; -#endif /* THINK_C */ - return (result); -} -#endif - -void -Write8Bits(FILE * fp, int i) -{ - putc(i & 0xff, fp); -} - - -void -Write16BitsLowHigh(FILE * fp, int i) -{ - putc(i & 0xff, fp); - putc((i >> 8) & 0xff, fp); -} - - -void -Write16BitsHighLow(FILE * fp, int i) -{ - putc((i >> 8) & 0xff, fp); - putc(i & 0xff, fp); -} - -#ifdef KLEMM_36 - -int -Read24BitsHighLow(FILE * fp) -{ - int high = ReadByte(fp); - int med = ReadByteUnsigned(fp); - int low = ReadByteUnsigned(fp); - - return (high << 16) | (med << 8) | low; -} - -#else -int -Read24BitsHighLow(FILE * fp) -{ - int first, second, third; - int result; - - first = 0xff & getc(fp); - second = 0xff & getc(fp); - third = 0xff & getc(fp); - - result = (first << 16) + (second << 8) + third; - if (result & 0x800000) - result = result - 0x1000000; - return (result); -} -#endif - -#define Read32BitsLowHigh(f) Read32Bits(f) - -#ifdef KLEMM_36 - -int -Read32Bits(FILE * fp) -{ - int low = ReadByteUnsigned(fp); - int medl = ReadByteUnsigned(fp); - int medh = ReadByteUnsigned(fp); - int high = ReadByte(fp); - - return (high << 24) | (medh << 16) | (medl << 8) | low; -} - -#else - -int -Read32Bits(FILE * fp) -{ - int first, second, result; - - first = 0xffff & Read16BitsLowHigh(fp); - second = 0xffff & Read16BitsLowHigh(fp); - - result = (second << 16) + first; -#ifdef CRAY - if (result & 0x80000000) - result = result - 0x100000000; -#endif /* CRAY */ - return (result); -} -#endif - - -#ifdef KLEMM_36 - -int -Read32BitsHighLow(FILE * fp) -{ - int high = ReadByte(fp); - int medh = ReadByteUnsigned(fp); - int medl = ReadByteUnsigned(fp); - int low = ReadByteUnsigned(fp); - - return (high << 24) | (medh << 16) | (medl << 8) | low; -} - -#else - -int -Read32BitsHighLow(FILE * fp) -{ - int first, second, result; - - first = 0xffff & Read16BitsHighLow(fp); - second = 0xffff & Read16BitsHighLow(fp); - - result = (first << 16) + second; -#ifdef CRAY - if (result & 0x80000000) - result = result - 0x100000000; -#endif - return (result); -} - -#endif - -void -Write32Bits(FILE * fp, int i) -{ - Write16BitsLowHigh(fp, (int) (i & 0xffffL)); - Write16BitsLowHigh(fp, (int) ((i >> 16) & 0xffffL)); -} - - -void -Write32BitsLowHigh(FILE * fp, int i) -{ - Write16BitsLowHigh(fp, (int) (i & 0xffffL)); - Write16BitsLowHigh(fp, (int) ((i >> 16) & 0xffffL)); -} - - -void -Write32BitsHighLow(FILE * fp, int i) -{ - Write16BitsHighLow(fp, (int) ((i >> 16) & 0xffffL)); - Write16BitsHighLow(fp, (int) (i & 0xffffL)); -} - -#ifdef KLEMM_36 -void -ReadBytes(FILE * fp, char *p, int n) -{ - memset(p, 0, n); - fread(p, 1, n, fp); -} -#else -void -ReadBytes(FILE * fp, char *p, int n) -{ - /* What about fread? */ - - while (!feof(fp) & (n-- > 0)) - *p++ = (char) getc(fp); -} -#endif - -void -ReadBytesSwapped(FILE * fp, char *p, int n) -{ - register char *q = p; - - /* What about fread? */ - - while (!feof(fp) & (n-- > 0)) - *q++ = (char) getc(fp); - - /* If not all bytes could be read, the resorting is different - * from the normal resorting. Is this intention or another bug? - */ - for (q--; p < q; p++, q--) { - n = *p; - *p = *q; - *q = (char) n; - } -} - -#ifdef KLEMM_36 -void -WriteBytes(FILE * fp, char *p, int n) -{ - /* return n == */ - fwrite(p, 1, n, fp); -} -#else -void -WriteBytes(FILE * fp, char *p, int n) -{ - /* No error condition checking */ - while (n-- > 0) - putc(*p++, fp); -} -#endif -#ifdef KLEMM_36 -void -WriteBytesSwapped(FILE * fp, char *p, int n) -{ - p += n; - while (n-- > 0) - putc(*--p, fp); -} -#else -void -WriteBytesSwapped(FILE * fp, char *p, int n) -{ - p += n - 1; - while (n-- > 0) - putc(*p--, fp); -} -#endif - - - -/**************************************************************** - * The following two routines make up for deficiencies in many - * compilers to convert properly between unsigned integers and - * floating-point. Some compilers which have this bug are the - * THINK_C compiler for the Macintosh and the C compiler for the - * Silicon Graphics MIPS-based Iris. - ****************************************************************/ - -#ifdef applec /* The Apple C compiler works */ -# define FloatToUnsigned(f) ((unsigned long)(f)) -# define UnsignedToFloat(u) ((double)(u)) -#else /* applec */ -# define FloatToUnsigned(f) ((unsigned long)(((long)((f) - 2147483648.0)) + 2147483647L + 1)) -# define UnsignedToFloat(u) (((double)((long)((u) - 2147483647L - 1))) + 2147483648.0) -#endif /* applec */ -/**************************************************************** - * Extended precision IEEE floating-point conversion routines - ****************************************************************/ - -static double -ConvertFromIeeeExtended(char *bytes) -{ - double f; - long expon; - unsigned long hiMant, loMant; - -#ifdef TEST - printf("ConvertFromIEEEExtended(%lx,%lx,%lx,%lx,%lx,%lx,%lx,%lx,%lx,%lx\r", - (long) bytes[0], (long) bytes[1], (long) bytes[2], (long) bytes[3], - (long) bytes[4], (long) bytes[5], (long) bytes[6], - (long) bytes[7], (long) bytes[8], (long) bytes[9]); -#endif - - expon = ((bytes[0] & 0x7F) << 8) | (bytes[1] & 0xFF); - hiMant = ((unsigned long) (bytes[2] & 0xFF) << 24) - | ((unsigned long) (bytes[3] & 0xFF) << 16) - | ((unsigned long) (bytes[4] & 0xFF) << 8) - | ((unsigned long) (bytes[5] & 0xFF)); - loMant = ((unsigned long) (bytes[6] & 0xFF) << 24) - | ((unsigned long) (bytes[7] & 0xFF) << 16) - | ((unsigned long) (bytes[8] & 0xFF) << 8) - | ((unsigned long) (bytes[9] & 0xFF)); - - /* This case should also be called if the number is below the smallest - * positive double variable */ - if (expon == 0 && hiMant == 0 && loMant == 0) { - f = 0; - } - else { - /* This case should also be called if the number is too large to fit into - * a double variable */ - - if (expon == 0x7FFF) { /* Infinity or NaN */ - f = HUGE_VAL; - } - else { - expon -= 16383; - f = ldexp(UnsignedToFloat(hiMant), (int) (expon -= 31)); - f += ldexp(UnsignedToFloat(loMant), (int) (expon -= 32)); - } - } - - if (bytes[0] & 0x80) - return -f; - else - return f; -} - - - - - -double -ReadIeeeExtendedHighLow(FILE * fp) -{ - char bytes[10]; - - ReadBytes(fp, bytes, 10); - return ConvertFromIeeeExtended(bytes); -} diff --git a/frontend/portableio.h b/frontend/portableio.h deleted file mode 100644 index 98cc048..0000000 --- a/frontend/portableio.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef LAME_PORTABLEIO_H -#define LAME_PORTABLEIO_H -/* Copyright (C) 1988-1991 Apple Computer, Inc. - * All Rights Reserved. - * - * Warranty Information - * Even though Apple has reviewed this software, Apple makes no warranty - * or representation, either express or implied, with respect to this - * software, its quality, accuracy, merchantability, or fitness for a - * particular purpose. As a result, this software is provided "as is," - * and you, its user, are assuming the entire risk as to its quality - * and accuracy. - * - * This code may be used and freely distributed as long as it includes - * this copyright notice and the warranty information. - * - * Machine-independent I/O routines for 8-, 16-, 24-, and 32-bit integers. - * - * Motorola processors (Macintosh, Sun, Sparc, MIPS, etc) - * pack bytes from high to low (they are big-endian). - * Use the HighLow routines to match the native format - * of these machines. - * - * Intel-like machines (PCs, Sequent) - * pack bytes from low to high (the are little-endian). - * Use the LowHigh routines to match the native format - * of these machines. - * - * These routines have been tested on the following machines: - * Apple Macintosh, MPW 3.1 C compiler - * Apple Macintosh, THINK C compiler - * Silicon Graphics IRIS, MIPS compiler - * Cray X/MP and Y/MP - * Digital Equipment VAX - * - * - * Implemented by Malcolm Slaney and Ken Turkowski. - * - * Malcolm Slaney contributions during 1988-1990 include big- and little- - * endian file I/O, conversion to and from Motorola's extended 80-bit - * floating-point format, and conversions to and from IEEE single- - * precision floating-point format. - * - * In 1991, Ken Turkowski implemented the conversions to and from - * IEEE double-precision format, added more precision to the extended - * conversions, and accommodated conversions involving +/- infinity, - * NaN's, and denormalized numbers. - * - * $Id$ - */ - -#include <stdio.h> - -#if defined(__cplusplus) -extern "C" { -#endif - -extern int ReadByte(FILE * fp); -extern int Read16BitsLowHigh(FILE * fp); -extern int Read16BitsHighLow(FILE * fp); -extern void Write8Bits(FILE * fp, int i); -extern void Write16BitsLowHigh(FILE * fp, int i); -extern void Write16BitsHighLow(FILE * fp, int i); -extern int Read24BitsHighLow(FILE * fp); -extern int Read32Bits(FILE * fp); -extern int Read32BitsHighLow(FILE * fp); -extern void Write32Bits(FILE * fp, int i); -extern void Write32BitsLowHigh(FILE * fp, int i); -extern void Write32BitsHighLow(FILE * fp, int i); -extern void ReadBytes(FILE * fp, char *p, int n); -extern void ReadBytesSwapped(FILE * fp, char *p, int n); -extern void WriteBytes(FILE * fp, char *p, int n); -extern void WriteBytesSwapped(FILE * fp, char *p, int n); -extern double ReadIeeeFloatHighLow(FILE * fp); -extern double ReadIeeeFloatLowHigh(FILE * fp); -extern double ReadIeeeDoubleHighLow(FILE * fp); -extern double ReadIeeeDoubleLowHigh(FILE * fp); -extern double ReadIeeeExtendedHighLow(FILE * fp); -extern double ReadIeeeExtendedLowHigh(FILE * fp); -extern void WriteIeeeFloatLowHigh(FILE * fp, double num); -extern void WriteIeeeFloatHighLow(FILE * fp, double num); -extern void WriteIeeeDoubleLowHigh(FILE * fp, double num); -extern void WriteIeeeDoubleHighLow(FILE * fp, double num); -extern void WriteIeeeExtendedLowHigh(FILE * fp, double num); -extern void WriteIeeeExtendedHighLow(FILE * fp, double num); - -#define Read32BitsLowHigh(f) Read32Bits(f) -#define WriteString(f,s) fwrite(s,strlen(s),sizeof(char),f) - -#if defined(__cplusplus) -} -#endif - -#endif
_______________________________________________ pkg-multimedia-maintainers mailing list pkg-multimedia-maintainers@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers