[FFmpeg-devel] [PATCH] updated LGPL AC-3 decoder
Michael Niedermayer
michaelni
Fri May 4 11:46:33 CEST 2007
Hi
On Fri, May 04, 2007 at 12:46:25AM -0400, Justin Ruggles wrote:
[...]
>
> >
> > [...]
> >
> >
> >>+static inline float
> >>+symmetric_dequant(int code, int levels)
> >>+{
> >>+ float m = (code - (levels >> 1)) << 1;
> >>+ return (m / levels);
> >>+}
> >
> >
> > as level is always a constant this could be simplified to
> >
> > return (code - (levels >> 1)) * (2.0/levels);
> >
> > gcc should here be able to change levels >> 1 and 2.0/levels to
> > constants
>
> I almost get it... Is it because the function is inlined and all the
> function calls use constants for levels that gcc will be smart enough to
> know to treat it this way?
yes
>
> I can also create tables for the bap=3 and bap=5 dequantization so that
> this function will only need to be called during initialization.
that is a good idea too
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070504/10cdf05a/attachment.pgp>
More information about the ffmpeg-devel
mailing list