tools/utils/generators/deflate_generator/huff_codes.cpp
// Upon return, codes[] contains the code lengths,
// and bl_count is the count of the lengths
Upon return, codes[] contains the code lengths,
and bl_count is the count of the lengths
Upon return codes [] contains the code lengths and bl_count is the count of the lengths
void copy_lens(uint32_t const *code_lens,
                   uint32_t num_lens,
                   uint32_t *bl_count,
                   uint32_t *codes,
                   uint32_t num_codes)
    {
        uint32_t i, clen;
        for (i = 0; i <= 15; i++)
        {
            bl_count[i] = 0;
        }
        for (i = 0; i < num_lens; i++)
        {
            codes[i] = clen = code_lens[i];
            bl_count[clen]++;
        }
        for (; i < num_codes; i++)
        {
            codes[i] = 0;
        }
    }
void copy_lens ( uint32_t const * code_lens , uint32_t num_lens , uint32_t * bl_count , uint32_t * codes , uint32_t num_codes ) { uint32_t i , clen ; for ( i = 0 ; i <= 15 ; i ++ ) { bl_count [ i ] = 0 ; } for ( i = 0 ; i < num_lens ; i ++ ) { codes [ i ] = clen = code_lens [ i ] ; bl_count [ clen ] ++ ; } for ( ; i < num_codes ; i ++ ) { codes [ i ] = 0 ; } }
Upon return, codes[] contains the code lengths,
and bl_count is the count of the lengths
Upon return codes [] contains the code lengths and bl_count is the count of the lengths