[FFmpeg-devel] [PATCH] Fix for inverted sign?in?ffvorbis?audio?output (resubmit)

Michael Niedermayer michaelni
Sat May 16 11:51:48 CEST 2009


On Sat, May 16, 2009 at 11:25:13AM +0300, Siarhei Siamashka wrote:
> On Friday 15 May 2009, Michael Niedermayer wrote:
> > On Fri, May 15, 2009 at 10:52:05AM +0300, Siarhei Siamashka wrote:
> [...]
> > > Would this patch be finally OK (kind of blend of your and Reimar's
> > > suggestions)?
> >
> > [...]
> >
> > > @@ -85,10 +85,12 @@ av_cold int ff_mdct_init(MDCTContext *s, int nbits,
> > > int inverse) if (!s->tsin)
> > >          goto fail;
> > >
> > > +    theta = scale < 0 ? 0.5 * M_PI : 0;
> > > +    scale = sqrt(fabs(scale));
> > >      for(i=0;i<n4;i++) {
> > > -        alpha = 2 * M_PI * (i + 1.0 / 8.0) / n;
> > > -        s->tcos[i] = -cos(alpha);
> > > -        s->tsin[i] = -sin(alpha);
> > > +        alpha = 2 * M_PI * (i + 1.0 / 8.0) / n + theta;
> >
> > alpha = 2 * M_PI * (i + theta) / n;
> >
> > would be slightly more accurate as (i + theta) / n is exact and thus
> > the addition of two inexact variables is avoided
> 
> Fixed
> 
> -- 
> Best regards,
> Siarhei Siamashka

>  aac.c           |    4 ++--
>  aacenc.c        |    4 ++--
>  ac3dec.c        |    4 ++--
>  atrac3.c        |    2 +-
>  cook.c          |    2 +-
>  dca.c           |    2 +-
>  dsputil.h       |    2 +-
>  fft-test.c      |    2 +-
>  mdct.c          |   12 +++++++-----
>  nellymoserdec.c |    2 +-
>  nellymoserenc.c |    2 +-
>  vorbis_dec.c    |    4 ++--
>  vorbis_enc.c    |    4 ++--
>  wmadec.c        |    2 +-
>  wmaenc.c        |    2 +-
>  15 files changed, 26 insertions(+), 24 deletions(-)
> 0df8af2d1b69975d160b51f189f4809e4372a4b9  0001-Support-for-getting-i-MDCT-output-multiplied-by-a-c.patch
> From 6aab5782fcd3378ae505b0d98b39c103d5ac9d30 Mon Sep 17 00:00:00 2001
> From: Siarhei Siamashka <siarhei.siamashka at gmail.com>
> Date: Sun, 10 May 2009 04:40:00 +0300
> Subject: [PATCH] Support for getting (i)MDCT output multiplied by a constant scaling factor.
> 
> Scaling (i)MDCT output has no runtime overhead and can be used to improve
> performance of audio codecs. All the changes are only needed in
> 'ff_mdct_init' function and slow down initialization a bit.

ok

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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle
-------------- 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/20090516/86590515/attachment.pgp>



More information about the ffmpeg-devel mailing list