[FFmpeg-devel] [RFC] remove table_4_3_value with CONFIG_SMALL

Reimar Döffinger Reimar.Doeffinger
Tue Oct 13 13:11:39 CEST 2009


On Tue, Oct 13, 2009 at 12:54:29PM +0200, Michael Niedermayer wrote:
> On Tue, Oct 13, 2009 at 12:24:58PM +0200, Reimar D?ffinger wrote:
> > Hello,
> > at over 128kB this is one of the largest variables in .bss
> > Since it is in .bss I'm not 100% sure it is worth avoiding, though
> > it might help compiling on IA64 which currently can't handle .bss > 4 MB
> > with gcc at least.
> > Attached patch instead uses pow etc. if CONFIG_SMALL is set.
> > Which on the other hand might be really silly because the systems where
> > you'd use CONFIG_SMALL are those that are least likely to have a fast
> > pow implementation...
> > I also admit that the pow for the exponent could probably be trivially
> > replaced by shift and a 4-entry multiplication table for the lower bits.
> 
> [...]
> > @@ -218,6 +220,9 @@
> >  /* compute value^(4/3) * 2^(exponent/4). It normalized to FRAC_BITS */
> >  static inline int l3_unscale(int value, int exponent)
> >  {
> > +#if CONFIG_SMALL
> > +    return pow(value, 4.0 / 3.0) * pow(2, exponent*0.25) + 0.5;
> 
> value * cbrtf(value) * exp2f(exponent*0.25) + 0.5

Is exp2f going to be faster than
(1 << (exponent >> 2)) * exptbl[exponent & 3]
(I think that might assume exponent to not be negative, but the current
code already looks like it is).
Either way, should the code that generates the tables be updated to use
the same formula?



More information about the ffmpeg-devel mailing list