From: <tp...@fr...> - 2005-04-02 22:26:20
|
CVS Root: /cvs/gstreamer Module: gst-plugins Changes by: tpm Date: Sat Apr 02 2005 14:26:17 PST Branch: BRANCH-GSTREAMER-0_8 Log message: Get rid of ^M characters in source files Modified files: . : ChangeLog ext/wavpack : bits.c extra1.c extra2.c float.c gstwavpackdec.c gstwavpackreader.c metadata.c unpack.c wavpack.h words.c wputils.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ChangeLog.diff?r1=1.1641.2.81&r2=1.1641.2.82 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/bits.c.diff?r1=1.1.2.1&r2=1.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/extra1.c.diff?r1=1.1.2.1&r2=1.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/extra2.c.diff?r1=1.1.2.1&r2=1.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/float.c.diff?r1=1.1.2.1&r2=1.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/gstwavpackdec.c.diff?r1=1.1.2.1&r2=1.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/gstwavpackreader.c.diff?r1=1.1.2.1&r2=1.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/metadata.c.diff?r1=1.1.2.1&r2=1.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/unpack.c.diff?r1=1.1.2.1&r2=1.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/wavpack.h.diff?r1=1.1.2.1&r2=1.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/words.c.diff?r1=1.1.2.1&r2=1.1.2.2 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins/ext/wavpack/wputils.c.diff?r1=1.1.2.1&r2=1.1.2.2 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins/ChangeLog,v retrieving revision 1.1641.2.81 retrieving revision 1.1641.2.82 diff -u -d -r1.1641.2.81 -r1.1641.2.82 --- ChangeLog 2 Apr 2005 20:00:46 -0000 1.1641.2.81 +++ ChangeLog 2 Apr 2005 22:26:04 -0000 1.1641.2.82 @@ -1,5 +1,20 @@ 2005-04-02 Tim-Philipp Müller <tim at centricular dot net> + * ext/wavpack/bits.c: + * ext/wavpack/extra1.c: + * ext/wavpack/extra2.c: + * ext/wavpack/float.c: + * ext/wavpack/gstwavpackdec.c: + * ext/wavpack/gstwavpackreader.c: + * ext/wavpack/metadata.c: + * ext/wavpack/unpack.c: + * ext/wavpack/wavpack.h: + * ext/wavpack/words.c: + * ext/wavpack/wputils.c: + Get rid of ^M characters in source files. + +2005-04-02 Tim-Philipp Müller <tim at centricular dot net> + * ext/cdaudio/gstcdaudio.c: (gst_cdaudio_get_query_types): Don't advertise query types that are not supported (GST_QUERY_START and GST_QUERY_SEGMENT_END) Index: bits.c RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/bits.c,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -d -r1.1.2.1 -r1.1.2.2 --- bits.c 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ bits.c 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -1,245 +1,253 @@ -//////////////////////////////////////////////////////////////////////////// -// **** WAVPACK **** // -// Hybrid Lossless Wavefile Compressor // -// Copyright (c) 1998 - 2004 Conifer Software. // -// All Rights Reserved. // -// Distributed under the BSD Software License (see license.txt) // - -// bits.c - -// This module provides utilities to support the BitStream structure which is -// used to read and write all WavPack audio data streams. It also contains a -// wrapper for the stream I/O functions and a set of functions dealing with -// endian-ness, both for enhancing portability. Finally, a debug wrapper for -// the malloc() system is provided. -#include "wavpack.h" -#include <stdlib.h> -#include <string.h> -#include <ctype.h> -#include <sys/stat.h> -#if defined(WIN32) -#include <io.h> -#else /* */ -#include <unistd.h> -#endif /* */ -////////////////////////// Bitstream functions //////////////////////////////// -#if defined(UNPACK) || defined(INFO_ONLY) -// Open the specified BitStream and associate with the specified buffer. - static void bs_read (Bitstream * bs); - void -bs_open_read (Bitstream * bs, uchar * buffer_start, uchar * buffer_end) +//////////////////////////////////////////////////////////////////////////// +// **** WAVPACK **** // +// Hybrid Lossless Wavefile Compressor // +// Copyright (c) 1998 - 2004 Conifer Software. // +// All Rights Reserved. // +// Distributed under the BSD Software License (see license.txt) // +// bits.c +// This module provides utilities to support the BitStream structure which is +// used to read and write all WavPack audio data streams. It also contains a +// wrapper for the stream I/O functions and a set of functions dealing with +// endian-ness, both for enhancing portability. Finally, a debug wrapper for +// the malloc() system is provided. +#include "wavpack.h" +#include <stdlib.h> +#include <string.h> +#include <ctype.h> +#include <sys/stat.h> +#if defined(WIN32) +#include <io.h> +#else /* */ +#include <unistd.h> +#endif /* */ +////////////////////////// Bitstream functions //////////////////////////////// +#if defined(UNPACK) || defined(INFO_ONLY) +// Open the specified BitStream and associate with the specified buffer. +static void bs_read (Bitstream * bs); +void +bs_open_read (Bitstream * bs, uchar * buffer_start, uchar * buffer_end) { - bs->error = bs->sr = bs->bc = 0; - bs->ptr = (bs->buf = buffer_start) - 1; - bs->end = buffer_end; - bs->wrap = bs_read; - } + bs->error = bs->sr = bs->bc = 0; + bs->ptr = (bs->buf = buffer_start) - 1; + bs->end = buffer_end; + bs->wrap = bs_read; +} -// This function is only called from the getbit() and getbits() macros when -// the BitStream has been exhausted and more data is required. Sinve these -// bistreams no longer access files, this function simple sets an error and -// resets the buffer. - static void -bs_read (Bitstream * bs) +// This function is only called from the getbit() and getbits() macros when +// the BitStream has been exhausted and more data is required. Sinve these +// bistreams no longer access files, this function simple sets an error and +// resets the buffer. +static void +bs_read (Bitstream * bs) - bs->ptr = bs->buf - 1; - bs->error = 1; + bs->ptr = bs->buf - 1; + bs->error = 1; -// This function is called to close the bitstream. It returns the number of -// full bytes actually read as bits. - ulong bs_close_read (Bitstream * bs) +// This function is called to close the bitstream. It returns the number of +// full bytes actually read as bits. +ulong +bs_close_read (Bitstream * bs) - ulong bytes_read; - if (bs->bc < 8) - bs->ptr++; - if ((bs->buf - bs->ptr) & 1) - bytes_read = bs->ptr - bs->buf; - CLEAR (*bs); - return bytes_read; - } + ulong bytes_read; - -#ifdef PACK -// Open the specified BitStream using the specified buffer pointers. It is -// assumed that enough buffer space has been allocated for all data that will -// be written, otherwise an error will be generated. - static void bs_write (Bitstream * bs); -bs_open_write (Bitstream * bs, uchar * buffer_start, uchar * buffer_end) + if (bs->bc < 8) + bs->ptr++; + if ((bs->buf - bs->ptr) & 1) + bytes_read = bs->ptr - bs->buf; + CLEAR (*bs); + return bytes_read; +#ifdef PACK +// Open the specified BitStream using the specified buffer pointers. It is +// assumed that enough buffer space has been allocated for all data that will +// be written, otherwise an error will be generated. +static void bs_write (Bitstream * bs); +bs_open_write (Bitstream * bs, uchar * buffer_start, uchar * buffer_end) - bs->ptr = bs->buf = buffer_start; - bs->wrap = bs_write; + bs->ptr = bs->buf = buffer_start; + bs->wrap = bs_write; -// This function is only called from the putbit() and putbits() macros when -// the buffer is full, which is now flagged as an error. -bs_write (Bitstream * bs) +// This function is only called from the putbit() and putbits() macros when +// the buffer is full, which is now flagged as an error. +bs_write (Bitstream * bs) - bs->ptr = bs->buf; + bs->ptr = bs->buf; -// This function forces a flushing write of the specified BitStream, and -// returns the total number of bytes written into the buffer. - ulong bs_close_write (Bitstream * bs) +// This function forces a flushing write of the specified BitStream, and +// returns the total number of bytes written into the buffer. +bs_close_write (Bitstream * bs) - ulong bytes_written; - if (bs->error) - return (ulong) - 1; - while (bs->bc || ((bs->ptr - bs->buf) & 1)) + ulong bytes_written; + if (bs->error) + return (ulong) - 1; + while (bs->bc || ((bs->ptr - bs->buf) & 1)) putbit_1 (bs); - bytes_written = bs->ptr - bs->buf; - return bytes_written; + bytes_written = bs->ptr - bs->buf; + return bytes_written; -/////////////////////// Endian Correction Routines //////////////////////////// - void -little_endian_to_native (void *data, char *format) +/////////////////////// Endian Correction Routines //////////////////////////// +little_endian_to_native (void *data, char *format) - uchar * cp = (uchar *) data; - long temp; + uchar *cp = (uchar *) data; + long temp; - while (*format) { - switch (*format) { - case 'L': - temp = + while (*format) { + switch (*format) { + case 'L': + temp = cp[0] + ((long) cp[1] << 8) + ((long) cp[2] << 16) + ((long) cp[3] << 24); - *(long *) cp = temp; - cp += 4; - break; - case 'S': - temp = cp[0] + (cp[1] << 8); - *(short *) cp = (short) temp; - cp += 2; - default: - if (isdigit (*format)) - cp += *format - '0'; - break; - } - format++; - } -native_to_little_endian (void *data, char *format) + *(long *) cp = temp; + cp += 4; + break; + case 'S': + temp = cp[0] + (cp[1] << 8); + *(short *) cp = (short) temp; + cp += 2; + default: + if (isdigit (*format)) + cp += *format - '0'; + } + format++; + } +native_to_little_endian (void *data, char *format) - temp = *(long *) cp; - *cp++ = (uchar) temp; - *cp++ = (uchar) (temp >> 8); - *cp++ = (uchar) (temp >> 16); - *cp++ = (uchar) (temp >> 24); - temp = *(short *) cp; + temp = *(long *) cp; + *cp++ = (uchar) temp; + *cp++ = (uchar) (temp >> 8); + *cp++ = (uchar) (temp >> 16); + *cp++ = (uchar) (temp >> 24); + temp = *(short *) cp; -////////////////////////// Debug Wrapper for Malloc /////////////////////////// -#ifdef DEBUG_ALLOC - void *vptrs[512]; - static void * -add_ptr (void *ptr) +////////////////////////// Debug Wrapper for Malloc /////////////////////////// +#ifdef DEBUG_ALLOC +void *vptrs[512]; +static void * +add_ptr (void *ptr) - int i; + int i; - for (i = 0; i < 512; ++i) - if (!vptrs[i]) { - vptrs[i] = ptr; - break; - if (i == 512) - error_line ("too many mallocs!"); - return ptr; -del_ptr (void *ptr) + for (i = 0; i < 512; ++i) + if (!vptrs[i]) { + vptrs[i] = ptr; + break; + if (i == 512) + error_line ("too many mallocs!"); + return ptr; +del_ptr (void *ptr) - if (vptrs[i] == ptr) { - vptrs[i] = NULL; - error_line ("free invalid ptr!"); - void * -malloc_db (ulong size) + if (vptrs[i] == ptr) { + vptrs[i] = NULL; + error_line ("free invalid ptr!"); +void * +malloc_db (ulong size) - if (size) - return add_ptr (malloc (size)); - + if (size) + return add_ptr (malloc (size)); else - return NULL; -free_db (void *ptr) + return NULL; +free_db (void *ptr) - if (ptr) - free (del_ptr (ptr)); -realloc_db (void *ptr, ulong size) + if (ptr) + free (del_ptr (ptr)); +realloc_db (void *ptr, ulong size) - if (ptr && size) - return add_ptr (realloc (del_ptr (ptr), size)); + if (ptr && size) + return add_ptr (realloc (del_ptr (ptr), size)); else if (size) - return malloc_db (size); + return malloc_db (size); - free_db (ptr); - return NULL; - long -dump_alloc (void) + free_db (ptr); + return NULL; +long +dump_alloc (void) - int i, j; + int i, j; - for (j = i = 0; i < 512; ++i) - if (vptrs[i]) - j++; - return j; + for (j = i = 0; i < 512; ++i) + if (vptrs[i]) + j++; + return j; Index: extra1.c RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/extra1.c,v --- extra1.c 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ extra1.c 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -1,577 +1,571 @@ -// extra1.c -// This module handles the "extra" mode for mono files. [...1021 lines suppressed...] + error_line (string); + for (i = 0; i < nterms; ++i) + if (!wps->decorr_passes[i].term) + wps->num_terms = i; + for (i = 0; i < nterms + 2; ++i) + free (sampleptrs[i]); +#ifdef MINMAX_WEIGHTS + error_line ("weight range = %ld (%d) to %ld (%d)", min_weight, min_term, max_weight, max_term); -} Index: extra2.c RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/extra2.c,v --- extra2.c 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ extra2.c 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -1,811 +1,806 @@ -// extra2.c -// This module handles the "extra" mode for stereo files. [...1449 lines suppressed...] Index: float.c RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/float.c,v --- float.c 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ float.c 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -1,365 +1,372 @@ -// float.c -#define malloc malloc_db -#define realloc realloc_db -#define free free_db +// float.c +#define malloc malloc_db +#define realloc realloc_db +#define free free_db void *malloc_db (ulong size); - void *realloc_db (void *ptr, ulong size); - void free_db (void *ptr); - long dump_alloc (void); +void *realloc_db (void *ptr, ulong size); +void free_db (void *ptr); +long dump_alloc (void); -write_float_info (WavpackStream * wps, WavpackMetadata * wpmd) +write_float_info (WavpackStream * wps, WavpackMetadata * wpmd) - char *byteptr; + char *byteptr; - byteptr = wpmd->data = malloc (4); - wpmd->id = ID_FLOAT_INFO; - *byteptr++ = wps->float_flags; - *byteptr++ = wps->float_shift; - *byteptr++ = wps->float_max_exp; - *byteptr++ = wps->float_norm_exp; - wpmd->byte_length = byteptr - (char *) wpmd->data; - } int -scan_float_data (WavpackStream * wps, f32 * values, long num_values) + byteptr = wpmd->data = malloc (4); + wpmd->id = ID_FLOAT_INFO; + *byteptr++ = wps->float_flags; + *byteptr++ = wps->float_shift; + *byteptr++ = wps->float_max_exp; + *byteptr++ = wps->float_norm_exp; + wpmd->byte_length = byteptr - (char *) wpmd->data; +} int +scan_float_data (WavpackStream * wps, f32 * values, long num_values) - long shifted_ones = 0, shifted_zeros = 0, shifted_both = 0; - long false_zeros = 0, neg_zeros = 0; + long shifted_ones = 0, shifted_zeros = 0, shifted_both = 0; + long false_zeros = 0, neg_zeros = 0; - ulong ordata = 0, crc = 0xffffffff; - int max_exp = 0, shift_count; - long count, value; + ulong ordata = 0, crc = 0xffffffff; + int max_exp = 0, shift_count; + long count, value; + f32 *dp; + wps->float_shift = wps->float_flags = 0; + for (dp = values, count = num_values; count--; dp++) { + crc = crc * 27 + dp->mantissa * 9 + dp->exponent * 3 + dp->sign; + if (dp->exponent > max_exp && dp->exponent < 255) + max_exp = dp->exponent; + wps->crc_x = crc; + if (dp->exponent == 255) { + wps->float_flags |= FLOAT_EXCEPTIONS; + value = 0x1000000; + shift_count = 0; - f32 * dp; - wps->float_shift = wps->float_flags = 0; - for (dp = values, count = num_values; count--; dp++) { - crc = crc * 27 + dp->mantissa * 9 + dp->exponent * 3 + dp->sign; - if (dp->exponent > max_exp && dp->exponent < 255) - max_exp = dp->exponent; - wps->crc_x = crc; - if (dp->exponent == 255) { - wps->float_flags |= FLOAT_EXCEPTIONS; - value = 0x1000000; - shift_count = 0; else if (dp->exponent) { - shift_count = max_exp - dp->exponent; - value = 0x800000 + dp->mantissa; + shift_count = max_exp - dp->exponent; + value = 0x800000 + dp->mantissa; else { - shift_count = max_exp ? max_exp - 1 : 0; - value = dp->mantissa; - -// if (dp->mantissa) -// denormals++; + shift_count = max_exp ? max_exp - 1 : 0; + value = dp->mantissa; +// if (dp->mantissa) +// denormals++; } - if (shift_count < 25) - value >>= shift_count; + if (shift_count < 25) + value >>= shift_count; else - value = 0; - if (!value) { - if (dp->exponent || dp->mantissa) - ++false_zeros; - + value = 0; + if (!value) { + if (dp->exponent || dp->mantissa) + ++false_zeros; else if (dp->sign) - ++neg_zeros; + ++neg_zeros; else if (shift_count) { - long mask = (1 << shift_count) - 1; + long mask = (1 << shift_count) - 1; + if (!(dp->mantissa & mask)) + shifted_zeros++; - if (!(dp->mantissa & mask)) - shifted_zeros++; else if ((dp->mantissa & mask) == mask) - shifted_ones++; + shifted_ones++; else - shifted_both++; - ordata |= value; - *(long *) dp = (dp->sign) ? -value : value; - } wps->float_max_exp = max_exp; - if (shifted_both) - wps->float_flags |= FLOAT_SHIFT_SENT; + shifted_both++; + ordata |= value; + *(long *) dp = (dp->sign) ? -value : value; + } wps->float_max_exp = max_exp; + if (shifted_both) + wps->float_flags |= FLOAT_SHIFT_SENT; else if (shifted_ones && !shifted_zeros) - wps->float_flags |= FLOAT_SHIFT_ONES; + wps->float_flags |= FLOAT_SHIFT_ONES; else if (shifted_ones && shifted_zeros) - wps->float_flags |= FLOAT_SHIFT_SAME; + wps->float_flags |= FLOAT_SHIFT_SAME; else if (ordata && !(ordata & 1)) { - while (!(ordata & 1)) { - wps->float_shift++; - ordata >>= 1; - for (dp = values, count = num_values; count--; dp++) - *(long *) dp >>= wps->float_shift; - wps->wphdr.flags &= ~MAG_MASK; - while (ordata) { - wps->wphdr.flags += 1 << MAG_LSB; - ordata >>= 1; - if (false_zeros || neg_zeros) - wps->float_flags |= FLOAT_ZEROS_SENT; - if (neg_zeros) - wps->float_flags |= FLOAT_NEG_ZEROS; - -// error_line ("samples = %d, max exp = %d, pre-shift = %d, denormals = %d", -// num_values, max_exp, wps->float_shift, denormals); -// if (wps->float_flags & FLOAT_EXCEPTIONS) -// error_line ("exceptions!"); -// error_line ("shifted ones/zeros/both = %d/%d/%d, true/neg/false zeros = %d/%d/%d", -// shifted_ones, shifted_zeros, shifted_both, true_zeros, neg_zeros, false_zeros); - return wps-> + while (!(ordata & 1)) { + wps->float_shift++; + ordata >>= 1; + for (dp = values, count = num_values; count--; dp++) + *(long *) dp >>= wps->float_shift; + wps->wphdr.flags &= ~MAG_MASK; + while (ordata) { + wps->wphdr.flags += 1 << MAG_LSB; + ordata >>= 1; + if (false_zeros || neg_zeros) + wps->float_flags |= FLOAT_ZEROS_SENT; + if (neg_zeros) + wps->float_flags |= FLOAT_NEG_ZEROS; +// error_line ("samples = %d, max exp = %d, pre-shift = %d, denormals = %d", +// num_values, max_exp, wps->float_shift, denormals); +// if (wps->float_flags & FLOAT_EXCEPTIONS) +// error_line ("exceptions!"); +// error_line ("shifted ones/zeros/both = %d/%d/%d, true/neg/false zeros = %d/%d/%d", +// shifted_ones, shifted_zeros, shifted_both, true_zeros, neg_zeros, false_zeros); + return wps-> float_flags & (FLOAT_EXCEPTIONS | FLOAT_ZEROS_SENT | FLOAT_SHIFT_SENT | FLOAT_SHIFT_SAME); -send_float_data (WavpackStream * wps, f32 * values, long num_values) +send_float_data (WavpackStream * wps, f32 * values, long num_values) - int max_exp = wps->float_max_exp; - long count, value, shift_count; + int max_exp = wps->float_max_exp; + long count, value, shift_count; + if (dp->mantissa) { + putbit_1 (&wps->wvxbits); + putbits (dp->mantissa, 23, &wps->wvxbits); + } - if (dp->mantissa) { - putbit_1 (&wps->wvxbits); - putbits (dp->mantissa, 23, &wps->wvxbits); - } else { - putbit_0 (&wps->wvxbits); - value = 0x1000000; + putbit_0 (&wps->wvxbits); - if (wps->float_flags & FLOAT_ZEROS_SENT) { - if (dp->exponent || dp->mantissa) { - putbit_1 (&wps->wvxbits); - putbits (dp->mantissa, 23, &wps->wvxbits); - if (max_exp >= 25) { - putbits (dp->exponent, 8, &wps->wvxbits); - } - putbit (dp->sign, &wps->wvxbits); - } - + if (wps->float_flags & FLOAT_ZEROS_SENT) { + if (dp->exponent || dp->mantissa) { + putbit_1 (&wps->wvxbits); + putbits (dp->mantissa, 23, &wps->wvxbits); + if (max_exp >= 25) { + putbits (dp->exponent, 8, &wps->wvxbits); + } + putbit (dp->sign, &wps->wvxbits); + } else { - putbit_0 (&wps->wvxbits); - if (wps->float_flags & FLOAT_NEG_ZEROS) - putbit (dp->sign, &wps->wvxbits); + putbit_0 (&wps->wvxbits); + if (wps->float_flags & FLOAT_NEG_ZEROS) + putbit (dp->sign, &wps->wvxbits); - if (wps->float_flags & FLOAT_SHIFT_SENT) { - long data = dp->mantissa & ((1 << shift_count) - 1); + if (wps->float_flags & FLOAT_SHIFT_SENT) { + long data = dp->mantissa & ((1 << shift_count) - 1); + putbits (data, shift_count, &wps->wvxbits); - putbits (data, shift_count, &wps->wvxbits); else if (wps->float_flags & FLOAT_SHIFT_SAME) { - putbit (dp->mantissa & 1, &wps->wvxbits); + putbit (dp->mantissa & 1, &wps->wvxbits); - int -read_float_info (WavpackStream * wps, WavpackMetadata * wpmd) +int +read_float_info (WavpackStream * wps, WavpackMetadata * wpmd) - int bytecnt = wpmd->byte_length; - char *byteptr = wpmd->data; + int bytecnt = wpmd->byte_length; + char *byteptr = wpmd->data; - if (bytecnt != 4) - return FALSE; - wps->float_flags = *byteptr++; - wps->float_shift = *byteptr++; - wps->float_max_exp = *byteptr++; - wps->float_norm_exp = *byteptr; - return TRUE; + if (bytecnt != 4) + return FALSE; + wps->float_flags = *byteptr++; + wps->float_shift = *byteptr++; + wps->float_max_exp = *byteptr++; + wps->float_norm_exp = *byteptr; + return TRUE; -#ifdef UNPACK - static void float_values_nowvx (WavpackStream * wps, long *values, +#ifdef UNPACK +static void float_values_nowvx (WavpackStream * wps, long *values, long num_values); -float_values (WavpackStream * wps, long *values, long num_values) +float_values (WavpackStream * wps, long *values, long num_values) - ulong crc = wps->crc_x; - if (!bs_is_open (&wps->wvxbits)) { - float_values_nowvx (wps, values, num_values); - return; - while (num_values--) { - int shift_count = 0, exp = wps->float_max_exp; + ulong crc = wps->crc_x; + if (!bs_is_open (&wps->wvxbits)) { + float_values_nowvx (wps, values, num_values); + return; + while (num_values--) { + int shift_count = 0, exp = wps->float_max_exp; + f32 outval = { + 0, 0, 0 + }; + ulong temp; + if (*values == 0) { + if (getbit (&wps->wvxbits)) { + getbits (&temp, 23, &wps->wvxbits); + outval.mantissa = temp; + if (exp >= 25) { + getbits (&temp, 8, &wps->wvxbits); + outval.exponent = temp; + outval.sign = getbit (&wps->wvxbits); - f32 outval = { - 0, 0, 0}; - ulong temp; - if (*values == 0) { - if (getbit (&wps->wvxbits)) { - getbits (&temp, 23, &wps->wvxbits); - outval.mantissa = temp; - if (exp >= 25) { - getbits (&temp, 8, &wps->wvxbits); - outval.exponent = temp; - outval.sign = getbit (&wps->wvxbits); else if (wps->float_flags & FLOAT_NEG_ZEROS) - outval.sign = getbit (&wps->wvxbits); - *values <<= wps->float_shift; - if (*values < 0) { - *values = -*values; - outval.sign = 1; - if (*values == 0x1000000) { - outval.exponent = 255; + *values <<= wps->float_shift; + if (*values < 0) { + *values = -*values; + outval.sign = 1; + if (*values == 0x1000000) { + outval.exponent = 255; - if (exp) - while (!(*values & 0x800000) && --exp) { - shift_count++; - *values <<= 1; - if (shift_count) { - if ((wps->float_flags & FLOAT_SHIFT_ONES) || + if (exp) + while (!(*values & 0x800000) && --exp) { + shift_count++; + *values <<= 1; + if (shift_count) { + if ((wps->float_flags & FLOAT_SHIFT_ONES) || ((wps->float_flags & FLOAT_SHIFT_SAME) && getbit (&wps->wvxbits))) - *values |= ((1 << shift_count) - 1); - + *values |= ((1 << shift_count) - 1); else if (wps->float_flags & FLOAT_SHIFT_SENT) { - getbits (&temp, shift_count, &wps->wvxbits); - *values |= temp & ((1 << shift_count) - 1); - outval.mantissa = *values; - outval.exponent = exp; - crc = crc * 27 + outval.mantissa * 9 + outval.exponent * 3 + outval.sign; - *(f32 *) values++ = outval; - static void -float_values_nowvx (WavpackStream * wps, long *values, long num_values) + getbits (&temp, shift_count, &wps->wvxbits); + *values |= temp & ((1 << shift_count) - 1); + outval.mantissa = *values; + outval.exponent = exp; + crc = crc * 27 + outval.mantissa * 9 + outval.exponent * 3 + outval.sign; + *(f32 *) values++ = outval; +float_values_nowvx (WavpackStream * wps, long *values, long num_values) - while (num_values--) { + if (*values) { + if (*values >= 0x1000000) { + while (*values & 0xf000000) { + *values >>= 1; + ++exp; - if (*values) { - if (*values >= 0x1000000) { - while (*values & 0xf000000) { - *values >>= 1; - ++exp; else if (exp) { - while (!(*values & 0x800000) && --exp) { - shift_count++; - *values <<= 1; - if (shift_count && (wps->float_flags & FLOAT_SHIFT_ONES)) - *values |= ((1 << shift_count) - 1); - outval.mantissa = *values; - outval.exponent = exp; - *(f32 *) values++ = outval; -float_normalize (long *values, long num_values, int delta_exp) + while (!(*values & 0x800000) && --exp) { + shift_count++; + *values <<= 1; + if (shift_count && (wps->float_flags & FLOAT_SHIFT_ONES)) + *values |= ((1 << shift_count) - 1); + outval.mantissa = *values; + outval.exponent = exp; +float_normalize (long *values, long num_values, int delta_exp) - f32 * fvalues = (f32 *) values, fzero = { + f32 *fvalues = (f32 *) values, fzero = { 0, 0, 0}; - int exp; + int exp; + if (!delta_exp) + if ((exp = fvalues->exponent) == 0 || exp + delta_exp <= 0) + *fvalues = fzero; - if (!delta_exp) - if ((exp = fvalues->exponent) == 0 || exp + delta_exp <= 0) - *fvalues = fzero; else if (exp == 255 || (exp += delta_exp) >= 255) { - fvalues->exponent = 255; - fvalues->mantissa = 0; + fvalues->exponent = 255; + fvalues->mantissa = 0; - fvalues->exponent = exp; - fvalues++; + fvalues->exponent = exp; + fvalues++; Index: gstwavpackdec.c RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/gstwavpackdec.c,v --- gstwavpackdec.c 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ gstwavpackdec.c 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -55,7 +55,7 @@ /* state */ stream_reader reader; WavpackContext *ctx; - GstByteStream * bs; + GstByteStream *bs; gboolean seek_pending; guint64 seek_offset; /* in samples */ @@ -588,7 +588,7 @@ g_free (wavpackdec->decodebuf); wavpackdec->decodebuf = NULL; wavpackdec->ctx = NULL; - wavpackdec->bs = NULL; + wavpackdec->bs = NULL; wavpackdec->depth = 0; wavpackdec->width = 0; wavpackdec->rate = 0; Index: gstwavpackreader.c RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/gstwavpackreader.c,v --- gstwavpackreader.c 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ gstwavpackreader.c 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -116,13 +116,13 @@ return gst_bytestream_tell ((GstByteStream *) id); } /*************************************************************************** * * gst_wavpack_reader_set_pos_rel ***************************************************************************/ - static int +static int gst_wavpack_reader_set_pos_rel (void *id, long pos, int mode) GstByteStream *bs = (GstByteStream *) id; @@ -158,13 +158,13 @@ return 0; /* just like fseek */ * gst_wavpack_reader_set_pos_abs gst_wavpack_reader_set_pos_abs (void *id, ulong pos) return gst_wavpack_reader_set_pos_rel (id, (long) pos, SEEK_SET); @@ -187,7 +187,7 @@ g_return_val_if_reached (-1); * gst_wavpack_reader_get_length @@ -199,30 +199,30 @@ return gst_bytestream_length ((GstByteStream *) id); * gst_wavpack_reader_can_seek gst_wavpack_reader_can_seek (void *id) return TRUE; * gst_wavpack_reader_init - void gst_wavpack_reader_init (stream_reader * r) r->read_bytes = gst_wavpack_reader_read_bytes; - r->get_pos = gst_wavpack_reader_get_pos; - r->set_pos_abs = gst_wavpack_reader_set_pos_abs; + r->get_pos = gst_wavpack_reader_get_pos; + r->set_pos_abs = gst_wavpack_reader_set_pos_abs; r->set_pos_rel = gst_wavpack_reader_set_pos_rel; r->push_back_byte = gst_wavpack_reader_push_back_byte; r->get_length = gst_wavpack_reader_get_length; Index: metadata.c RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/metadata.c,v --- metadata.c 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ metadata.c 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -1,268 +1,274 @@ -// Copyright (c) 1998 - 2003 Conifer Software. // -// metadata.c -// This module handles the metadata structure introduced in WavPack 4.0 +// Copyright (c) 1998 - 2003 Conifer Software. // +// metadata.c +// This module handles the metadata structure introduced in WavPack 4.0 -read_metadata_buff (WavpackMetadata * wpmd, uchar * blockbuff, - uchar ** buffptr) +read_metadata_buff (WavpackMetadata * wpmd, uchar * blockbuff, uchar ** buffptr) - WavpackHeader * wphdr = (WavpackHeader *) blockbuff; - uchar * buffend = blockbuff + wphdr->ckSize + 8; - if (buffend - *buffptr < 2) - wpmd->id = *(*buffptr)++; - wpmd->byte_length = *(*buffptr)++ << 1; - if (wpmd->id & ID_LARGE) { - wpmd->id &= ~ID_LARGE; - if (buffend - *buffptr < 2) - return FALSE; - wpmd->byte_length += *(*buffptr)++ << 9; - wpmd->byte_length += *(*buffptr)++ << 17; - if (wpmd->id & ID_ODD_SIZE) { - wpmd->id &= ~ID_ODD_SIZE; - wpmd->byte_length--; - if (wpmd->byte_length) { - if (buffend - *buffptr < wpmd->byte_length + (wpmd->byte_length & 1)) { - wpmd->data = NULL; - wpmd->data = *buffptr; - (*buffptr) += wpmd->byte_length + (wpmd->byte_length & 1); + WavpackHeader *wphdr = (WavpackHeader *) blockbuff; + uchar *buffend = blockbuff + wphdr->ckSize + 8; + if (buffend - *buffptr < 2) + wpmd->id = *(*buffptr)++; + wpmd->byte_length = *(*buffptr)++ << 1; + if (wpmd->id & ID_LARGE) { + wpmd->id &= ~ID_LARGE; + if (buffend - *buffptr < 2) + return FALSE; + wpmd->byte_length += *(*buffptr)++ << 9; + wpmd->byte_length += *(*buffptr)++ << 17; + if (wpmd->id & ID_ODD_SIZE) { + wpmd->id &= ~ID_ODD_SIZE; + wpmd->byte_length--; + if (wpmd->byte_length) { + if (buffend - *buffptr < wpmd->byte_length + (wpmd->byte_length & 1)) { + wpmd->data = NULL; + wpmd->data = *buffptr; + (*buffptr) += wpmd->byte_length + (wpmd->byte_length & 1); - wpmd->data = NULL; - return TRUE; - int -process_metadata (WavpackContext * wpc, WavpackMetadata * wpmd) + wpmd->data = NULL; +process_metadata (WavpackContext * wpc, WavpackMetadata * wpmd) - WavpackStream * wps = wpc->streams[wpc->current_stream]; - switch (wpmd->id) { - case ID_DUMMY: - return TRUE; - case ID_DECORR_TERMS: - return read_decorr_terms (wps, wpmd); - case ID_DECORR_WEIGHTS: - return read_decorr_weights (wps, wpmd); - case ID_DECORR_SAMPLES: - return read_decorr_samples (wps, wpmd); - case ID_ENTROPY_VARS: - return read_entropy_vars (wps, wpmd); - case ID_HYBRID_PROFILE: - return read_hybrid_profile (wps, wpmd); - case ID_SHAPING_WEIGHTS: - return read_shaping_info (wps, wpmd); - case ID_FLOAT_INFO: - return read_float_info (wps, wpmd); - case ID_INT32_INFO: - return read_int32_info (wps, wpmd); - case ID_CHANNEL_INFO: - return read_channel_info (wpc, wpmd); - case ID_CONFIG_BLOCK: - return read_config_info (wpc, wpmd); - case ID_WV_BITSTREAM: - return init_wv_bitstream (wps, wpmd); - case ID_WVC_BITSTREAM: - return init_wvc_bitstream (wps, wpmd); - case ID_WVX_BITSTREAM: - return init_wvx_bitstream (wps, wpmd); - case ID_RIFF_HEADER: + WavpackStream *wps = wpc->streams[wpc->current_stream]; + switch (wpmd->id) { + case ID_DUMMY: + return TRUE; + case ID_DECORR_TERMS: + return read_decorr_terms (wps, wpmd); + case ID_DECORR_WEIGHTS: + return read_decorr_weights (wps, wpmd); + case ID_DECORR_SAMPLES: + return read_decorr_samples (wps, wpmd); + case ID_ENTROPY_VARS: + return read_entropy_vars (wps, wpmd); + case ID_HYBRID_PROFILE: + return read_hybrid_profile (wps, wpmd); + case ID_SHAPING_WEIGHTS: + return read_shaping_info (wps, wpmd); + case ID_FLOAT_INFO: + return read_float_info (wps, wpmd); + case ID_INT32_INFO: + return read_int32_info (wps, wpmd); + case ID_CHANNEL_INFO: + return read_channel_info (wpc, wpmd); + case ID_CONFIG_BLOCK: + return read_config_info (wpc, wpmd); + case ID_WV_BITSTREAM: + return init_wv_bitstream (wps, wpmd); + case ID_WVC_BITSTREAM: + return init_wvc_bitstream (wps, wpmd); + case ID_WVX_BITSTREAM: + return init_wvx_bitstream (wps, wpmd); + case ID_RIFF_HEADER: case ID_RIFF_TRAILER: - return read_wrapper_data (wpc, wpmd); - case ID_MD5_CHECKSUM: - if (wpmd->byte_length == 16) { - memcpy (wpc->config.md5_checksum, wpmd->data, 16); - wpc->config.flags |= CONFIG_MD5_CHECKSUM; - wpc->config.md5_read = 1; - return TRUE; - default: - return (wpmd->id & ID_OPTIONAL_DATA) ? TRUE : FALSE; + return read_wrapper_data (wpc, wpmd); + case ID_MD5_CHECKSUM: + if (wpmd->byte_length == 16) { + memcpy (wpc->config.md5_checksum, wpmd->data, 16); + wpc->config.flags |= CONFIG_MD5_CHECKSUM; + wpc->config.md5_read = 1; + default: + return (wpmd->id & ID_OPTIONAL_DATA) ? TRUE : FALSE; -copy_metadata (WavpackMetadata * wpmd, uchar * buffer_start, - uchar * buffer_end) +copy_metadata (WavpackMetadata * wpmd, uchar * buffer_start, uchar * buffer_end) - ulong mdsize = wpmd->byte_length + (wpmd->byte_length & 1); - WavpackHeader * wphdr = (WavpackHeader *) buffer_start; - if (wpmd->byte_length & 1) - ((char *) wpmd->data)[wpmd->byte_length] = 0; - mdsize += (wpmd->byte_length > 510) ? 4 : 2; - buffer_start += wphdr->ckSize + 8; - if (buffer_start + mdsize >= buffer_end) - buffer_start[0] = wpmd->id | (wpmd->byte_length & 1 ? ID_ODD_SIZE : 0); - buffer_start[1] = (wpmd->byte_length + 1) >> 1; - if (wpmd->byte_length > 510) { - buffer_start[0] |= ID_LARGE; - buffer_start[2] = (wpmd->byte_length + 1) >> 9; - buffer_start[3] = (wpmd->byte_length + 1) >> 17; - if (wpmd->data && wpmd->byte_length) { - if (wpmd->byte_length > 510) { - buffer_start[0] |= ID_LARGE; - buffer_start[2] = (wpmd->byte_length + 1) >> 9; - buffer_start[3] = (wpmd->byte_length + 1) >> 17; - memcpy (buffer_start + 4, wpmd->data, mdsize - 4); + ulong mdsize = wpmd->byte_length + (wpmd->byte_length & 1); + WavpackHeader *wphdr = (WavpackHeader *) buffer_start; + if (wpmd->byte_length & 1) + ((char *) wpmd->data)[wpmd->byte_length] = 0; + mdsize += (wpmd->byte_length > 510) ? 4 : 2; + buffer_start += wphdr->ckSize + 8; + if (buffer_start + mdsize >= buffer_end) + buffer_start[0] = wpmd->id | (wpmd->byte_length & 1 ? ID_ODD_SIZE : 0); + buffer_start[1] = (wpmd->byte_length + 1) >> 1; + if (wpmd->byte_length > 510) { + buffer_start[0] |= ID_LARGE; + buffer_start[2] = (wpmd->byte_length + 1) >> 9; + buffer_start[3] = (wpmd->byte_length + 1) >> 17; + if (wpmd->data && wpmd->byte_length) { + if (wpmd->byte_length > 510) { + buffer_start[0] |= ID_LARGE; + buffer_start[2] = (wpmd->byte_length + 1) >> 9; + buffer_start[3] = (wpmd->byte_length + 1) >> 17; + memcpy (buffer_start + 4, wpmd->data, mdsize - 4); - memcpy (buffer_start + 2, wpmd->data, mdsize - 2); - wphdr->ckSize += mdsize; -add_to_metadata (WavpackContext * wpc, void *data, ulong bcount, uchar id) + memcpy (buffer_start + 2, wpmd->data, mdsize - 2); + wphdr->ckSize += mdsize; +add_to_metadata (WavpackContext * wpc, void *data, ulong bcount, uchar id) - WavpackMetadata * mdp; - uchar * src = data; - while (bcount) { - if (wpc->metacount) { - ulong bc = bcount; - mdp = wpc->metadata + wpc->metacount - 1; - if (mdp->id == id) { - if (wpc->metabytes + bcount > 1000000) - bc = 1000000 - wpc->metabytes; - mdp->data = realloc (mdp->data, mdp->byte_length + bc); - memcpy ((char *) mdp->data + mdp->byte_length, src, bc); - mdp->byte_length += bc; - wpc->metabytes += bc; - bcount -= bc; - src += bc; - if (wpc->metabytes >= 1000000 && !write_metadata_block (wpc)) - return FALSE; - if (bcount) { - wpc->metadata = + WavpackMetadata *mdp; + uchar *src = data; + while (bcount) { + if (wpc->metacount) { + ulong bc = bcount; + mdp = wpc->metadata + wpc->metacount - 1; + if (mdp->id == id) { + if (wpc->metabytes + bcount > 1000000) + bc = 1000000 - wpc->metabytes; + mdp->data = realloc (mdp->data, mdp->byte_length + bc); + memcpy ((char *) mdp->data + mdp->byte_length, src, bc); + mdp->byte_length += bc; + wpc->metabytes += bc; + bcount -= bc; + src += bc; + if (wpc->metabytes >= 1000000 && !write_metadata_block (wpc)) + return FALSE; + if (bcount) { + wpc->metadata = realloc (wpc->metadata, (wpc->metacount + 1) * sizeof (WavpackMetadata)); - mdp = wpc->metadata + wpc->metacount++; - mdp->byte_length = 0; - mdp->data = NULL; - mdp->id = id; - static char * -write_metadata (WavpackMetadata * wpmd, char *outdata) + mdp = wpc->metadata + wpc->metacount++; + mdp->byte_length = 0; + mdp->data = NULL; + mdp->id = id; +static char * +write_metadata (WavpackMetadata * wpmd, char *outdata) - uchar id = wpmd->id, wordlen[3]; - wordlen[0] = (wpmd->byte_length + 1) >> 1; - wordlen[1] = (wpmd->byte_length + 1) >> 9; - wordlen[2] = (wpmd->byte_length + 1) >> 17; - if (wpmd->byte_length & 1) { -// ((char *) wpmd->data) [wpmd->byte_length] = 0; - id |= ID_ODD_SIZE; - if (wordlen[1] || wordlen[2]) - id |= ID_LARGE; - *outdata++ = id; - *outdata++ = wordlen[0]; - if (id & ID_LARGE) { - *outdata++ = wordlen[1]; - *outdata++ = wordlen[2]; - memcpy (outdata, wpmd->data, wpmd->byte_length); - outdata += wpmd->byte_length; - if (wpmd->byte_length & 1) - *outdata++ = 0; - return outdata; -write_metadata_block (WavpackContext * wpc) + uchar id = wpmd->id, wordlen[3]; + wordlen[0] = (wpmd->byte_length + 1) >> 1; + wordlen[1] = (wpmd->byte_length + 1) >> 9; + wordlen[2] = (wpmd->byte_length + 1) >> 17; + if (wpmd->byte_length & 1) { +// ((char *) wpmd->data) [wpmd->byte_length] = 0; + id |= ID_ODD_SIZE; + if (wordlen[1] || wordlen[2]) + id |= ID_LARGE; + *outdata++ = id; + *outdata++ = wordlen[0]; + if (id & ID_LARGE) { + *outdata++ = wordlen[1]; + *outdata++ = wordlen[2]; + memcpy (outdata, wpmd->data, wpmd->byte_length); + outdata += wpmd->byte_length; + if (wpmd->byte_length & 1) + *outdata++ = 0; + return outdata; +write_metadata_block (WavpackContext * wpc) - char *block_buff, *block_ptr; + char *block_buff, *block_ptr; - WavpackHeader * wphdr; - if (wpc->metacount) { - int metacount = wpc->metacount, block_size = sizeof (WavpackHeader); + WavpackHeader *wphdr; - WavpackMetadata * wpmdp = wpc->metadata; - while (metacount--) { - block_size += wpmdp->byte_length + (wpmdp->byte_length & 1); - block_size += (wpmdp->byte_length > 510) ? 4 : 2; - wpmdp++; - wphdr = (WavpackHeader *) (block_buff = malloc (block_size)); - CLEAR (*wphdr); - memcpy (wphdr->ckID, "wvpk", 4); - wphdr->total_samples = wpc->total_samples; - wphdr->version = 0x403; - wphdr->ckSize = block_size - 8; - wphdr->block_samples = 0; - block_ptr = (char *) (wphdr + 1); - wpmdp = wpc->metadata; - while (wpc->metacount) { - block_ptr = write_metadata (wpmdp, block_ptr); - wpc->metabytes -= wpmdp->byte_length; - free_metadata (wpmdp++); - wpc->metacount--; - free (wpc->metadata); - wpc->metadata = NULL; - native_to_little_endian ((WavpackHeader *) block_buff, - WavpackHeaderFormat); - if (!wpc->blockout (wpc->wv_out, block_buff, block_size)) { - free (block_buff); - strcpy (wpc->error_message, + if (wpc->metacount) { + int metacount = wpc->metacount, block_size = sizeof (WavpackHeader); + WavpackMetadata *wpmdp = wpc->metadata; + while (metacount--) { + block_size += wpmdp->byte_length + (wpmdp->byte_length & 1); + block_size += (wpmdp->byte_length > 510) ? 4 : 2; + wpmdp++; + wphdr = (WavpackHeader *) (block_buff = malloc (block_size)); + CLEAR (*wphdr); + memcpy (wphdr->ckID, "wvpk", 4); + wphdr->total_samples = wpc->total_samples; + wphdr->version = 0x403; + wphdr->ckSize = block_size - 8; + wphdr->block_samples = 0; + block_ptr = (char *) (wphdr + 1); + wpmdp = wpc->metadata; + while (wpc->metacount) { + block_ptr = write_metadata (wpmdp, block_ptr); + wpc->metabytes -= wpmdp->byte_length; + free_metadata (wpmdp++); + wpc->metacount--; + free (wpc->metadata); + wpc->metadata = NULL; + native_to_little_endian ((WavpackHeader *) block_buff, WavpackHeaderFormat); + if (!wpc->blockout (wpc->wv_out, block_buff, block_size)) { + free (block_buff); + strcpy (wpc->error_message, "can't write WavPack data, disk probably full!"); - free (block_buff); + free (block_buff); -free_metadata (WavpackMetadata * wpmd) -{ - if (wpmd->data) { - free (wpmd->data); +free_metadata (WavpackMetadata * wpmd) +{ + if (wpmd->data) { + free (wpmd->data); Index: unpack.c RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/unpack.c,v --- unpack.c 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ unpack.c 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -1,931 +1,932 @@ -// unpack.c -// This module actually handles the decompression of the audio data, except [...1709 lines suppressed...] - for (stream = 0; stream < wpc->num_streams; stream++) { - WavpackStream * wps = wpc->streams[stream]; - if (wps->crc != wps->wphdr.crc) - ++result; else if (bs_is_open (&wps->wvxbits) && wps->crc_x != wps->crc_wvx) - return result; + ++result; + return result; Index: wavpack.h RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/wavpack.h,v --- wavpack.h 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ wavpack.h 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -1,604 +1,604 @@ -// wavpack.h -#ifndef WAVPACK_H [...1177 lines suppressed...] +int WavpackGetMD5Sum (WavpackContext *wpc, uchar data [16]); +ulong WavpackGetWrapperBytes (WavpackContext *wpc); +uchar *WavpackGetWrapperData (WavpackContext *wpc); +void WavpackFreeWrapper (WavpackContext *wpc); +double WavpackGetProgress (WavpackContext *wpc); +ulong WavpackGetFileSize (WavpackContext *wpc); +double WavpackGetRatio (WavpackContext *wpc); +double WavpackGetAverageBitrate (WavpackContext *wpc, int count_wvc); +double WavpackGetInstantBitrate (WavpackContext *wpc); +int WavpackGetTagItem (WavpackContext *wpc, const char *item, char *value, int size); +WavpackContext *WavpackOpenFileOutput (blockout blockout, void *wv_id, void *wvc_id); +int WavpackSetConfiguration (WavpackContext *wpc, WavpackConfig *config, ulong total_samples); +int WavpackAddWrapper (WavpackContext *wpc, void *data, ulong bcount); +int WavpackStoreMD5Sum (WavpackContext *wpc, uchar data [16]); +int WavpackPackInit (WavpackContext *wpc); +int WavpackPackSamples (WavpackContext *wpc, long *sample_buffer, ulong sample_count); +int WavpackFlushSamples (WavpackContext *wpc); +#endif Index: words.c RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/words.c,v --- words.c 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ words.c 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -1,1375 +1,1374 @@ -// words.c -// This module provides entropy word encoding and decoding functions using -// a variation on the Rice method. This was introduced in version 3.93 [...2560 lines suppressed...] - int restore_weight (char weight) + weight = -1024; + if (weight > 0) + weight -= (weight + 64) >> 7; + return (weight + 4) >> 3; +int restore_weight (char weight) - int result; - if ((result = (int) weight << 3) > 0) - result += (result + 64) >> 7; + int result; + if ((result = (int) weight << 3) > 0) + result += (result + 64) >> 7; Index: wputils.c RCS file: /cvs/gstreamer/gst-plugins/ext/wavpack/Attic/wputils.c,v --- wputils.c 2 Apr 2005 19:51:56 -0000 1.1.2.1 +++ wputils.c 2 Apr 2005 22:26:04 -0000 1.1.2.2 @@ -1,1903 +1,1925 @@ -// wputils.c -// This module provides a high-level interface to reading and writing WavPack [...3543 lines suppressed...] - if (m_tag->ape_tag_data) { - free (m_tag->ape_tag_data); - m_tag->ape_tag_data = 0; + if (m_tag->ape_tag_data) { + free (m_tag->ape_tag_data); + m_tag->ape_tag_data = 0; |