[FFmpeg-devel] [Issue 664] [PATCH] Fix AAC PNS Scaling

Michael Niedermayer michaelni
Tue Oct 14 19:02:12 CEST 2008


On Tue, Oct 14, 2008 at 05:31:06PM +0100, Robert Swain wrote:
> 2008/10/10 Michael Niedermayer <michaelni at gmx.at>:
> > On Fri, Oct 10, 2008 at 12:15:30PM +0100, Robert Swain wrote:
> >> 2008/10/8 Michael Niedermayer <michaelni at gmx.at>:
> >>
> >> [...]
> >>
> >> > so it seems the gcc version makes a very significant difference as well
> >>
> >> It seems there isn't really a good all-round solution here. What shall
> >> we do? I would be inclined to look toward the future and use doubles
> >> for the sums and sqrtf() as this performs best on a modern CPU with
> >> GCC 4.3, but what do you think? I suppose less powerful older cpus
> >> would need better performance more, but obviously ideally we would
> >> want to use whatever is best on the machine in question. Maybe a macro
> >> and configure time testing/identification and mapping based on CPU?
> >
> > Iam still thinking that 1 second of normalized random vectors might be
> > worth considering. That would avoid the sqrt() completely unless iam
> > missing something.
> 
> Previously you said:
> 
> "precalculate a second of noise normalized to the band sizes and
> randomly pick from these"
> 
> Could you elaborate on what you have in mind please?
> 
> At the moment I'm thinking that all band sizes would have to be found
> from the swb_offset[] tables. Then I don't really understand what
> you're suggesting we have for each band size.

If all bands have sizes of lets say either 2, 3 or 4 then we could generate
random normalized vectors of these lengths like
vectors={
    NULL,
    NULL,
    {{1,0}, {0,-1}, {0.7, 0.7}, ... },
    {{1,0,0}, {0.7, -0.7, 0}, ... },
    {{0,-1,0,0}, ... },
}

(or whichever kind of normalization the spec requires)
this would be done during init or could even be a const table in a header.

then when we need some random data we can just take it by

random_vector= vectors[band_length][random()%123];
for(i=0; i<band_length; i++)
    coeffs[i]= random_vector[i] * scalefactor;

Just an idea of course ...

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

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- 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/20081014/f0bb0fe2/attachment.pgp>



More information about the ffmpeg-devel mailing list