X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fopenjp2%2Ft1_generate_luts.c;h=b2944d8ce6c8bd37d82cb2404a3070c25ad6c637;hb=c02c1432e89cca24f20f04266c332a94741a4520;hp=b2e3334d2a257352320abbbfc76a372211f061dd;hpb=4b140e060bf1a5cd1cc048014bc9e512930e2a8d;p=openjpeg.git diff --git a/src/lib/openjp2/t1_generate_luts.c b/src/lib/openjp2/t1_generate_luts.c index b2e3334d..b2944d8c 100644 --- a/src/lib/openjp2/t1_generate_luts.c +++ b/src/lib/openjp2/t1_generate_luts.c @@ -170,7 +170,7 @@ static int t1_init_spb(int f) { return n; } -void dump_array16(int array[],int size){ +static void dump_array16(int array[],int size){ int i; --size; for (i = 0; i < size; ++i) { @@ -181,7 +181,8 @@ void dump_array16(int array[],int size){ printf("0x%04x\n};\n\n", array[size]); } -int main(){ +int main(int argc, char **argv) +{ int i, j; double u, v, t; @@ -190,6 +191,7 @@ int main(){ int lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS]; int lut_nmsedec_ref[1 << T1_NMSEDEC_BITS]; int lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS]; + (void)argc; (void)argv; printf("/* This file was automatically generated by t1_generate_luts.c */\n\n"); @@ -206,7 +208,7 @@ int main(){ } } - printf("static char lut_ctxno_zc[1024] = {\n "); + printf("static OPJ_BYTE lut_ctxno_zc[1024] = {\n "); for (i = 0; i < 1023; ++i) { printf("%i, ", lut_ctxno_zc[i]); if(!((i+1)&0x1f)) @@ -215,7 +217,7 @@ int main(){ printf("%i\n};\n\n", lut_ctxno_zc[1023]); /* lut_ctxno_sc */ - printf("static char lut_ctxno_sc[256] = {\n "); + printf("static OPJ_BYTE lut_ctxno_sc[256] = {\n "); for (i = 0; i < 255; ++i) { printf("0x%x, ", t1_init_ctxno_sc(i << 4)); if(!((i+1)&0xf)) @@ -224,7 +226,7 @@ int main(){ printf("0x%x\n};\n\n", t1_init_ctxno_sc(255 << 4)); /* lut_spb */ - printf("static char lut_spb[256] = {\n "); + printf("static OPJ_BYTE lut_spb[256] = {\n "); for (i = 0; i < 255; ++i) { printf("%i, ", t1_init_spb(i << 4)); if(!((i+1)&0x1f)) @@ -258,16 +260,16 @@ int main(){ (int) (floor((u * u) * pow(2, T1_NMSEDEC_FRACBITS) + 0.5) / pow(2, T1_NMSEDEC_FRACBITS) * 8192.0)); } - printf("static short lut_nmsedec_sig[1 << T1_NMSEDEC_BITS] = {\n "); + printf("static OPJ_INT16 lut_nmsedec_sig[1 << T1_NMSEDEC_BITS] = {\n "); dump_array16(lut_nmsedec_sig, 1 << T1_NMSEDEC_BITS); - printf("static short lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS] = {\n "); + printf("static OPJ_INT16 lut_nmsedec_sig0[1 << T1_NMSEDEC_BITS] = {\n "); dump_array16(lut_nmsedec_sig0, 1 << T1_NMSEDEC_BITS); - printf("static short lut_nmsedec_ref[1 << T1_NMSEDEC_BITS] = {\n "); + printf("static OPJ_INT16 lut_nmsedec_ref[1 << T1_NMSEDEC_BITS] = {\n "); dump_array16(lut_nmsedec_ref, 1 << T1_NMSEDEC_BITS); - printf("static short lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS] = {\n "); + printf("static OPJ_INT16 lut_nmsedec_ref0[1 << T1_NMSEDEC_BITS] = {\n "); dump_array16(lut_nmsedec_ref0, 1 << T1_NMSEDEC_BITS); return 0;