MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / DecodeBlockType

Function DecodeBlockType

static/plugins/pdfmake/pdfmake.js:27472–27490  ·  view source on GitHub ↗
(max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br)

Source from the content-addressed store, hash-verified

27470}
27471
27472function DecodeBlockType(max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br) {
27473 var ringbuffer = tree_type * 2;
27474 var index = tree_type;
27475 var type_code = ReadSymbol(trees, tree_type * HUFFMAN_MAX_TABLE_SIZE, br);
27476 var block_type;
27477 if (type_code === 0) {
27478 block_type = ringbuffers[ringbuffer + (indexes[index] & 1)];
27479 } else if (type_code === 1) {
27480 block_type = ringbuffers[ringbuffer + ((indexes[index] - 1) & 1)] + 1;
27481 } else {
27482 block_type = type_code - 2;
27483 }
27484 if (block_type >= max_block_type) {
27485 block_type -= max_block_type;
27486 }
27487 block_types[tree_type] = block_type;
27488 ringbuffers[ringbuffer + (indexes[index] & 1)] = block_type;
27489 ++indexes[index];
27490}
27491
27492function CopyUncompressedBlockToOutput(output, len, pos, ringbuffer, ringbuffer_mask, br) {
27493 var rb_size = ringbuffer_mask + 1;

Callers 1

BrotliDecompressFunction · 0.70

Calls 1

ReadSymbolFunction · 0.70

Tested by

no test coverage detected