From 8b3c16e6152a527f9aec1a88a9eed74119de7000 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Wed, 22 Aug 2007 07:52:33 +0000 Subject: major engine cleanup. dependency on baselib removed. engine is now C code (not ansi tho). some other cruft removed aswell --- src/wavpack/float.c | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 src/wavpack/float.c (limited to 'src/wavpack/float.c') diff --git a/src/wavpack/float.c b/src/wavpack/float.c deleted file mode 100644 index 4b9b44ee..00000000 --- a/src/wavpack/float.c +++ /dev/null @@ -1,50 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// **** WAVPACK **** // -// Hybrid Lossless Wavefile Compressor // -// Copyright (c) 1998 - 2006 Conifer Software. // -// All Rights Reserved. // -// Distributed under the BSD Software License (see license.txt) // -//////////////////////////////////////////////////////////////////////////// - -// float.c - -#include "wavpack.h" - -int read_float_info (WavpackStream *wps, WavpackMetadata *wpmd) -{ - 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; -} - -void float_values (WavpackStream *wps, int32_t *values, int32_t num_values) -{ - int shift = wps->float_max_exp - wps->float_norm_exp + wps->float_shift; - - if (shift > 32) - shift = 32; - else if (shift < -32) - shift = -32; - - while (num_values--) { - if (shift > 0) - *values <<= shift; - else if (shift < 0) - *values >>= -shift; - - if (*values > 8388607L) - *values = 8388607L; - else if (*values < -8388608L) - *values = -8388608L; - - values++; - } -} -- cgit 1.4.1