[FFmpeg-devel] [PATCH] Common fixed-point ACELP routines (1/3) - math
Michael Niedermayer
michaelni
Tue Apr 22 17:36:26 CEST 2008
On Tue, Apr 22, 2008 at 09:12:16AM +0700, Vladimir Voroshilov wrote:
[...]
> +/**
> + * Table used to compute log2(x)
> + *
> + * ff_acelp_tab_log2[i] = (1<<15) * log2(1 + i/32), i=0..32
> + */
> +static const uint16_t ff_acelp_tab_log2[33] =
> +{
> + 0, 1455, 2866, 4236, 5568, 6863, 8124, 9352, 10549, 11716,
> + 12855, 13967, 15054, 16117, 17156, 18172, 19167, 20142, 21097, 22033,
> + 22951, 23852, 24735, 25603, 26455, 27291, 28113, 28922, 29716, 30497,
> + 31266, 32023, 32767
> +};
with following table:
4, 1459, 2870, 4240, 5572, 6867, 8127, 9355, 10552, 11719,
12858, 13971, 15057, 16120, 17158, 18175, 19170, 20145, 21100, 22036,
22954, 23854, 24738, 25605, 26457, 27294, 28116, 28924, 29719, 30500,
31269, 32025, 32769,
the log2 code has a 10 times smaller squared difference to the real log2(), its
worst case error is also slightly less.
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.
-------------- 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/20080422/183d1637/attachment.pgp>
More information about the ffmpeg-devel
mailing list