(max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br)
| 27470 | } |
| 27471 | |
| 27472 | function 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 | |
| 27492 | function CopyUncompressedBlockToOutput(output, len, pos, ringbuffer, ringbuffer_mask, br) { |
| 27493 | var rb_size = ringbuffer_mask + 1; |
no test coverage detected