From 5c13f64bc32ad7024e96326d6e7ad4b2e209617d Mon Sep 17 00:00:00 2001 From: Jens Ochsenmeier Date: Mon, 25 Mar 2024 22:55:19 +0100 Subject: [PATCH] removed one more map --- release/lossless.js.map | 1 - 1 file changed, 1 deletion(-) delete mode 100644 release/lossless.js.map diff --git a/release/lossless.js.map b/release/lossless.js.map deleted file mode 100644 index 783a175..0000000 --- a/release/lossless.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../src/main.ts","../src/component-spec.ts","../src/data-stream.ts","../src/frame-header.ts","../src/utils.ts","../src/huffman-table.ts","../src/quantization-table.ts","../src/scan-component.ts","../src/scan-header.ts","../src/decoder.ts"],"sourcesContent":["export { ComponentSpec } from './component-spec.js'\nexport { DataStream } from './data-stream.js'\nexport { Decoder } from './decoder.js'\nexport { FrameHeader } from './frame-header.js'\nexport { HuffmanTable } from './huffman-table.js'\nexport { QuantizationTable } from './quantization-table.js'\nexport { ScanComponent } from './scan-component.js'\nexport { ScanHeader } from './scan-header.js'\nexport * as Utils from './utils.js'\n","export const ComponentSpec = {\n hSamp: 0,\n quantTableSel: 0,\n vSamp: 0\n}\n","export class DataStream {\n buffer: Uint8Array\n index: number\n\n constructor(data: ArrayBuffer, offset?: number, length?: number) {\n this.buffer = new Uint8Array(data, offset, length)\n this.index = 0\n }\n\n get16() {\n // var value = this.buffer.getUint16(this.index, false);\n const value = (this.buffer[this.index] << 8) + this.buffer[this.index + 1] // DataView is big-endian by default\n this.index += 2\n return value\n }\n\n get8() {\n // var value = this.buffer.getUint8(this.index);\n const value = this.buffer[this.index]\n this.index += 1\n return value\n }\n}\n","import { ComponentSpec } from './component-spec.js'\nimport { DataStream } from './data-stream.js'\n\nexport class FrameHeader {\n dimX = 0\n dimY = 0\n numComp = 0\n precision = 0\n components: Array = []\n\n read(data: DataStream) {\n let count = 0\n let temp\n\n const length = data.get16()\n count += 2\n\n this.precision = data.get8()\n count += 1\n\n this.dimY = data.get16()\n count += 2\n\n this.dimX = data.get16()\n count += 2\n\n this.numComp = data.get8()\n count += 1\n for (let i = 1; i <= this.numComp; i += 1) {\n if (count > length) {\n throw new Error('ERROR: frame format error')\n }\n\n const c = data.get8()\n count += 1\n\n if (count >= length) {\n throw new Error('ERROR: frame format error [c>=Lf]')\n }\n\n temp = data.get8()\n count += 1\n\n if (!this.components[c]) {\n this.components[c] = { ...ComponentSpec }\n }\n\n this.components[c].hSamp = temp >> 4\n this.components[c].vSamp = temp & 0x0f\n this.components[c].quantTableSel = data.get8()\n count += 1\n }\n\n if (count !== length) {\n throw new Error('ERROR: frame format error [Lf!=count]')\n }\n\n return 1\n }\n}\n","type NestedArray = Array>\n\n// https://stackoverflow.com/a/12588826\nexport const createArray = (...dimensions: number[]): NestedArray => {\n if (dimensions.length > 1) {\n const dim = dimensions[0]\n const rest = dimensions.slice(1)\n const newArray = []\n for (let i = 0; i < dim; i++) {\n newArray[i] = createArray(...rest)\n }\n return newArray\n } else {\n return Array(dimensions[0]).fill(undefined)\n }\n}\n\n// http://stackoverflow.com/questions/18638900/javascript-crc32\nexport const makeCRCTable = function () {\n let c\n const crcTable = []\n for (let n = 0; n < 256; n++) {\n c = n\n for (let k = 0; k < 8; k++) {\n c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1\n }\n crcTable[n] = c\n }\n return crcTable\n}\n\nexport const crcTable = makeCRCTable()\n\nexport const crc32 = function (buffer: ArrayBuffer) {\n const uint8view = new Uint8Array(buffer)\n let crc = 0 ^ -1\n\n for (let i = 0; i < uint8view.length; i++) {\n crc = (crc >>> 8) ^ crcTable[(crc ^ uint8view[i]) & 0xff]\n }\n\n return (crc ^ -1) >>> 0\n}\n","import { DataStream } from './data-stream.js'\nimport { createArray } from './utils.js'\n\nexport class HuffmanTable {\n static MSB = 0x80000000\n\n l: number[][][]\n th: number[]\n v: number[][][][]\n tc: number[][]\n\n constructor() {\n this.l = createArray(4, 2, 16) as number[][][]\n this.th = [0, 0, 0, 0]\n this.v = createArray(4, 2, 16, 200) as number[][][][]\n this.tc = [\n [0, 0],\n [0, 0],\n [0, 0],\n [0, 0]\n ]\n }\n\n read(data: DataStream, HuffTab: number[][][]) {\n let count = 0\n let temp\n let t\n let c\n let i\n let j\n\n const length = data.get16()\n count += 2\n\n while (count < length) {\n temp = data.get8()\n count += 1\n t = temp & 0x0f\n if (t > 3) {\n throw new Error('ERROR: Huffman table ID > 3')\n }\n\n c = temp >> 4\n if (c > 2) {\n throw new Error('ERROR: Huffman table [Table class > 2 ]')\n }\n\n this.th[t] = 1\n this.tc[t][c] = 1\n\n for (i = 0; i < 16; i += 1) {\n this.l[t][c][i] = data.get8()\n count += 1\n }\n\n for (i = 0; i < 16; i += 1) {\n for (j = 0; j < this.l[t][c][i]; j += 1) {\n if (count > length) {\n throw new Error('ERROR: Huffman table format error [count>Lh]')\n }\n\n this.v[t][c][i][j] = data.get8()\n count += 1\n }\n }\n }\n\n if (count !== length) {\n throw new Error('ERROR: Huffman table format error [count!=Lf]')\n }\n\n for (i = 0; i < 4; i += 1) {\n for (j = 0; j < 2; j += 1) {\n if (this.tc[i][j] !== 0) {\n this.buildHuffTable(HuffTab[i][j], this.l[i][j], this.v[i][j])\n }\n }\n }\n\n return 1\n }\n\n //\tBuild_HuffTab()\n //\tParameter: t table ID\n //\t c table class ( 0 for DC, 1 for AC )\n //\t L[i] # of codewords which length is i\n //\t V[i][j] Huffman Value (length=i)\n //\tEffect:\n //\t build up HuffTab[t][c] using L and V.\n buildHuffTable(tab: number[], L: number[], V: number[][]) {\n let currentTable, k, i, j, n\n const temp = 256\n k = 0\n\n for (i = 0; i < 8; i += 1) {\n // i+1 is Code length\n for (j = 0; j < L[i]; j += 1) {\n for (n = 0; n < temp >> (i + 1); n += 1) {\n tab[k] = V[i][j] | ((i + 1) << 8)\n k += 1\n }\n }\n }\n\n for (i = 1; k < 256; i += 1, k += 1) {\n tab[k] = i | HuffmanTable.MSB\n }\n\n currentTable = 1\n k = 0\n\n for (i = 8; i < 16; i += 1) {\n // i+1 is Code length\n for (j = 0; j < L[i]; j += 1) {\n for (n = 0; n < temp >> (i - 7); n += 1) {\n tab[currentTable * 256 + k] = V[i][j] | ((i + 1) << 8)\n k += 1\n }\n\n if (k >= 256) {\n if (k > 256) {\n throw new Error('ERROR: Huffman table error(1)!')\n }\n\n k = 0\n currentTable += 1\n }\n }\n }\n }\n}\n","import { DataStream } from './data-stream.js'\nimport { createArray } from './utils.js'\n\nexport class QuantizationTable {\n precision: number[] = [] // Quantization precision 8 or 16\n tq = [0, 0, 0, 0] // 1: this table is presented\n quantTables: number[][] = createArray(4, 64) as number[][] // Tables\n\n static enhanceQuantizationTable = function (qtab: number[], table: number[]) {\n for (let i = 0; i < 8; i += 1) {\n qtab[table[0 * 8 + i]] *= 90\n qtab[table[4 * 8 + i]] *= 90\n qtab[table[2 * 8 + i]] *= 118\n qtab[table[6 * 8 + i]] *= 49\n qtab[table[5 * 8 + i]] *= 71\n qtab[table[1 * 8 + i]] *= 126\n qtab[table[7 * 8 + i]] *= 25\n qtab[table[3 * 8 + i]] *= 106\n }\n\n for (let i = 0; i < 8; i += 1) {\n qtab[table[0 + 8 * i]] *= 90\n qtab[table[4 + 8 * i]] *= 90\n qtab[table[2 + 8 * i]] *= 118\n qtab[table[6 + 8 * i]] *= 49\n qtab[table[5 + 8 * i]] *= 71\n qtab[table[1 + 8 * i]] *= 126\n qtab[table[7 + 8 * i]] *= 25\n qtab[table[3 + 8 * i]] *= 106\n }\n\n for (let i = 0; i < 64; i += 1) {\n qtab[i] >>= 6\n }\n }\n\n read(data: DataStream, table: number[]) {\n let count = 0\n let temp\n let t\n let i\n\n const length = data.get16()\n count += 2\n\n while (count < length) {\n temp = data.get8()\n count += 1\n t = temp & 0x0f\n\n if (t > 3) {\n throw new Error('ERROR: Quantization table ID > 3')\n }\n\n this.precision[t] = temp >> 4\n\n if (this.precision[t] === 0) {\n this.precision[t] = 8\n } else if (this.precision[t] === 1) {\n this.precision[t] = 16\n } else {\n throw new Error('ERROR: Quantization table precision error')\n }\n\n this.tq[t] = 1\n\n if (this.precision[t] === 8) {\n for (i = 0; i < 64; i += 1) {\n if (count > length) {\n throw new Error('ERROR: Quantization table format error')\n }\n\n this.quantTables[t][i] = data.get8()\n count += 1\n }\n\n QuantizationTable.enhanceQuantizationTable(this.quantTables[t], table)\n } else {\n for (i = 0; i < 64; i += 1) {\n if (count > length) {\n throw new Error('ERROR: Quantization table format error')\n }\n\n this.quantTables[t][i] = data.get16()\n count += 2\n }\n\n QuantizationTable.enhanceQuantizationTable(this.quantTables[t], table)\n }\n }\n\n if (count !== length) {\n throw new Error('ERROR: Quantization table error [count!=Lq]')\n }\n\n return 1\n }\n}\n","export const ScanComponent = {\n acTabSel: 0, // AC table selector\n dcTabSel: 0, // DC table selector\n scanCompSel: 0 // Scan component selector\n}\n","import { DataStream } from './data-stream.js'\nimport { ScanComponent } from './scan-component.js'\n\nexport class ScanHeader {\n ah = 0\n al = 0\n numComp = 0 // Number of components in the scan\n selection = 0 // Start of spectral or predictor selection\n spectralEnd = 0 // End of spectral selection\n components: Array = []\n\n read(data: DataStream) {\n let count = 0\n let i\n let temp\n\n const length = data.get16()\n count += 2\n\n this.numComp = data.get8()\n count += 1\n\n for (i = 0; i < this.numComp; i += 1) {\n this.components[i] = { ...ScanComponent }\n\n if (count > length) {\n throw new Error('ERROR: scan header format error')\n }\n\n this.components[i].scanCompSel = data.get8()\n count += 1\n\n temp = data.get8()\n count += 1\n\n this.components[i].dcTabSel = temp >> 4\n this.components[i].acTabSel = temp & 0x0f\n }\n\n this.selection = data.get8()\n count += 1\n\n this.spectralEnd = data.get8()\n count += 1\n\n temp = data.get8()\n this.ah = temp >> 4\n this.al = temp & 0x0f\n count += 1\n\n if (count !== length) {\n throw new Error('ERROR: scan header format error [count!=Ns]')\n }\n\n return 1\n }\n}\n","import { ComponentSpec } from './component-spec.js'\nimport { DataStream } from './data-stream.js'\nimport { FrameHeader } from './frame-header.js'\nimport { HuffmanTable } from './huffman-table.js'\nimport { QuantizationTable } from './quantization-table.js'\nimport { ScanHeader } from './scan-header.js'\nimport { createArray } from './utils.js'\n\nconst littleEndian = (function () {\n const buffer = new ArrayBuffer(2)\n new DataView(buffer).setInt16(0, 256, true /* littleEndian */)\n // Int16Array uses the platform's endianness.\n return new Int16Array(buffer)[0] === 256\n})()\n\nexport class Decoder {\n static IDCT_P = [\n 0, 5, 40, 16, 45, 2, 7, 42, 21, 56, 8, 61, 18, 47, 1, 4, 41, 23, 58, 13, 32, 24, 37, 10, 63, 17, 44, 3, 6, 43, 20,\n 57, 15, 34, 29, 48, 53, 26, 39, 9, 60, 19, 46, 22, 59, 12, 33, 31, 50, 55, 25, 36, 11, 62, 14, 35, 28, 49, 52, 27,\n 38, 30, 51, 54\n ]\n\n static TABLE = [\n 0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44,\n 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49,\n 57, 58, 62, 63\n ]\n\n static MAX_HUFFMAN_SUBTREE = 50\n static MSB = 0x80000000\n static RESTART_MARKER_BEGIN = 0xffd0\n static RESTART_MARKER_END = 0xffd7\n\n buffer: ArrayBuffer | null = null\n stream: DataStream | null = null\n frame = new FrameHeader()\n huffTable = new HuffmanTable()\n quantTable = new QuantizationTable()\n scan = new ScanHeader()\n DU: number[][][] = createArray(10, 4, 64) as number[][][] // at most 10 data units in a MCU, at most 4 data units in one component\n HuffTab: number[][][] = createArray(4, 2, 50 * 256) as number[][][]\n IDCT_Source: number[] = []\n nBlock: number[] = [] // number of blocks in the i-th Comp in a scan\n acTab: number[][] = createArray(10, 1) as number[][] // ac HuffTab for the i-th Comp in a scan\n dcTab: number[][] = createArray(10, 1) as number[][] // dc HuffTab for the i-th Comp in a scan\n qTab: number[][] = createArray(10, 1) as number[][] // quantization table for the i-th Comp in a scan\n marker = 0\n markerIndex = 0\n numComp = 0\n restartInterval = 0\n selection = 0\n xDim = 0\n yDim = 0\n xLoc = 0\n yLoc = 0\n outputData: Uint8Array | Uint16Array | null = null\n restarting = false\n mask = 0\n numBytes = 0\n\n precision: number | undefined = undefined\n components: Array = []\n\n getter: null | ((index: number, compOffset: number) => number) = null\n setter: null | ((index: number, val: number, compOffset?: number) => void) = null\n output: null | ((PRED: number[]) => void) = null\n selector: null | ((compOffset?: number) => number) = null\n\n /**\n * The Decoder constructor.\n * @property {number} numBytes - number of bytes per component\n * @type {Function}\n */\n constructor(buffer?: ArrayBuffer | null, numBytes?: number) {\n this.buffer = buffer ?? null\n this.numBytes = numBytes ?? 0\n }\n\n /**\n * Returns decompressed data.\n */\n decompress(buffer: ArrayBuffer, offset: number, length: number): ArrayBuffer {\n const result = this.decode(buffer, offset, length)\n return result.buffer\n }\n\n decode(buffer?: ArrayBuffer, offset?: number, length?: number, numBytes?: number) {\n let scanNum = 0\n const pred = []\n let i\n let compN\n const temp = []\n const index = []\n let mcuNum\n\n if (buffer) {\n this.buffer = buffer\n }\n\n if (numBytes !== undefined) {\n this.numBytes = numBytes\n }\n\n this.stream = new DataStream(this.buffer as ArrayBuffer, offset, length)\n this.buffer = null\n\n this.xLoc = 0\n this.yLoc = 0\n let current = this.stream.get16()\n\n if (current !== 0xffd8) {\n // SOI\n throw new Error('Not a JPEG file')\n }\n\n current = this.stream.get16()\n\n while (current >> 4 !== 0x0ffc || current === 0xffc4) {\n // SOF 0~15\n switch (current) {\n case 0xffc4: // DHT\n this.huffTable.read(this.stream, this.HuffTab)\n break\n case 0xffcc: // DAC\n throw new Error(\"Program doesn't support arithmetic coding. (format throw new IOException)\")\n case 0xffdb:\n this.quantTable.read(this.stream, Decoder.TABLE)\n break\n case 0xffdd:\n this.restartInterval = this.readNumber() ?? 0\n break\n case 0xffe0:\n case 0xffe1:\n case 0xffe2:\n case 0xffe3:\n case 0xffe4:\n case 0xffe5:\n case 0xffe6:\n case 0xffe7:\n case 0xffe8:\n case 0xffe9:\n case 0xffea:\n case 0xffeb:\n case 0xffec:\n case 0xffed:\n case 0xffee:\n case 0xffef:\n this.readApp()\n break\n case 0xfffe:\n this.readComment()\n break\n default:\n if (current >> 8 !== 0xff) {\n throw new Error('ERROR: format throw new IOException! (decode)')\n }\n }\n\n current = this.stream.get16()\n }\n\n if (current < 0xffc0 || current > 0xffc7) {\n throw new Error('ERROR: could not handle arithmetic code!')\n }\n\n this.frame.read(this.stream)\n current = this.stream.get16()\n\n do {\n while (current !== 0x0ffda) {\n // SOS\n switch (current) {\n case 0xffc4: // DHT\n this.huffTable.read(this.stream, this.HuffTab)\n break\n case 0xffcc: // DAC\n throw new Error(\"Program doesn't support arithmetic coding. (format throw new IOException)\")\n case 0xffdb:\n this.quantTable.read(this.stream, Decoder.TABLE)\n break\n case 0xffdd:\n this.restartInterval = this.readNumber() ?? 0\n break\n case 0xffe0:\n case 0xffe1:\n case 0xffe2:\n case 0xffe3:\n case 0xffe4:\n case 0xffe5:\n case 0xffe6:\n case 0xffe7:\n case 0xffe8:\n case 0xffe9:\n case 0xffea:\n case 0xffeb:\n case 0xffec:\n case 0xffed:\n case 0xffee:\n case 0xffef:\n this.readApp()\n break\n case 0xfffe:\n this.readComment()\n break\n default:\n if (current >> 8 !== 0xff) {\n throw new Error('ERROR: format throw new IOException! (Parser.decode)')\n }\n }\n\n current = this.stream.get16()\n }\n\n this.precision = this.frame.precision\n this.components = this.frame.components\n\n if (!this.numBytes) {\n this.numBytes = Math.round(Math.ceil(this.precision / 8))\n }\n\n if (this.numBytes === 1) {\n this.mask = 0xff\n } else {\n this.mask = 0xffff\n }\n\n this.scan.read(this.stream)\n this.numComp = this.scan.numComp\n this.selection = this.scan.selection\n\n if (this.numBytes === 1) {\n if (this.numComp === 3) {\n this.getter = this.getValueRGB\n this.setter = this.setValueRGB\n this.output = this.outputRGB\n } else {\n this.getter = this.getValue8\n this.setter = this.setValue8\n this.output = this.outputSingle\n }\n } else {\n this.getter = this.getValue8\n this.setter = this.setValue8\n this.output = this.outputSingle\n }\n\n switch (this.selection) {\n case 2:\n this.selector = this.select2\n break\n case 3:\n this.selector = this.select3\n break\n case 4:\n this.selector = this.select4\n break\n case 5:\n this.selector = this.select5\n break\n case 6:\n this.selector = this.select6\n break\n case 7:\n this.selector = this.select7\n break\n default:\n this.selector = this.select1\n break\n }\n\n // this.scanComps = this.scan.components\n // this.quantTables = this.quantTable.quantTables\n\n for (i = 0; i < this.numComp; i += 1) {\n compN = this.scan.components[i].scanCompSel\n this.qTab[i] = this.quantTable.quantTables[this.components[compN].quantTableSel]\n this.nBlock[i] = this.components[compN].vSamp * this.components[compN].hSamp\n this.dcTab[i] = this.HuffTab[this.scan.components[i].dcTabSel][0]\n this.acTab[i] = this.HuffTab[this.scan.components[i].acTabSel][1]\n }\n\n this.xDim = this.frame.dimX\n this.yDim = this.frame.dimY\n if (this.numBytes === 1) {\n this.outputData = new Uint8Array(new ArrayBuffer(this.xDim * this.yDim * this.numBytes * this.numComp))\n } else {\n this.outputData = new Uint16Array(new ArrayBuffer(this.xDim * this.yDim * this.numBytes * this.numComp))\n }\n\n scanNum += 1\n\n while (true) {\n // Decode one scan\n temp[0] = 0\n index[0] = 0\n\n for (i = 0; i < 10; i += 1) {\n pred[i] = 1 << (this.precision - 1)\n }\n\n if (this.restartInterval === 0) {\n current = this.decodeUnit(pred, temp, index)\n\n while (current === 0 && this.xLoc < this.xDim && this.yLoc < this.yDim) {\n this.output(pred)\n current = this.decodeUnit(pred, temp, index)\n }\n\n break // current=MARKER\n }\n\n for (mcuNum = 0; mcuNum < this.restartInterval; mcuNum += 1) {\n this.restarting = mcuNum === 0\n current = this.decodeUnit(pred, temp, index)\n this.output(pred)\n\n if (current !== 0) {\n break\n }\n }\n\n if (current === 0) {\n if (this.markerIndex !== 0) {\n current = 0xff00 | this.marker\n this.markerIndex = 0\n } else {\n current = this.stream.get16()\n }\n }\n\n if (!(current >= Decoder.RESTART_MARKER_BEGIN && current <= Decoder.RESTART_MARKER_END)) {\n break // current=MARKER\n }\n }\n\n if (current === 0xffdc && scanNum === 1) {\n // DNL\n this.readNumber()\n current = this.stream.get16()\n }\n } while (current !== 0xffd9 && this.xLoc < this.xDim && this.yLoc < this.yDim && scanNum === 0)\n\n return this.outputData\n }\n\n decodeUnit(prev: number[], temp: number[], index: number[]): number {\n if (this.numComp === 1) {\n return this.decodeSingle(prev, temp, index)\n } else if (this.numComp === 3) {\n return this.decodeRGB(prev, temp, index)\n } else {\n return -1\n }\n }\n\n select1(compOffset?: number) {\n return this.getPreviousX(compOffset)\n }\n\n select2(compOffset?: number) {\n return this.getPreviousY(compOffset)\n }\n\n select3(compOffset?: number) {\n return this.getPreviousXY(compOffset)\n }\n\n select4(compOffset?: number) {\n return this.getPreviousX(compOffset) + this.getPreviousY(compOffset) - this.getPreviousXY(compOffset)\n }\n\n select5(compOffset?: number) {\n return this.getPreviousX(compOffset) + ((this.getPreviousY(compOffset) - this.getPreviousXY(compOffset)) >> 1)\n }\n\n select6(compOffset?: number) {\n return this.getPreviousY(compOffset) + ((this.getPreviousX(compOffset) - this.getPreviousXY(compOffset)) >> 1)\n }\n\n select7(compOffset?: number) {\n return (this.getPreviousX(compOffset) + this.getPreviousY(compOffset)) / 2\n }\n\n decodeRGB(prev: number[], temp: number[], index: number[]) {\n if (this.selector === null) throw new Error(\"decode hasn't run yet\")\n\n let actab, dctab, qtab, ctrC, i, k, j\n\n prev[0] = this.selector(0)\n prev[1] = this.selector(1)\n prev[2] = this.selector(2)\n\n for (ctrC = 0; ctrC < this.numComp; ctrC += 1) {\n qtab = this.qTab[ctrC]\n actab = this.acTab[ctrC]\n dctab = this.dcTab[ctrC]\n for (i = 0; i < this.nBlock[ctrC]; i += 1) {\n for (k = 0; k < this.IDCT_Source.length; k += 1) {\n this.IDCT_Source[k] = 0\n }\n\n let value = this.getHuffmanValue(dctab, temp, index)\n\n if (value >= 0xff00) {\n return value\n }\n\n prev[ctrC] = this.IDCT_Source[0] = prev[ctrC] + this.getn(index, value, temp, index)\n this.IDCT_Source[0] *= qtab[0]\n\n for (j = 1; j < 64; j += 1) {\n value = this.getHuffmanValue(actab, temp, index)\n\n if (value >= 0xff00) {\n return value\n }\n\n j += value >> 4\n\n if ((value & 0x0f) === 0) {\n if (value >> 4 === 0) {\n break\n }\n } else {\n this.IDCT_Source[Decoder.IDCT_P[j]] = this.getn(index, value & 0x0f, temp, index) * qtab[j]\n }\n }\n }\n }\n\n return 0\n }\n\n decodeSingle(prev: number[], temp: number[], index: number[]) {\n if (this.selector === null) throw new Error(\"decode hasn't run yet\")\n\n let value, i, n, nRestart\n\n if (this.restarting) {\n this.restarting = false\n prev[0] = 1 << (this.frame.precision - 1)\n } else {\n prev[0] = this.selector()\n }\n\n for (i = 0; i < this.nBlock[0]; i += 1) {\n value = this.getHuffmanValue(this.dcTab[0], temp, index)\n if (value >= 0xff00) {\n return value\n }\n\n n = this.getn(prev, value, temp, index)\n nRestart = n >> 8\n\n if (nRestart >= Decoder.RESTART_MARKER_BEGIN && nRestart <= Decoder.RESTART_MARKER_END) {\n return nRestart\n }\n\n prev[0] += n\n }\n\n return 0\n }\n\n //\tHuffman table for fast search: (HuffTab) 8-bit Look up table 2-layer search architecture, 1st-layer represent 256 node (8 bits) if codeword-length > 8\n //\tbits, then the entry of 1st-layer = (# of 2nd-layer table) | MSB and it is stored in the 2nd-layer Size of tables in each layer are 256.\n //\tHuffTab[*][*][0-256] is always the only 1st-layer table.\n //\n //\tAn entry can be: (1) (# of 2nd-layer table) | MSB , for code length > 8 in 1st-layer (2) (Code length) << 8 | HuffVal\n //\n //\tHuffmanValue(table HuffTab[x][y] (ex) HuffmanValue(HuffTab[1][0],...)\n //\t ):\n //\t return: Huffman Value of table\n //\t 0xFF?? if it receives a MARKER\n //\t Parameter: table HuffTab[x][y] (ex) HuffmanValue(HuffTab[1][0],...)\n //\t temp temp storage for remainded bits\n //\t index index to bit of temp\n //\t in FILE pointer\n //\t Effect:\n //\t temp store new remainded bits\n //\t index change to new index\n //\t in change to new position\n //\t NOTE:\n //\t Initial by temp=0; index=0;\n //\t NOTE: (explain temp and index)\n //\t temp: is always in the form at calling time or returning time\n //\t | byte 4 | byte 3 | byte 2 | byte 1 |\n //\t | 0 | 0 | 00000000 | 00000??? | if not a MARKER\n //\t ^index=3 (from 0 to 15)\n //\t 321\n //\t NOTE (marker and marker_index):\n //\t If get a MARKER from 'in', marker=the low-byte of the MARKER\n //\t and marker_index=9\n //\t If marker_index=9 then index is always > 8, or HuffmanValue()\n //\t will not be called\n getHuffmanValue(table: number[], temp: number[], index: number[]): number {\n let code, input\n const mask = 0xffff\n\n if (!this.stream) throw new Error('stream not initialized')\n\n if (index[0] < 8) {\n temp[0] <<= 8\n input = this.stream.get8()\n if (input === 0xff) {\n this.marker = this.stream.get8()\n if (this.marker !== 0) {\n this.markerIndex = 9\n }\n }\n temp[0] |= input\n } else {\n index[0] -= 8\n }\n\n code = table[temp[0] >> index[0]]\n\n if ((code & Decoder.MSB) !== 0) {\n if (this.markerIndex !== 0) {\n this.markerIndex = 0\n return 0xff00 | this.marker\n }\n\n temp[0] &= mask >> (16 - index[0])\n temp[0] <<= 8\n input = this.stream.get8()\n\n if (input === 0xff) {\n this.marker = this.stream.get8()\n if (this.marker !== 0) {\n this.markerIndex = 9\n }\n }\n\n temp[0] |= input\n code = table[(code & 0xff) * 256 + (temp[0] >> index[0])]\n index[0] += 8\n }\n\n index[0] += 8 - (code >> 8)\n\n if (index[0] < 0) {\n throw new Error('index=' + index[0] + ' temp=' + temp[0] + ' code=' + code + ' in HuffmanValue()')\n }\n\n if (index[0] < this.markerIndex) {\n this.markerIndex = 0\n return 0xff00 | this.marker\n }\n\n temp[0] &= mask >> (16 - index[0])\n return code & 0xff\n }\n\n getn(PRED: number[], n: number, temp: number[], index: number[]) {\n let result, input\n const one = 1\n const n_one = -1\n const mask = 0xffff\n\n if (this.stream === null) throw new Error('stream not initialized')\n\n if (n === 0) {\n return 0\n }\n\n if (n === 16) {\n if (PRED[0] >= 0) {\n return -32768\n } else {\n return 32768\n }\n }\n\n index[0] -= n\n\n if (index[0] >= 0) {\n if (index[0] < this.markerIndex && !this.isLastPixel()) {\n // this was corrupting the last pixel in some cases\n this.markerIndex = 0\n return (0xff00 | this.marker) << 8\n }\n\n result = temp[0] >> index[0]\n temp[0] &= mask >> (16 - index[0])\n } else {\n temp[0] <<= 8\n input = this.stream.get8()\n\n if (input === 0xff) {\n this.marker = this.stream.get8()\n if (this.marker !== 0) {\n this.markerIndex = 9\n }\n }\n\n temp[0] |= input\n index[0] += 8\n\n if (index[0] < 0) {\n if (this.markerIndex !== 0) {\n this.markerIndex = 0\n return (0xff00 | this.marker) << 8\n }\n\n temp[0] <<= 8\n input = this.stream.get8()\n\n if (input === 0xff) {\n this.marker = this.stream.get8()\n if (this.marker !== 0) {\n this.markerIndex = 9\n }\n }\n\n temp[0] |= input\n index[0] += 8\n }\n\n if (index[0] < 0) {\n throw new Error('index=' + index[0] + ' in getn()')\n }\n\n if (index[0] < this.markerIndex) {\n this.markerIndex = 0\n return (0xff00 | this.marker) << 8\n }\n\n result = temp[0] >> index[0]\n temp[0] &= mask >> (16 - index[0])\n }\n\n if (result < one << (n - 1)) {\n result += (n_one << n) + 1\n }\n\n return result\n }\n\n getPreviousX(compOffset = 0): number {\n if (this.getter === null) throw new Error(\"decode hasn't run yet\")\n\n if (this.xLoc > 0) {\n return this.getter(this.yLoc * this.xDim + this.xLoc - 1, compOffset)\n } else if (this.yLoc > 0) {\n return this.getPreviousY(compOffset)\n } else {\n return 1 << (this.frame.precision - 1)\n }\n }\n\n getPreviousXY(compOffset = 0) {\n if (this.getter === null) throw new Error(\"decode hasn't run yet\")\n\n if (this.xLoc > 0 && this.yLoc > 0) {\n return this.getter((this.yLoc - 1) * this.xDim + this.xLoc - 1, compOffset)\n } else {\n return this.getPreviousY(compOffset)\n }\n }\n\n getPreviousY(compOffset = 0) {\n if (this.getter === null) throw new Error(\"decode hasn't run yet\")\n\n if (this.yLoc > 0) {\n return this.getter((this.yLoc - 1) * this.xDim + this.xLoc, compOffset)\n } else {\n return this.getPreviousX(compOffset)\n }\n }\n\n isLastPixel() {\n return this.xLoc === this.xDim - 1 && this.yLoc === this.yDim - 1\n }\n\n outputSingle(PRED: number[]) {\n if (this.setter === null) throw new Error(\"decode hasn't run yet\")\n\n if (this.xLoc < this.xDim && this.yLoc < this.yDim) {\n this.setter(this.yLoc * this.xDim + this.xLoc, this.mask & PRED[0])\n\n this.xLoc += 1\n\n if (this.xLoc >= this.xDim) {\n this.yLoc += 1\n this.xLoc = 0\n }\n }\n }\n\n outputRGB(PRED: number[]) {\n if (this.setter === null) throw new Error(\"decode hasn't run yet\")\n\n const offset = this.yLoc * this.xDim + this.xLoc\n\n if (this.xLoc < this.xDim && this.yLoc < this.yDim) {\n this.setter(offset, PRED[0], 0)\n this.setter(offset, PRED[1], 1)\n this.setter(offset, PRED[2], 2)\n\n this.xLoc += 1\n\n if (this.xLoc >= this.xDim) {\n this.yLoc += 1\n this.xLoc = 0\n }\n }\n }\n\n setValue8(index: number, val: number) {\n if (!this.outputData) throw new Error('output data not ready')\n\n if (littleEndian) {\n this.outputData[index] = val\n } else {\n this.outputData[index] = ((val & 0xff) << 8) | ((val >> 8) & 0xff)\n }\n }\n\n getValue8(index: number) {\n if (this.outputData === null) throw new Error('output data not ready')\n if (littleEndian) {\n return this.outputData[index] // mask should not be necessary because outputData is either Int8Array or Int16Array\n } else {\n const val = this.outputData[index]\n return ((val & 0xff) << 8) | ((val >> 8) & 0xff)\n }\n }\n\n setValueRGB(index: number, val: number, compOffset = 0) {\n if (this.outputData === null) return\n this.outputData[index * 3 + compOffset] = val\n }\n\n getValueRGB(index: number, compOffset: number) {\n if (this.outputData === null) throw new Error('output data not ready')\n return this.outputData[index * 3 + compOffset]\n }\n\n readApp() {\n if (this.stream === null) return null\n\n let count = 0\n const length = this.stream.get16()\n count += 2\n\n while (count < length) {\n this.stream.get8()\n count += 1\n }\n\n return length\n }\n\n readComment() {\n if (this.stream === null) return null\n\n let sb = ''\n let count = 0\n\n const length = this.stream.get16()\n count += 2\n\n while (count < length) {\n sb += this.stream.get8()\n count += 1\n }\n\n return sb\n }\n\n readNumber() {\n if (this.stream === null) return null\n\n const Ld = this.stream.get16()\n\n if (Ld !== 4) {\n throw new Error('ERROR: Define number format throw new IOException [Ld!=4]')\n }\n\n return this.stream.get16()\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAO,IAAM,gBAAgB;AAAA,EAC3B,OAAO;AAAA,EACP,eAAe;AAAA,EACf,OAAO;AACT;;;ACJO,IAAM,aAAN,MAAiB;AAAA,EACtB;AAAA,EACA;AAAA,EAEA,YAAY,MAAmB,QAAiB,QAAiB;AAC/D,SAAK,SAAS,IAAI,WAAW,MAAM,QAAQ,MAAM;AACjD,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,QAAQ;AAEN,UAAM,SAAS,KAAK,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK,OAAO,KAAK,QAAQ,CAAC;AACzE,SAAK,SAAS;AACd,WAAO;AAAA,EACT;AAAA,EAEA,OAAO;AAEL,UAAM,QAAQ,KAAK,OAAO,KAAK,KAAK;AACpC,SAAK,SAAS;AACd,WAAO;AAAA,EACT;AACF;;;ACnBO,IAAM,cAAN,MAAkB;AAAA,EACvB,OAAO;AAAA,EACP,OAAO;AAAA,EACP,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,aAA0C,CAAC;AAAA,EAE3C,KAAK,MAAkB;AACrB,QAAI,QAAQ;AACZ,QAAI;AAEJ,UAAM,SAAS,KAAK,MAAM;AAC1B,aAAS;AAET,SAAK,YAAY,KAAK,KAAK;AAC3B,aAAS;AAET,SAAK,OAAO,KAAK,MAAM;AACvB,aAAS;AAET,SAAK,OAAO,KAAK,MAA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