Re: [Audacity-devel] Potential P2 in Audacity 2.0.0 alpha
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Martyn S. <mar...@gm...> - 2012-02-09 00:37:29
|
On 08/02/2012 02:15, Michael Chinen wrote: > On Tue, Feb 7, 2012 at 3:07 PM, Martyn Shaw<mar...@gm...> wrote: >> [...] >>>> I'm not sure why there have increasing numbers of reports of "flatlined" >>>> exports recently. It could merely be that I've been actively looking for >>>> them, thinking they could be project reopening bugs. These sort of >>>> reports look to be fairly common on the Forum, but given the reports >>>> are usually vague they are usually dismissed as user running out of >>>> disk space and not noticing the holes in the project, or having a >>>> fragmented drive. >>> >>> The problem was that the dithering macros didn't expect floats> 0db. >> >> All the clipping stuff is already in there, I think, in >> IMPLEMENT_STORE, and that looks fine to me. The actual problem is in >> Dither::ShapedDither where lrintf overflows with these large sample >> values. You can see that by changing >> float r = DITHER_NOISE + DITHER_NOISE; >> to >> float r = 0.0; >> and using an otherwise silent track, with a BIG second or third sample >> and then putting a breakpoint on >> return result; >> and watching what happens to mBuffer values - they should all stay at >> zero but don't. >> >> So I changed lrintf for llrintf. >> >>> I checked in a possible fix in r11460 which clips them for the dither. >>> Please take a look. This should only affect dithering conversion from >>> float to int, so mainly export to wav/mp3/etc. >> >> I've reverted that and put my fix in instead. I don't think that >> yours causes any particular problems, but I feel that I have hit the >> cause rather than treating a symptom. > > Hi Martyn, I looked at your fix and found two issues with it. > > It has the same problem as the original bug, but just shifts it back > by a couple hundred decibels. > This is because both lrintf and llrintf is undefined for values larger > than a long int and long long int, respectively. > Since floats can be much larger than long long this will still be an issue. > On my system this is 32 bits, which means llrintf gets an extra 192db > of headroom, but still will have the same problem after that. > I tested this and it seems to be true - using steve's nyquist with > instead of 100 db, 300 db, and the same error occurs. Yes, of course, you are absolutely right. I just moved the problem by 192dB (which is quite a lot ;-)) but not eliminated it. I'd like to see this 'right' (treating the problem, not the symptom) but don't have time right now (and might not have before code-freeze). Feel free to revert my change if you wish. I think it a pretty minor bug, but interesting. TTFN Martyn > Also, I put the clipping in the FROM_FLOAT, because that is first > point used by all dither macros where clipping could and should > happen. > I thought this was better than in ShapedDither because IMPLEMENT_STORE > also uses lrintf, which could blow up for other dithers. > This actually does happen with other dithers when I looked closer - > the sample that should be exported as +1 gets exported as -1 (which I > now recall is another bug on bugzilla) > Because there is no IIR filter behavior in the other dithers, the > weird behavior only exists while the sample is the high value (as > opposed to every sample after that with ShapedDither). > > Clipping in FROM_FLOAT fixes both of these issues, so I think we > should revert unless there are other issues. > > Best, > > Michael > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > audacity-devel mailing list > aud...@li... > https://lists.sourceforge.net/lists/listinfo/audacity-devel |