Lines Matching defs:table
78 /* Stores code in table[0], table[step], table[2*step], ..., table[end] */
80 static BROTLI_INLINE void ReplicateValue(HuffmanCode* table,
85 table[end] = code;
89 /* Returns the table width of the next 2nd level table. |count| is the histogram
104 void BrotliBuildCodeLengthsHuffmanTable(HuffmanCode* table,
107 HuffmanCode code; /* current table entry */
108 int symbol; /* symbol index in original or sorted table */
111 int step; /* step size to replicate values in current table */
112 int table_size; /* size of current table */
114 /* offsets in sorted table for each length */
121 /* Generate offsets into sorted symbol table by code length. */
147 table[key] = code;
152 /* Fill in table. */
161 ReplicateValue(&table[BrotliReverseBits(key)], step, table_size, code);
173 HuffmanCode code; /* current table entry */
174 HuffmanCode* table; /* next available space in table */
176 int symbol; /* symbol index in original or sorted table */
179 brotli_reg_t sub_key; /* 2nd level table prefix code */
180 brotli_reg_t sub_key_step; /* 2nd level table prefix code addend */
181 int step; /* step size to replicate values in current table */
182 int table_bits; /* key length of current table */
183 int table_size; /* size of current table */
184 int total_size; /* sum of root table size and 2nd level table sizes */
196 table = root_table;
201 /* Fill in the root table. Reduce the table size to if possible,
216 ReplicateValue(&table[BrotliReverseBits(key)], step, table_size, code);
225 memcpy(&table[table_size], &table[0],
226 (size_t)table_size * sizeof(table[0]));
230 /* Fill in 2nd level tables and add pointers to root table. */
238 table += table_size;
246 (uint16_t)(((size_t)(table - root_table)) - sub_key));
252 &table[BrotliReverseBits(sub_key)], step, table_size, code);
261 uint32_t BrotliBuildSimpleHuffmanTable(HuffmanCode* table,
269 table[0] = ConstructHuffmanCode(0, val[0]);
273 table[0] = ConstructHuffmanCode(1, val[0]);
274 table[1] = ConstructHuffmanCode(1, val[1]);
276 table[0] = ConstructHuffmanCode(1, val[1]);
277 table[1] = ConstructHuffmanCode(1, val[0]);
282 table[0] = ConstructHuffmanCode(1, val[0]);
283 table[2] = ConstructHuffmanCode(1, val[0]);
285 table[1] = ConstructHuffmanCode(2, val[1]);
286 table[3] = ConstructHuffmanCode(2, val[2]);
288 table[1] = ConstructHuffmanCode(2, val[2]);
289 table[3] = ConstructHuffmanCode(2, val[1]);
304 table[0] = ConstructHuffmanCode(2, val[0]);
305 table[2] = ConstructHuffmanCode(2, val[1]);
306 table[1] = ConstructHuffmanCode(2, val[2]);
307 table[3] = ConstructHuffmanCode(2, val[3]);
317 table[0] = ConstructHuffmanCode(1, val[0]);
318 table[1] = ConstructHuffmanCode(2, val[1]);
319 table[2] = ConstructHuffmanCode(1, val[0]);
320 table[3] = ConstructHuffmanCode(3, val[2]);
321 table[4] = ConstructHuffmanCode(1, val[0]);
322 table[5] = ConstructHuffmanCode(2, val[1]);
323 table[6] = ConstructHuffmanCode(1, val[0]);
324 table[7] = ConstructHuffmanCode(3, val[3]);
330 memcpy(&table[table_size], &table[0],
331 (size_t)table_size * sizeof(table[0]));