This is consistent with how all other table generation programs are named.
Moreover this ensures that the cos table generation program is correctly
deleted when cleaning the tree.
---
 libavcodec/Makefile       |    8 ++--
 libavcodec/cos_tablegen.c |   76 +++++++++++++++++++++++++++++++++++++++++++++
 libavcodec/costablegen.c  |   76 ---------------------------------------------
 3 files changed, 80 insertions(+), 80 deletions(-)
 create mode 100644 libavcodec/cos_tablegen.c
 delete mode 100644 libavcodec/costablegen.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 9040b32..3ad0c13 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -664,7 +664,7 @@ TESTPROGS = cabac dct eval fft fft-fixed h264 iirfilter 
rangecoder snow
 TESTPROGS-$(HAVE_MMX) += motion
 TESTOBJS = dctref.o
 
-HOSTPROGS = costablegen
+HOSTPROGS = cos_tablegen
 
 DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86
 
@@ -674,13 +674,13 @@ include $(SUBDIR)../subdir.mak
 
 $(SUBDIR)dct-test$(EXESUF): $(SUBDIR)dctref.o
 
-$(SUBDIR)cos_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF)
+$(SUBDIR)cos_tables.c: $(SUBDIR)cos_tablegen$(HOSTEXESUF)
        $(M)./$< > $@
 
-$(SUBDIR)cos_fixed_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF)
+$(SUBDIR)cos_fixed_tables.c: $(SUBDIR)cos_tablegen$(HOSTEXESUF)
        $(M)./$< cos fixed > $@
 
-$(SUBDIR)sin_tables.c: $(SUBDIR)costablegen$(HOSTEXESUF)
+$(SUBDIR)sin_tables.c: $(SUBDIR)cos_tablegen$(HOSTEXESUF)
        $(M)./$< sin > $@
 
 ifdef CONFIG_SMALL
diff --git a/libavcodec/cos_tablegen.c b/libavcodec/cos_tablegen.c
new file mode 100644
index 0000000..65c4926
--- /dev/null
+++ b/libavcodec/cos_tablegen.c
@@ -0,0 +1,76 @@
+/*
+ * Generate a header file for hardcoded ff_cos_* tables
+ *
+ * Copyright (c) 2009 Reimar Döffinger <[email protected]>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+
+#ifndef M_PI
+#define M_PI 3.14159265358979323846
+#endif
+#define BITS 16
+#define FLOATFMT "%.18e"
+#define FIXEDFMT "%6d"
+
+static int clip_f15(int v)
+{
+    return v < -32767 ? -32767 :
+           v >  32767 ?  32767 :
+           v;
+}
+
+static void printval(double val, int fixed)
+{
+    if (fixed)
+        printf(" "FIXEDFMT",", clip_f15(lrint(val * (double)(1<<15))));
+    else
+        printf(" "FLOATFMT",", val);
+
+}
+
+int main(int argc, char *argv[])
+{
+    int i, j;
+    int do_sin = argc > 1 && !strcmp(argv[1], "sin");
+    int fixed  = argc > 2 && !strcmp(argv[2], "fixed");
+    double (*func)(double) = do_sin ? sin : cos;
+
+    printf("/* This file was generated by libavcodec/costablegen */\n");
+    printf("#define CONFIG_FFT_FLOAT %d\n", !fixed);
+    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;
+        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;
+            if (do_sin && j >= m/4)
+                idx = m/4 - j;
+            printval(func(idx*freq), fixed);
+            if ((j & 3) == 3)
+                printf("\n   ");
+        }
+        printval(func(do_sin ? -(m/4 - 1)*freq : freq), fixed);
+        printf("\n};\n");
+    }
+    return 0;
+}
diff --git a/libavcodec/costablegen.c b/libavcodec/costablegen.c
deleted file mode 100644
index 65c4926..0000000
--- a/libavcodec/costablegen.c
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Generate a header file for hardcoded ff_cos_* tables
- *
- * Copyright (c) 2009 Reimar Döffinger <[email protected]>
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <math.h>
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-#define BITS 16
-#define FLOATFMT "%.18e"
-#define FIXEDFMT "%6d"
-
-static int clip_f15(int v)
-{
-    return v < -32767 ? -32767 :
-           v >  32767 ?  32767 :
-           v;
-}
-
-static void printval(double val, int fixed)
-{
-    if (fixed)
-        printf(" "FIXEDFMT",", clip_f15(lrint(val * (double)(1<<15))));
-    else
-        printf(" "FLOATFMT",", val);
-
-}
-
-int main(int argc, char *argv[])
-{
-    int i, j;
-    int do_sin = argc > 1 && !strcmp(argv[1], "sin");
-    int fixed  = argc > 2 && !strcmp(argv[2], "fixed");
-    double (*func)(double) = do_sin ? sin : cos;
-
-    printf("/* This file was generated by libavcodec/costablegen */\n");
-    printf("#define CONFIG_FFT_FLOAT %d\n", !fixed);
-    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;
-        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;
-            if (do_sin && j >= m/4)
-                idx = m/4 - j;
-            printval(func(idx*freq), fixed);
-            if ((j & 3) == 3)
-                printf("\n   ");
-        }
-        printval(func(do_sin ? -(m/4 - 1)*freq : freq), fixed);
-        printf("\n};\n");
-    }
-    return 0;
-}
-- 
1.7.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to