(alphabetSizeMax: number, alphabetSizeLimit: number, tableGroup: Int32Array, tableIdx: number, s: State)
| 452 | return buildHuffmanTable(tableGroup, tableIdx, 8, codeLengths, alphabetSizeLimit); |
| 453 | } |
| 454 | function readHuffmanCode(alphabetSizeMax: number, alphabetSizeLimit: number, tableGroup: Int32Array, tableIdx: number, s: State): number { |
| 455 | if (s.halfOffset > 2030) { |
| 456 | const result: number = readMoreInput(s); |
| 457 | if (result < 0) { |
| 458 | return result; |
| 459 | } |
| 460 | } |
| 461 | if (s.bitOffset >= 16) { |
| 462 | s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16); |
| 463 | s.bitOffset -= 16; |
| 464 | } |
| 465 | const simpleCodeOrSkip: number = readFewBits(s, 2); |
| 466 | if (simpleCodeOrSkip === 1) { |
| 467 | return readSimpleHuffmanCode(alphabetSizeMax, alphabetSizeLimit, tableGroup, tableIdx, s); |
| 468 | } |
| 469 | return readComplexHuffmanCode(alphabetSizeLimit, simpleCodeOrSkip, tableGroup, tableIdx, s); |
| 470 | } |
| 471 | function decodeContextMap(contextMapSize: number, contextMap: Int8Array, s: State): number { |
| 472 | let result: number; |
| 473 | if (s.halfOffset > 2030) { |
no test coverage detected
searching dependent graphs…