最終更新 1 month ago

Test decompress LritRice with libaec.

racerxdl's Avatar Lucas Teske revised this gist 9 years ago. Go to revision

1 file changed, 28 insertions

aectest.h(file created)

@@ -0,0 +1,28 @@
1 + #include <szlib.h>
2 + #include <stdio.h>
3 +
4 + int main() {
5 +
6 + char input[241];
7 + FILE *f = fopen("1725_0_1964.lrit", "rb");
8 + fread(input, 241, 1, f);
9 + fclose(f);
10 +
11 + char *output[3463];
12 +
13 + SZ_com_t params;
14 + params.options_mask = SZ_ALLOW_K13_OPTION_MASK | SZ_MSB_OPTION_MASK | SZ_NN_OPTION_MASK | SZ_RAW_OPTION_MASK;
15 + params.bits_per_pixel = 8;
16 + params.pixels_per_block = 16;
17 + params.pixels_per_scanline = 3463;
18 +
19 + int destLen = 3463;
20 +
21 + int x = SZ_BufftoBuffDecompress(output, &destLen, input, 241, &params);
22 + printf("Result: %d - %d\n", x, destLen);
23 +
24 + f = fopen("1725_0_1964.decomp2", "wb");
25 + fwrite(output, 3463, 1, f);
26 + fclose(f);
27 + return 0;
28 + }
Newer Older