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

Siarhei Siamashka siarhei.siamashka
Thu May 14 11:09:31 CEST 2009


On Thu, May 14, 2009 at 11:29 AM, Reimar D?ffinger wrote:
> On Thu, May 14, 2009 at 11:06:21AM +0300, Siarhei Siamashka wrote:
>> And what about this variant?
>>
>> + ? ?alpha = (scale < 0 ? 0.5 * M_PI : 0) + 0.25 * M_PI / n;
>> + ? ?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);
>> + ? ? ? ?s->tcos[i] = cos(alpha) * scale;
>> + ? ? ? ?s->tsin[i] = sin(alpha) * scale;
>> + ? ? ? ?alpha += 2.0 * M_PI / n;
>
> Rounding errors accumulate like that, IMO you really should never do
> that unless a) you know the value you add can be represented exactly
> or b) you absolutely can't avoid it for performance reasons.

Everything is calculated in double precision floating point, with the
final results stored in single precision. Additionally, transcendental
functions generally have their precision unspecified unless I'm
mistaken. There are plenty of extra bits of precision in intermediate
calculations. Regression test does not detect any problems, this
probably means that accumulated rounding errors never had any real
impact and the final result of double->float conversion was always the
same (of course it could affect the results theoretically, but this
probability is rather low).

>From Diego E.  Thu May 14 12:01:05 2009
From: Diego E. (Diego E.)
Date: Thu, 14 May 2009 12:01:05 +0200
Subject: [FFmpeg-devel] [PATCH] Fix FTBFS for kfreebsd
In-Reply-To: <yw1xab5gf5yk.fsf at unicorn.mansr.com>
References: <200905132227.36863.mcitadel at gmail.com>
	<yw1xab5gf5yk.fsf at unicorn.mansr.com>
Message-ID: <1242295265.26880.4.camel at yamato>

Il giorno Thu, 14/05/2009 alle 09.23 +0100, M?ns Rullg?rd ha scritto:
> 
> What is FTBFS?

Build failure... I'd expect, knowing debian, for that to mean "Failure
To Build From Source" ... what we usually call "build failure".

-- 
Diego Elio Petten? ? ?Flameeyes?
http://blog.flameeyes.eu/

If you found a .asc file in this mail and know not what it is,
it's a GnuPG digital signature: http://www.gnupg.org/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Questa ? una parte del messaggio firmata digitalmente
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090514/9dcab415/attachment.pgp>



More information about the ffmpeg-devel mailing list