Re: [ecasound] lossless conversion broken?

From: Kai Vehmanen <kvehmanen@email-addr-hidden>
Date: Sun Oct 31 2010 - 23:32:59 EET

Hi,

On Sun, 31 Oct 2010, Dan Muresan wrote:

> Not to be too too pedantic -- but now that this question is out in the
> open, how does ecasound convert PCM to float? I'm surprised to see

libecasound/eca-sample-conversion.h:
http://ecasound.git.sourceforge.net/git/gitweb.cgi?p=ecasound/ecasound;a=blob;f=libecasound/eca-sample-conversion.h;h=f11aced93bd9ff2616c5500205d661cc8c554201;hb=HEAD#l96

This is unit-tested in libecasound/eca-sample-conversion_test.h:
http://ecasound.git.sourceforge.net/git/gitweb.cgi?p=ecasound/ecasound;a=blob;f=libecasound/eca-sample-conversion_test.h;h=fa0c52247290c4886dc98889afde9eaac0f8e70d;hb=HEAD

So this is basicly the "asymmetric" method in:
http://blog.bjornroche.com/2009/12/linearity-and-dynamic-range-in-int.html

I'd actually like to change to the symmetric method, based on
discussion of this blog post on jackit-devel (2009 Dec):
http://comments.gmane.org/gmane.comp.audio.jackit/20492
http://comments.gmane.org/gmane.comp.audio.jackit/20499

So I'm leaning towards symmetric, but not sure when/how to do it properly
(cannot do this in a minor version update). Anyways, the thread(s) also
highlight that the impact is minimal in practise, and based on this I
haven't rushed the change.

So in your test case, sox might convert sine to 32767, while ecasound
would convert it to 32768. This could perhaps explain the one-bit flips
(aside float implementation issues).

You can use an alternative conversion already now by using
the libsndfile one in ecasound. E.g.:
ecasound -f:f32 -i sndfile,foo.wav -o sndfile,bar.wav

This will avoind ecasound's own int2float completely.

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ecasound-list mailing list
Ecasound-list@email-addr-hidden
https://lists.sourceforge.net/lists/listinfo/ecasound-list
Received on Mon Nov 1 00:15:02 2010

This archive was generated by hypermail 2.1.8 : Mon Nov 01 2010 - 00:15:03 EET