[FFmpeg-devel] [PATCH] cos_tablegen: fix the lack on M_PI

Clément Bœsch ubitux at gmail.com
Sat Jan 5 14:21:21 CET 2013


On Sat, Jan 05, 2013 at 02:16:33PM +0100, Michael Niedermayer wrote:
> We dont include mathematics.h as the headers get configured by config.h
> for the target not the host.
> 
> Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> ---
>  libavcodec/cos_tablegen.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavcodec/cos_tablegen.c b/libavcodec/cos_tablegen.c
> index af9391d..313a1d2 100644
> --- a/libavcodec/cos_tablegen.c
> +++ b/libavcodec/cos_tablegen.c
> @@ -56,7 +56,7 @@ int main(int argc, char *argv[])
>      printf("#include \"libavcodec/%s\"\n", do_sin ? "rdft.h" : "fft.h");
>      for (i = 4; i <= BITS; i++) {
>          int m = 1 << i;
> -        double freq = 2*M_PI/m;
> +        double freq = 2*3.14159265358979323846/m;
>          printf("%s(%i) = {\n   ", do_sin ? "SINTABLE" : "COSTABLE", m);
>          for (j = 0; j < m/2 - 1; j++) {
>              int idx = j > m/4 ? m/2 - j : j;

#include <math.h> // M_PI

 ... looks better to me.

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130105/4302e1fe/attachment.asc>


More information about the ffmpeg-devel mailing list