Re: [linux-audio-user] Flac vs wavpack and float32 to pcm24 conversion tests

From: Erik de Castro Lopo <mle+la@email-addr-hidden-nerd.com>
Date: Sun Mar 04 2007 - 23:37:02 EET

Thorsten Wilms wrote:

> Hi!
>
> I'm interested in losless compression of typical Jack audifiles
> for exchange. That means float32 sample format.

Hmm, interesting.

> Flac doesn't handle float, only pcm.
> wavpack handles both.
>
> So I was told that converting from (wav) float32 to pcm24 and back
> should be losless, if the float file is normalized.

I would be **very** surprised if it was. For a normalised WAV file
the maximum value would be 1.0 which will correspond to a pcm24
value of 0x7ffffff. The float32 file could also contain a sample
with a value of 1/(2^25) which is smaller than the pcm24 value of
0x1. Hence, float32 -> pcm24 -> float32 is not lossless.

> This would cut
> down on file-size by itself and allow to use Flac.
> I tested this using sndfile-convert and diff tells me there are
> differences. The file sizes are identical.
> diff did not report differences for a wav-unpacked file (staying
> in float32).

The wavpack algorithm must do soemthing special with float32 data.

Maybe what you want to do is add wavpack to libsndfile :-).

Erik

-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"If POSIX threads are a good thing, perhaps I don't want to know what
they're better than."                                   -- Rob Pike
Received on Mon Mar 5 00:15:03 2007

This archive was generated by hypermail 2.1.8 : Mon Mar 05 2007 - 00:15:03 EET