get the distance code tree of a deflated block with fixed tree, as specified in the deflate specification*/
| 880 | |
| 881 | /*get the distance code tree of a deflated block with fixed tree, as specified in the deflate specification*/ |
| 882 | static unsigned generateFixedDistanceTree(HuffmanTree* tree) |
| 883 | { |
| 884 | unsigned i, error = 0; |
| 885 | unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); |
| 886 | if(!bitlen) return 83; /*alloc fail*/ |
| 887 | |
| 888 | /*there are 32 distance codes, but 30-31 are unused*/ |
| 889 | for(i = 0; i < NUM_DISTANCE_SYMBOLS; i++) bitlen[i] = 5; |
| 890 | error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DISTANCE_SYMBOLS, 15); |
| 891 | |
| 892 | lodepng_free(bitlen); |
| 893 | return error; |
| 894 | } |
| 895 | |
| 896 | #ifdef LODEPNG_COMPILE_DECODER |
| 897 |
no test coverage detected