Lines Matching refs:mb
136 MetaBlockSplit* mb) {
190 &mb->literal_split,
191 &mb->command_split,
192 &mb->distance_split);
198 BROTLI_ALLOC(m, ContextType, mb->literal_split.num_types);
200 for (i = 0; i < mb->literal_split.num_types; ++i) {
206 mb->literal_split.num_types * literal_context_multiplier;
213 mb->distance_split.num_types << BROTLI_DISTANCE_CONTEXT_BITS;
219 BROTLI_DCHECK(mb->command_histograms == 0);
220 mb->command_histograms_size = mb->command_split.num_types;
221 mb->command_histograms =
222 BROTLI_ALLOC(m, HistogramCommand, mb->command_histograms_size);
223 if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->command_histograms)) return;
224 ClearHistogramsCommand(mb->command_histograms, mb->command_histograms_size);
227 &mb->literal_split, &mb->command_split, &mb->distance_split,
229 literal_histograms, mb->command_histograms, distance_histograms);
232 BROTLI_DCHECK(mb->literal_context_map == 0);
233 mb->literal_context_map_size =
234 mb->literal_split.num_types << BROTLI_LITERAL_CONTEXT_BITS;
235 mb->literal_context_map =
236 BROTLI_ALLOC(m, uint32_t, mb->literal_context_map_size);
237 if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->literal_context_map)) return;
239 BROTLI_DCHECK(mb->literal_histograms == 0);
240 mb->literal_histograms_size = mb->literal_context_map_size;
241 mb->literal_histograms =
242 BROTLI_ALLOC(m, HistogramLiteral, mb->literal_histograms_size);
243 if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->literal_histograms)) return;
246 kMaxNumberOfHistograms, mb->literal_histograms,
247 &mb->literal_histograms_size, mb->literal_context_map);
253 for (i = mb->literal_split.num_types; i != 0;) {
257 mb->literal_context_map[(i << BROTLI_LITERAL_CONTEXT_BITS) + j] =
258 mb->literal_context_map[i];
263 BROTLI_DCHECK(mb->distance_context_map == 0);
264 mb->distance_context_map_size =
265 mb->distance_split.num_types << BROTLI_DISTANCE_CONTEXT_BITS;
266 mb->distance_context_map =
267 BROTLI_ALLOC(m, uint32_t, mb->distance_context_map_size);
268 if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->distance_context_map)) return;
270 BROTLI_DCHECK(mb->distance_histograms == 0);
271 mb->distance_histograms_size = mb->distance_context_map_size;
272 mb->distance_histograms =
273 BROTLI_ALLOC(m, HistogramDistance, mb->distance_histograms_size);
274 if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->distance_histograms)) return;
277 mb->distance_context_map_size,
279 mb->distance_histograms,
280 &mb->distance_histograms_size,
281 mb->distance_context_map);
519 MetaBlockSplit* mb) {
521 BROTLI_DCHECK(mb->literal_context_map == 0);
522 mb->literal_context_map_size =
523 mb->literal_split.num_types << BROTLI_LITERAL_CONTEXT_BITS;
524 mb->literal_context_map =
525 BROTLI_ALLOC(m, uint32_t, mb->literal_context_map_size);
526 if (BROTLI_IS_OOM(m) || BROTLI_IS_NULL(mb->literal_context_map)) return;
528 for (i = 0; i < mb->literal_split.num_types; ++i) {
532 mb->literal_context_map[(i << BROTLI_LITERAL_CONTEXT_BITS) + j] =
542 const Command* commands, size_t n_commands, MetaBlockSplit* mb) {
557 num_literals, &mb->literal_split, &mb->literal_histograms,
558 &mb->literal_histograms_size);
561 num_literals, &mb->literal_split, &mb->literal_histograms,
562 &mb->literal_histograms_size);
566 500.0, n_commands, &mb->command_split, &mb->command_histograms,
567 &mb->command_histograms_size);
570 &mb->distance_split, &mb->distance_histograms,
571 &mb->distance_histograms_size);
615 MapStaticContexts(m, num_contexts, static_context_map, mb);
630 MetaBlockSplit* mb) {
633 prev_byte2, literal_context_lut, 1, NULL, commands, n_commands, mb);
637 commands, n_commands, mb);
642 MetaBlockSplit* mb) {
645 for (i = 0; i < mb->literal_histograms_size; ++i) {
646 BrotliOptimizeHuffmanCountsForRle(256, mb->literal_histograms[i].data_,
649 for (i = 0; i < mb->command_histograms_size; ++i) {
651 mb->command_histograms[i].data_,
654 for (i = 0; i < mb->distance_histograms_size; ++i) {
656 mb->distance_histograms[i].data_,