get the distance code tree of a deflated block with fixed tree, as specified in the deflate specification*/
| 925 | |
| 926 | /*get the distance code tree of a deflated block with fixed tree, as specified in the deflate specification*/ |
| 927 | static unsigned generateFixedDistanceTree(HuffmanTree* tree) |
| 928 | { |
| 929 | unsigned i, error = 0; |
| 930 | unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); |
| 931 | if(!bitlen) return 83; /*alloc fail*/ |
| 932 | |
| 933 | /*there are 32 distance codes, but 30-31 are unused*/ |
| 934 | for(i = 0; i != NUM_DISTANCE_SYMBOLS; ++i) bitlen[i] = 5; |
| 935 | error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DISTANCE_SYMBOLS, 15); |
| 936 | |
| 937 | lodepng_free(bitlen); |
| 938 | return error; |
| 939 | } |
| 940 | |
| 941 | #ifdef LODEPNG_COMPILE_DECODER |
| 942 |
no test coverage detected