Revision 8eaa6e0e libavcodec/qdm2_tablegen.c

View differences:

libavcodec/qdm2_tablegen.c
25 25
#include "qdm2_tablegen.h"
26 26
#include "tableprint.h"
27 27

  
28
void tableinit(void)
28
int main(void)
29 29
{
30 30
    softclip_table_init();
31 31
    rnd_table_init();
32 32
    init_noise_samples();
33
}
34 33

  
35
const struct tabledef tables[] = {
36
    {
37
        "static const uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1]",
38
        write_uint16_array,
39
        softclip_table,
40
        HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1,
41
        0
42
    },
43
    {
44
        "static const float noise_table[4096]",
45
        write_float_array,
46
        noise_table,
47
        4096,
48
        0
49
    },
50
    {
51
        "static const uint8_t random_dequant_index[256][5]",
52
        write_uint8_2d_array,
53
        random_dequant_index,
54
        256,
55
        5
56
    },
57
    {
58
        "static const uint8_t random_dequant_type24[128][3]",
59
        write_uint8_2d_array,
60
        random_dequant_type24,
61
        128,
62
        3
63
    },
64
    {
65
        "static const float noise_samples[128]",
66
        write_float_array,
67
        noise_samples,
68
        128,
69
        0
70
    },
71
    { NULL }
72
};
34
    write_fileheader();
35

  
36
    printf("static const uint16_t softclip_table[HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1] = {\n");
37
    write_uint16_array(softclip_table, HARDCLIP_THRESHOLD - SOFTCLIP_THRESHOLD + 1);
38
    printf("};\n");
39

  
40
    printf("static const float noise_table[4096] = {\n");
41
    write_float_array(noise_table, 4096);
42
    printf("};\n");
43

  
44
    printf("static const uint8_t random_dequant_index[256][5] = {\n");
45
    write_uint8_2d_array(random_dequant_index, 256, 5);
46
    printf("};\n");
47

  
48
    printf("static const uint8_t random_dequant_type24[128][3] = {\n");
49
    write_uint8_2d_array(random_dequant_type24, 128, 3);
50
    printf("};\n");
51

  
52
    printf("static const float noise_samples[128] = {\n");
53
    write_float_array(noise_samples, 128);
54
    printf("};\n");
55

  
56
    return 0;
57
}

Also available in: Unified diff