Merge commit '86bfcfcf2364bc837b7bb582c66a8a15a332414f'
[ffmpeg.git] / libavcodec / qdm2_tablegen.c
index b311e7f..a7a9fb6 100644 (file)
  */
 
 #include <stdlib.h>
-#define av_cold
 #define CONFIG_HARDCODED_TABLES 0
 #include "qdm2_tablegen.h"
 #include "tableprint.h"
 
-void tableinit(void)
+int main(void)
 {
     softclip_table_init();
     rnd_table_init();
     init_noise_samples();
-}
 
-const struct tabledef tables[] = {
-    {
-        "static const uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1]",
-        write_uint16_array,
-        softclip_table,
-        HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1,
-        0
-    },
-    {
-        "static const float noise_table[4096]",
-        write_float_array,
-        noise_table,
-        4096,
-        0
-    },
-    {
-        "static const uint8_t random_dequant_index[256][5]",
-        write_uint8_2d_array,
-        random_dequant_index,
-        256,
-        5
-    },
-    {
-        "static const uint8_t random_dequant_type24[128][3]",
-        write_uint8_2d_array,
-        random_dequant_type24,
-        128,
-        3
-    },
-    {
-        "static const float noise_samples[128]",
-        write_float_array,
-        noise_samples,
-        128,
-        0
-    },
-    { NULL }
-};
+    write_fileheader();
+
+    WRITE_ARRAY("static const", uint16_t, softclip_table);
+    WRITE_ARRAY("static const", float, noise_table);
+    WRITE_ARRAY("static const", float, noise_samples);
+
+    WRITE_2D_ARRAY("static const", uint8_t, random_dequant_index);
+    WRITE_2D_ARRAY("static const", uint8_t, random_dequant_type24);
+
+    return 0;
+}