Re: [ecasound] lossless conversion broken?

From: Stuart Allie <Stuart.Allie@email-addr-hidden>
Date: Fri Nov 05 2010 - 00:02:02 EET

I wouldn't let it worry you Kai. I once wrote a piece of code that
failed intermittently and for the life of me I couldn't find the bug. I
went through every line over and over. Other people read the code and
could see nothing wrong with it. Seven(!) years later I came across
that old code and out of curiosity started to read through it. The very
first line had an obvious error in it... that was the "mystery bug".

First line. Obvious error. The brain is really good at fooling itself
:)

Stuart Allie

> -----Original Message-----
> From: Kai Vehmanen [mailto:kvehmanen@email-addr-hidden]
> Sent: Friday, 5 November 2010 8:03 AM
> To: Dan Muresan
> Cc: ecasound-list@email-addr-hidden
> Subject: Re: [ecasound] lossless conversion broken?
>
> Hi,
>
> On Wed, 3 Nov 2010, Dan Muresan wrote:
>
> > I looked at the code. I'm surprised at a different asymmetry -- the
> > one between eca_sample_convert_float_to_s32 vs.
> > eca_sample_convert_s32_to_float:
> >
> > int32_t eca_sample_convert_float_to_s32(float inval) {
> > if (inval < 0.0f)
> > return((int32_t)((float)(inval * (INT32_MAX))));
> >
> > return((int32_t)((float)(inval * INT32_MAX) - 0.5f));
> > }
>
> oh yes, thanks, I've been blind to that completely, that's not right
at
> all. Definitely a bug. It sure is depressing to find such stuff... :P
>
> > I agree with the jackit threads -- introducing a nonlinear
> > transformation in a chain is not a good thing (from a signals &
> > systems POV). Sounds like 0x8000, symmetrical would be best for the
> > future. I assume this breaks existing files, which is why you'd have
> > to wait for a major release.
>
> Yes, agreed.
>
>
------------------------------------------------------------------------
------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
> _______________________________________________
> Ecasound-list mailing list
> Ecasound-list@email-addr-hidden
> https://lists.sourceforge.net/lists/listinfo/ecasound-list

------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a
Billion" shares his insights and actions to help propel your
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Ecasound-list mailing list
Ecasound-list@email-addr-hidden
https://lists.sourceforge.net/lists/listinfo/ecasound-list
Received on Fri Nov 5 04:15:01 2010

This archive was generated by hypermail 2.1.8 : Fri Nov 05 2010 - 04:15:02 EET