MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / append_symbol_coins

Function append_symbol_coins

src/lodepng.cpp:698–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

696}
697
698static unsigned append_symbol_coins(Coin* coins, const unsigned* frequencies, unsigned numcodes, size_t sum)
699{
700 unsigned i;
701 unsigned j = 0; /*index of present symbols*/
702 for(i = 0; i < numcodes; i++)
703 {
704 if(frequencies[i] != 0) /*only include symbols that are present*/
705 {
706 coins[j].weight = frequencies[i] / (float)sum;
707 uivector_push_back(&coins[j].symbols, i);
708 j++;
709 }
710 }
711 return 0;
712}
713
714unsigned lodepng_huffman_code_lengths(unsigned* lengths, const unsigned* frequencies,
715 size_t numcodes, unsigned maxbitlen)

Callers 1

Calls 1

uivector_push_backFunction · 0.85

Tested by

no test coverage detected