Lines Matching refs: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 */
148 table[key] = code;
153 /* fill in table */
163 ReplicateValue(&table[BrotliReverseBits(key)], step, table_size, code);
175 HuffmanCode code; /* current table entry */
176 HuffmanCode* table; /* next available space in table */
178 int symbol; /* symbol index in original or sorted table */
181 reg_t sub_key; /* 2nd level table prefix code */
182 reg_t sub_key_step; /* 2nd level table prefix code addend */
183 int step; /* step size to replicate values in current table */
184 int table_bits; /* key length of current table */
185 int table_size; /* size of current table */
186 int total_size; /* sum of root table size and 2nd level table sizes */
198 table = root_table;
203 /* fill in root table */
204 /* let's reduce the table size to a smaller size if possible, and */
220 ReplicateValue(&table[BrotliReverseBits(key)], step, table_size, code);
228 /* table, and we need to replicate it now. */
230 memcpy(&table[table_size], &table[0],
231 (size_t)table_size * sizeof(table[0]));
235 /* fill in 2nd level tables and add pointers to root table */
243 table += table_size;
251 (uint16_t)(((size_t)(table - root_table)) - sub_key);
258 &table[BrotliReverseBits(sub_key)], step, table_size, code);
267 uint32_t BrotliBuildSimpleHuffmanTable(HuffmanCode* table,
275 table[0].bits = 0;
276 table[0].value = val[0];
279 table[0].bits = 1;
280 table[1].bits = 1;
282 table[0].value = val[0];
283 table[1].value = val[1];
285 table[0].value = val[1];
286 table[1].value = val[0];
291 table[0].bits = 1;
292 table[0].value = val[0];
293 table[2].bits = 1;
294 table[2].value = val[0];
296 table[1].value = val[1];
297 table[3].value = val[2];
299 table[1].value = val[2];
300 table[3].value = val[1];
302 table[1].bits = 2;
303 table[3].bits = 2;
318 table[i].bits = 2;
320 table[0].value = val[0];
321 table[2].value = val[1];
322 table[1].value = val[2];
323 table[3].value = val[3];
335 table[i].value = val[0];
336 table[i].bits = (uint8_t)(1 + (i & 1));
338 table[1].value = val[1];
339 table[3].value = val[2];
340 table[5].value = val[1];
341 table[7].value = val[3];
342 table[3].bits = 3;
343 table[7].bits = 3;
349 memcpy(&table[table_size], &table[0],
350 (size_t)table_size * sizeof(table[0]));