[FFmpeg-devel] [PATCH] vorbis_enc.c: avoid div zero that causes noise

Michael Niedermayer michaelni
Wed Jun 2 03:01:53 CEST 2010


On Tue, Jun 01, 2010 at 02:10:54PM -0700, Frank Barchard wrote:
> On Tue, Jun 1, 2010 at 11:35 AM, Ronald S. Bultje <rsbultje at gmail.com>wrote:
> 
> > Hi,
> >
> > On Tue, Jun 1, 2010 at 2:28 PM, Frank Barchard <fbarchard at google.com>
> > wrote:
> > > Improves quality for ff vorbis encoding of silence.> +        if
> > (average) {
> > > +            average *= pow(tot_average / average, 0.5) * pow(1.25,
> > position/200.); // MAGIC!
> > > +        } else {
> > > +            average = 0;
> > > +        }
> >
> > The last 3 lines seem unnecessary?
> >
> 
> True.  Fixed in updated patch.
> 
> On Tue, Jun 1, 2010 at 12:39 PM, Michael Niedermayer <michaelni at gmx.at>
>  wrote:
> 
> > On Tue, Jun 01, 2010 at 11:28:40AM -0700, Frank Barchard wrote:
> > > Improves quality for ff vorbis encoding of silence.
> > >
> > > -        average *= pow(tot_average / average, 0.5) * pow(1.25,
> > position/200.); // MAGIC!
> > > +        if (average) {
> > > +            average *= pow(tot_average / average, 0.5) * pow(1.25,
> > position/200.); // MAGIC!
> >
> > does
> > average= sqrt(tot_average * average) *  pow(1.25, position*0.005)
> >
> > work as well (without the 0 special casing of course) ?
> >
> 
> This works
> if (average) average *= sqrt(tot_average / average) * pow(1.25f, position*
> 0.005f); // MAGIC!

for which values does it differ from what i suggested?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100602/e60b64aa/attachment.pgp>



More information about the ffmpeg-devel mailing list