MCPcopy
hub / github.com/google/brotli / readSymbol

Function readSymbol

js/decode.ts:239–254  ·  view source on GitHub ↗
(tableGroup: Int32Array, tableIdx: number, s: State)

Source from the content-addressed store, hash-verified

237 return 0;
238}
239function readSymbol(tableGroup: Int32Array, tableIdx: number, s: State): number {
240 let offset: number = tableGroup[tableIdx];
241 const v: number = s.accumulator32 >>> s.bitOffset;
242 offset += v & 0xFF;
243 const bits: number = tableGroup[offset] >> 16;
244 const sym: number = tableGroup[offset] & 0xFFFF;
245 if (bits <= 8) {
246 s.bitOffset += bits;
247 return sym;
248 }
249 offset += sym;
250 const mask: number = (1 << bits) - 1;
251 offset += (v & mask) >>> 8;
252 s.bitOffset += (tableGroup[offset] >> 16) + 8;
253 return tableGroup[offset] & 0xFFFF;
254}
255function readBlockLength(tableGroup: Int32Array, tableIdx: number, s: State): number {
256 if (s.bitOffset >= 16) {
257 s.accumulator32 = (s.shortBuffer[s.halfOffset++] << 16) | (s.accumulator32 >>> 16);

Callers 4

readBlockLengthFunction · 0.70
decodeContextMapFunction · 0.70
decodeBlockTypeAndLengthFunction · 0.70
decompressFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…