Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-21 Thread Michael Niedermayer
On Tue, Apr 21, 2015 at 06:50:20PM +0200, Andreas Cadhalpun wrote: > On 21.04.2015 02:20, Claudio Freire wrote: > > On Mon, Apr 20, 2015 at 9:13 PM, Michael Niedermayer > > wrote: > >> On Mon, Apr 20, 2015 at 09:07:14PM -0300, Claudio Freire wrote: > >>> On Mon, Apr 20, 2015 at 8:59 PM, Claudio F

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-21 Thread Andreas Cadhalpun
On 21.04.2015 02:20, Claudio Freire wrote: > On Mon, Apr 20, 2015 at 9:13 PM, Michael Niedermayer wrote: >> On Mon, Apr 20, 2015 at 09:07:14PM -0300, Claudio Freire wrote: >>> On Mon, Apr 20, 2015 at 8:59 PM, Claudio Freire >>> wrote: On Mon, Apr 20, 2015 at 8:32 PM, Andreas Cadhalpun

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-20 Thread Claudio Freire
On Mon, Apr 20, 2015 at 9:13 PM, Michael Niedermayer wrote: > On Mon, Apr 20, 2015 at 09:07:14PM -0300, Claudio Freire wrote: >> On Mon, Apr 20, 2015 at 8:59 PM, Claudio Freire >> wrote: >> > On Mon, Apr 20, 2015 at 8:32 PM, Andreas Cadhalpun >> > wrote: >> > The long version: >> > >> >

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-20 Thread Michael Niedermayer
On Mon, Apr 20, 2015 at 09:07:14PM -0300, Claudio Freire wrote: > On Mon, Apr 20, 2015 at 8:59 PM, Claudio Freire > wrote: > > On Mon, Apr 20, 2015 at 8:32 PM, Andreas Cadhalpun > > wrote: > > The long version: > > > > ath should approximate the shape of the absolute hearing threshol

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-20 Thread Claudio Freire
On Mon, Apr 20, 2015 at 8:59 PM, Claudio Freire wrote: > On Mon, Apr 20, 2015 at 8:32 PM, Andreas Cadhalpun > wrote: > The long version: > > ath should approximate the shape of the absolute hearing threshold, so > yes, it's best if it really uses the minimum, since that will preve

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-20 Thread Claudio Freire
On Mon, Apr 20, 2015 at 8:32 PM, Andreas Cadhalpun wrote: The long version: ath should approximate the shape of the absolute hearing threshold, so yes, it's best if it really uses the minimum, since that will prevent clipping of the ath curve and result in a more accurate

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-20 Thread Andreas Cadhalpun
On 21.04.2015 01:13, Claudio Freire wrote: > On Mon, Apr 20, 2015 at 7:18 PM, Andreas Cadhalpun > wrote: >> On 20.04.2015 22:15, Claudio Freire wrote: >>> TL;DR, band->thr should not be negative ever, band->thr == 0.0f would >>> cause lots of issues on its own if band->energy != 0.0f in such a cas

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-20 Thread Claudio Freire
On Mon, Apr 20, 2015 at 7:18 PM, Andreas Cadhalpun wrote: > On 20.04.2015 22:15, Claudio Freire wrote: >> TL;DR, band->thr should not be negative ever, band->thr == 0.0f would >> cause lots of issues on its own if band->energy != 0.0f in such a case >> (though I don't see how band->thr can be 0.0f

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-20 Thread Andreas Cadhalpun
On 20.04.2015 22:15, Claudio Freire wrote: > TL;DR, band->thr should not be negative ever, band->thr == 0.0f would > cause lots of issues on its own if band->energy != 0.0f in such a case > (though I don't see how band->thr can be 0.0f if band->energy is not), This could happen in pathological cas

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-20 Thread Andreas Cadhalpun
On 20.04.2015 12:53, Luca Barbato wrote: > On 18/04/15 22:37, Andreas Cadhalpun wrote: >> I think the crash should be fixed before a larger reshaping. >> > > I do not see how you can fix it w/out having a separate code path for > 0-energy/0-threshold band. And getting that would require that kind

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-20 Thread Claudio Freire
On Sat, Apr 18, 2015 at 10:34 AM, Michael Niedermayer wrote: > On Sat, Apr 18, 2015 at 01:59:53PM +0200, Andreas Cadhalpun wrote: >> On 18.04.2015 04:40, Michael Niedermayer wrote: >> > On Sat, Apr 18, 2015 at 12:55:08AM +0200, Andreas Cadhalpun wrote: >> >> The problem is that minath is not the m

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-18 Thread Andreas Cadhalpun
On 18.04.2015 21:46, Luca Barbato wrote: > On 18/04/15 13:50, Andreas Cadhalpun wrote: >> Here you can still have 0/0. >> > > I know, once you get a 0 you get completely out of the previous loop and > you do not even enter in the other. > > To sum up the problem, a way to tackle it is to calculat

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-18 Thread Michael Niedermayer
On Sat, Apr 18, 2015 at 01:59:53PM +0200, Andreas Cadhalpun wrote: > On 18.04.2015 04:40, Michael Niedermayer wrote: > > On Sat, Apr 18, 2015 at 12:55:08AM +0200, Andreas Cadhalpun wrote: > >> The problem is that minath is not the minimum, only close: > >> minath = ath(3410, ATH_ADD) = -5.24237

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-18 Thread Andreas Cadhalpun
On 18.04.2015 04:40, Michael Niedermayer wrote: > On Sat, Apr 18, 2015 at 12:55:08AM +0200, Andreas Cadhalpun wrote: >> The problem is that minath is not the minimum, only close: >> minath = ath(3410, ATH_ADD) = -5.24237967 >> ath(3407, ATH_ADD) = -5.24241638 > > the exact locatio

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-18 Thread Andreas Cadhalpun
On 18.04.2015 03:54, Luca Barbato wrote: > if thr is really tiny norm_fac would be huge, not tiny. (or tiny and not > huge depending if you look it before or after norm_fac = 1/norm_fac) That depends. If band->thr is 0 this more or less means band->energy is 0 (band->thr is set to 'band->energy *

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-17 Thread Michael Niedermayer
On Sat, Apr 18, 2015 at 12:55:08AM +0200, Andreas Cadhalpun wrote: > On 17.04.2015 23:39, Luca Barbato wrote: > > On 17/04/15 16:08, Andreas Cadhalpun wrote: > >> On 17.04.2015 02:01, Luca Barbato wrote: > >>> is band->thr = 0.0f a valid value? > >> > >> Come to think of it, that's probably invalid

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-17 Thread Andreas Cadhalpun
On 17.04.2015 23:39, Luca Barbato wrote: > On 17/04/15 16:08, Andreas Cadhalpun wrote: >> On 17.04.2015 02:01, Luca Barbato wrote: >>> is band->thr = 0.0f a valid value? >> >> Come to think of it, that's probably invalid. I retract that, it seems band->thr = 0.0f is valid. >> It can happen if coe

Re: [FFmpeg-devel] [libav-devel] [PATCH] aacpsy: avoid norm_fac becoming NaN

2015-04-17 Thread Andreas Cadhalpun
On 17.04.2015 02:01, Luca Barbato wrote: > On 16/04/15 20:19, Andreas Cadhalpun wrote: >> On 16.04.2015 19:41, Claudio Freire wrote: >>> It should be if band->thr > 0.0f, all divisions by zero return >>> something that casts into an ~1: > > is band->thr = 0.0f a valid value? Come to think of it,