@eka-care/ekascribe-ts-sdk 2.1.31 → 2.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +21 -2
- package/dist/index.mjs +884 -833
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -312,33 +312,35 @@ const getConfigV2 = async () => {
|
|
|
312
312
|
}, patchTransactionStatus = async ({
|
|
313
313
|
sessionId: s,
|
|
314
314
|
processing_status: n,
|
|
315
|
-
processing_error: i
|
|
315
|
+
processing_error: i,
|
|
316
|
+
patient_details: c
|
|
316
317
|
}) => {
|
|
317
318
|
try {
|
|
318
|
-
const
|
|
319
|
-
|
|
319
|
+
const l = new Headers();
|
|
320
|
+
l.append("Content-Type", "application/json");
|
|
320
321
|
const f = {
|
|
322
|
+
...n ? { processing_status: n } : {},
|
|
323
|
+
...c ? { patient_details: c } : {},
|
|
324
|
+
...i ? { processing_error: i } : {}
|
|
325
|
+
}, u = {
|
|
321
326
|
method: "PATCH",
|
|
322
|
-
headers:
|
|
323
|
-
body: JSON.stringify(
|
|
324
|
-
|
|
325
|
-
processing_error: i
|
|
326
|
-
})
|
|
327
|
-
}, u = await fetchWrapper(
|
|
327
|
+
headers: l,
|
|
328
|
+
body: JSON.stringify(f)
|
|
329
|
+
}, d = await fetchWrapper(
|
|
328
330
|
`${GET_EKA_VOICE_HOST_V2()}/transaction/${s}`,
|
|
329
|
-
|
|
331
|
+
u
|
|
330
332
|
);
|
|
331
|
-
if (!
|
|
332
|
-
throw new Error(`Error: ${
|
|
333
|
-
let
|
|
334
|
-
return
|
|
335
|
-
...
|
|
336
|
-
code:
|
|
337
|
-
},
|
|
338
|
-
} catch (
|
|
339
|
-
return console.error("Patch transaction status api failed",
|
|
333
|
+
if (!d.ok)
|
|
334
|
+
throw new Error(`Error: ${d.statusText}`);
|
|
335
|
+
let _ = await d.json();
|
|
336
|
+
return _ = {
|
|
337
|
+
..._,
|
|
338
|
+
code: d.status
|
|
339
|
+
}, _;
|
|
340
|
+
} catch (l) {
|
|
341
|
+
return console.error("Patch transaction status api failed", l), {
|
|
340
342
|
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
341
|
-
message: `Something went wrong! ${
|
|
343
|
+
message: `Something went wrong! ${l}`
|
|
342
344
|
};
|
|
343
345
|
}
|
|
344
346
|
};
|
|
@@ -545,7 +547,7 @@ class AwsV4Signer {
|
|
|
545
547
|
m.add(S);
|
|
546
548
|
}
|
|
547
549
|
return !0;
|
|
548
|
-
}).map((S) => S.map((T) => encodeRfc3986(encodeURIComponent(T)))).sort(([S, T], [v,
|
|
550
|
+
}).map((S) => S.map((T) => encodeRfc3986(encodeURIComponent(T)))).sort(([S, T], [v, E]) => S < v ? -1 : S > v ? 1 : T < E ? -1 : T > E ? 1 : 0).map((S) => S.join("=")).join("&");
|
|
549
551
|
}
|
|
550
552
|
async sign() {
|
|
551
553
|
return this.signQuery ? (this.url.searchParams.set("X-Amz-Signature", await this.signature()), this.sessionToken && this.appendSessionToken && this.url.searchParams.set("X-Amz-Security-Token", this.sessionToken)) : this.headers.set("Authorization", await this.authHeader()), {
|
|
@@ -1406,12 +1408,12 @@ function Da() {
|
|
|
1406
1408
|
];
|
|
1407
1409
|
function o(g, y, m) {
|
|
1408
1410
|
for (var S = 10, T = y + 238 - 14 - 286, v = -15; v < 0; v++) {
|
|
1409
|
-
var
|
|
1410
|
-
|
|
1411
|
+
var E, A, w;
|
|
1412
|
+
E = d[S + -10], A = g[T + -224] * E, w = g[y + 224] * E, E = d[S + -9], A += g[T + -160] * E, w += g[y + 160] * E, E = d[S + -8], A += g[T + -96] * E, w += g[y + 96] * E, E = d[S + -7], A += g[T + -32] * E, w += g[y + 32] * E, E = d[S + -6], A += g[T + 32] * E, w += g[y + -32] * E, E = d[S + -5], A += g[T + 96] * E, w += g[y + -96] * E, E = d[S + -4], A += g[T + 160] * E, w += g[y + -160] * E, E = d[S + -3], A += g[T + 224] * E, w += g[y + -224] * E, E = d[S + -2], A += g[y + -256] * E, w -= g[T + 256] * E, E = d[S + -1], A += g[y + -192] * E, w -= g[T + 192] * E, E = d[S + 0], A += g[y + -128] * E, w -= g[T + 128] * E, E = d[S + 1], A += g[y + -64] * E, w -= g[T + 64] * E, E = d[S + 2], A += g[y + 0] * E, w -= g[T + 0] * E, E = d[S + 3], A += g[y + 64] * E, w -= g[T + -64] * E, E = d[S + 4], A += g[y + 128] * E, w -= g[T + -128] * E, E = d[S + 5], A += g[y + 192] * E, w -= g[T + -192] * E, A *= d[S + 6], E = w - A, m[30 + v * 2] = w + A, m[31 + v * 2] = d[S + 7] * E, S += 18, y--, T++;
|
|
1411
1413
|
}
|
|
1412
1414
|
{
|
|
1413
|
-
var A,
|
|
1414
|
-
|
|
1415
|
+
var A, w, x, N;
|
|
1416
|
+
w = g[y + -16] * d[S + -10], A = g[y + -32] * d[S + -2], w += (g[y + -48] - g[y + 16]) * d[S + -9], A += g[y + -96] * d[S + -1], w += (g[y + -80] + g[y + 48]) * d[S + -8], A += g[y + -160] * d[S + 0], w += (g[y + -112] - g[y + 80]) * d[S + -7], A += g[y + -224] * d[S + 1], w += (g[y + -144] + g[y + 112]) * d[S + -6], A -= g[y + 32] * d[S + 2], w += (g[y + -176] - g[y + 144]) * d[S + -5], A -= g[y + 96] * d[S + 3], w += (g[y + -208] + g[y + 176]) * d[S + -4], A -= g[y + 160] * d[S + 4], w += (g[y + -240] - g[y + 208]) * d[S + -3], A -= g[y + 224], x = A - w, N = A + w, w = m[14], A = m[15] - w, m[31] = N + w, m[30] = x + A, m[15] = x - A, m[14] = N - w;
|
|
1415
1417
|
}
|
|
1416
1418
|
{
|
|
1417
1419
|
var D;
|
|
@@ -1420,15 +1422,15 @@ function Da() {
|
|
|
1420
1422
|
}
|
|
1421
1423
|
function h(g, y) {
|
|
1422
1424
|
for (var m = 0; m < 3; m++) {
|
|
1423
|
-
var S, T, v,
|
|
1424
|
-
|
|
1425
|
+
var S, T, v, E, A, w;
|
|
1426
|
+
E = g[y + 6] * _[f.SHORT_TYPE][0] - g[y + 15], S = g[y + 0] * _[f.SHORT_TYPE][2] - g[y + 9], T = E + S, v = E - S, E = g[y + 15] * _[f.SHORT_TYPE][0] + g[y + 6], S = g[y + 9] * _[f.SHORT_TYPE][2] + g[y + 0], A = E + S, w = -E + S, S = (g[y + 3] * _[f.SHORT_TYPE][1] - g[y + 12]) * 2069978111953089e-26, E = (g[y + 12] * _[f.SHORT_TYPE][1] + g[y + 3]) * 2069978111953089e-26, g[y + 0] = T * 190752519173728e-25 + S, g[y + 15] = -A * 190752519173728e-25 + E, v = v * 0.8660254037844387 * 1907525191737281e-26, A = A * 0.5 * 1907525191737281e-26 + E, g[y + 3] = v - A, g[y + 6] = v + A, T = T * 0.5 * 1907525191737281e-26 - S, w = w * 0.8660254037844387 * 1907525191737281e-26, g[y + 9] = T + w, g[y + 12] = T - w, y++;
|
|
1425
1427
|
}
|
|
1426
1428
|
}
|
|
1427
1429
|
function b(g, y, m) {
|
|
1428
1430
|
var S, T;
|
|
1429
1431
|
{
|
|
1430
|
-
var v,
|
|
1431
|
-
v = m[17] - m[9], A = m[15] - m[11],
|
|
1432
|
+
var v, E, A, w, x, N, D, M;
|
|
1433
|
+
v = m[17] - m[9], A = m[15] - m[11], w = m[14] - m[12], x = m[0] + m[8], N = m[1] + m[7], D = m[2] + m[6], M = m[3] + m[5], g[y + 17] = x + D - M - (N - m[4]), T = (x + D - M) * a[19] + (N - m[4]), S = (v - A - w) * a[18], g[y + 5] = S + T, g[y + 6] = S - T, E = (m[16] - m[10]) * a[18], N = N * a[19] + m[4], S = v * a[12] + E + A * a[13] + w * a[14], T = -x * a[16] + N - D * a[17] + M * a[15], g[y + 1] = S + T, g[y + 2] = S - T, S = v * a[13] - E - A * a[14] + w * a[12], T = -x * a[17] + N - D * a[15] + M * a[16], g[y + 9] = S + T, g[y + 10] = S - T, S = v * a[14] - E + A * a[12] - w * a[13], T = x * a[15] - N + D * a[16] - M * a[17], g[y + 13] = S + T, g[y + 14] = S - T;
|
|
1432
1434
|
}
|
|
1433
1435
|
{
|
|
1434
1436
|
var P, L, B, V, X, Z, q, k;
|
|
@@ -1437,13 +1439,13 @@ function Da() {
|
|
|
1437
1439
|
}
|
|
1438
1440
|
this.mdct_sub48 = function(g, y, m) {
|
|
1439
1441
|
for (var S = y, T = 286, v = 0; v < g.channels_out; v++) {
|
|
1440
|
-
for (var
|
|
1441
|
-
for (var A,
|
|
1442
|
+
for (var E = 0; E < g.mode_gr; E++) {
|
|
1443
|
+
for (var A, w = g.l3_side.tt[E][v], x = w.xr, N = 0, D = g.sb_sample[v][1 - E], M = 0, P = 0; P < 18 / 2; P++)
|
|
1442
1444
|
for (o(S, T, D[M]), o(S, T + 32, D[M + 1]), M += 2, T += 64, A = 1; A < 32; A += 2)
|
|
1443
1445
|
D[M - 1][A] *= -1;
|
|
1444
1446
|
for (A = 0; A < 32; A++, N += 18) {
|
|
1445
|
-
var L =
|
|
1446
|
-
if (
|
|
1447
|
+
var L = w.block_type, B = g.sb_sample[v][E], V = g.sb_sample[v][1 - E];
|
|
1448
|
+
if (w.mixed_block_flag != 0 && A < 2 && (L = 0), g.amp_filter[A] < 1e-12)
|
|
1447
1449
|
c.fill(
|
|
1448
1450
|
x,
|
|
1449
1451
|
N + 0,
|
|
@@ -1550,50 +1552,50 @@ function t1() {
|
|
|
1550
1552
|
var p = Da(), a = Ga(), t = j1, e = _.FFTOFFSET, r = _.MPG_MD_MS_LR, o = null;
|
|
1551
1553
|
this.psy = null;
|
|
1552
1554
|
var h = null, b = null, g = null;
|
|
1553
|
-
this.setModules = function(v,
|
|
1554
|
-
o = v, this.psy =
|
|
1555
|
+
this.setModules = function(v, E, A, w) {
|
|
1556
|
+
o = v, this.psy = E, h = E, b = w, g = A;
|
|
1555
1557
|
};
|
|
1556
1558
|
var y = new p();
|
|
1557
1559
|
function m(v) {
|
|
1558
|
-
var
|
|
1560
|
+
var E, A;
|
|
1559
1561
|
if (v.ATH.useAdjust == 0) {
|
|
1560
1562
|
v.ATH.adjust = 1;
|
|
1561
1563
|
return;
|
|
1562
1564
|
}
|
|
1563
|
-
if (A = v.loudness_sq[0][0],
|
|
1565
|
+
if (A = v.loudness_sq[0][0], E = v.loudness_sq[1][0], v.channels_out == 2 ? (A += v.loudness_sq[0][1], E += v.loudness_sq[1][1]) : (A += A, E += E), v.mode_gr == 2 && (A = Math.max(A, E)), A *= 0.5, A *= v.ATH.aaSensitivityP, A > 0.03125)
|
|
1564
1566
|
v.ATH.adjust >= 1 ? v.ATH.adjust = 1 : v.ATH.adjust < v.ATH.adjustLimit && (v.ATH.adjust = v.ATH.adjustLimit), v.ATH.adjustLimit = 1;
|
|
1565
1567
|
else {
|
|
1566
|
-
var
|
|
1567
|
-
v.ATH.adjust >=
|
|
1568
|
+
var w = 31.98 * A + 625e-6;
|
|
1569
|
+
v.ATH.adjust >= w ? (v.ATH.adjust *= w * 0.075 + 0.925, v.ATH.adjust < w && (v.ATH.adjust = w)) : v.ATH.adjustLimit >= w ? v.ATH.adjust = w : v.ATH.adjust < v.ATH.adjustLimit && (v.ATH.adjust = v.ATH.adjustLimit), v.ATH.adjustLimit = w;
|
|
1568
1570
|
}
|
|
1569
1571
|
}
|
|
1570
1572
|
function S(v) {
|
|
1571
|
-
var
|
|
1572
|
-
for (d(0 <= v.bitrate_index && v.bitrate_index < 16), d(0 <= v.mode_ext && v.mode_ext < 4), v.bitrate_stereoMode_Hist[v.bitrate_index][4]++, v.bitrate_stereoMode_Hist[15][4]++, v.channels_out == 2 && (v.bitrate_stereoMode_Hist[v.bitrate_index][v.mode_ext]++, v.bitrate_stereoMode_Hist[15][v.mode_ext]++),
|
|
1573
|
+
var E, A;
|
|
1574
|
+
for (d(0 <= v.bitrate_index && v.bitrate_index < 16), d(0 <= v.mode_ext && v.mode_ext < 4), v.bitrate_stereoMode_Hist[v.bitrate_index][4]++, v.bitrate_stereoMode_Hist[15][4]++, v.channels_out == 2 && (v.bitrate_stereoMode_Hist[v.bitrate_index][v.mode_ext]++, v.bitrate_stereoMode_Hist[15][v.mode_ext]++), E = 0; E < v.mode_gr; ++E)
|
|
1573
1575
|
for (A = 0; A < v.channels_out; ++A) {
|
|
1574
|
-
var
|
|
1575
|
-
v.l3_side.tt[
|
|
1576
|
+
var w = v.l3_side.tt[E][A].block_type | 0;
|
|
1577
|
+
v.l3_side.tt[E][A].mixed_block_flag != 0 && (w = 4), v.bitrate_blockType_Hist[v.bitrate_index][w]++, v.bitrate_blockType_Hist[v.bitrate_index][5]++, v.bitrate_blockType_Hist[15][w]++, v.bitrate_blockType_Hist[15][5]++;
|
|
1576
1578
|
}
|
|
1577
1579
|
}
|
|
1578
|
-
function T(v,
|
|
1579
|
-
var A = v.internal_flags,
|
|
1580
|
+
function T(v, E) {
|
|
1581
|
+
var A = v.internal_flags, w, x;
|
|
1580
1582
|
if (A.lame_encode_frame_init == 0) {
|
|
1581
1583
|
var N, D, M = l(2014), P = l(2014);
|
|
1582
1584
|
for (A.lame_encode_frame_init = 1, N = 0, D = 0; N < 286 + 576 * (1 + A.mode_gr); ++N)
|
|
1583
|
-
N < 576 * A.mode_gr ? (M[N] = 0, A.channels_out == 2 && (P[N] = 0)) : (M[N] =
|
|
1585
|
+
N < 576 * A.mode_gr ? (M[N] = 0, A.channels_out == 2 && (P[N] = 0)) : (M[N] = E[0][D], A.channels_out == 2 && (P[N] = E[1][D]), ++D);
|
|
1584
1586
|
for (x = 0; x < A.mode_gr; x++)
|
|
1585
|
-
for (
|
|
1586
|
-
A.l3_side.tt[x][
|
|
1587
|
+
for (w = 0; w < A.channels_out; w++)
|
|
1588
|
+
A.l3_side.tt[x][w].block_type = _.SHORT_TYPE;
|
|
1587
1589
|
y.mdct_sub48(A, M, P), d(576 >= _.FFTOFFSET), d(A.mf_size >= _.BLKSIZE + v.framesize - _.FFTOFFSET), d(A.mf_size >= 512 + v.framesize - 32);
|
|
1588
1590
|
}
|
|
1589
1591
|
}
|
|
1590
|
-
this.lame_encode_mp3_frame = function(v,
|
|
1592
|
+
this.lame_encode_mp3_frame = function(v, E, A, w, x, N) {
|
|
1591
1593
|
var D, M = c([2, 2]);
|
|
1592
1594
|
M[0][0] = new a(), M[0][1] = new a(), M[1][0] = new a(), M[1][1] = new a();
|
|
1593
1595
|
var P = c([2, 2]);
|
|
1594
1596
|
P[0][0] = new a(), P[0][1] = new a(), P[1][0] = new a(), P[1][1] = new a();
|
|
1595
1597
|
var L, B = [null, null], V = v.internal_flags, X = f([2, 4]), Z = [0.5, 0.5], q = [[0, 0], [0, 0]], k = [[0, 0], [0, 0]], I, O, F;
|
|
1596
|
-
if (B[0] =
|
|
1598
|
+
if (B[0] = E, B[1] = A, V.lame_encode_frame_init == 0 && T(v, B), V.padding = 0, (V.slot_lag -= V.frac_SpF) < 0 && (V.slot_lag += v.out_samplerate, V.padding = 1), V.psymodel != 0) {
|
|
1597
1599
|
var j, he = [null, null], Xe = 0, Q = u(2);
|
|
1598
1600
|
for (F = 0; F < V.mode_gr; F++) {
|
|
1599
1601
|
for (O = 0; O < V.channels_out; O++)
|
|
@@ -1660,19 +1662,19 @@ function t1() {
|
|
|
1660
1662
|
V.pinfo.energy[F][O].length
|
|
1661
1663
|
));
|
|
1662
1664
|
if (v.VBR == i.vbr_off || v.VBR == i.vbr_abr) {
|
|
1663
|
-
var ht,
|
|
1665
|
+
var ht, Et;
|
|
1664
1666
|
for (ht = 0; ht < 18; ht++)
|
|
1665
1667
|
V.nsPsy.pefirbuf[ht] = V.nsPsy.pefirbuf[ht + 1];
|
|
1666
|
-
for (
|
|
1668
|
+
for (Et = 0, F = 0; F < V.mode_gr; F++)
|
|
1667
1669
|
for (O = 0; O < V.channels_out; O++)
|
|
1668
|
-
|
|
1669
|
-
for (V.nsPsy.pefirbuf[18] =
|
|
1670
|
-
|
|
1671
|
-
for (
|
|
1670
|
+
Et += I[F][O];
|
|
1671
|
+
for (V.nsPsy.pefirbuf[18] = Et, Et = V.nsPsy.pefirbuf[9], ht = 0; ht < 9; ht++)
|
|
1672
|
+
Et += (V.nsPsy.pefirbuf[ht] + V.nsPsy.pefirbuf[18 - ht]) * _.fircoef[ht];
|
|
1673
|
+
for (Et = 670 * 5 * V.mode_gr * V.channels_out / Et, F = 0; F < V.mode_gr; F++)
|
|
1672
1674
|
for (O = 0; O < V.channels_out; O++)
|
|
1673
|
-
I[F][O] *=
|
|
1675
|
+
I[F][O] *= Et;
|
|
1674
1676
|
}
|
|
1675
|
-
if (V.iteration_loop.iteration_loop(v, I, Z, L), o.format_bitstream(v), D = o.copy_buffer(V,
|
|
1677
|
+
if (V.iteration_loop.iteration_loop(v, I, Z, L), o.format_bitstream(v), D = o.copy_buffer(V, w, x, N, 1), v.bWriteVbrTag && b.addVbrFrame(v), v.analysis && V.pinfo != null) {
|
|
1676
1678
|
for (O = 0; O < V.channels_out; O++) {
|
|
1677
1679
|
var Ot;
|
|
1678
1680
|
for (Ot = 0; Ot < e; Ot++)
|
|
@@ -1708,15 +1710,15 @@ function $a() {
|
|
|
1708
1710
|
var r, o, h, b, g, y, m;
|
|
1709
1711
|
m = p >> 1, b = p, g = p << 1, y = g + b, p = g << 1, a = u, t = a + m;
|
|
1710
1712
|
do {
|
|
1711
|
-
var S, T, v,
|
|
1712
|
-
T = f[a + 0] - f[a + b], S = f[a + 0] + f[a + b],
|
|
1713
|
+
var S, T, v, E;
|
|
1714
|
+
T = f[a + 0] - f[a + b], S = f[a + 0] + f[a + b], E = f[a + g] - f[a + y], v = f[a + g] + f[a + y], f[a + g] = S - v, f[a + 0] = S + v, f[a + y] = T - E, f[a + b] = T + E, T = f[t + 0] - f[t + b], S = f[t + 0] + f[t + b], E = Ze.SQRT2 * f[t + y], v = Ze.SQRT2 * f[t + g], f[t + g] = S - v, f[t + 0] = S + v, f[t + y] = T - E, f[t + b] = T + E, t += p, a += p;
|
|
1713
1715
|
} while (a < e);
|
|
1714
1716
|
for (o = i[_ + 0], r = i[_ + 1], h = 1; h < m; h++) {
|
|
1715
|
-
var A,
|
|
1716
|
-
A = 1 - 2 * r * r,
|
|
1717
|
+
var A, w;
|
|
1718
|
+
A = 1 - 2 * r * r, w = 2 * r * o, a = u + h, t = u + b - h;
|
|
1717
1719
|
do {
|
|
1718
|
-
var x, N, D, S, T, M, v, P,
|
|
1719
|
-
N =
|
|
1720
|
+
var x, N, D, S, T, M, v, P, E, L;
|
|
1721
|
+
N = w * f[a + b] - A * f[t + b], x = A * f[a + b] + w * f[t + b], T = f[a + 0] - x, S = f[a + 0] + x, M = f[t + 0] - N, D = f[t + 0] + N, N = w * f[a + y] - A * f[t + y], x = A * f[a + y] + w * f[t + y], E = f[a + g] - x, v = f[a + g] + x, L = f[t + g] - N, P = f[t + g] + N, N = r * v - o * L, x = o * v + r * L, f[a + g] = S - x, f[a + 0] = S + x, f[t + y] = M - N, f[t + b] = M + N, N = o * P - r * E, x = r * P + o * E, f[t + g] = D - x, f[t + 0] = D + x, f[a + y] = T - N, f[a + b] = T + N, t += p, a += p;
|
|
1720
1722
|
} while (a < e);
|
|
1721
1723
|
A = o, o = A * i[_ + 0] - r * i[_ + 1], r = A * i[_ + 1] + r * i[_ + 0];
|
|
1722
1724
|
}
|
|
@@ -1923,7 +1925,7 @@ function Ua() {
|
|
|
1923
1925
|
}
|
|
1924
1926
|
$.athaa_loudapprox == 2 && me < 2 && (ke.loudness_sq[fe][me] = ke.loudness_sq_save[me], ke.loudness_sq_save[me] = b(G, ke));
|
|
1925
1927
|
}
|
|
1926
|
-
var y = 8, m = 23, S = 15, T, v,
|
|
1928
|
+
var y = 8, m = 23, S = 15, T, v, E, A = [
|
|
1927
1929
|
1,
|
|
1928
1930
|
0.79433,
|
|
1929
1931
|
0.63096,
|
|
@@ -1934,8 +1936,8 @@ function Ua() {
|
|
|
1934
1936
|
0.25119,
|
|
1935
1937
|
0.11749
|
|
1936
1938
|
];
|
|
1937
|
-
function
|
|
1938
|
-
T = Math.pow(10, (y + 1) / 16), v = Math.pow(10, (m + 1) / 16),
|
|
1939
|
+
function w() {
|
|
1940
|
+
T = Math.pow(10, (y + 1) / 16), v = Math.pow(10, (m + 1) / 16), E = Math.pow(10, S / 10);
|
|
1939
1941
|
}
|
|
1940
1942
|
var x = [
|
|
1941
1943
|
3.3246 * 3.3246,
|
|
@@ -2009,7 +2011,7 @@ function Ua() {
|
|
|
2009
2011
|
return $ * N[fe];
|
|
2010
2012
|
}
|
|
2011
2013
|
var fe = 0 | n1.FAST_LOG10_X(be, 16);
|
|
2012
|
-
if (G = ve.ATH.cb_l[z] * ve.ATH.adjust, $ <
|
|
2014
|
+
if (G = ve.ATH.cb_l[z] * ve.ATH.adjust, $ < E * G) {
|
|
2013
2015
|
if ($ > G) {
|
|
2014
2016
|
var me, st;
|
|
2015
2017
|
return me = 1, fe <= 13 && (me = D[fe]), st = n1.FAST_LOG10_X($ / G, 10 / 15), $ * ((x[fe] - me) * st + me);
|
|
@@ -2314,20 +2316,20 @@ function Ua() {
|
|
|
2314
2316
|
ve[oe][ft].en.assign(qe.en[ft]), ve[oe][ft].thm.assign(qe.thm[ft]), Vt > 2 && (Y[oe][ft].en.assign(qe.en[ft + 2]), Y[oe][ft].thm.assign(qe.thm[ft + 2]));
|
|
2315
2317
|
}
|
|
2316
2318
|
for (ft = 0; ft < Vt; ft++) {
|
|
2317
|
-
var bt, Ct,
|
|
2319
|
+
var bt, Ct, wt = g0(12), $t = [0, 0, 0, 0], Jt = g0(12), sn = 1, on, it = g0(r0.CBANDS), zt = g0(r0.CBANDS), Ut = [0, 0, 0, 0], fn = g0(r0.HBLKSIZE), dn = m1([3, r0.HBLKSIZE_s]);
|
|
2318
2320
|
for (C0(qe.npart_s <= r0.CBANDS), C0(qe.npart_l <= r0.CBANDS), dt = 0; dt < 3; dt++)
|
|
2319
|
-
|
|
2321
|
+
wt[dt] = qe.nsPsy.last_en_subshort[ft][dt + 6], C0(qe.nsPsy.last_en_subshort[ft][dt + 4] > 0), Jt[dt] = wt[dt] / qe.nsPsy.last_en_subshort[ft][dt + 4], $t[0] += wt[dt];
|
|
2320
2322
|
if (ft == 2)
|
|
2321
2323
|
for (dt = 0; dt < 576; dt++) {
|
|
2322
|
-
var vn,
|
|
2323
|
-
vn = jt[0][dt],
|
|
2324
|
+
var vn, En;
|
|
2325
|
+
vn = jt[0][dt], En = jt[1][dt], jt[0][dt] = vn + En, jt[1][dt] = vn - En;
|
|
2324
2326
|
}
|
|
2325
2327
|
{
|
|
2326
2328
|
var kn = jt[ft & 1], cn = 0;
|
|
2327
2329
|
for (dt = 0; dt < 9; dt++) {
|
|
2328
2330
|
for (var On = cn + 64, un = 1; cn < On; cn++)
|
|
2329
2331
|
un < Math.abs(kn[cn]) && (un = Math.abs(kn[cn]));
|
|
2330
|
-
qe.nsPsy.last_en_subshort[ft][dt] =
|
|
2332
|
+
qe.nsPsy.last_en_subshort[ft][dt] = wt[dt + 3] = un, $t[1 + dt / 3] += un, un > wt[dt + 3 - 2] ? (C0(wt[dt + 3 - 2] > 0), un = un / wt[dt + 3 - 2]) : wt[dt + 3 - 2] > un * 10 ? un = wt[dt + 3 - 2] / (un * 10) : un = 0, Jt[dt + 3] = un;
|
|
2331
2333
|
}
|
|
2332
2334
|
}
|
|
2333
2335
|
if ($.analysis) {
|
|
@@ -2380,7 +2382,7 @@ function Ua() {
|
|
|
2380
2382
|
);
|
|
2381
2383
|
ln = Math.min(ln, un);
|
|
2382
2384
|
}
|
|
2383
|
-
Mn =
|
|
2385
|
+
Mn = wt[Bt * 3 + 3] + wt[Bt * 3 + 4] + wt[Bt * 3 + 5], wt[Bt * 3 + 5] * 6 < Mn && (ln *= 0.5, wt[Bt * 3 + 4] * 6 < Mn && (ln *= 0.5)), qe.thm[ft].s[vt][Bt] = ln;
|
|
2384
2386
|
}
|
|
2385
2387
|
}
|
|
2386
2388
|
for (qe.nsPsy.lastAttacks[ft] = Ut[2], Qt = 0, It = 0; It < qe.npart_l; It++) {
|
|
@@ -2407,8 +2409,8 @@ function Ua() {
|
|
|
2407
2409
|
V(qe), Pn = $.msfix, Math.abs(Pn) > 0 && X(qe, Pn, $.ATHlower * qe.ATH.adjust);
|
|
2408
2410
|
}
|
|
2409
2411
|
for (I($, xt, st, tt), ft = 0; ft < Vt; ft++) {
|
|
2410
|
-
var Tn, bn = 0,
|
|
2411
|
-
ft > 1 ? (Tn = fe, bn = -2,
|
|
2412
|
+
var Tn, bn = 0, wn, An;
|
|
2413
|
+
ft > 1 ? (Tn = fe, bn = -2, wn = r0.NORM_TYPE, (st[0] == r0.SHORT_TYPE || st[1] == r0.SHORT_TYPE) && (wn = r0.SHORT_TYPE), An = Y[oe][ft - 2]) : (Tn = be, bn = 0, wn = st[ft], An = ve[oe][ft]), wn == r0.SHORT_TYPE ? Tn[bn + ft] = j(An, qe.masking_lower) : Tn[bn + ft] = Xe(An, qe.masking_lower), $.analysis && (qe.pinfo.pe[oe][ft] = Tn[bn + ft]);
|
|
2412
2414
|
}
|
|
2413
2415
|
return 0;
|
|
2414
2416
|
};
|
|
@@ -2466,7 +2468,7 @@ function Ua() {
|
|
|
2466
2468
|
-552212e-22 * 2,
|
|
2467
2469
|
-0.313819 * 2
|
|
2468
2470
|
];
|
|
2469
|
-
function
|
|
2471
|
+
function Et($, G, z, oe, ve, Y, be, fe, me, st) {
|
|
2470
2472
|
for (var qe = m1([2, 576]), ke = $.internal_flags, ot = ke.channels_out, pt = $.mode == s.JOINT_STEREO ? 4 : ot, lt = 0; lt < ot; lt++) {
|
|
2471
2473
|
firbuf = G[lt];
|
|
2472
2474
|
for (var Pt = z + 576 - 350 - o + 192, tt = 0; tt < 576; tt++) {
|
|
@@ -2504,8 +2506,8 @@ function Ua() {
|
|
|
2504
2506
|
for (var tt = 0; tt < 12; tt++)
|
|
2505
2507
|
me[lt][tt / 3] == 0 && It[tt] > Bt && (me[lt][tt / 3] = tt % 3 + 1);
|
|
2506
2508
|
for (var tt = 1; tt < 4; tt++) {
|
|
2507
|
-
var bt = Nt[tt - 1], Ct = Nt[tt],
|
|
2508
|
-
|
|
2509
|
+
var bt = Nt[tt - 1], Ct = Nt[tt], wt = Math.max(bt, Ct);
|
|
2510
|
+
wt < 4e4 && bt < 1.7 * Ct && Ct < 1.7 * bt && (tt == 1 && me[lt][0] <= me[lt][tt] && (me[lt][0] = 0), me[lt][tt] = 0);
|
|
2509
2511
|
}
|
|
2510
2512
|
me[lt][0] <= ke.nsPsy.lastAttacks[lt] && (me[lt][0] = 0), (ke.nsPsy.lastAttacks[lt] == 3 || me[lt][0] + me[lt][1] + me[lt][2] + me[lt][3] != 0) && (jt = 0, me[lt][1] != 0 && me[lt][0] != 0 && (me[lt][1] = 0), me[lt][2] != 0 && me[lt][1] != 0 && (me[lt][2] = 0), me[lt][3] != 0 && me[lt][2] != 0 && (me[lt][3] = 0)), lt < 2 ? st[lt] = jt : jt == 0 && (st[0] = st[1] = 0), be[lt] = ke.tot_ener[lt];
|
|
2511
2513
|
}
|
|
@@ -2624,7 +2626,7 @@ function Ua() {
|
|
|
2624
2626
|
[0, 0, 0, 0],
|
|
2625
2627
|
[0, 0, 0, 0]
|
|
2626
2628
|
], Nt = L1(2), Qt = $.mode == s.JOINT_STEREO ? 4 : qe.channels_out;
|
|
2627
|
-
|
|
2629
|
+
Et(
|
|
2628
2630
|
$,
|
|
2629
2631
|
G,
|
|
2630
2632
|
z,
|
|
@@ -2961,7 +2963,7 @@ function Ua() {
|
|
|
2961
2963
|
ke,
|
|
2962
2964
|
ot,
|
|
2963
2965
|
oe
|
|
2964
|
-
),
|
|
2966
|
+
), w(), n.init_fft(G), G.decay = Math.exp(-1 * i / (p * pt / 192));
|
|
2965
2967
|
{
|
|
2966
2968
|
var dt;
|
|
2967
2969
|
dt = r, $.exp_nspsytune & 2 && (dt = 1), Math.abs($.msfix) > 0 && (dt = $.msfix), $.msfix = dt;
|
|
@@ -3432,7 +3434,7 @@ function j0() {
|
|
|
3432
3434
|
return t * t;
|
|
3433
3435
|
}
|
|
3434
3436
|
this.AnalyzeSamples = function(t, e, r, o, h, b, g) {
|
|
3435
|
-
var y, m, S, T, v,
|
|
3437
|
+
var y, m, S, T, v, E, A;
|
|
3436
3438
|
if (b == 0)
|
|
3437
3439
|
return GAIN_ANALYSIS_OK;
|
|
3438
3440
|
switch (A = 0, v = b, g) {
|
|
@@ -3469,26 +3471,26 @@ function j0() {
|
|
|
3469
3471
|
MAX_ORDER,
|
|
3470
3472
|
MAX_ORDER
|
|
3471
3473
|
)); v > 0; ) {
|
|
3472
|
-
|
|
3474
|
+
E = v > t.sampleWindow - t.totsamp ? t.sampleWindow - t.totsamp : v, A < MAX_ORDER ? (y = t.linpre + A, m = t.linprebuf, S = t.rinpre + A, T = t.rinprebuf, E > MAX_ORDER - A && (E = MAX_ORDER - A)) : (y = r + A, m = e, S = h + A, T = o), u(m, y, t.lstepbuf, t.lstep + t.totsamp, E, l[t.reqindex]), u(T, S, t.rstepbuf, t.rstep + t.totsamp, E, l[t.reqindex]), d(
|
|
3473
3475
|
t.lstepbuf,
|
|
3474
3476
|
t.lstep + t.totsamp,
|
|
3475
3477
|
t.loutbuf,
|
|
3476
3478
|
t.lout + t.totsamp,
|
|
3477
|
-
|
|
3479
|
+
E,
|
|
3478
3480
|
f[t.reqindex]
|
|
3479
3481
|
), d(
|
|
3480
3482
|
t.rstepbuf,
|
|
3481
3483
|
t.rstep + t.totsamp,
|
|
3482
3484
|
t.routbuf,
|
|
3483
3485
|
t.rout + t.totsamp,
|
|
3484
|
-
|
|
3486
|
+
E,
|
|
3485
3487
|
f[t.reqindex]
|
|
3486
3488
|
), y = t.lout + t.totsamp, m = t.loutbuf, S = t.rout + t.totsamp, T = t.routbuf;
|
|
3487
|
-
for (var
|
|
3489
|
+
for (var w = E % 8; w-- != 0; )
|
|
3488
3490
|
t.lsum += p(m[y++]), t.rsum += p(T[S++]);
|
|
3489
|
-
for (
|
|
3491
|
+
for (w = E / 8; w-- != 0; )
|
|
3490
3492
|
t.lsum += p(m[y + 0]) + p(m[y + 1]) + p(m[y + 2]) + p(m[y + 3]) + p(m[y + 4]) + p(m[y + 5]) + p(m[y + 6]) + p(m[y + 7]), y += 8, t.rsum += p(T[S + 0]) + p(T[S + 1]) + p(T[S + 2]) + p(T[S + 3]) + p(T[S + 4]) + p(T[S + 5]) + p(T[S + 6]) + p(T[S + 7]), S += 8;
|
|
3491
|
-
if (v -=
|
|
3493
|
+
if (v -= E, A += E, t.totsamp += E, t.totsamp == t.sampleWindow) {
|
|
3492
3494
|
var x = j0.STEPS_per_dB * 10 * Math.log10((t.lsum + t.rsum) / t.totsamp * 0.5 + 1e-37), N = x <= 0 ? 0 : 0 | x;
|
|
3493
3495
|
N >= t.A.length && (N = t.A.length - 1), t.A[N]++, t.lsum = t.rsum = 0, _1.arraycopy(
|
|
3494
3496
|
t.loutbuf,
|
|
@@ -7122,7 +7124,7 @@ function Va() {
|
|
|
7122
7124
|
return d(0 <= L + t.Q_MAX2 && L < t.Q_MAX), A[L + t.Q_MAX2];
|
|
7123
7125
|
}
|
|
7124
7126
|
this.IPOW20 = function(L) {
|
|
7125
|
-
return d(0 <= L && L < t.Q_MAX),
|
|
7127
|
+
return d(0 <= L && L < t.Q_MAX), w[L];
|
|
7126
7128
|
};
|
|
7127
7129
|
var g = 2220446049250313e-31, y = t.IXMAX_VAL, m = y + 2, S = t.Q_MAX, T = t.Q_MAX2;
|
|
7128
7130
|
t.LARGE_BITS;
|
|
@@ -7135,7 +7137,7 @@ function Va() {
|
|
|
7135
7137
|
[[6, 6, 6, 3], [12, 9, 9, 6], [6, 12, 9, 6]],
|
|
7136
7138
|
[[8, 8, 5, 0], [15, 12, 9, 0], [6, 18, 9, 0]]
|
|
7137
7139
|
];
|
|
7138
|
-
var
|
|
7140
|
+
var E = [
|
|
7139
7141
|
0,
|
|
7140
7142
|
0,
|
|
7141
7143
|
0,
|
|
@@ -7159,7 +7161,7 @@ function Va() {
|
|
|
7159
7161
|
2,
|
|
7160
7162
|
0
|
|
7161
7163
|
];
|
|
7162
|
-
this.pretab =
|
|
7164
|
+
this.pretab = E, this.sfBandIndex = [
|
|
7163
7165
|
// Table B.2.b: 22.05 kHz
|
|
7164
7166
|
new s(
|
|
7165
7167
|
[
|
|
@@ -7495,7 +7497,7 @@ function Va() {
|
|
|
7495
7497
|
/* sfb12 pseudo sub bands */
|
|
7496
7498
|
)
|
|
7497
7499
|
];
|
|
7498
|
-
var A = f(S + T + 1),
|
|
7500
|
+
var A = f(S + T + 1), w = f(S), x = f(m), N = f(m);
|
|
7499
7501
|
this.adj43 = N;
|
|
7500
7502
|
function D(L, B) {
|
|
7501
7503
|
var V = h.ATHformula(B, L);
|
|
@@ -7559,7 +7561,7 @@ function Va() {
|
|
|
7559
7561
|
0.75
|
|
7560
7562
|
);
|
|
7561
7563
|
for (N[X] = 0.5, X = 0; X < S; X++)
|
|
7562
|
-
|
|
7564
|
+
w[X] = Math.pow(2, (X - 210) * -0.1875);
|
|
7563
7565
|
for (X = 0; X <= S + T; X++)
|
|
7564
7566
|
A[X] = Math.pow(2, (X - 210 - T) * 0.25);
|
|
7565
7567
|
r.huffman_init(B);
|
|
@@ -7615,8 +7617,8 @@ function Va() {
|
|
|
7615
7617
|
var Q, Ce, rt, ct, yt, mt;
|
|
7616
7618
|
L.VBR == i.vbr_rh || L.VBR == i.vbr_mtrh ? Ce = athAdjust(F.adjust, F.l[k], F.floor) : Ce = F.adjust * F.l[k], yt = V.width[k], rt = Ce / yt, ct = g, mt = yt >> 1, Q = 0;
|
|
7617
7619
|
do {
|
|
7618
|
-
var ht,
|
|
7619
|
-
ht = j[I] * j[I], Q += ht, ct += ht < rt ? ht : rt, I++,
|
|
7620
|
+
var ht, Et;
|
|
7621
|
+
ht = j[I] * j[I], Q += ht, ct += ht < rt ? ht : rt, I++, Et = j[I] * j[I], Q += Et, ct += Et < rt ? Et : rt, I++;
|
|
7620
7622
|
} while (--mt > 0);
|
|
7621
7623
|
if (Q > Ce && O++, k == _.SBPSY_l) {
|
|
7622
7624
|
var Ot = Ce * q.nsPsy.longfact[k];
|
|
@@ -7642,8 +7644,8 @@ function Va() {
|
|
|
7642
7644
|
var Q = 0, Ce, rt, ct, mt = yt >> 1;
|
|
7643
7645
|
rt = gt / yt, ct = g;
|
|
7644
7646
|
do {
|
|
7645
|
-
var ht,
|
|
7646
|
-
ht = j[I] * j[I], Q += ht, ct += ht < rt ? ht : rt, I++,
|
|
7647
|
+
var ht, Et;
|
|
7648
|
+
ht = j[I] * j[I], Q += ht, ct += ht < rt ? ht : rt, I++, Et = j[I] * j[I], Q += Et, ct += Et < rt ? Et : rt, I++;
|
|
7647
7649
|
} while (--mt > 0);
|
|
7648
7650
|
if (Q > gt && O++, U == _.SBPSY_s) {
|
|
7649
7651
|
var Ot = gt * q.nsPsy.shortfact[U];
|
|
@@ -7687,7 +7689,7 @@ function Va() {
|
|
|
7687
7689
|
}, this.calc_noise = function(L, B, V, X, Z) {
|
|
7688
7690
|
var q = 0, k = 0, I, O, F = 0, j = 0, he = 0, Xe = -20, Q = 0, Ce = L.scalefac, rt = 0;
|
|
7689
7691
|
for (X.over_SSD = 0, I = 0; I < L.psymax; I++) {
|
|
7690
|
-
var ct = L.global_gain - (Ce[rt++] + (L.preflag != 0 ?
|
|
7692
|
+
var ct = L.global_gain - (Ce[rt++] + (L.preflag != 0 ? E[I] : 0) << L.scalefac_scale + 1) - L.subblock_gain[L.window[I]] * 8, yt = 0;
|
|
7691
7693
|
if (Z != null && Z.step[I] == ct)
|
|
7692
7694
|
yt = Z.noise[I], Q += L.width[I], V[q++] = yt / B[k++], yt = Z.noise_log[I];
|
|
7693
7695
|
else {
|
|
@@ -7696,8 +7698,8 @@ function Va() {
|
|
|
7696
7698
|
var ht;
|
|
7697
7699
|
ht = L.max_nonzero_coeff - Q + 1, ht > 0 ? O = ht >> 1 : O = 0;
|
|
7698
7700
|
}
|
|
7699
|
-
var
|
|
7700
|
-
yt = this.calc_noise_core(L,
|
|
7701
|
+
var Et = new P(Q);
|
|
7702
|
+
yt = this.calc_noise_core(L, Et, O, mt), Q = Et.s, Z != null && (Z.step[I] = ct, Z.noise[I] = yt), yt = V[q++] = yt / B[k++], yt = l.FAST_LOG10(Math.max(yt, 1e-20)), Z != null && (Z.noise_log[I] = yt);
|
|
7701
7703
|
}
|
|
7702
7704
|
if (Z != null && (Z.global_gain = L.global_gain), he += yt, yt > 0) {
|
|
7703
7705
|
var Ot;
|
|
@@ -7714,17 +7716,17 @@ function Va() {
|
|
|
7714
7716
|
var yt = q.scalefac_band.l[k], mt = q.scalefac_band.l[k + 1], ht = mt - yt;
|
|
7715
7717
|
for (F = 0; ct < mt; ct++)
|
|
7716
7718
|
F += B.xr[ct] * B.xr[ct];
|
|
7717
|
-
F /= ht, j = 1e15, q.pinfo.en[X][Z][k] = j * F, q.pinfo.xfsf[X][Z][k] = j * Q[k] * Ce[k] / ht, V.en.l[k] > 0 && !L.ATHonly ? F = F / V.en.l[k] : F = 0, q.pinfo.thr[X][Z][k] = j * Math.max(F * V.thm.l[k], q.ATH.l[k]), q.pinfo.LAMEsfb[X][Z][k] = 0, B.preflag != 0 && k >= 11 && (q.pinfo.LAMEsfb[X][Z][k] = -he *
|
|
7719
|
+
F /= ht, j = 1e15, q.pinfo.en[X][Z][k] = j * F, q.pinfo.xfsf[X][Z][k] = j * Q[k] * Ce[k] / ht, V.en.l[k] > 0 && !L.ATHonly ? F = F / V.en.l[k] : F = 0, q.pinfo.thr[X][Z][k] = j * Math.max(F * V.thm.l[k], q.ATH.l[k]), q.pinfo.LAMEsfb[X][Z][k] = 0, B.preflag != 0 && k >= 11 && (q.pinfo.LAMEsfb[X][Z][k] = -he * E[k]), k < _.SBPSY_l && (d(Xe[k] >= 0), q.pinfo.LAMEsfb[X][Z][k] -= he * Xe[k]);
|
|
7718
7720
|
}
|
|
7719
7721
|
if (B.block_type == _.SHORT_TYPE)
|
|
7720
7722
|
for (I = k, k = B.sfb_smin; k < _.SBMAX_s; k++)
|
|
7721
|
-
for (var yt = q.scalefac_band.s[k], mt = q.scalefac_band.s[k + 1], ht = mt - yt,
|
|
7723
|
+
for (var yt = q.scalefac_band.s[k], mt = q.scalefac_band.s[k + 1], ht = mt - yt, Et = 0; Et < 3; Et++) {
|
|
7722
7724
|
for (F = 0, O = yt; O < mt; O++)
|
|
7723
7725
|
F += B.xr[ct] * B.xr[ct], ct++;
|
|
7724
|
-
F = Math.max(F / ht, 1e-20), j = 1e15, q.pinfo.en_s[X][Z][3 * k +
|
|
7725
|
-
F * V.thm.s[k][
|
|
7726
|
+
F = Math.max(F / ht, 1e-20), j = 1e15, q.pinfo.en_s[X][Z][3 * k + Et] = j * F, q.pinfo.xfsf_s[X][Z][3 * k + Et] = j * Q[I] * Ce[I] / ht, V.en.s[k][Et] > 0 ? F = F / V.en.s[k][Et] : F = 0, (L.ATHonly || L.ATHshort) && (F = 0), q.pinfo.thr_s[X][Z][3 * k + Et] = j * Math.max(
|
|
7727
|
+
F * V.thm.s[k][Et],
|
|
7726
7728
|
q.ATH.s[k]
|
|
7727
|
-
), q.pinfo.LAMEsfb_s[X][Z][3 * k +
|
|
7729
|
+
), q.pinfo.LAMEsfb_s[X][Z][3 * k + Et] = -2 * B.subblock_gain[Et], k < _.SBPSY_s && (q.pinfo.LAMEsfb_s[X][Z][3 * k + Et] -= he * Xe[I]), I++;
|
|
7728
7730
|
}
|
|
7729
7731
|
q.pinfo.LAMEqss[X][Z] = B.global_gain, q.pinfo.LAMEmainbits[X][Z] = B.part2_3_length + B.part2_length, q.pinfo.LAMEsfbits[X][Z] = B.part2_length, q.pinfo.over[X][Z] = rt.over_count, q.pinfo.max_noise[X][Z] = rt.max_noise * 10, q.pinfo.over_noise[X][Z] = rt.over_noise * 10, q.pinfo.tot_noise[X][Z] = rt.tot_noise * 10, q.pinfo.over_SSD[X][Z] = rt.over_SSD;
|
|
7730
7732
|
};
|
|
@@ -7811,7 +7813,7 @@ function Oa() {
|
|
|
7811
7813
|
}
|
|
7812
7814
|
}
|
|
7813
7815
|
function h(q, k, I, O, F) {
|
|
7814
|
-
var j, he, Xe = 0, Q, Ce = 0, rt = 0, ct = 0, yt = k, mt = 0, ht = yt,
|
|
7816
|
+
var j, he, Xe = 0, Q, Ce = 0, rt = 0, ct = 0, yt = k, mt = 0, ht = yt, Et = 0, Ot = q, Ht = 0;
|
|
7815
7817
|
for (Q = F != null && O.global_gain == F.global_gain, O.block_type == f.SHORT_TYPE ? he = 38 : he = 21, j = 0; j <= he; j++) {
|
|
7816
7818
|
var nn = -1;
|
|
7817
7819
|
if ((Q || O.block_type == f.NORM_TYPE) && (nn = O.global_gain - (O.scalefac[j] + (O.preflag != 0 ? a.pretab[j] : 0) << O.scalefac_scale + 1) - O.subblock_gain[O.window[j]] * 8), l(O.width[j] >= 0), Q && F.step[j] == nn)
|
|
@@ -7821,14 +7823,14 @@ function Oa() {
|
|
|
7821
7823
|
Ot,
|
|
7822
7824
|
Ht,
|
|
7823
7825
|
ht,
|
|
7824
|
-
|
|
7826
|
+
Et
|
|
7825
7827
|
), Ce = 0), rt != 0 && (r(
|
|
7826
7828
|
rt,
|
|
7827
7829
|
I,
|
|
7828
7830
|
Ot,
|
|
7829
7831
|
Ht,
|
|
7830
7832
|
ht,
|
|
7831
|
-
|
|
7833
|
+
Et
|
|
7832
7834
|
), rt = 0);
|
|
7833
7835
|
else {
|
|
7834
7836
|
var C = O.width[j];
|
|
@@ -7836,35 +7838,35 @@ function Oa() {
|
|
|
7836
7838
|
var U;
|
|
7837
7839
|
U = O.max_nonzero_coeff - Xe + 1, i.fill(k, O.max_nonzero_coeff, 576, 0), C = U, C < 0 && (C = 0), j = he + 1;
|
|
7838
7840
|
}
|
|
7839
|
-
if (Ce == 0 && rt == 0 && (ht = yt,
|
|
7841
|
+
if (Ce == 0 && rt == 0 && (ht = yt, Et = mt, Ot = q, Ht = ct), F != null && F.sfb_count1 > 0 && j >= F.sfb_count1 && F.step[j] > 0 && nn >= F.step[j] ? (Ce != 0 && (o(
|
|
7840
7842
|
Ce,
|
|
7841
7843
|
I,
|
|
7842
7844
|
Ot,
|
|
7843
7845
|
Ht,
|
|
7844
7846
|
ht,
|
|
7845
|
-
|
|
7846
|
-
), Ce = 0, ht = yt,
|
|
7847
|
+
Et
|
|
7848
|
+
), Ce = 0, ht = yt, Et = mt, Ot = q, Ht = ct), rt += C) : (rt != 0 && (r(
|
|
7847
7849
|
rt,
|
|
7848
7850
|
I,
|
|
7849
7851
|
Ot,
|
|
7850
7852
|
Ht,
|
|
7851
7853
|
ht,
|
|
7852
|
-
|
|
7853
|
-
), rt = 0, ht = yt,
|
|
7854
|
+
Et
|
|
7855
|
+
), rt = 0, ht = yt, Et = mt, Ot = q, Ht = ct), Ce += C), C <= 0) {
|
|
7854
7856
|
rt != 0 && (r(
|
|
7855
7857
|
rt,
|
|
7856
7858
|
I,
|
|
7857
7859
|
Ot,
|
|
7858
7860
|
Ht,
|
|
7859
7861
|
ht,
|
|
7860
|
-
|
|
7862
|
+
Et
|
|
7861
7863
|
), rt = 0), Ce != 0 && (o(
|
|
7862
7864
|
Ce,
|
|
7863
7865
|
I,
|
|
7864
7866
|
Ot,
|
|
7865
7867
|
Ht,
|
|
7866
7868
|
ht,
|
|
7867
|
-
|
|
7869
|
+
Et
|
|
7868
7870
|
), Ce = 0);
|
|
7869
7871
|
break;
|
|
7870
7872
|
}
|
|
@@ -7877,14 +7879,14 @@ function Oa() {
|
|
|
7877
7879
|
Ot,
|
|
7878
7880
|
Ht,
|
|
7879
7881
|
ht,
|
|
7880
|
-
|
|
7882
|
+
Et
|
|
7881
7883
|
), Ce = 0), rt != 0 && (r(
|
|
7882
7884
|
rt,
|
|
7883
7885
|
I,
|
|
7884
7886
|
Ot,
|
|
7885
7887
|
Ht,
|
|
7886
7888
|
ht,
|
|
7887
|
-
|
|
7889
|
+
Et
|
|
7888
7890
|
), rt = 0);
|
|
7889
7891
|
}
|
|
7890
7892
|
function b(q, k, I) {
|
|
@@ -8048,7 +8050,7 @@ function Oa() {
|
|
|
8048
8050
|
}
|
|
8049
8051
|
return this.noquant_count_bits(q, I, O);
|
|
8050
8052
|
};
|
|
8051
|
-
function
|
|
8053
|
+
function E(q, k, I, O, F, j, he) {
|
|
8052
8054
|
for (var Xe = k.big_values, Q = 0; Q <= 22; Q++)
|
|
8053
8055
|
O[Q] = _.LARGE_BITS;
|
|
8054
8056
|
for (var Q = 0; Q < 16; Q++) {
|
|
@@ -8061,10 +8063,10 @@ function Oa() {
|
|
|
8061
8063
|
var ht = q.scalefac_band.l[Q + mt + 2];
|
|
8062
8064
|
if (ht >= Xe)
|
|
8063
8065
|
break;
|
|
8064
|
-
var
|
|
8065
|
-
ct = new t(
|
|
8066
|
+
var Et = rt;
|
|
8067
|
+
ct = new t(Et);
|
|
8066
8068
|
var Ot = v(I, Ce, ht, ct);
|
|
8067
|
-
|
|
8069
|
+
Et = ct.bits, O[Q + mt] > Et && (O[Q + mt] = Et, F[Q + mt] = Q, j[Q + mt] = yt, he[Q + mt] = Ot);
|
|
8068
8070
|
}
|
|
8069
8071
|
}
|
|
8070
8072
|
}
|
|
@@ -8083,7 +8085,7 @@ function Oa() {
|
|
|
8083
8085
|
this.best_huffman_divide = function(q, k) {
|
|
8084
8086
|
var I = new d(), O = k.l3_enc, F = c(23), j = c(23), he = c(23), Xe = c(23);
|
|
8085
8087
|
if (!(k.block_type == f.SHORT_TYPE && q.mode_gr == 1)) {
|
|
8086
|
-
I.assign(k), k.block_type == f.NORM_TYPE && (
|
|
8088
|
+
I.assign(k), k.block_type == f.NORM_TYPE && (E(q, k, O, F, j, he, Xe), A(
|
|
8087
8089
|
q,
|
|
8088
8090
|
I,
|
|
8089
8091
|
k,
|
|
@@ -8125,7 +8127,7 @@ function Oa() {
|
|
|
8125
8127
|
}
|
|
8126
8128
|
}
|
|
8127
8129
|
};
|
|
8128
|
-
var
|
|
8130
|
+
var w = [1, 1, 1, 1, 8, 2, 2, 2, 4, 4, 4, 8, 8, 8, 16, 16], x = [1, 2, 4, 8, 1, 2, 4, 8, 2, 4, 8, 2, 4, 8, 4, 8], N = [0, 0, 0, 0, 3, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4], D = [0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 1, 2, 3, 2, 3];
|
|
8129
8131
|
p.slen1_tab = N, p.slen2_tab = D;
|
|
8130
8132
|
function M(q, k) {
|
|
8131
8133
|
for (var I, O = k.tt[1][q], F = k.tt[0][q], j = 0; j < u.scfsi_band.length - 1; j++) {
|
|
@@ -8143,7 +8145,7 @@ function Oa() {
|
|
|
8143
8145
|
for (var Q = 0, Ce = 0; I < f.SBPSY_l; I++)
|
|
8144
8146
|
O.scalefac[I] != -1 && (Ce++, Q < O.scalefac[I] && (Q = O.scalefac[I]));
|
|
8145
8147
|
for (var j = 0; j < 16; j++)
|
|
8146
|
-
if (he <
|
|
8148
|
+
if (he < w[j] && Q < x[j]) {
|
|
8147
8149
|
var rt = N[j] * Xe + D[j] * Ce;
|
|
8148
8150
|
O.part2_length > rt && (O.part2_length = rt, O.scalefac_compress = j);
|
|
8149
8151
|
}
|
|
@@ -8255,7 +8257,7 @@ function Oa() {
|
|
|
8255
8257
|
for (; I < q.sfbmax; I++)
|
|
8256
8258
|
F < he[I] && (F = he[I]);
|
|
8257
8259
|
for (q.part2_length = _.LARGE_BITS, k = 0; k < 16; k++)
|
|
8258
|
-
O <
|
|
8260
|
+
O < w[k] && F < x[k] && q.part2_length > j[k] && (q.part2_length = j[k], q.scalefac_compress = k);
|
|
8259
8261
|
return q.part2_length == _.LARGE_BITS;
|
|
8260
8262
|
};
|
|
8261
8263
|
var X = [
|
|
@@ -8287,15 +8289,15 @@ function Oa() {
|
|
|
8287
8289
|
for (Xe = !1, F = 0; F < 4; F++)
|
|
8288
8290
|
rt[F] > X[I][F] && (Xe = !0);
|
|
8289
8291
|
if (!Xe) {
|
|
8290
|
-
var mt, ht,
|
|
8292
|
+
var mt, ht, Et, Ot;
|
|
8291
8293
|
for (k.sfb_partition_table = a.nr_of_sfb_block[I][O], F = 0; F < 4; F++)
|
|
8292
8294
|
k.slen[F] = Z[rt[F]];
|
|
8293
|
-
switch (mt = k.slen[0], ht = k.slen[1],
|
|
8295
|
+
switch (mt = k.slen[0], ht = k.slen[1], Et = k.slen[2], Ot = k.slen[3], I) {
|
|
8294
8296
|
case 0:
|
|
8295
|
-
k.scalefac_compress = (mt * 5 + ht << 4) + (
|
|
8297
|
+
k.scalefac_compress = (mt * 5 + ht << 4) + (Et << 2) + Ot;
|
|
8296
8298
|
break;
|
|
8297
8299
|
case 1:
|
|
8298
|
-
k.scalefac_compress = 400 + (mt * 5 + ht << 2) +
|
|
8300
|
+
k.scalefac_compress = 400 + (mt * 5 + ht << 2) + Et;
|
|
8299
8301
|
break;
|
|
8300
8302
|
case 2:
|
|
8301
8303
|
k.scalefac_compress = 500 + mt * 3 + ht;
|
|
@@ -8366,16 +8368,16 @@ function Ve() {
|
|
|
8366
8368
|
var F = 0 | (k.version + 1) * 72e3 * O / k.out_samplerate + I.padding;
|
|
8367
8369
|
return 8 * F;
|
|
8368
8370
|
};
|
|
8369
|
-
function
|
|
8371
|
+
function E(k) {
|
|
8370
8372
|
n.arraycopy(k.header[k.w_ptr].buf, 0, m, T, k.sideinfo_len), T += k.sideinfo_len, S += k.sideinfo_len * 8, k.w_ptr = k.w_ptr + 1 & a.MAX_HEADER_BUF - 1;
|
|
8371
8373
|
}
|
|
8372
8374
|
function A(k, I, O) {
|
|
8373
8375
|
for (; O > 0; ) {
|
|
8374
8376
|
var F;
|
|
8375
|
-
v == 0 && (v = 8, T++, u(T < e.LAME_MAXMP3BUFFER), u(k.header[k.w_ptr].write_timing >= S), k.header[k.w_ptr].write_timing == S &&
|
|
8377
|
+
v == 0 && (v = 8, T++, u(T < e.LAME_MAXMP3BUFFER), u(k.header[k.w_ptr].write_timing >= S), k.header[k.w_ptr].write_timing == S && E(k), m[T] = 0), F = Math.min(O, v), O -= F, v -= F, m[T] |= I >> O << v, S += F;
|
|
8376
8378
|
}
|
|
8377
8379
|
}
|
|
8378
|
-
function
|
|
8380
|
+
function w(k, I, O) {
|
|
8379
8381
|
for (; O > 0; ) {
|
|
8380
8382
|
var F;
|
|
8381
8383
|
v == 0 && (v = 8, T++, u(T < e.LAME_MAXMP3BUFFER), m[T] = 0), F = Math.min(O, v), O -= F, v -= F, m[T] |= I >> O << v, S += F;
|
|
@@ -8450,19 +8452,19 @@ function Ve() {
|
|
|
8450
8452
|
if (I == 0)
|
|
8451
8453
|
return Xe;
|
|
8452
8454
|
for (var Q = O; Q < F; Q += 2) {
|
|
8453
|
-
var Ce = 0, rt = 0, ct = he.xlen, yt = he.xlen, mt = 0, ht = j.l3_enc[Q],
|
|
8455
|
+
var Ce = 0, rt = 0, ct = he.xlen, yt = he.xlen, mt = 0, ht = j.l3_enc[Q], Et = j.l3_enc[Q + 1];
|
|
8454
8456
|
if (ht != 0 && (j.xr[Q] < 0 && mt++, Ce--), I > 15) {
|
|
8455
8457
|
if (ht > 14) {
|
|
8456
8458
|
var Ot = ht - 15;
|
|
8457
8459
|
u(Ot <= he.linmax), mt |= Ot << 1, rt = ct, ht = 15;
|
|
8458
8460
|
}
|
|
8459
|
-
if (
|
|
8460
|
-
var Ht =
|
|
8461
|
-
u(Ht <= he.linmax), mt <<= ct, mt |= Ht, rt += ct,
|
|
8461
|
+
if (Et > 14) {
|
|
8462
|
+
var Ht = Et - 15;
|
|
8463
|
+
u(Ht <= he.linmax), mt <<= ct, mt |= Ht, rt += ct, Et = 15;
|
|
8462
8464
|
}
|
|
8463
8465
|
yt = 16;
|
|
8464
8466
|
}
|
|
8465
|
-
|
|
8467
|
+
Et != 0 && (mt <<= 1, j.xr[Q + 1] < 0 && mt++, Ce--), ht = ht * yt + Et, rt -= Ce, Ce += he.hlen[ht], A(k, he.table[ht], Ce), A(k, mt, rt), Xe += Ce + rt;
|
|
8466
8468
|
}
|
|
8467
8469
|
return Xe;
|
|
8468
8470
|
}
|
|
@@ -8513,8 +8515,8 @@ function Ve() {
|
|
|
8513
8515
|
var Ce = Q.tt[I][O], yt, mt, ht = 0;
|
|
8514
8516
|
if (u(Ce.sfb_partition_table != null), j = 0, F = 0, mt = 0, Ce.block_type == p.SHORT_TYPE) {
|
|
8515
8517
|
for (; mt < 4; mt++) {
|
|
8516
|
-
var
|
|
8517
|
-
for (yt = 0; yt <
|
|
8518
|
+
var Et = Ce.sfb_partition_table[mt] / 3, Ot = Ce.slen[mt];
|
|
8519
|
+
for (yt = 0; yt < Et; yt++, F++)
|
|
8518
8520
|
A(
|
|
8519
8521
|
Xe,
|
|
8520
8522
|
Math.max(Ce.scalefac[F * 3 + 0], 0),
|
|
@@ -8532,8 +8534,8 @@ function Ve() {
|
|
|
8532
8534
|
j += B(Xe, Ce);
|
|
8533
8535
|
} else {
|
|
8534
8536
|
for (; mt < 4; mt++) {
|
|
8535
|
-
var
|
|
8536
|
-
for (yt = 0; yt <
|
|
8537
|
+
var Et = Ce.sfb_partition_table[mt], Ot = Ce.slen[mt];
|
|
8538
|
+
for (yt = 0; yt < Et; yt++, F++)
|
|
8537
8539
|
A(Xe, Math.max(Ce.scalefac[F], 0), Ot), ht += Ot;
|
|
8538
8540
|
}
|
|
8539
8541
|
j += V(Xe, Ce);
|
|
@@ -8561,7 +8563,7 @@ function Ve() {
|
|
|
8561
8563
|
}
|
|
8562
8564
|
}, this.add_dummy_byte = function(k, I, O) {
|
|
8563
8565
|
for (var F = k.internal_flags, j; O-- > 0; )
|
|
8564
|
-
for (
|
|
8566
|
+
for (w(F, I, 8), j = 0; j < a.MAX_HEADER_BUF; ++j)
|
|
8565
8567
|
F.header[j].write_timing += 8;
|
|
8566
8568
|
}, this.format_bitstream = function(k) {
|
|
8567
8569
|
var I = k.internal_flags, O;
|
|
@@ -8652,9 +8654,9 @@ function Oe() {
|
|
|
8652
8654
|
g.V9 = 410, g.V8 = 420, g.V7 = 430, g.V6 = 440, g.V5 = 450, g.V4 = 460, g.V3 = 470, g.V2 = 480, g.V1 = 490, g.V0 = 500, g.R3MIX = 1e3, g.STANDARD = 1001, g.EXTREME = 1002, g.INSANE = 1003, g.STANDARD_FAST = 1004, g.EXTREME_FAST = 1005, g.MEDIUM = 1006, g.MEDIUM_FAST = 1007;
|
|
8653
8655
|
var T = 16384 + S;
|
|
8654
8656
|
g.LAME_MAXMP3BUFFER = T;
|
|
8655
|
-
var v,
|
|
8657
|
+
var v, E, A, w, x, N = new _(), D, M, P;
|
|
8656
8658
|
this.enc = new b(), this.setModules = function(C, U, Tt, gt, kt, Dt, _t, Rt, Lt) {
|
|
8657
|
-
v = C,
|
|
8659
|
+
v = C, E = U, A = Tt, w = gt, x = kt, D = Dt, M = Rt, P = Lt, this.enc.setModules(E, N, w, D);
|
|
8658
8660
|
};
|
|
8659
8661
|
function L() {
|
|
8660
8662
|
this.mask_adjust = 0, this.mask_adjust_short = 0, this.bo_l_weight = l(b.SBMAX_l), this.bo_s_weight = l(b.SBMAX_s);
|
|
@@ -8959,16 +8961,16 @@ function Oe() {
|
|
|
8959
8961
|
return C.internal_flags = null, -1;
|
|
8960
8962
|
} else
|
|
8961
8963
|
U.bitrate_index = 1;
|
|
8962
|
-
C.analysis && (C.bWriteVbrTag = !1), U.pinfo != null && (C.bWriteVbrTag = !1),
|
|
8964
|
+
C.analysis && (C.bWriteVbrTag = !1), U.pinfo != null && (C.bWriteVbrTag = !1), E.init_bit_stream_w(U);
|
|
8963
8965
|
for (var Mt = U.samplerate_index + 3 * C.version + 6 * (C.out_samplerate < 16e3 ? 1 : 0), St = 0; St < b.SBMAX_l + 1; St++)
|
|
8964
|
-
U.scalefac_band.l[St] =
|
|
8966
|
+
U.scalefac_band.l[St] = w.sfBandIndex[Mt].l[St];
|
|
8965
8967
|
for (var St = 0; St < b.PSFB21 + 1; St++) {
|
|
8966
8968
|
var Wt = (U.scalefac_band.l[22] - U.scalefac_band.l[21]) / b.PSFB21, en = U.scalefac_band.l[21] + St * Wt;
|
|
8967
8969
|
U.scalefac_band.psfb21[St] = en;
|
|
8968
8970
|
}
|
|
8969
8971
|
U.scalefac_band.psfb21[b.PSFB21] = 576;
|
|
8970
8972
|
for (var St = 0; St < b.SBMAX_s + 1; St++)
|
|
8971
|
-
U.scalefac_band.s[St] =
|
|
8973
|
+
U.scalefac_band.s[St] = w.sfBandIndex[Mt].s[St];
|
|
8972
8974
|
for (var St = 0; St < b.PSFB12 + 1; St++) {
|
|
8973
8975
|
var Wt = (U.scalefac_band.s[13] - U.scalefac_band.s[12]) / b.PSFB12, en = U.scalefac_band.s[12] + St * Wt;
|
|
8974
8976
|
U.scalefac_band.psfb12[St] = en;
|
|
@@ -9024,7 +9026,7 @@ function Oe() {
|
|
|
9024
9026
|
C.VBR_mean_bitrate_kbps
|
|
9025
9027
|
);
|
|
9026
9028
|
}
|
|
9027
|
-
return C.tune && (U.PSY.mask_adjust += C.tune_value_a, U.PSY.mask_adjust_short += C.tune_value_a), Xe(C), d(C.scale >= 0), C.athaa_type < 0 ? U.ATH.useAdjust = 3 : U.ATH.useAdjust = C.athaa_type, U.ATH.aaSensitivityP = Math.pow(10, C.athaa_sensitivity / -10), C.short_blocks == null && (C.short_blocks = c.short_block_allowed), C.short_blocks == c.short_block_allowed && (C.mode == y.JOINT_STEREO || C.mode == y.STEREO) && (C.short_blocks = c.short_block_coupled), C.quant_comp < 0 && (C.quant_comp = 1), C.quant_comp_short < 0 && (C.quant_comp_short = 0), C.msfix < 0 && (C.msfix = 0), C.exp_nspsytune = C.exp_nspsytune | 1, C.internal_flags.nsPsy.attackthre < 0 && (C.internal_flags.nsPsy.attackthre = _.NSATTACKTHRE), C.internal_flags.nsPsy.attackthre_s < 0 && (C.internal_flags.nsPsy.attackthre_s = _.NSATTACKTHRE_S), d(C.scale >= 0), C.scale < 0 && (C.scale = 1), C.ATHtype < 0 && (C.ATHtype = 4), C.ATHcurve < 0 && (C.ATHcurve = 4), C.athaa_loudapprox < 0 && (C.athaa_loudapprox = 2), C.interChRatio < 0 && (C.interChRatio = 0), C.useTemporal == null && (C.useTemporal = !0), U.slot_lag = U.frac_SpF = 0, C.VBR == i.vbr_off && (U.slot_lag = U.frac_SpF = (C.version + 1) * 72e3 * C.brate % C.out_samplerate | 0),
|
|
9029
|
+
return C.tune && (U.PSY.mask_adjust += C.tune_value_a, U.PSY.mask_adjust_short += C.tune_value_a), Xe(C), d(C.scale >= 0), C.athaa_type < 0 ? U.ATH.useAdjust = 3 : U.ATH.useAdjust = C.athaa_type, U.ATH.aaSensitivityP = Math.pow(10, C.athaa_sensitivity / -10), C.short_blocks == null && (C.short_blocks = c.short_block_allowed), C.short_blocks == c.short_block_allowed && (C.mode == y.JOINT_STEREO || C.mode == y.STEREO) && (C.short_blocks = c.short_block_coupled), C.quant_comp < 0 && (C.quant_comp = 1), C.quant_comp_short < 0 && (C.quant_comp_short = 0), C.msfix < 0 && (C.msfix = 0), C.exp_nspsytune = C.exp_nspsytune | 1, C.internal_flags.nsPsy.attackthre < 0 && (C.internal_flags.nsPsy.attackthre = _.NSATTACKTHRE), C.internal_flags.nsPsy.attackthre_s < 0 && (C.internal_flags.nsPsy.attackthre_s = _.NSATTACKTHRE_S), d(C.scale >= 0), C.scale < 0 && (C.scale = 1), C.ATHtype < 0 && (C.ATHtype = 4), C.ATHcurve < 0 && (C.ATHcurve = 4), C.athaa_loudapprox < 0 && (C.athaa_loudapprox = 2), C.interChRatio < 0 && (C.interChRatio = 0), C.useTemporal == null && (C.useTemporal = !0), U.slot_lag = U.frac_SpF = 0, C.VBR == i.vbr_off && (U.slot_lag = U.frac_SpF = (C.version + 1) * 72e3 * C.brate % C.out_samplerate | 0), w.iteration_init(C), N.psymodel_init(C), d(C.scale >= 0), 0;
|
|
9028
9030
|
};
|
|
9029
9031
|
function Ce(C, U) {
|
|
9030
9032
|
(C.in_buffer_0 == null || C.in_buffer_nsamples < U) && (C.in_buffer_0 = l(U), C.in_buffer_1 = l(U), C.in_buffer_nsamples = U);
|
|
@@ -9045,7 +9047,7 @@ function Oe() {
|
|
|
9045
9047
|
Lt
|
|
9046
9048
|
), Tt += _t, Rt += _t, St -= G != C.frameNum ? 1 : 0;
|
|
9047
9049
|
}
|
|
9048
|
-
if (kt.mf_samples_to_encode = 0, _t < 0 || (Lt = gt - Rt, gt == 0 && (Lt = 0),
|
|
9050
|
+
if (kt.mf_samples_to_encode = 0, _t < 0 || (Lt = gt - Rt, gt == 0 && (Lt = 0), E.flush_bitstream(C), _t = E.copy_buffer(
|
|
9049
9051
|
kt,
|
|
9050
9052
|
U,
|
|
9051
9053
|
Tt,
|
|
@@ -9054,7 +9056,7 @@ function Oe() {
|
|
|
9054
9056
|
), _t < 0))
|
|
9055
9057
|
return _t;
|
|
9056
9058
|
if (Tt += _t, Rt += _t, Lt = gt - Rt, gt == 0 && (Lt = 0), C.write_id3tag_automatic) {
|
|
9057
|
-
if (M.id3tag_write_v1(C), _t =
|
|
9059
|
+
if (M.id3tag_write_v1(C), _t = E.copy_buffer(
|
|
9058
9060
|
kt,
|
|
9059
9061
|
U,
|
|
9060
9062
|
Tt,
|
|
@@ -9094,7 +9096,7 @@ function Oe() {
|
|
|
9094
9096
|
return -3;
|
|
9095
9097
|
if (gt == 0)
|
|
9096
9098
|
return 0;
|
|
9097
|
-
if ($ =
|
|
9099
|
+
if ($ = E.copy_buffer(Rt, kt, Dt, _t, 0), $ < 0)
|
|
9098
9100
|
return $;
|
|
9099
9101
|
if (Dt += $, Lt += $, z[0] = U, z[1] = Tt, o.NEQ(C.scale, 0) && o.NEQ(C.scale, 1))
|
|
9100
9102
|
for (St = 0; St < gt; ++St)
|
|
@@ -9165,8 +9167,8 @@ function Oe() {
|
|
|
9165
9167
|
function ht() {
|
|
9166
9168
|
this.num_used = 0;
|
|
9167
9169
|
}
|
|
9168
|
-
function
|
|
9169
|
-
return U != 0 ?
|
|
9170
|
+
function Et(C, U) {
|
|
9171
|
+
return U != 0 ? Et(U, C % U) : C;
|
|
9170
9172
|
}
|
|
9171
9173
|
function Ot(C, U, Tt) {
|
|
9172
9174
|
var gt = Math.PI * U;
|
|
@@ -9175,7 +9177,7 @@ function Oe() {
|
|
|
9175
9177
|
return Math.abs(kt) < 1e-9 ? gt / Math.PI : Dt * Math.sin(Tt * gt * kt) / (Math.PI * Tt * kt);
|
|
9176
9178
|
}
|
|
9177
9179
|
function Ht(C, U, Tt, gt, kt, Dt, _t, Rt, Lt) {
|
|
9178
|
-
var Mt = C.internal_flags, St, Wt = 0, en, $ = C.out_samplerate /
|
|
9180
|
+
var Mt = C.internal_flags, St, Wt = 0, en, $ = C.out_samplerate / Et(C.out_samplerate, C.in_samplerate);
|
|
9179
9181
|
$ > a.BPC && ($ = a.BPC);
|
|
9180
9182
|
var G = Math.abs(Mt.resample_ratio - Math.floor(0.5 + Mt.resample_ratio)) < 1e-4 ? 1 : 0, z = 1 / Mt.resample_ratio;
|
|
9181
9183
|
z > 1 && (z = 1);
|
|
@@ -9254,11 +9256,11 @@ function Oe() {
|
|
|
9254
9256
|
var p2 = Q0, M1 = p2.VbrMode;
|
|
9255
9257
|
function H2() {
|
|
9256
9258
|
var s = Oe();
|
|
9257
|
-
function n(a, t, e, r, o, h, b, g, y, m, S, T, v,
|
|
9258
|
-
this.vbr_q = a, this.quant_comp = t, this.quant_comp_s = e, this.expY = r, this.st_lrm = o, this.st_s = h, this.masking_adj = b, this.masking_adj_short = g, this.ath_lower = y, this.ath_curve = m, this.ath_sensitivity = S, this.interch = T, this.safejoint = v, this.sfb21mod =
|
|
9259
|
+
function n(a, t, e, r, o, h, b, g, y, m, S, T, v, E, A) {
|
|
9260
|
+
this.vbr_q = a, this.quant_comp = t, this.quant_comp_s = e, this.expY = r, this.st_lrm = o, this.st_s = h, this.masking_adj = b, this.masking_adj_short = g, this.ath_lower = y, this.ath_curve = m, this.ath_sensitivity = S, this.interch = T, this.safejoint = v, this.sfb21mod = E, this.msfix = A;
|
|
9259
9261
|
}
|
|
9260
|
-
function i(a, t, e, r, o, h, b, g, y, m, S, T, v,
|
|
9261
|
-
this.quant_comp = t, this.quant_comp_s = e, this.safejoint = r, this.nsmsfix = o, this.st_lrm = h, this.st_s = b, this.nsbass = g, this.scale = y, this.masking_adj = m, this.ath_lower = S, this.ath_curve = T, this.interch = v, this.sfscale =
|
|
9262
|
+
function i(a, t, e, r, o, h, b, g, y, m, S, T, v, E) {
|
|
9263
|
+
this.quant_comp = t, this.quant_comp_s = e, this.safejoint = r, this.nsmsfix = o, this.st_lrm = h, this.st_s = b, this.nsbass = g, this.scale = y, this.masking_adj = m, this.ath_lower = S, this.ath_curve = T, this.interch = v, this.sfscale = E;
|
|
9262
9264
|
}
|
|
9263
9265
|
var c;
|
|
9264
9266
|
this.setModules = function(a) {
|
|
@@ -9440,8 +9442,8 @@ function $2() {
|
|
|
9440
9442
|
if (y.xrpow_max = 0, X1.fill(m, T, 576, 0), S = f(y, m, T, S), S > 1e-20) {
|
|
9441
9443
|
var v = 0;
|
|
9442
9444
|
g.substep_shaping & 2 && (v = 1);
|
|
9443
|
-
for (var
|
|
9444
|
-
g.pseudohalf[
|
|
9445
|
+
for (var E = 0; E < y.psymax; E++)
|
|
9446
|
+
g.pseudohalf[E] = v;
|
|
9445
9447
|
return !0;
|
|
9446
9448
|
}
|
|
9447
9449
|
return X1.fill(y.l3_enc, 0, 576, 0), !1;
|
|
@@ -9450,14 +9452,14 @@ function $2() {
|
|
|
9450
9452
|
var m = g.ATH, S = y.xr;
|
|
9451
9453
|
if (y.block_type != D0.SHORT_TYPE)
|
|
9452
9454
|
for (var T = !1, v = D0.PSFB21 - 1; v >= 0 && !T; v--) {
|
|
9453
|
-
var
|
|
9455
|
+
var E = g.scalefac_band.psfb21[v], A = g.scalefac_band.psfb21[v + 1], w = i.athAdjust(
|
|
9454
9456
|
m.adjust,
|
|
9455
9457
|
m.psfb21[v],
|
|
9456
9458
|
m.floor
|
|
9457
9459
|
);
|
|
9458
|
-
g.nsPsy.longfact[21] > 1e-12 && (
|
|
9459
|
-
for (var x = A - 1; x >=
|
|
9460
|
-
if (Math.abs(S[x]) <
|
|
9460
|
+
g.nsPsy.longfact[21] > 1e-12 && (w *= g.nsPsy.longfact[21]);
|
|
9461
|
+
for (var x = A - 1; x >= E; x--)
|
|
9462
|
+
if (Math.abs(S[x]) < w)
|
|
9461
9463
|
S[x] = 0;
|
|
9462
9464
|
else {
|
|
9463
9465
|
T = !0;
|
|
@@ -9467,13 +9469,13 @@ function $2() {
|
|
|
9467
9469
|
else
|
|
9468
9470
|
for (var N = 0; N < 3; N++)
|
|
9469
9471
|
for (var T = !1, v = D0.PSFB12 - 1; v >= 0 && !T; v--) {
|
|
9470
|
-
var
|
|
9472
|
+
var E = g.scalefac_band.s[12] * 3 + (g.scalefac_band.s[13] - g.scalefac_band.s[12]) * N + (g.scalefac_band.psfb12[v] - g.scalefac_band.psfb12[0]), A = E + (g.scalefac_band.psfb12[v + 1] - g.scalefac_band.psfb12[v]), D = i.athAdjust(
|
|
9471
9473
|
m.adjust,
|
|
9472
9474
|
m.psfb12[v],
|
|
9473
9475
|
m.floor
|
|
9474
9476
|
);
|
|
9475
9477
|
g.nsPsy.shortfact[12] > 1e-12 && (D *= g.nsPsy.shortfact[12]);
|
|
9476
|
-
for (var x = A - 1; x >=
|
|
9478
|
+
for (var x = A - 1; x >= E; x--)
|
|
9477
9479
|
if (Math.abs(S[x]) < D)
|
|
9478
9480
|
S[x] = 0;
|
|
9479
9481
|
else {
|
|
@@ -9492,9 +9494,9 @@ function $2() {
|
|
|
9492
9494
|
var T = g.scalefac_band.l[y.sfb_lmax];
|
|
9493
9495
|
y1.arraycopy(y.xr, 0, S, 0, 576);
|
|
9494
9496
|
for (var m = y.sfb_smin; m < D0.SBMAX_s; m++)
|
|
9495
|
-
for (var v = g.scalefac_band.s[m],
|
|
9496
|
-
for (var
|
|
9497
|
-
y.xr[T++] = S[3 *
|
|
9497
|
+
for (var v = g.scalefac_band.s[m], E = g.scalefac_band.s[m + 1], A = 0; A < 3; A++)
|
|
9498
|
+
for (var w = v; w < E; w++)
|
|
9499
|
+
y.xr[T++] = S[3 * w + A];
|
|
9498
9500
|
for (var x = y.sfb_lmax, m = y.sfb_smin; m < D0.SBMAX_s; m++)
|
|
9499
9501
|
y.width[x] = y.width[x + 1] = y.width[x + 2] = g.scalefac_band.s[m + 1] - g.scalefac_band.s[m], y.window[x] = 0, y.window[x + 1] = 1, y.window[x + 2] = 2, x += 3;
|
|
9500
9502
|
}
|
|
@@ -9505,44 +9507,44 @@ function $2() {
|
|
|
9505
9507
|
}
|
|
9506
9508
|
d.BINSEARCH_NONE = new d(0), d.BINSEARCH_UP = new d(1), d.BINSEARCH_DOWN = new d(2);
|
|
9507
9509
|
function _(g, y, m, S, T) {
|
|
9508
|
-
var v,
|
|
9509
|
-
for (y.global_gain =
|
|
9510
|
+
var v, E = g.CurrentStep[S], A = !1, w = g.OldValue[S], x = d.BINSEARCH_NONE;
|
|
9511
|
+
for (y.global_gain = w, m -= y.part2_length; ; ) {
|
|
9510
9512
|
var N;
|
|
9511
|
-
if (v = l.count_bits(g, T, y, null),
|
|
9513
|
+
if (v = l.count_bits(g, T, y, null), E == 1 || v == m)
|
|
9512
9514
|
break;
|
|
9513
|
-
v > m ? (x == d.BINSEARCH_DOWN && (A = !0), A && (
|
|
9515
|
+
v > m ? (x == d.BINSEARCH_DOWN && (A = !0), A && (E /= 2), x = d.BINSEARCH_UP, N = E) : (x == d.BINSEARCH_UP && (A = !0), A && (E /= 2), x = d.BINSEARCH_DOWN, N = -E), y.global_gain += N, y.global_gain < 0 && (y.global_gain = 0, A = !0), y.global_gain > 255 && (y.global_gain = 255, A = !0);
|
|
9514
9516
|
}
|
|
9515
9517
|
for (U1(y.global_gain >= 0), U1(y.global_gain < 256); v > m && y.global_gain < 255; )
|
|
9516
9518
|
y.global_gain++, v = l.count_bits(g, T, y, null);
|
|
9517
|
-
return g.CurrentStep[S] =
|
|
9519
|
+
return g.CurrentStep[S] = w - y.global_gain >= 4 ? 4 : 2, g.OldValue[S] = y.global_gain, y.part2_3_length = v, v;
|
|
9518
9520
|
}
|
|
9519
9521
|
this.trancate_smallspectrums = function(g, y, m, S) {
|
|
9520
9522
|
var T = K1(va.SFBMAX);
|
|
9521
9523
|
if (!(!(g.substep_shaping & 4) && y.block_type == D0.SHORT_TYPE || g.substep_shaping & 128)) {
|
|
9522
9524
|
i.calc_noise(y, m, T, new we(), null);
|
|
9523
|
-
for (var
|
|
9525
|
+
for (var E = 0; E < 576; E++) {
|
|
9524
9526
|
var v = 0;
|
|
9525
|
-
y.l3_enc[
|
|
9527
|
+
y.l3_enc[E] != 0 && (v = Math.abs(y.xr[E])), S[E] = v;
|
|
9526
9528
|
}
|
|
9527
|
-
var
|
|
9529
|
+
var E = 0, A = 8;
|
|
9528
9530
|
y.block_type == D0.SHORT_TYPE && (A = 6);
|
|
9529
9531
|
do {
|
|
9530
|
-
var
|
|
9531
|
-
if (
|
|
9532
|
-
|
|
9532
|
+
var w, x, N, D, M = y.width[A];
|
|
9533
|
+
if (E += M, !(T[A] >= 1) && (X1.sort(S, E - M, M), !BitStream.EQ(S[E - 1], 0))) {
|
|
9534
|
+
w = (1 - T[A]) * m[A], x = 0, D = 0;
|
|
9533
9535
|
do {
|
|
9534
9536
|
var P;
|
|
9535
|
-
for (N = 1; D + N < M && !BitStream.NEQ(S[D +
|
|
9537
|
+
for (N = 1; D + N < M && !BitStream.NEQ(S[D + E - M], S[D + E + N - M]); N++)
|
|
9536
9538
|
;
|
|
9537
|
-
if (P = S[D +
|
|
9538
|
-
D != 0 && (x = S[D +
|
|
9539
|
+
if (P = S[D + E - M] * S[D + E - M] * N, w < P) {
|
|
9540
|
+
D != 0 && (x = S[D + E - M - 1]);
|
|
9539
9541
|
break;
|
|
9540
9542
|
}
|
|
9541
|
-
|
|
9543
|
+
w -= P, D += N;
|
|
9542
9544
|
} while (D < M);
|
|
9543
9545
|
if (!BitStream.EQ(x, 0))
|
|
9544
9546
|
do
|
|
9545
|
-
Math.abs(y.xr[
|
|
9547
|
+
Math.abs(y.xr[E - M]) <= x && (y.l3_enc[E - M] = 0);
|
|
9546
9548
|
while (--M > 0);
|
|
9547
9549
|
}
|
|
9548
9550
|
} while (++A < y.psymax);
|
|
@@ -9601,10 +9603,10 @@ function $2() {
|
|
|
9601
9603
|
return y.over_count == 0 && (v = v && m.bits < y.bits), v;
|
|
9602
9604
|
}
|
|
9603
9605
|
function r(g, y, m, S, T) {
|
|
9604
|
-
var v = g.internal_flags,
|
|
9605
|
-
y.scalefac_scale == 0 ?
|
|
9606
|
-
for (var A = 0,
|
|
9607
|
-
A < m[
|
|
9606
|
+
var v = g.internal_flags, E;
|
|
9607
|
+
y.scalefac_scale == 0 ? E = 1.2968395546510096 : E = 1.6817928305074292;
|
|
9608
|
+
for (var A = 0, w = 0; w < y.sfbmax; w++)
|
|
9609
|
+
A < m[w] && (A = m[w]);
|
|
9608
9610
|
var x = v.noise_shaping_amp;
|
|
9609
9611
|
switch (x == 3 && (T ? x = 2 : x = 1), x) {
|
|
9610
9612
|
case 2:
|
|
@@ -9617,13 +9619,13 @@ function $2() {
|
|
|
9617
9619
|
A > 1 ? A = 1 : A *= 0.95;
|
|
9618
9620
|
break;
|
|
9619
9621
|
}
|
|
9620
|
-
for (var N = 0,
|
|
9621
|
-
var D = y.width[
|
|
9622
|
-
if (N += D, !(m[
|
|
9623
|
-
if (v.substep_shaping & 2 && (v.pseudohalf[
|
|
9622
|
+
for (var N = 0, w = 0; w < y.sfbmax; w++) {
|
|
9623
|
+
var D = y.width[w], M;
|
|
9624
|
+
if (N += D, !(m[w] < A)) {
|
|
9625
|
+
if (v.substep_shaping & 2 && (v.pseudohalf[w] = v.pseudohalf[w] == 0 ? 1 : 0, v.pseudohalf[w] == 0 && v.noise_shaping_amp == 2))
|
|
9624
9626
|
return;
|
|
9625
|
-
for (y.scalefac[
|
|
9626
|
-
S[N + M] *=
|
|
9627
|
+
for (y.scalefac[w]++, M = -D; M < 0; M++)
|
|
9628
|
+
S[N + M] *= E, S[N + M] > y.xrpow_max && (y.xrpow_max = S[N + M]);
|
|
9627
9629
|
if (v.noise_shaping_amp == 2)
|
|
9628
9630
|
return;
|
|
9629
9631
|
}
|
|
@@ -9631,13 +9633,13 @@ function $2() {
|
|
|
9631
9633
|
}
|
|
9632
9634
|
function o(g, y) {
|
|
9633
9635
|
for (var m = 1.2968395546510096, S = 0, T = 0; T < g.sfbmax; T++) {
|
|
9634
|
-
var v = g.width[T],
|
|
9635
|
-
if (g.preflag != 0 && (
|
|
9636
|
-
|
|
9636
|
+
var v = g.width[T], E = g.scalefac[T];
|
|
9637
|
+
if (g.preflag != 0 && (E += i.pretab[T]), S += v, E & 1) {
|
|
9638
|
+
E++;
|
|
9637
9639
|
for (var A = -v; A < 0; A++)
|
|
9638
9640
|
y[S + A] *= m, y[S + A] > g.xrpow_max && (g.xrpow_max = y[S + A]);
|
|
9639
9641
|
}
|
|
9640
|
-
g.scalefac[T] =
|
|
9642
|
+
g.scalefac[T] = E >> 1;
|
|
9641
9643
|
}
|
|
9642
9644
|
g.preflag = 0, g.scalefac_scale = 1;
|
|
9643
9645
|
}
|
|
@@ -9647,20 +9649,20 @@ function $2() {
|
|
|
9647
9649
|
if (T[S] >= 16)
|
|
9648
9650
|
return !0;
|
|
9649
9651
|
for (var v = 0; v < 3; v++) {
|
|
9650
|
-
var
|
|
9652
|
+
var E = 0, A = 0;
|
|
9651
9653
|
for (S = y.sfb_lmax + v; S < y.sfbdivide; S += 3)
|
|
9652
|
-
|
|
9654
|
+
E < T[S] && (E = T[S]);
|
|
9653
9655
|
for (; S < y.sfbmax; S += 3)
|
|
9654
9656
|
A < T[S] && (A = T[S]);
|
|
9655
|
-
if (!(
|
|
9657
|
+
if (!(E < 16 && A < 8)) {
|
|
9656
9658
|
if (y.subblock_gain[v] >= 7)
|
|
9657
9659
|
return !0;
|
|
9658
9660
|
y.subblock_gain[v]++;
|
|
9659
|
-
var
|
|
9661
|
+
var w = g.scalefac_band.l[y.sfb_lmax];
|
|
9660
9662
|
for (S = y.sfb_lmax + v; S < y.sfbmax; S += 3) {
|
|
9661
9663
|
var x, N = y.width[S], D = T[S];
|
|
9662
9664
|
if (D = D - (4 >> y.scalefac_scale), D >= 0) {
|
|
9663
|
-
T[S] = D,
|
|
9665
|
+
T[S] = D, w += N * 3;
|
|
9664
9666
|
continue;
|
|
9665
9667
|
}
|
|
9666
9668
|
T[S] = 0;
|
|
@@ -9668,16 +9670,16 @@ function $2() {
|
|
|
9668
9670
|
var M = 210 + (D << y.scalefac_scale + 1);
|
|
9669
9671
|
x = i.IPOW20(M);
|
|
9670
9672
|
}
|
|
9671
|
-
|
|
9673
|
+
w += N * (v + 1);
|
|
9672
9674
|
for (var P = -N; P < 0; P++)
|
|
9673
|
-
m[
|
|
9674
|
-
|
|
9675
|
+
m[w + P] *= x, m[w + P] > y.xrpow_max && (y.xrpow_max = m[w + P]);
|
|
9676
|
+
w += N * (3 - v - 1);
|
|
9675
9677
|
}
|
|
9676
9678
|
{
|
|
9677
9679
|
var x = i.IPOW20(202);
|
|
9678
|
-
|
|
9680
|
+
w += y.width[S] * (v + 1);
|
|
9679
9681
|
for (var P = -y.width[S]; P < 0; P++)
|
|
9680
|
-
m[
|
|
9682
|
+
m[w + P] *= x, m[w + P] > y.xrpow_max && (y.xrpow_max = m[w + P]);
|
|
9681
9683
|
}
|
|
9682
9684
|
}
|
|
9683
9685
|
}
|
|
@@ -9686,12 +9688,12 @@ function $2() {
|
|
|
9686
9688
|
function b(g, y, m, S, T) {
|
|
9687
9689
|
var v = g.internal_flags;
|
|
9688
9690
|
r(g, y, m, S, T);
|
|
9689
|
-
var
|
|
9690
|
-
return
|
|
9691
|
+
var E = p(y);
|
|
9692
|
+
return E ? !1 : (v.mode_gr == 2 ? E = l.scale_bitcount(y) : E = l.scale_bitcount_lsf(v, y), E ? (v.noise_shaping > 1 && (X1.fill(v.pseudohalf, 0), y.scalefac_scale == 0 ? (o(y, S), E = !1) : y.block_type == D0.SHORT_TYPE && v.subblock_gain > 0 && (E = h(v, y, S) || p(y))), E || (v.mode_gr == 2 ? E = l.scale_bitcount(y) : E = l.scale_bitcount_lsf(v, y)), !E) : !0);
|
|
9691
9693
|
}
|
|
9692
9694
|
this.outer_loop = function(g, y, m, S, T, v) {
|
|
9693
|
-
var
|
|
9694
|
-
if (_(
|
|
9695
|
+
var E = g.internal_flags, A = new la(), w = K1(576), x = K1(va.SFBMAX), N = new we(), D, M = new G2(), P = 9999999, L = !1, B = !1, V = 0;
|
|
9696
|
+
if (_(E, y, v, T, S), E.noise_shaping == 0)
|
|
9695
9697
|
return 100;
|
|
9696
9698
|
i.calc_noise(
|
|
9697
9699
|
y,
|
|
@@ -9701,17 +9703,17 @@ function $2() {
|
|
|
9701
9703
|
M
|
|
9702
9704
|
), N.bits = y.part2_3_length, A.assign(y);
|
|
9703
9705
|
var X = 0;
|
|
9704
|
-
for (y1.arraycopy(S, 0,
|
|
9706
|
+
for (y1.arraycopy(S, 0, w, 0, 576); !L; ) {
|
|
9705
9707
|
do {
|
|
9706
9708
|
var Z = new we(), q, k = 255;
|
|
9707
|
-
if (
|
|
9709
|
+
if (E.substep_shaping & 2 ? q = 20 : q = 3, E.sfb21_extra && (x[A.sfbmax] > 1 || A.block_type == D0.SHORT_TYPE && (x[A.sfbmax + 1] > 1 || x[A.sfbmax + 2] > 1)) || !b(g, A, x, S, B))
|
|
9708
9710
|
break;
|
|
9709
9711
|
A.scalefac_scale != 0 && (k = 254);
|
|
9710
9712
|
var I = v - A.part2_length;
|
|
9711
9713
|
if (I <= 0)
|
|
9712
9714
|
break;
|
|
9713
9715
|
for (; (A.part2_3_length = l.count_bits(
|
|
9714
|
-
|
|
9716
|
+
E,
|
|
9715
9717
|
S,
|
|
9716
9718
|
A,
|
|
9717
9719
|
M
|
|
@@ -9721,7 +9723,7 @@ function $2() {
|
|
|
9721
9723
|
break;
|
|
9722
9724
|
if (N.over_count == 0) {
|
|
9723
9725
|
for (; (A.part2_3_length = l.count_bits(
|
|
9724
|
-
|
|
9726
|
+
E,
|
|
9725
9727
|
S,
|
|
9726
9728
|
A,
|
|
9727
9729
|
M
|
|
@@ -9743,23 +9745,23 @@ function $2() {
|
|
|
9743
9745
|
A,
|
|
9744
9746
|
x
|
|
9745
9747
|
) ? 1 : 0, D != 0)
|
|
9746
|
-
P = y.part2_3_length, N = Z, y.assign(A), X = 0, y1.arraycopy(S, 0,
|
|
9747
|
-
else if (
|
|
9748
|
+
P = y.part2_3_length, N = Z, y.assign(A), X = 0, y1.arraycopy(S, 0, w, 0, 576);
|
|
9749
|
+
else if (E.full_outer_loop == 0 && (++X > q && N.over_count == 0 || E.noise_shaping_amp == 3 && B && X > 30 || E.noise_shaping_amp == 3 && B && A.global_gain - V > 15))
|
|
9748
9750
|
break;
|
|
9749
9751
|
} while (A.global_gain + A.scalefac_scale < 255);
|
|
9750
|
-
|
|
9752
|
+
E.noise_shaping_amp == 3 ? B ? L = !0 : (A.assign(y), y1.arraycopy(w, 0, S, 0, 576), X = 0, V = A.global_gain, B = !0) : L = !0;
|
|
9751
9753
|
}
|
|
9752
|
-
return U1(y.global_gain + y.scalefac_scale <= 255), g.VBR == _a.vbr_rh || g.VBR == _a.vbr_mtrh ? y1.arraycopy(
|
|
9754
|
+
return U1(y.global_gain + y.scalefac_scale <= 255), g.VBR == _a.vbr_rh || g.VBR == _a.vbr_mtrh ? y1.arraycopy(w, 0, S, 0, 576) : E.substep_shaping & 1 && trancate_smallspectrums(E, y, m, S), N.over_count;
|
|
9753
9755
|
}, this.iteration_finish_one = function(g, y, m) {
|
|
9754
9756
|
var S = g.l3_side, T = S.tt[y][m];
|
|
9755
9757
|
l.best_scalefac_store(g, y, m, S), g.use_best_huffman == 1 && l.best_huffman_divide(g, T), n.ResvAdjust(g, T);
|
|
9756
|
-
}, this.VBR_encode_granule = function(g, y, m, S, T, v,
|
|
9757
|
-
var A = g.internal_flags,
|
|
9758
|
-
U1(N <= LameInternalFlags.MAX_BITS_PER_CHANNEL), X1.fill(
|
|
9758
|
+
}, this.VBR_encode_granule = function(g, y, m, S, T, v, E) {
|
|
9759
|
+
var A = g.internal_flags, w = new la(), x = K1(576), N = E, D = E + 1, M = (E + v) / 2, P, L, B = 0, V = A.sfb21_extra;
|
|
9760
|
+
U1(N <= LameInternalFlags.MAX_BITS_PER_CHANNEL), X1.fill(w.l3_enc, 0);
|
|
9759
9761
|
do
|
|
9760
|
-
M > N - 42 ? A.sfb21_extra = !1 : A.sfb21_extra = V, L = outer_loop(g, y, m, S, T, M), L <= 0 ? (B = 1, D = y.part2_3_length,
|
|
9762
|
+
M > N - 42 ? A.sfb21_extra = !1 : A.sfb21_extra = V, L = outer_loop(g, y, m, S, T, M), L <= 0 ? (B = 1, D = y.part2_3_length, w.assign(y), y1.arraycopy(S, 0, x, 0, 576), E = D - 32, P = E - v, M = (E + v) / 2) : (v = M + 32, P = E - v, M = (E + v) / 2, B != 0 && (B = 2, y.assign(w), y1.arraycopy(x, 0, S, 0, 576)));
|
|
9761
9763
|
while (P > 12);
|
|
9762
|
-
A.sfb21_extra = V, B == 2 && y1.arraycopy(
|
|
9764
|
+
A.sfb21_extra = V, B == 2 && y1.arraycopy(w.l3_enc, 0, y.l3_enc, 0, 576), U1(y.part2_3_length <= N);
|
|
9763
9765
|
}, this.get_framebits = function(g, y) {
|
|
9764
9766
|
var m = g.internal_flags;
|
|
9765
9767
|
m.bitrate_index = m.VBR_min_bitrate;
|
|
@@ -9770,7 +9772,7 @@ function $2() {
|
|
|
9770
9772
|
var v = new MeanBits(S);
|
|
9771
9773
|
y[T] = n.ResvFrameBegin(g, v), S = v.bits;
|
|
9772
9774
|
}
|
|
9773
|
-
}, this.VBR_old_prepare = function(g, y, m, S, T, v,
|
|
9775
|
+
}, this.VBR_old_prepare = function(g, y, m, S, T, v, E, A, w) {
|
|
9774
9776
|
var x = g.internal_flags, N, D = 0, M = 1, P = 0;
|
|
9775
9777
|
x.bitrate_index = x.VBR_max_bitrate;
|
|
9776
9778
|
var L = n.ResvFrameBegin(g, new MeanBits(0)) / x.mode_gr;
|
|
@@ -9783,50 +9785,50 @@ function $2() {
|
|
|
9783
9785
|
Z.block_type != D0.SHORT_TYPE ? (D = 1.28 / (1 + Math.exp(3.5 - y[B][X] / 300)) - 0.05, N = x.PSY.mask_adjust - D) : (D = 2.56 / (1 + Math.exp(3.5 - y[B][X] / 300)) - 0.14, N = x.PSY.mask_adjust_short - D), x.masking_lower = Math.pow(
|
|
9784
9786
|
10,
|
|
9785
9787
|
N * 0.1
|
|
9786
|
-
), init_outer_loop(x, Z),
|
|
9788
|
+
), init_outer_loop(x, Z), w[B][X] = i.calc_xmin(
|
|
9787
9789
|
g,
|
|
9788
9790
|
S[B][X],
|
|
9789
9791
|
Z,
|
|
9790
9792
|
T[B][X]
|
|
9791
|
-
),
|
|
9793
|
+
), w[B][X] != 0 && (M = 0), E[B][X] = 126, P += A[B][X];
|
|
9792
9794
|
}
|
|
9793
9795
|
}
|
|
9794
9796
|
for (var B = 0; B < x.mode_gr; B++)
|
|
9795
9797
|
for (var X = 0; X < x.channels_out; X++)
|
|
9796
|
-
P > v[x.VBR_max_bitrate] && (A[B][X] *= v[x.VBR_max_bitrate], A[B][X] /= P),
|
|
9798
|
+
P > v[x.VBR_max_bitrate] && (A[B][X] *= v[x.VBR_max_bitrate], A[B][X] /= P), E[B][X] > A[B][X] && (E[B][X] = A[B][X]);
|
|
9797
9799
|
return M;
|
|
9798
9800
|
}, this.bitpressure_strategy = function(g, y, m, S) {
|
|
9799
9801
|
for (var T = 0; T < g.mode_gr; T++)
|
|
9800
9802
|
for (var v = 0; v < g.channels_out; v++) {
|
|
9801
|
-
for (var
|
|
9802
|
-
A[
|
|
9803
|
-
if (
|
|
9804
|
-
for (var x =
|
|
9805
|
-
A[
|
|
9803
|
+
for (var E = g.l3_side.tt[T][v], A = y[T][v], w = 0, x = 0; x < E.psy_lmax; x++)
|
|
9804
|
+
A[w++] *= 1 + 0.029 * x * x / D0.SBMAX_l / D0.SBMAX_l;
|
|
9805
|
+
if (E.block_type == D0.SHORT_TYPE)
|
|
9806
|
+
for (var x = E.sfb_smin; x < D0.SBMAX_s; x++)
|
|
9807
|
+
A[w++] *= 1 + 0.029 * x * x / D0.SBMAX_s / D0.SBMAX_s, A[w++] *= 1 + 0.029 * x * x / D0.SBMAX_s / D0.SBMAX_s, A[w++] *= 1 + 0.029 * x * x / D0.SBMAX_s / D0.SBMAX_s;
|
|
9806
9808
|
S[T][v] = 0 | Math.max(
|
|
9807
9809
|
m[T][v],
|
|
9808
9810
|
0.9 * S[T][v]
|
|
9809
9811
|
);
|
|
9810
9812
|
}
|
|
9811
9813
|
}, this.VBR_new_prepare = function(g, y, m, S, T, v) {
|
|
9812
|
-
var
|
|
9814
|
+
var E = g.internal_flags, A = 1, w = 0, x = 0, N;
|
|
9813
9815
|
if (g.free_format) {
|
|
9814
|
-
|
|
9815
|
-
var D = new MeanBits(
|
|
9816
|
-
N = n.ResvFrameBegin(g, D),
|
|
9816
|
+
E.bitrate_index = 0;
|
|
9817
|
+
var D = new MeanBits(w);
|
|
9818
|
+
N = n.ResvFrameBegin(g, D), w = D.bits, T[0] = N;
|
|
9817
9819
|
} else {
|
|
9818
|
-
|
|
9819
|
-
var D = new MeanBits(
|
|
9820
|
-
n.ResvFrameBegin(g, D),
|
|
9821
|
-
}
|
|
9822
|
-
for (var M = 0; M <
|
|
9823
|
-
i.on_pe(g, y, v[M],
|
|
9824
|
-
for (var P = 0; P <
|
|
9825
|
-
var L =
|
|
9826
|
-
|
|
9820
|
+
E.bitrate_index = E.VBR_max_bitrate;
|
|
9821
|
+
var D = new MeanBits(w);
|
|
9822
|
+
n.ResvFrameBegin(g, D), w = D.bits, get_framebits(g, T), N = T[E.VBR_max_bitrate];
|
|
9823
|
+
}
|
|
9824
|
+
for (var M = 0; M < E.mode_gr; M++) {
|
|
9825
|
+
i.on_pe(g, y, v[M], w, M, 0), E.mode_ext == D0.MPG_MD_MS_LR && ms_convert(E.l3_side, M);
|
|
9826
|
+
for (var P = 0; P < E.channels_out; ++P) {
|
|
9827
|
+
var L = E.l3_side.tt[M][P];
|
|
9828
|
+
E.masking_lower = Math.pow(
|
|
9827
9829
|
10,
|
|
9828
|
-
|
|
9829
|
-
), init_outer_loop(
|
|
9830
|
+
E.PSY.mask_adjust * 0.1
|
|
9831
|
+
), init_outer_loop(E, L), i.calc_xmin(
|
|
9830
9832
|
g,
|
|
9831
9833
|
m[M][P],
|
|
9832
9834
|
L,
|
|
@@ -9834,41 +9836,41 @@ function $2() {
|
|
|
9834
9836
|
) != 0 && (A = 0), x += v[M][P];
|
|
9835
9837
|
}
|
|
9836
9838
|
}
|
|
9837
|
-
for (var M = 0; M <
|
|
9838
|
-
for (var P = 0; P <
|
|
9839
|
+
for (var M = 0; M < E.mode_gr; M++)
|
|
9840
|
+
for (var P = 0; P < E.channels_out; P++)
|
|
9839
9841
|
x > N && (v[M][P] *= N, v[M][P] /= x);
|
|
9840
9842
|
return A;
|
|
9841
9843
|
}, this.calc_target_bits = function(g, y, m, S, T, v) {
|
|
9842
|
-
var
|
|
9843
|
-
|
|
9844
|
+
var E = g.internal_flags, A = E.l3_side, w, x, N, D, M = 0;
|
|
9845
|
+
E.bitrate_index = E.VBR_max_bitrate;
|
|
9844
9846
|
var P = new MeanBits(M);
|
|
9845
|
-
for (v[0] = n.ResvFrameBegin(g, P), M = P.bits,
|
|
9847
|
+
for (v[0] = n.ResvFrameBegin(g, P), M = P.bits, E.bitrate_index = 1, M = s.getframebits(g) - E.sideinfo_len * 8, T[0] = M / (E.mode_gr * E.channels_out), M = g.VBR_mean_bitrate_kbps * g.framesize * 1e3, E.substep_shaping & 1 && (M *= 1.09), M /= g.out_samplerate, M -= E.sideinfo_len * 8, M /= E.mode_gr * E.channels_out, w = 0.93 + 0.07 * (11 - g.compression_ratio) / (11 - 5.5), w < 0.9 && (w = 0.9), w > 1 && (w = 1), x = 0; x < E.mode_gr; x++) {
|
|
9846
9848
|
var L = 0;
|
|
9847
|
-
for (N = 0; N <
|
|
9848
|
-
if (S[x][N] = int(
|
|
9849
|
+
for (N = 0; N < E.channels_out; N++) {
|
|
9850
|
+
if (S[x][N] = int(w * M), y[x][N] > 700) {
|
|
9849
9851
|
var B = int((y[x][N] - 700) / 1.4), V = A.tt[x][N];
|
|
9850
|
-
S[x][N] = int(
|
|
9852
|
+
S[x][N] = int(w * M), V.block_type == D0.SHORT_TYPE && B < M / 2 && (B = M / 2), B > M * 3 / 2 ? B = M * 3 / 2 : B < 0 && (B = 0), S[x][N] += B;
|
|
9851
9853
|
}
|
|
9852
9854
|
S[x][N] > LameInternalFlags.MAX_BITS_PER_CHANNEL && (S[x][N] = LameInternalFlags.MAX_BITS_PER_CHANNEL), L += S[x][N];
|
|
9853
9855
|
}
|
|
9854
9856
|
if (L > LameInternalFlags.MAX_BITS_PER_GRANULE)
|
|
9855
|
-
for (N = 0; N <
|
|
9857
|
+
for (N = 0; N < E.channels_out; ++N)
|
|
9856
9858
|
S[x][N] *= LameInternalFlags.MAX_BITS_PER_GRANULE, S[x][N] /= L;
|
|
9857
9859
|
}
|
|
9858
|
-
if (
|
|
9859
|
-
for (x = 0; x <
|
|
9860
|
+
if (E.mode_ext == D0.MPG_MD_MS_LR)
|
|
9861
|
+
for (x = 0; x < E.mode_gr; x++)
|
|
9860
9862
|
i.reduce_side(
|
|
9861
9863
|
S[x],
|
|
9862
9864
|
m[x],
|
|
9863
|
-
M *
|
|
9865
|
+
M * E.channels_out,
|
|
9864
9866
|
LameInternalFlags.MAX_BITS_PER_GRANULE
|
|
9865
9867
|
);
|
|
9866
|
-
for (D = 0, x = 0; x <
|
|
9867
|
-
for (N = 0; N <
|
|
9868
|
+
for (D = 0, x = 0; x < E.mode_gr; x++)
|
|
9869
|
+
for (N = 0; N < E.channels_out; N++)
|
|
9868
9870
|
S[x][N] > LameInternalFlags.MAX_BITS_PER_CHANNEL && (S[x][N] = LameInternalFlags.MAX_BITS_PER_CHANNEL), D += S[x][N];
|
|
9869
9871
|
if (D > v[0])
|
|
9870
|
-
for (x = 0; x <
|
|
9871
|
-
for (N = 0; N <
|
|
9872
|
+
for (x = 0; x < E.mode_gr; x++)
|
|
9873
|
+
for (N = 0; N < E.channels_out; N++)
|
|
9872
9874
|
S[x][N] *= v[0], S[x][N] /= D;
|
|
9873
9875
|
};
|
|
9874
9876
|
}
|
|
@@ -10216,13 +10218,13 @@ function Q1() {
|
|
|
10216
10218
|
function v(M, P, L) {
|
|
10217
10219
|
M[P + 0] = 255 & (L >> 8 & 255), M[P + 1] = 255 & (L & 255);
|
|
10218
10220
|
}
|
|
10219
|
-
function
|
|
10221
|
+
function E(M, P) {
|
|
10220
10222
|
return new String(M, P, h.length(), o).equals(h) || new String(M, P, b.length(), o).equals(b);
|
|
10221
10223
|
}
|
|
10222
10224
|
function A(M, P, L) {
|
|
10223
10225
|
return 255 & (M << P | L & ~(-1 << P));
|
|
10224
10226
|
}
|
|
10225
|
-
function
|
|
10227
|
+
function w(M, P) {
|
|
10226
10228
|
var L = M.internal_flags;
|
|
10227
10229
|
P[0] = A(P[0], 8, 255), P[1] = A(P[1], 3, 7), P[1] = A(
|
|
10228
10230
|
P[1],
|
|
@@ -10242,7 +10244,7 @@ function Q1() {
|
|
|
10242
10244
|
var P = new VBRTagData(), L = 0;
|
|
10243
10245
|
P.flags = 0;
|
|
10244
10246
|
var B = M[L + 1] >> 3 & 1, V = M[L + 2] >> 2 & 3, X = M[L + 3] >> 6 & 3, Z = M[L + 2] >> 4 & 15;
|
|
10245
|
-
if (Z = Tables.bitrate_table[B][Z], M[L + 1] >> 4 == 14 ? P.samprate = Tables.samplerate_table[2][V] : P.samprate = Tables.samplerate_table[B][V], B != 0 ? X != 3 ? L += 36 : L += 21 : X != 3 ? L += 21 : L += 13, !
|
|
10247
|
+
if (Z = Tables.bitrate_table[B][Z], M[L + 1] >> 4 == 14 ? P.samprate = Tables.samplerate_table[2][V] : P.samprate = Tables.samplerate_table[B][V], B != 0 ? X != 3 ? L += 36 : L += 21 : X != 3 ? L += 21 : L += 13, !E(M, L))
|
|
10246
10248
|
return null;
|
|
10247
10249
|
L += 4, P.hId = B;
|
|
10248
10250
|
var q = P.flags = S(M, L);
|
|
@@ -10267,7 +10269,7 @@ function Q1() {
|
|
|
10267
10269
|
}
|
|
10268
10270
|
P.VBR_seek_table.nVbrNumFrames = 0, P.VBR_seek_table.nBytesWritten = 0, P.VBR_seek_table.sum = 0, P.VBR_seek_table.seen = 0, P.VBR_seek_table.want = 1, P.VBR_seek_table.pos = 0, P.VBR_seek_table.bag == null && (P.VBR_seek_table.bag = new int[400](), P.VBR_seek_table.size = 400);
|
|
10269
10271
|
var X = te(_);
|
|
10270
|
-
|
|
10272
|
+
w(M, X);
|
|
10271
10273
|
for (var Z = P.VBR_seek_table.TotalFrameSize, q = 0; q < Z; ++q)
|
|
10272
10274
|
n.add_dummy_byte(M, X[q] & 255, 1);
|
|
10273
10275
|
};
|
|
@@ -10280,7 +10282,7 @@ function Q1() {
|
|
|
10280
10282
|
M[0] = x(P[L + V], M[0]);
|
|
10281
10283
|
};
|
|
10282
10284
|
function N(M, P, L, B, V) {
|
|
10283
|
-
var X = M.internal_flags, Z = 0, q = M.encoder_delay, k = M.encoder_padding, I = 100 - 10 * M.VBR_q - M.quality, O = i.getLameVeryShortVersion(), F, j = 0, he, Xe = [1, 5, 3, 2, 4, 0, 3], Q = 0 | (M.lowpassfreq / 100 + 0.5 > 255 ? 255 : M.lowpassfreq / 100 + 0.5), Ce = 0, rt = 0, ct = 0, yt = M.internal_flags.noise_shaping, mt = 0, ht = 0,
|
|
10285
|
+
var X = M.internal_flags, Z = 0, q = M.encoder_delay, k = M.encoder_padding, I = 100 - 10 * M.VBR_q - M.quality, O = i.getLameVeryShortVersion(), F, j = 0, he, Xe = [1, 5, 3, 2, 4, 0, 3], Q = 0 | (M.lowpassfreq / 100 + 0.5 > 255 ? 255 : M.lowpassfreq / 100 + 0.5), Ce = 0, rt = 0, ct = 0, yt = M.internal_flags.noise_shaping, mt = 0, ht = 0, Et = 0, Ot = 0, Ht = 0, nn = (M.exp_nspsytune & 1) != 0, C = (M.exp_nspsytune & 2) != 0, U = !1, Tt = !1, gt = M.internal_flags.nogap_total, kt = M.internal_flags.nogap_current, Dt = M.ATHtype, _t = 0, Rt;
|
|
10284
10286
|
switch (M.VBR) {
|
|
10285
10287
|
case vbr_abr:
|
|
10286
10288
|
Rt = M.VBR_mean_bitrate_kbps;
|
|
@@ -10309,8 +10311,8 @@ function Q1() {
|
|
|
10309
10311
|
mt = 7;
|
|
10310
10312
|
break;
|
|
10311
10313
|
}
|
|
10312
|
-
M.in_samplerate <= 32e3 ?
|
|
10313
|
-
M.scale_left < M.scale_right || M.scale_left > M.scale_right || M.disable_reservoir && M.brate < 320 || M.noATH || M.ATHonly || Dt == 0 || M.in_samplerate <= 32e3) && (ht = 1), Ot = yt + (mt << 2) + (ht << 5) + (
|
|
10314
|
+
M.in_samplerate <= 32e3 ? Et = 0 : M.in_samplerate == 48e3 ? Et = 2 : M.in_samplerate > 48e3 ? Et = 3 : Et = 1, (M.short_blocks == ha.short_block_forced || M.short_blocks == ha.short_block_dispensed || M.lowpassfreq == -1 && M.highpassfreq == -1 || /* "-k" */
|
|
10315
|
+
M.scale_left < M.scale_right || M.scale_left > M.scale_right || M.disable_reservoir && M.brate < 320 || M.noATH || M.ATHonly || Dt == 0 || M.in_samplerate <= 32e3) && (ht = 1), Ot = yt + (mt << 2) + (ht << 5) + (Et << 6), Ht = X.nMusicCRC, T(L, B + Z, I), Z += 4;
|
|
10314
10316
|
for (var Lt = 0; Lt < 9; Lt++)
|
|
10315
10317
|
L[B + Z + Lt] = 255 & O.charAt(Lt);
|
|
10316
10318
|
Z += 9, L[B + Z] = 255 & he, Z++, L[B + Z] = 255 & Q, Z++, T(
|
|
@@ -10343,7 +10345,7 @@ function Q1() {
|
|
|
10343
10345
|
return 0;
|
|
10344
10346
|
if (P.length < L.VBR_seek_table.TotalFrameSize)
|
|
10345
10347
|
return L.VBR_seek_table.TotalFrameSize;
|
|
10346
|
-
z2.fill(P, 0, L.VBR_seek_table.TotalFrameSize, 0),
|
|
10348
|
+
z2.fill(P, 0, L.VBR_seek_table.TotalFrameSize, 0), w(M, P);
|
|
10347
10349
|
var B = te(d);
|
|
10348
10350
|
if (M.free_format)
|
|
10349
10351
|
for (var V = 1; V < d; ++V)
|
|
@@ -10393,8 +10395,8 @@ function cr(s, n, i) {
|
|
|
10393
10395
|
var y = 1152, m = 0 | 1.25 * y + 7200, S = ua(m);
|
|
10394
10396
|
this.encodeBuffer = function(T, v) {
|
|
10395
10397
|
s == 1 && (v = T), er(T.length == v.length), T.length > y && (y = T.length, m = 0 | 1.25 * y + 7200, S = ua(m));
|
|
10396
|
-
var
|
|
10397
|
-
return new Int8Array(S.subarray(0,
|
|
10398
|
+
var E = c.lame_encode_buffer(g, T, v, T.length, S, 0, m);
|
|
10399
|
+
return new Int8Array(S.subarray(0, E));
|
|
10398
10400
|
}, this.flush = function() {
|
|
10399
10401
|
var T = c.lame_encode_flush(g, S, 0, m);
|
|
10400
10402
|
return new Int8Array(S.subarray(0, T));
|
|
@@ -11353,11 +11355,11 @@ function requireOrtWeb_min() {
|
|
|
11353
11355
|
}));
|
|
11354
11356
|
var o, h, b, g, y, m, S = Object.assign({}, t), T = "./this.program", v = (R, H) => {
|
|
11355
11357
|
throw H;
|
|
11356
|
-
},
|
|
11358
|
+
}, E = typeof window == "object", A = typeof importScripts == "function", w = typeof process == "object" && typeof process.versions == "object" && typeof process.versions.node == "string", x = t.ENVIRONMENT_IS_PTHREAD || !1, N = "";
|
|
11357
11359
|
function D(R) {
|
|
11358
11360
|
return t.locateFile ? t.locateFile(R, N) : N + R;
|
|
11359
11361
|
}
|
|
11360
|
-
if (
|
|
11362
|
+
if (w) {
|
|
11361
11363
|
let R;
|
|
11362
11364
|
N = A ? i(908).dirname(N) + "/" : "//", m = () => {
|
|
11363
11365
|
y || (g = i(1384), y = i(908));
|
|
@@ -11383,7 +11385,7 @@ function requireOrtWeb_min() {
|
|
|
11383
11385
|
throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'), H;
|
|
11384
11386
|
}
|
|
11385
11387
|
i.g.Worker = R.Worker;
|
|
11386
|
-
} else (
|
|
11388
|
+
} else (E || A) && (A ? N = self.location.href : typeof document < "u" && document.currentScript && (N = document.currentScript.src), c && (N = c), N = N.indexOf("blob:") !== 0 ? N.substr(0, N.replace(/[?#].*/, "").lastIndexOf("/") + 1) : "", w || (o = (R) => {
|
|
11387
11389
|
var H = new XMLHttpRequest();
|
|
11388
11390
|
return H.open("GET", R, !1), H.send(null), H.responseText;
|
|
11389
11391
|
}, A && (b = (R) => {
|
|
@@ -11395,9 +11397,9 @@ function requireOrtWeb_min() {
|
|
|
11395
11397
|
le.status == 200 || le.status == 0 && le.response ? H(le.response) : K();
|
|
11396
11398
|
}, le.onerror = K, le.send(null);
|
|
11397
11399
|
}));
|
|
11398
|
-
|
|
11400
|
+
w && typeof performance > "u" && (i.g.performance = i(6953).performance);
|
|
11399
11401
|
var M = console.log.bind(console), P = console.warn.bind(console);
|
|
11400
|
-
|
|
11402
|
+
w && (m(), M = (R) => g.writeSync(1, R + `
|
|
11401
11403
|
`), P = (R) => g.writeSync(2, R + `
|
|
11402
11404
|
`));
|
|
11403
11405
|
var L, B = t.print || M, V = t.printErr || P;
|
|
@@ -11467,9 +11469,9 @@ function requireOrtWeb_min() {
|
|
|
11467
11469
|
var ht = t.INITIAL_MEMORY || 16777216;
|
|
11468
11470
|
if (x) Z = t.wasmMemory, k = t.buffer;
|
|
11469
11471
|
else if (t.wasmMemory) Z = t.wasmMemory;
|
|
11470
|
-
else if (!((Z = new WebAssembly.Memory({ initial: ht / 65536, maximum: 65536, shared: !0 })).buffer instanceof SharedArrayBuffer)) throw V("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"),
|
|
11472
|
+
else if (!((Z = new WebAssembly.Memory({ initial: ht / 65536, maximum: 65536, shared: !0 })).buffer instanceof SharedArrayBuffer)) throw V("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag"), w && console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)"), Error("bad memory");
|
|
11471
11473
|
Z && (k = Z.buffer), ht = k.byteLength, mt(k);
|
|
11472
|
-
var
|
|
11474
|
+
var Et, Ot = [], Ht = [], nn = [], C = [];
|
|
11473
11475
|
function U() {
|
|
11474
11476
|
return X || !1;
|
|
11475
11477
|
}
|
|
@@ -11512,12 +11514,12 @@ function requireOrtWeb_min() {
|
|
|
11512
11514
|
}, H.loaded && (H.$b(), delete H.$b), 0;
|
|
11513
11515
|
}
|
|
11514
11516
|
function $(R) {
|
|
11515
|
-
if (x) return
|
|
11517
|
+
if (x) return wt(1, 1, R);
|
|
11516
11518
|
U() || (z.oc(), t.onExit && t.onExit(R), Xe = !0), v(R, new St(R));
|
|
11517
11519
|
}
|
|
11518
11520
|
function G(R, H) {
|
|
11519
11521
|
if (!H && x) throw Y(R), "unwind";
|
|
11520
|
-
U() || x || (Pn(), oe(nn), mn(0), vn[1].length &&
|
|
11522
|
+
U() || x || (Pn(), oe(nn), mn(0), vn[1].length && En(1, 10), vn[2].length && En(2, 10), z.oc()), $(R);
|
|
11521
11523
|
}
|
|
11522
11524
|
var z = { Yb: [], ac: [], qc: [], Vb: {}, fc: function() {
|
|
11523
11525
|
x && z.Ec();
|
|
@@ -11545,7 +11547,7 @@ function requireOrtWeb_min() {
|
|
|
11545
11547
|
z.Bc = void 0;
|
|
11546
11548
|
}, R.onerror = (K) => {
|
|
11547
11549
|
throw V("worker sent an error! " + K.filename + ":" + K.lineno + ": " + K.message), K;
|
|
11548
|
-
},
|
|
11550
|
+
}, w && (R.on("message", (function(K) {
|
|
11549
11551
|
R.onmessage({ data: K });
|
|
11550
11552
|
})), R.on("error", (function(K) {
|
|
11551
11553
|
R.onerror(K);
|
|
@@ -11565,7 +11567,7 @@ function requireOrtWeb_min() {
|
|
|
11565
11567
|
return R = R(), Gt(H), R;
|
|
11566
11568
|
}
|
|
11567
11569
|
function Y(R) {
|
|
11568
|
-
if (x) return
|
|
11570
|
+
if (x) return wt(2, 0, R);
|
|
11569
11571
|
try {
|
|
11570
11572
|
G(R);
|
|
11571
11573
|
} catch (H) {
|
|
@@ -11579,7 +11581,7 @@ function requireOrtWeb_min() {
|
|
|
11579
11581
|
var be = [];
|
|
11580
11582
|
function fe(R) {
|
|
11581
11583
|
var H = be[R];
|
|
11582
|
-
return H || (R >= be.length && (be.length = R + 1), be[R] = H =
|
|
11584
|
+
return H || (R >= be.length && (be.length = R + 1), be[R] = H = Et.get(R)), H;
|
|
11583
11585
|
}
|
|
11584
11586
|
t.invokeEntryPoint = function(R, H) {
|
|
11585
11587
|
R = fe(R)(H), U() ? z.nc(R) : Bn(R);
|
|
@@ -11624,7 +11626,7 @@ function requireOrtWeb_min() {
|
|
|
11624
11626
|
return Dn(new pt(R).Sb);
|
|
11625
11627
|
}
|
|
11626
11628
|
function Pt(R, H, K, le) {
|
|
11627
|
-
return x ?
|
|
11629
|
+
return x ? wt(3, 1, R, H, K, le) : tt(R, H, K, le);
|
|
11628
11630
|
}
|
|
11629
11631
|
function tt(R, H, K, le) {
|
|
11630
11632
|
if (typeof SharedArrayBuffer > "u") return V("Current environment does not support SharedArrayBuffer, pthreads are not available!"), 6;
|
|
@@ -11632,43 +11634,43 @@ function requireOrtWeb_min() {
|
|
|
11632
11634
|
return x && Ye.length === 0 ? Pt(R, H, K, le) : (R = { Ic: K, Ub: R, zc: le, Nc: Ye }, x ? (R.Oc = "spawnThread", postMessage(R, Ye), 0) : en(R));
|
|
11633
11635
|
}
|
|
11634
11636
|
function xt(R, H, K) {
|
|
11635
|
-
return x ?
|
|
11637
|
+
return x ? wt(4, 1, R, H, K) : 0;
|
|
11636
11638
|
}
|
|
11637
11639
|
function Vt(R, H) {
|
|
11638
|
-
if (x) return
|
|
11640
|
+
if (x) return wt(5, 1, R, H);
|
|
11639
11641
|
}
|
|
11640
11642
|
function ft(R, H) {
|
|
11641
|
-
if (x) return
|
|
11643
|
+
if (x) return wt(6, 1, R, H);
|
|
11642
11644
|
}
|
|
11643
11645
|
function It(R, H, K) {
|
|
11644
|
-
if (x) return
|
|
11646
|
+
if (x) return wt(7, 1, R, H, K);
|
|
11645
11647
|
}
|
|
11646
11648
|
function dt(R, H, K) {
|
|
11647
|
-
return x ?
|
|
11649
|
+
return x ? wt(8, 1, R, H, K) : 0;
|
|
11648
11650
|
}
|
|
11649
11651
|
function Nt(R, H) {
|
|
11650
|
-
if (x) return
|
|
11652
|
+
if (x) return wt(9, 1, R, H);
|
|
11651
11653
|
}
|
|
11652
11654
|
function Qt(R, H, K) {
|
|
11653
|
-
if (x) return
|
|
11655
|
+
if (x) return wt(10, 1, R, H, K);
|
|
11654
11656
|
}
|
|
11655
11657
|
function vt(R, H, K, le) {
|
|
11656
|
-
if (x) return
|
|
11658
|
+
if (x) return wt(11, 1, R, H, K, le);
|
|
11657
11659
|
}
|
|
11658
11660
|
function Bt(R, H, K, le) {
|
|
11659
|
-
if (x) return
|
|
11661
|
+
if (x) return wt(12, 1, R, H, K, le);
|
|
11660
11662
|
}
|
|
11661
11663
|
function jt(R, H, K, le) {
|
|
11662
|
-
if (x) return
|
|
11664
|
+
if (x) return wt(13, 1, R, H, K, le);
|
|
11663
11665
|
}
|
|
11664
11666
|
function tn(R) {
|
|
11665
|
-
if (x) return
|
|
11667
|
+
if (x) return wt(14, 1, R);
|
|
11666
11668
|
}
|
|
11667
11669
|
function W(R, H) {
|
|
11668
|
-
if (x) return
|
|
11670
|
+
if (x) return wt(15, 1, R, H);
|
|
11669
11671
|
}
|
|
11670
11672
|
function J(R, H, K) {
|
|
11671
|
-
if (x) return
|
|
11673
|
+
if (x) return wt(16, 1, R, H, K);
|
|
11672
11674
|
}
|
|
11673
11675
|
function ue(R) {
|
|
11674
11676
|
Atomics.store(_(), R >> 2, 1), gn() && An(R), Atomics.compareExchange(_(), R >> 2, 1, 0);
|
|
@@ -11677,10 +11679,10 @@ function requireOrtWeb_min() {
|
|
|
11677
11679
|
return p()[R >>> 2] + 4294967296 * _()[R + 4 >>> 2];
|
|
11678
11680
|
}
|
|
11679
11681
|
function et(R, H, K, le, Ye, at) {
|
|
11680
|
-
return x ?
|
|
11682
|
+
return x ? wt(17, 1, R, H, K, le, Ye, at) : -52;
|
|
11681
11683
|
}
|
|
11682
11684
|
function nt(R, H, K, le, Ye, at) {
|
|
11683
|
-
if (x) return
|
|
11685
|
+
if (x) return wt(18, 1, R, H, K, le, Ye, at);
|
|
11684
11686
|
}
|
|
11685
11687
|
function bt(R) {
|
|
11686
11688
|
var H = yt(R) + 1, K = hn(H);
|
|
@@ -11690,23 +11692,23 @@ function requireOrtWeb_min() {
|
|
|
11690
11692
|
function le(Kt) {
|
|
11691
11693
|
return (Kt = Kt.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? Kt[1] : "GMT";
|
|
11692
11694
|
}
|
|
11693
|
-
if (x) return
|
|
11695
|
+
if (x) return wt(19, 1, R, H, K);
|
|
11694
11696
|
var Ye = (/* @__PURE__ */ new Date()).getFullYear(), at = new Date(Ye, 0, 1), At = new Date(Ye, 6, 1);
|
|
11695
11697
|
Ye = at.getTimezoneOffset();
|
|
11696
11698
|
var Ft = At.getTimezoneOffset(), Yt = Math.max(Ye, Ft);
|
|
11697
11699
|
_()[R >> 2 >>> 0] = 60 * Yt, _()[H >> 2 >>> 0] = +(Ye != Ft), R = le(at), H = le(At), R = bt(R), H = bt(H), Ft < Ye ? (p()[K >> 2 >>> 0] = R, p()[K + 4 >> 2 >>> 0] = H) : (p()[K >> 2 >>> 0] = H, p()[K + 4 >> 2 >>> 0] = R);
|
|
11698
11700
|
}
|
|
11699
|
-
function
|
|
11701
|
+
function wt(R, H) {
|
|
11700
11702
|
var K = arguments.length - 2, le = arguments;
|
|
11701
11703
|
return ve((() => {
|
|
11702
11704
|
for (var Ye = Fn(8 * K), at = Ye >> 3, At = 0; At < K; At++) {
|
|
11703
11705
|
var Ft = le[2 + At];
|
|
11704
11706
|
a()[at + At >>> 0] = Ft;
|
|
11705
11707
|
}
|
|
11706
|
-
return
|
|
11708
|
+
return wn(R, K, Ye, H);
|
|
11707
11709
|
}));
|
|
11708
11710
|
}
|
|
11709
|
-
t.executeNotifiedProxyingQueue = ue, st =
|
|
11711
|
+
t.executeNotifiedProxyingQueue = ue, st = w ? () => {
|
|
11710
11712
|
var R = process.hrtime();
|
|
11711
11713
|
return 1e3 * R[0] + R[1] / 1e6;
|
|
11712
11714
|
} : x ? () => performance.now() - t.__performance_now_clock_drift : () => performance.now();
|
|
@@ -11722,7 +11724,7 @@ function requireOrtWeb_min() {
|
|
|
11722
11724
|
return $t;
|
|
11723
11725
|
}
|
|
11724
11726
|
function it(R, H) {
|
|
11725
|
-
if (x) return
|
|
11727
|
+
if (x) return wt(20, 1, R, H);
|
|
11726
11728
|
var K = 0;
|
|
11727
11729
|
return on().forEach((function(le, Ye) {
|
|
11728
11730
|
var at = H + K;
|
|
@@ -11731,7 +11733,7 @@ function requireOrtWeb_min() {
|
|
|
11731
11733
|
})), 0;
|
|
11732
11734
|
}
|
|
11733
11735
|
function zt(R, H) {
|
|
11734
|
-
if (x) return
|
|
11736
|
+
if (x) return wt(21, 1, R, H);
|
|
11735
11737
|
var K = on();
|
|
11736
11738
|
p()[R >> 2 >>> 0] = K.length;
|
|
11737
11739
|
var le = 0;
|
|
@@ -11740,25 +11742,25 @@ function requireOrtWeb_min() {
|
|
|
11740
11742
|
})), p()[H >> 2 >>> 0] = le, 0;
|
|
11741
11743
|
}
|
|
11742
11744
|
function Ut(R) {
|
|
11743
|
-
return x ?
|
|
11745
|
+
return x ? wt(22, 1, R) : 52;
|
|
11744
11746
|
}
|
|
11745
11747
|
function fn(R, H, K, le) {
|
|
11746
|
-
return x ?
|
|
11748
|
+
return x ? wt(23, 1, R, H, K, le) : 52;
|
|
11747
11749
|
}
|
|
11748
11750
|
function dn(R, H, K, le, Ye) {
|
|
11749
|
-
return x ?
|
|
11751
|
+
return x ? wt(24, 1, R, H, K, le, Ye) : 70;
|
|
11750
11752
|
}
|
|
11751
11753
|
var vn = [null, [], []];
|
|
11752
|
-
function
|
|
11754
|
+
function En(R, H) {
|
|
11753
11755
|
var K = vn[R];
|
|
11754
11756
|
H === 0 || H === 10 ? ((R === 1 ? B : V)(Ce(K, 0)), K.length = 0) : K.push(H);
|
|
11755
11757
|
}
|
|
11756
11758
|
function kn(R, H, K, le) {
|
|
11757
|
-
if (x) return
|
|
11759
|
+
if (x) return wt(25, 1, R, H, K, le);
|
|
11758
11760
|
for (var Ye = 0, at = 0; at < K; at++) {
|
|
11759
11761
|
var At = p()[H >> 2 >>> 0], Ft = p()[H + 4 >> 2 >>> 0];
|
|
11760
11762
|
H += 8;
|
|
11761
|
-
for (var Yt = 0; Yt < Ft; Yt++)
|
|
11763
|
+
for (var Yt = 0; Yt < Ft; Yt++) En(R, d()[At + Yt >>> 0]);
|
|
11762
11764
|
Ye += Ft;
|
|
11763
11765
|
}
|
|
11764
11766
|
return p()[le >> 2 >>> 0] = Ye, 0;
|
|
@@ -11954,7 +11956,7 @@ function requireOrtWeb_min() {
|
|
|
11954
11956
|
}, pa: function() {
|
|
11955
11957
|
return ke;
|
|
11956
11958
|
}, Fa: function(R) {
|
|
11957
|
-
Tn(R, !A, 1, !
|
|
11959
|
+
Tn(R, !A, 1, !E), z.pc();
|
|
11958
11960
|
}, T: function(R) {
|
|
11959
11961
|
x ? postMessage({ cmd: "cleanupThread", thread: R }) : Wt(R);
|
|
11960
11962
|
}, xa: tt, j: function(R) {
|
|
@@ -11994,16 +11996,16 @@ function requireOrtWeb_min() {
|
|
|
11994
11996
|
}, y: function() {
|
|
11995
11997
|
_t("");
|
|
11996
11998
|
}, U: function() {
|
|
11997
|
-
if (!
|
|
11999
|
+
if (!w && !A) {
|
|
11998
12000
|
var R = "Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread";
|
|
11999
|
-
me || (me = {}), me[R] || (me[R] = 1,
|
|
12001
|
+
me || (me = {}), me[R] || (me[R] = 1, w && (R = "warning: " + R), V(R));
|
|
12000
12002
|
}
|
|
12001
12003
|
}, ra: function() {
|
|
12002
12004
|
return 4294901760;
|
|
12003
12005
|
}, B: st, Ia: function(R, H, K) {
|
|
12004
12006
|
d().copyWithin(R >>> 0, H >>> 0, H + K >>> 0);
|
|
12005
12007
|
}, F: function() {
|
|
12006
|
-
return
|
|
12008
|
+
return w ? i(3993).cpus().length : navigator.hardwareConcurrency;
|
|
12007
12009
|
}, Da: function(R, H, K) {
|
|
12008
12010
|
Jt.length = H, K >>= 3;
|
|
12009
12011
|
for (var le = 0; le < H; le++) Jt[le] = a()[K + le >>> 0];
|
|
@@ -12038,7 +12040,7 @@ function requireOrtWeb_min() {
|
|
|
12038
12040
|
var Ye = new Uint8Array(1);
|
|
12039
12041
|
return () => (crypto.getRandomValues(Ye), Ye[0]);
|
|
12040
12042
|
}
|
|
12041
|
-
if (
|
|
12043
|
+
if (w) try {
|
|
12042
12044
|
var at = i(Object((function() {
|
|
12043
12045
|
var At = new Error("Cannot find module 'crypto'");
|
|
12044
12046
|
throw At.code = "MODULE_NOT_FOUND", At;
|
|
@@ -12347,14 +12349,14 @@ function requireOrtWeb_min() {
|
|
|
12347
12349
|
} };
|
|
12348
12350
|
(function() {
|
|
12349
12351
|
function R(Ye, at) {
|
|
12350
|
-
t.asm = Ye.exports, z.qc.push(t.asm.sb),
|
|
12352
|
+
t.asm = Ye.exports, z.qc.push(t.asm.sb), Et = t.asm.ub, Ht.unshift(t.asm.Va), q = at, x || (kt--, t.monitorRunDependencies && t.monitorRunDependencies(kt), kt == 0 && Dt && (Ye = Dt, Dt = null, Ye()));
|
|
12351
12353
|
}
|
|
12352
12354
|
function H(Ye) {
|
|
12353
12355
|
R(Ye.instance, Ye.module);
|
|
12354
12356
|
}
|
|
12355
12357
|
function K(Ye) {
|
|
12356
12358
|
return (function() {
|
|
12357
|
-
if (!L && (
|
|
12359
|
+
if (!L && (E || A)) {
|
|
12358
12360
|
if (typeof fetch == "function" && !gt.startsWith("file://")) return fetch(gt, { credentials: "same-origin" }).then((function(at) {
|
|
12359
12361
|
if (!at.ok) throw "failed to load wasm binary file at '" + gt + "'";
|
|
12360
12362
|
return at.arrayBuffer();
|
|
@@ -12384,7 +12386,7 @@ function requireOrtWeb_min() {
|
|
|
12384
12386
|
} catch (Ye) {
|
|
12385
12387
|
return V("Module.instantiateWasm callback failed with error: " + Ye), !1;
|
|
12386
12388
|
}
|
|
12387
|
-
(L || typeof WebAssembly.instantiateStreaming != "function" || Rt() || gt.startsWith("file://") ||
|
|
12389
|
+
(L || typeof WebAssembly.instantiateStreaming != "function" || Rt() || gt.startsWith("file://") || w || typeof fetch != "function" ? K(H) : fetch(gt, { credentials: "same-origin" }).then((function(Ye) {
|
|
12388
12390
|
return WebAssembly.instantiateStreaming(Ye, le).then(H, (function(at) {
|
|
12389
12391
|
return V("wasm streaming compile failed: " + at), V("falling back to ArrayBuffer instantiation"), K(H);
|
|
12390
12392
|
}));
|
|
@@ -12452,8 +12454,8 @@ function requireOrtWeb_min() {
|
|
|
12452
12454
|
t.__emscripten_thread_crashed = function() {
|
|
12453
12455
|
return (t.__emscripten_thread_crashed = t.asm.wb).apply(null, arguments);
|
|
12454
12456
|
};
|
|
12455
|
-
var bn,
|
|
12456
|
-
return (
|
|
12457
|
+
var bn, wn = t._emscripten_run_in_main_runtime_thread_js = function() {
|
|
12458
|
+
return (wn = t._emscripten_run_in_main_runtime_thread_js = t.asm.xb).apply(null, arguments);
|
|
12457
12459
|
}, An = t.__emscripten_proxy_execute_task_queue = function() {
|
|
12458
12460
|
return (An = t.__emscripten_proxy_execute_task_queue = t.asm.yb).apply(null, arguments);
|
|
12459
12461
|
}, Ln = t.__emscripten_thread_free_data = function() {
|
|
@@ -12545,7 +12547,7 @@ function requireOrtWeb_min() {
|
|
|
12545
12547
|
})), process.on("unhandledRejection", (function(W) {
|
|
12546
12548
|
throw W;
|
|
12547
12549
|
})), g = (W, J) => {
|
|
12548
|
-
if (
|
|
12550
|
+
if (w || 0 < Q) throw process.exitCode = W, J;
|
|
12549
12551
|
J instanceof Ht || A("exiting due to exception: " + J), process.exit(W);
|
|
12550
12552
|
}, u.inspect = function() {
|
|
12551
12553
|
return "[Emscripten Module object]";
|
|
@@ -12561,9 +12563,9 @@ function requireOrtWeb_min() {
|
|
|
12561
12563
|
Fe.status == 200 || Fe.status == 0 && Fe.response ? J(Fe.response) : ue();
|
|
12562
12564
|
}, Fe.onerror = ue, Fe.send(null);
|
|
12563
12565
|
});
|
|
12564
|
-
var v,
|
|
12566
|
+
var v, E = u.print || console.log.bind(console), A = u.printErr || console.warn.bind(console);
|
|
12565
12567
|
Object.assign(u, h), h = null, u.thisProgram && (b = u.thisProgram), u.quit && (g = u.quit), u.wasmBinary && (v = u.wasmBinary);
|
|
12566
|
-
var
|
|
12568
|
+
var w = u.noExitRuntime || !1;
|
|
12567
12569
|
typeof WebAssembly != "object" && mt("no native wasm support detected");
|
|
12568
12570
|
var x, N, D, M, P, L, B = !1, V = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
|
|
12569
12571
|
function X(W, J, ue) {
|
|
@@ -12638,8 +12640,8 @@ function requireOrtWeb_min() {
|
|
|
12638
12640
|
return rt.startsWith("data:application/octet-stream;base64,");
|
|
12639
12641
|
}
|
|
12640
12642
|
if (rt = "ort-wasm.wasm", !ht()) {
|
|
12641
|
-
var
|
|
12642
|
-
rt = u.locateFile ? u.locateFile(
|
|
12643
|
+
var Et = rt;
|
|
12644
|
+
rt = u.locateFile ? u.locateFile(Et, T) : T + Et;
|
|
12643
12645
|
}
|
|
12644
12646
|
function Ot() {
|
|
12645
12647
|
var W = rt;
|
|
@@ -12720,7 +12722,7 @@ function requireOrtWeb_min() {
|
|
|
12720
12722
|
var St, Wt = [null, [], []];
|
|
12721
12723
|
function en(W, J) {
|
|
12722
12724
|
var ue = Wt[W];
|
|
12723
|
-
J === 0 || J === 10 ? ((W === 1 ?
|
|
12725
|
+
J === 0 || J === 10 ? ((W === 1 ? E : A)(X(ue, 0)), ue.length = 0) : ue.push(J);
|
|
12724
12726
|
}
|
|
12725
12727
|
var $ = 0;
|
|
12726
12728
|
function G(W) {
|
|
@@ -12760,7 +12762,7 @@ function requireOrtWeb_min() {
|
|
|
12760
12762
|
return new Date(it.getFullYear() - 1, 11, 30);
|
|
12761
12763
|
}
|
|
12762
12764
|
}
|
|
12763
|
-
function
|
|
12765
|
+
function wt(it) {
|
|
12764
12766
|
var zt = it.Bb;
|
|
12765
12767
|
for (it = new Date(new Date(it.Cb + 1900, 0, 1).getTime()); 0 < zt; ) {
|
|
12766
12768
|
var Ut = it.getMonth(), fn = (G(it.getFullYear()) ? z : oe)[Ut];
|
|
@@ -12790,9 +12792,9 @@ function requireOrtWeb_min() {
|
|
|
12790
12792
|
}, "%e": function(it) {
|
|
12791
12793
|
return et(it.Kb, 2, " ");
|
|
12792
12794
|
}, "%g": function(it) {
|
|
12793
|
-
return
|
|
12795
|
+
return wt(it).toString().substring(2);
|
|
12794
12796
|
}, "%G": function(it) {
|
|
12795
|
-
return
|
|
12797
|
+
return wt(it);
|
|
12796
12798
|
}, "%H": function(it) {
|
|
12797
12799
|
return nt(it.Gb, 2);
|
|
12798
12800
|
}, "%I": function(it) {
|
|
@@ -12954,10 +12956,10 @@ function requireOrtWeb_min() {
|
|
|
12954
12956
|
function Ct(on) {
|
|
12955
12957
|
return (on = on.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? on[1] : "GMT";
|
|
12956
12958
|
}
|
|
12957
|
-
var
|
|
12958
|
-
|
|
12959
|
+
var wt = (/* @__PURE__ */ new Date()).getFullYear(), $t = new Date(wt, 0, 1), Jt = new Date(wt, 6, 1);
|
|
12960
|
+
wt = $t.getTimezoneOffset();
|
|
12959
12961
|
var sn = Jt.getTimezoneOffset();
|
|
12960
|
-
P[et >> 2 >>> 0] = 60 * Math.max(
|
|
12962
|
+
P[et >> 2 >>> 0] = 60 * Math.max(wt, sn), P[nt >> 2 >>> 0] = +(wt != sn), et = Ct($t), nt = Ct(Jt), et = Rt(et), nt = Rt(nt), sn < wt ? (L[bt >> 2 >>> 0] = et, L[bt + 4 >> 2 >>> 0] = nt) : (L[bt >> 2 >>> 0] = nt, L[bt + 4 >> 2 >>> 0] = et);
|
|
12961
12963
|
})(J, ue, Fe));
|
|
12962
12964
|
}, B: function() {
|
|
12963
12965
|
mt("");
|
|
@@ -13003,7 +13005,7 @@ function requireOrtWeb_min() {
|
|
|
13003
13005
|
Fe += et.length + 1;
|
|
13004
13006
|
})), L[J >> 2 >>> 0] = Fe, 0;
|
|
13005
13007
|
}, ba: function(W) {
|
|
13006
|
-
|
|
13008
|
+
w || 0 < Q || (qe(), nn(he), st(0), Wt[1].length && en(1, 10), Wt[2].length && en(2, 10)), w || 0 < Q || (u.onExit && u.onExit(W), B = !0), g(W, new Ht(W));
|
|
13007
13009
|
}, E: function() {
|
|
13008
13010
|
return 52;
|
|
13009
13011
|
}, Q: function() {
|
|
@@ -13014,7 +13016,7 @@ function requireOrtWeb_min() {
|
|
|
13014
13016
|
for (var et = 0, nt = 0; nt < ue; nt++) {
|
|
13015
13017
|
var bt = L[J >> 2 >>> 0], Ct = L[J + 4 >> 2 >>> 0];
|
|
13016
13018
|
J += 8;
|
|
13017
|
-
for (var
|
|
13019
|
+
for (var wt = 0; wt < Ct; wt++) en(W, M[bt + wt >>> 0]);
|
|
13018
13020
|
et += Ct;
|
|
13019
13021
|
}
|
|
13020
13022
|
return L[Fe >> 2 >>> 0] = et, 0;
|
|
@@ -13130,40 +13132,40 @@ function requireOrtWeb_min() {
|
|
|
13130
13132
|
var Ct = ot();
|
|
13131
13133
|
try {
|
|
13132
13134
|
return _t(W)(J, ue, Fe, et, nt, bt);
|
|
13133
|
-
} catch (
|
|
13134
|
-
if (pt(Ct),
|
|
13135
|
+
} catch (wt) {
|
|
13136
|
+
if (pt(Ct), wt !== wt + 0) throw wt;
|
|
13135
13137
|
ke(1, 0);
|
|
13136
13138
|
}
|
|
13137
13139
|
}, K: function(W, J, ue, Fe, et, nt, bt, Ct) {
|
|
13138
|
-
var
|
|
13140
|
+
var wt = ot();
|
|
13139
13141
|
try {
|
|
13140
13142
|
return _t(W)(J, ue, Fe, et, nt, bt, Ct);
|
|
13141
13143
|
} catch ($t) {
|
|
13142
|
-
if (pt(
|
|
13144
|
+
if (pt(wt), $t !== $t + 0) throw $t;
|
|
13143
13145
|
ke(1, 0);
|
|
13144
13146
|
}
|
|
13145
|
-
}, D: function(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13147
|
+
}, D: function(W, J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn) {
|
|
13146
13148
|
var on = ot();
|
|
13147
13149
|
try {
|
|
13148
|
-
return _t(W)(J, ue, Fe, et, nt, bt, Ct,
|
|
13150
|
+
return _t(W)(J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn);
|
|
13149
13151
|
} catch (it) {
|
|
13150
13152
|
if (pt(on), it !== it + 0) throw it;
|
|
13151
13153
|
ke(1, 0);
|
|
13152
13154
|
}
|
|
13153
13155
|
}, X: function(W, J, ue, Fe, et, nt, bt, Ct) {
|
|
13154
|
-
var
|
|
13156
|
+
var wt = ot();
|
|
13155
13157
|
try {
|
|
13156
13158
|
return Bt(W, J, ue, Fe, et, nt, bt, Ct);
|
|
13157
13159
|
} catch ($t) {
|
|
13158
|
-
if (pt(
|
|
13160
|
+
if (pt(wt), $t !== $t + 0) throw $t;
|
|
13159
13161
|
ke(1, 0);
|
|
13160
13162
|
}
|
|
13161
13163
|
}, V: function(W, J, ue, Fe, et, nt, bt) {
|
|
13162
13164
|
var Ct = ot();
|
|
13163
13165
|
try {
|
|
13164
13166
|
return Vt(W, J, ue, Fe, et, nt, bt);
|
|
13165
|
-
} catch (
|
|
13166
|
-
if (pt(Ct),
|
|
13167
|
+
} catch (wt) {
|
|
13168
|
+
if (pt(Ct), wt !== wt + 0) throw wt;
|
|
13167
13169
|
ke(1, 0);
|
|
13168
13170
|
}
|
|
13169
13171
|
}, U: function(W, J, ue, Fe, et) {
|
|
@@ -13266,54 +13268,54 @@ function requireOrtWeb_min() {
|
|
|
13266
13268
|
var Ct = ot();
|
|
13267
13269
|
try {
|
|
13268
13270
|
_t(W)(J, ue, Fe, et, nt, bt);
|
|
13269
|
-
} catch (
|
|
13270
|
-
if (pt(Ct),
|
|
13271
|
+
} catch (wt) {
|
|
13272
|
+
if (pt(Ct), wt !== wt + 0) throw wt;
|
|
13271
13273
|
ke(1, 0);
|
|
13272
13274
|
}
|
|
13273
13275
|
}, z: function(W, J, ue, Fe, et, nt, bt, Ct) {
|
|
13274
|
-
var
|
|
13276
|
+
var wt = ot();
|
|
13275
13277
|
try {
|
|
13276
13278
|
_t(W)(J, ue, Fe, et, nt, bt, Ct);
|
|
13277
13279
|
} catch ($t) {
|
|
13278
|
-
if (pt(
|
|
13280
|
+
if (pt(wt), $t !== $t + 0) throw $t;
|
|
13279
13281
|
ke(1, 0);
|
|
13280
13282
|
}
|
|
13281
|
-
}, ga: function(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13283
|
+
}, ga: function(W, J, ue, Fe, et, nt, bt, Ct, wt) {
|
|
13282
13284
|
var $t = ot();
|
|
13283
13285
|
try {
|
|
13284
|
-
_t(W)(J, ue, Fe, et, nt, bt, Ct,
|
|
13286
|
+
_t(W)(J, ue, Fe, et, nt, bt, Ct, wt);
|
|
13285
13287
|
} catch (Jt) {
|
|
13286
13288
|
if (pt($t), Jt !== Jt + 0) throw Jt;
|
|
13287
13289
|
ke(1, 0);
|
|
13288
13290
|
}
|
|
13289
|
-
}, A: function(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13291
|
+
}, A: function(W, J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt) {
|
|
13290
13292
|
var sn = ot();
|
|
13291
13293
|
try {
|
|
13292
|
-
_t(W)(J, ue, Fe, et, nt, bt, Ct,
|
|
13294
|
+
_t(W)(J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt);
|
|
13293
13295
|
} catch (on) {
|
|
13294
13296
|
if (pt(sn), on !== on + 0) throw on;
|
|
13295
13297
|
ke(1, 0);
|
|
13296
13298
|
}
|
|
13297
|
-
}, C: function(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13299
|
+
}, C: function(W, J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn, on, it, zt, Ut) {
|
|
13298
13300
|
var fn = ot();
|
|
13299
13301
|
try {
|
|
13300
|
-
_t(W)(J, ue, Fe, et, nt, bt, Ct,
|
|
13302
|
+
_t(W)(J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn, on, it, zt, Ut);
|
|
13301
13303
|
} catch (dn) {
|
|
13302
13304
|
if (pt(fn), dn !== dn + 0) throw dn;
|
|
13303
13305
|
ke(1, 0);
|
|
13304
13306
|
}
|
|
13305
13307
|
}, aa: function(W, J, ue, Fe, et, nt, bt, Ct) {
|
|
13306
|
-
var
|
|
13308
|
+
var wt = ot();
|
|
13307
13309
|
try {
|
|
13308
13310
|
It(W, J, ue, Fe, et, nt, bt, Ct);
|
|
13309
13311
|
} catch ($t) {
|
|
13310
|
-
if (pt(
|
|
13312
|
+
if (pt(wt), $t !== $t + 0) throw $t;
|
|
13311
13313
|
ke(1, 0);
|
|
13312
13314
|
}
|
|
13313
|
-
}, _: function(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13315
|
+
}, _: function(W, J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn) {
|
|
13314
13316
|
var on = ot();
|
|
13315
13317
|
try {
|
|
13316
|
-
Nt(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13318
|
+
Nt(W, J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn);
|
|
13317
13319
|
} catch (it) {
|
|
13318
13320
|
if (pt(on), it !== it + 0) throw it;
|
|
13319
13321
|
ke(1, 0);
|
|
@@ -13732,43 +13734,43 @@ function requireOrtWeb_min() {
|
|
|
13732
13734
|
n = new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 13, 2, 96, 0, 1, 127, 96, 4, 127, 127, 127, 127, 1, 127, 3, 7, 6, 0, 1, 1, 1, 1, 1, 6, 6, 1, 127, 1, 65, 0, 11, 7, 50, 6, 3, 109, 117, 108, 0, 1, 5, 100, 105, 118, 95, 115, 0, 2, 5, 100, 105, 118, 95, 117, 0, 3, 5, 114, 101, 109, 95, 115, 0, 4, 5, 114, 101, 109, 95, 117, 0, 5, 8, 103, 101, 116, 95, 104, 105, 103, 104, 0, 0, 10, 191, 1, 6, 4, 0, 35, 0, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 126, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 127, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 128, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 129, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11, 36, 1, 1, 126, 32, 0, 173, 32, 1, 173, 66, 32, 134, 132, 32, 2, 173, 32, 3, 173, 66, 32, 134, 132, 130, 34, 4, 66, 32, 135, 167, 36, 0, 32, 4, 167, 11])), {}).exports;
|
|
13733
13735
|
} catch {
|
|
13734
13736
|
}
|
|
13735
|
-
function i(
|
|
13736
|
-
this.low = 0 |
|
|
13737
|
+
function i(w, x, N) {
|
|
13738
|
+
this.low = 0 | w, this.high = 0 | x, this.unsigned = !!N;
|
|
13737
13739
|
}
|
|
13738
|
-
function c(
|
|
13739
|
-
return (
|
|
13740
|
+
function c(w) {
|
|
13741
|
+
return (w && w.__isLong__) === !0;
|
|
13740
13742
|
}
|
|
13741
13743
|
i.prototype.__isLong__, Object.defineProperty(i.prototype, "__isLong__", { value: !0 }), i.isLong = c;
|
|
13742
13744
|
var l = {}, f = {};
|
|
13743
|
-
function u(
|
|
13745
|
+
function u(w, x) {
|
|
13744
13746
|
var N, D, M;
|
|
13745
|
-
return x ? (M = 0 <= (
|
|
13747
|
+
return x ? (M = 0 <= (w >>>= 0) && w < 256) && (D = f[w]) ? D : (N = _(w, (0 | w) < 0 ? -1 : 0, !0), M && (f[w] = N), N) : (M = -128 <= (w |= 0) && w < 128) && (D = l[w]) ? D : (N = _(w, w < 0 ? -1 : 0, !1), M && (l[w] = N), N);
|
|
13746
13748
|
}
|
|
13747
|
-
function d(
|
|
13748
|
-
if (isNaN(
|
|
13749
|
+
function d(w, x) {
|
|
13750
|
+
if (isNaN(w)) return x ? g : b;
|
|
13749
13751
|
if (x) {
|
|
13750
|
-
if (
|
|
13751
|
-
if (
|
|
13752
|
+
if (w < 0) return g;
|
|
13753
|
+
if (w >= r) return v;
|
|
13752
13754
|
} else {
|
|
13753
|
-
if (
|
|
13754
|
-
if (
|
|
13755
|
+
if (w <= -o) return E;
|
|
13756
|
+
if (w + 1 >= o) return T;
|
|
13755
13757
|
}
|
|
13756
|
-
return
|
|
13758
|
+
return w < 0 ? d(-w, x).neg() : _(w % e | 0, w / e | 0, x);
|
|
13757
13759
|
}
|
|
13758
|
-
function _(
|
|
13759
|
-
return new i(
|
|
13760
|
+
function _(w, x, N) {
|
|
13761
|
+
return new i(w, x, N);
|
|
13760
13762
|
}
|
|
13761
13763
|
i.fromInt = u, i.fromNumber = d, i.fromBits = _;
|
|
13762
13764
|
var p = Math.pow;
|
|
13763
|
-
function a(
|
|
13764
|
-
if (
|
|
13765
|
-
if (
|
|
13765
|
+
function a(w, x, N) {
|
|
13766
|
+
if (w.length === 0) throw Error("empty string");
|
|
13767
|
+
if (w === "NaN" || w === "Infinity" || w === "+Infinity" || w === "-Infinity") return b;
|
|
13766
13768
|
if (typeof x == "number" ? (N = x, x = !1) : x = !!x, (N = N || 10) < 2 || 36 < N) throw RangeError("radix");
|
|
13767
13769
|
var D;
|
|
13768
|
-
if ((D =
|
|
13769
|
-
if (D === 0) return a(
|
|
13770
|
-
for (var M = d(p(N, 8)), P = b, L = 0; L <
|
|
13771
|
-
var B = Math.min(8,
|
|
13770
|
+
if ((D = w.indexOf("-")) > 0) throw Error("interior hyphen");
|
|
13771
|
+
if (D === 0) return a(w.substring(1), x, N).neg();
|
|
13772
|
+
for (var M = d(p(N, 8)), P = b, L = 0; L < w.length; L += 8) {
|
|
13773
|
+
var B = Math.min(8, w.length - L), V = parseInt(w.substring(L, L + B), N);
|
|
13772
13774
|
if (B < 8) {
|
|
13773
13775
|
var X = d(p(N, B));
|
|
13774
13776
|
P = P.mul(X).add(d(V));
|
|
@@ -13776,8 +13778,8 @@ function requireOrtWeb_min() {
|
|
|
13776
13778
|
}
|
|
13777
13779
|
return P.unsigned = x, P;
|
|
13778
13780
|
}
|
|
13779
|
-
function t(
|
|
13780
|
-
return typeof
|
|
13781
|
+
function t(w, x) {
|
|
13782
|
+
return typeof w == "number" ? d(w, x) : typeof w == "string" ? a(w, x) : _(w.low, w.high, typeof x == "boolean" ? x : w.unsigned);
|
|
13781
13783
|
}
|
|
13782
13784
|
i.fromString = a, i.fromValue = t;
|
|
13783
13785
|
var e = 4294967296, r = e * e, o = r / 2, h = u(1 << 24), b = u(0);
|
|
@@ -13794,25 +13796,25 @@ function requireOrtWeb_min() {
|
|
|
13794
13796
|
i.MAX_VALUE = T;
|
|
13795
13797
|
var v = _(-1, -1, !0);
|
|
13796
13798
|
i.MAX_UNSIGNED_VALUE = v;
|
|
13797
|
-
var
|
|
13798
|
-
i.MIN_VALUE =
|
|
13799
|
+
var E = _(0, -2147483648, !1);
|
|
13800
|
+
i.MIN_VALUE = E;
|
|
13799
13801
|
var A = i.prototype;
|
|
13800
13802
|
A.toInt = function() {
|
|
13801
13803
|
return this.unsigned ? this.low >>> 0 : this.low;
|
|
13802
13804
|
}, A.toNumber = function() {
|
|
13803
13805
|
return this.unsigned ? (this.high >>> 0) * e + (this.low >>> 0) : this.high * e + (this.low >>> 0);
|
|
13804
|
-
}, A.toString = function(
|
|
13805
|
-
if ((
|
|
13806
|
+
}, A.toString = function(w) {
|
|
13807
|
+
if ((w = w || 10) < 2 || 36 < w) throw RangeError("radix");
|
|
13806
13808
|
if (this.isZero()) return "0";
|
|
13807
13809
|
if (this.isNegative()) {
|
|
13808
|
-
if (this.eq(
|
|
13809
|
-
var x = d(
|
|
13810
|
-
return N.toString(
|
|
13810
|
+
if (this.eq(E)) {
|
|
13811
|
+
var x = d(w), N = this.div(x), D = N.mul(x).sub(this);
|
|
13812
|
+
return N.toString(w) + D.toInt().toString(w);
|
|
13811
13813
|
}
|
|
13812
|
-
return "-" + this.neg().toString(
|
|
13814
|
+
return "-" + this.neg().toString(w);
|
|
13813
13815
|
}
|
|
13814
|
-
for (var M = d(p(
|
|
13815
|
-
var B = P.div(M), V = (P.sub(B.mul(M)).toInt() >>> 0).toString(
|
|
13816
|
+
for (var M = d(p(w, 6), this.unsigned), P = this, L = ""; ; ) {
|
|
13817
|
+
var B = P.div(M), V = (P.sub(B.mul(M)).toInt() >>> 0).toString(w);
|
|
13816
13818
|
if ((P = B).isZero()) return V + L;
|
|
13817
13819
|
for (; V.length < 6; ) V = "0" + V;
|
|
13818
13820
|
L = "" + V + L;
|
|
@@ -13826,8 +13828,8 @@ function requireOrtWeb_min() {
|
|
|
13826
13828
|
}, A.getLowBitsUnsigned = function() {
|
|
13827
13829
|
return this.low >>> 0;
|
|
13828
13830
|
}, A.getNumBitsAbs = function() {
|
|
13829
|
-
if (this.isNegative()) return this.eq(
|
|
13830
|
-
for (var
|
|
13831
|
+
if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
|
|
13832
|
+
for (var w = this.high != 0 ? this.high : this.low, x = 31; x > 0 && (w & 1 << x) == 0; x--) ;
|
|
13831
13833
|
return this.high != 0 ? x + 33 : x + 1;
|
|
13832
13834
|
}, A.isZero = function() {
|
|
13833
13835
|
return this.high === 0 && this.low === 0;
|
|
@@ -13839,99 +13841,99 @@ function requireOrtWeb_min() {
|
|
|
13839
13841
|
return (1 & this.low) == 1;
|
|
13840
13842
|
}, A.isEven = function() {
|
|
13841
13843
|
return (1 & this.low) == 0;
|
|
13842
|
-
}, A.equals = function(
|
|
13843
|
-
return c(
|
|
13844
|
-
}, A.eq = A.equals, A.notEquals = function(
|
|
13845
|
-
return !this.eq(
|
|
13846
|
-
}, A.neq = A.notEquals, A.ne = A.notEquals, A.lessThan = function(
|
|
13847
|
-
return this.comp(
|
|
13848
|
-
}, A.lt = A.lessThan, A.lessThanOrEqual = function(
|
|
13849
|
-
return this.comp(
|
|
13850
|
-
}, A.lte = A.lessThanOrEqual, A.le = A.lessThanOrEqual, A.greaterThan = function(
|
|
13851
|
-
return this.comp(
|
|
13852
|
-
}, A.gt = A.greaterThan, A.greaterThanOrEqual = function(
|
|
13853
|
-
return this.comp(
|
|
13854
|
-
}, A.gte = A.greaterThanOrEqual, A.ge = A.greaterThanOrEqual, A.compare = function(
|
|
13855
|
-
if (c(
|
|
13856
|
-
var x = this.isNegative(), N =
|
|
13857
|
-
return x && !N ? -1 : !x && N ? 1 : this.unsigned ?
|
|
13844
|
+
}, A.equals = function(w) {
|
|
13845
|
+
return c(w) || (w = t(w)), (this.unsigned === w.unsigned || this.high >>> 31 != 1 || w.high >>> 31 != 1) && this.high === w.high && this.low === w.low;
|
|
13846
|
+
}, A.eq = A.equals, A.notEquals = function(w) {
|
|
13847
|
+
return !this.eq(w);
|
|
13848
|
+
}, A.neq = A.notEquals, A.ne = A.notEquals, A.lessThan = function(w) {
|
|
13849
|
+
return this.comp(w) < 0;
|
|
13850
|
+
}, A.lt = A.lessThan, A.lessThanOrEqual = function(w) {
|
|
13851
|
+
return this.comp(w) <= 0;
|
|
13852
|
+
}, A.lte = A.lessThanOrEqual, A.le = A.lessThanOrEqual, A.greaterThan = function(w) {
|
|
13853
|
+
return this.comp(w) > 0;
|
|
13854
|
+
}, A.gt = A.greaterThan, A.greaterThanOrEqual = function(w) {
|
|
13855
|
+
return this.comp(w) >= 0;
|
|
13856
|
+
}, A.gte = A.greaterThanOrEqual, A.ge = A.greaterThanOrEqual, A.compare = function(w) {
|
|
13857
|
+
if (c(w) || (w = t(w)), this.eq(w)) return 0;
|
|
13858
|
+
var x = this.isNegative(), N = w.isNegative();
|
|
13859
|
+
return x && !N ? -1 : !x && N ? 1 : this.unsigned ? w.high >>> 0 > this.high >>> 0 || w.high === this.high && w.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(w).isNegative() ? -1 : 1;
|
|
13858
13860
|
}, A.comp = A.compare, A.negate = function() {
|
|
13859
|
-
return !this.unsigned && this.eq(
|
|
13860
|
-
}, A.neg = A.negate, A.add = function(
|
|
13861
|
-
c(
|
|
13862
|
-
var x = this.high >>> 16, N = 65535 & this.high, D = this.low >>> 16, M = 65535 & this.low, P =
|
|
13863
|
-
return Z += (q += M + (65535 &
|
|
13864
|
-
}, A.subtract = function(
|
|
13865
|
-
return c(
|
|
13866
|
-
}, A.sub = A.subtract, A.multiply = function(
|
|
13861
|
+
return !this.unsigned && this.eq(E) ? E : this.not().add(y);
|
|
13862
|
+
}, A.neg = A.negate, A.add = function(w) {
|
|
13863
|
+
c(w) || (w = t(w));
|
|
13864
|
+
var x = this.high >>> 16, N = 65535 & this.high, D = this.low >>> 16, M = 65535 & this.low, P = w.high >>> 16, L = 65535 & w.high, B = w.low >>> 16, V = 0, X = 0, Z = 0, q = 0;
|
|
13865
|
+
return Z += (q += M + (65535 & w.low)) >>> 16, X += (Z += D + B) >>> 16, V += (X += N + L) >>> 16, V += x + P, _((Z &= 65535) << 16 | (q &= 65535), (V &= 65535) << 16 | (X &= 65535), this.unsigned);
|
|
13866
|
+
}, A.subtract = function(w) {
|
|
13867
|
+
return c(w) || (w = t(w)), this.add(w.neg());
|
|
13868
|
+
}, A.sub = A.subtract, A.multiply = function(w) {
|
|
13867
13869
|
if (this.isZero()) return b;
|
|
13868
|
-
if (c(
|
|
13869
|
-
if (
|
|
13870
|
-
if (this.eq(
|
|
13871
|
-
if (
|
|
13872
|
-
if (this.isNegative()) return
|
|
13873
|
-
if (
|
|
13874
|
-
if (this.lt(h) &&
|
|
13875
|
-
var x = this.high >>> 16, N = 65535 & this.high, D = this.low >>> 16, M = 65535 & this.low, P =
|
|
13870
|
+
if (c(w) || (w = t(w)), n) return _(n.mul(this.low, this.high, w.low, w.high), n.get_high(), this.unsigned);
|
|
13871
|
+
if (w.isZero()) return b;
|
|
13872
|
+
if (this.eq(E)) return w.isOdd() ? E : b;
|
|
13873
|
+
if (w.eq(E)) return this.isOdd() ? E : b;
|
|
13874
|
+
if (this.isNegative()) return w.isNegative() ? this.neg().mul(w.neg()) : this.neg().mul(w).neg();
|
|
13875
|
+
if (w.isNegative()) return this.mul(w.neg()).neg();
|
|
13876
|
+
if (this.lt(h) && w.lt(h)) return d(this.toNumber() * w.toNumber(), this.unsigned);
|
|
13877
|
+
var x = this.high >>> 16, N = 65535 & this.high, D = this.low >>> 16, M = 65535 & this.low, P = w.high >>> 16, L = 65535 & w.high, B = w.low >>> 16, V = 65535 & w.low, X = 0, Z = 0, q = 0, k = 0;
|
|
13876
13878
|
return q += (k += M * V) >>> 16, Z += (q += D * V) >>> 16, q &= 65535, Z += (q += M * B) >>> 16, X += (Z += N * V) >>> 16, Z &= 65535, X += (Z += D * B) >>> 16, Z &= 65535, X += (Z += M * L) >>> 16, X += x * V + N * B + D * L + M * P, _((q &= 65535) << 16 | (k &= 65535), (X &= 65535) << 16 | (Z &= 65535), this.unsigned);
|
|
13877
|
-
}, A.mul = A.multiply, A.divide = function(
|
|
13878
|
-
if (c(
|
|
13879
|
+
}, A.mul = A.multiply, A.divide = function(w) {
|
|
13880
|
+
if (c(w) || (w = t(w)), w.isZero()) throw Error("division by zero");
|
|
13879
13881
|
var x, N, D;
|
|
13880
|
-
if (n) return this.unsigned || this.high !== -2147483648 ||
|
|
13882
|
+
if (n) return this.unsigned || this.high !== -2147483648 || w.low !== -1 || w.high !== -1 ? _((this.unsigned ? n.div_u : n.div_s)(this.low, this.high, w.low, w.high), n.get_high(), this.unsigned) : this;
|
|
13881
13883
|
if (this.isZero()) return this.unsigned ? g : b;
|
|
13882
13884
|
if (this.unsigned) {
|
|
13883
|
-
if (
|
|
13884
|
-
if (
|
|
13885
|
+
if (w.unsigned || (w = w.toUnsigned()), w.gt(this)) return g;
|
|
13886
|
+
if (w.gt(this.shru(1))) return m;
|
|
13885
13887
|
D = g;
|
|
13886
13888
|
} else {
|
|
13887
|
-
if (this.eq(
|
|
13888
|
-
if (
|
|
13889
|
-
if (this.isNegative()) return
|
|
13890
|
-
if (
|
|
13889
|
+
if (this.eq(E)) return w.eq(y) || w.eq(S) ? E : w.eq(E) ? y : (x = this.shr(1).div(w).shl(1)).eq(b) ? w.isNegative() ? y : S : (N = this.sub(w.mul(x)), D = x.add(N.div(w)));
|
|
13890
|
+
if (w.eq(E)) return this.unsigned ? g : b;
|
|
13891
|
+
if (this.isNegative()) return w.isNegative() ? this.neg().div(w.neg()) : this.neg().div(w).neg();
|
|
13892
|
+
if (w.isNegative()) return this.div(w.neg()).neg();
|
|
13891
13893
|
D = b;
|
|
13892
13894
|
}
|
|
13893
|
-
for (N = this; N.gte(
|
|
13894
|
-
x = Math.max(1, Math.floor(N.toNumber() /
|
|
13895
|
-
for (var M = Math.ceil(Math.log(x) / Math.LN2), P = M <= 48 ? 1 : p(2, M - 48), L = d(x), B = L.mul(
|
|
13895
|
+
for (N = this; N.gte(w); ) {
|
|
13896
|
+
x = Math.max(1, Math.floor(N.toNumber() / w.toNumber()));
|
|
13897
|
+
for (var M = Math.ceil(Math.log(x) / Math.LN2), P = M <= 48 ? 1 : p(2, M - 48), L = d(x), B = L.mul(w); B.isNegative() || B.gt(N); ) B = (L = d(x -= P, this.unsigned)).mul(w);
|
|
13896
13898
|
L.isZero() && (L = y), D = D.add(L), N = N.sub(B);
|
|
13897
13899
|
}
|
|
13898
13900
|
return D;
|
|
13899
|
-
}, A.div = A.divide, A.modulo = function(
|
|
13900
|
-
return c(
|
|
13901
|
+
}, A.div = A.divide, A.modulo = function(w) {
|
|
13902
|
+
return c(w) || (w = t(w)), n ? _((this.unsigned ? n.rem_u : n.rem_s)(this.low, this.high, w.low, w.high), n.get_high(), this.unsigned) : this.sub(this.div(w).mul(w));
|
|
13901
13903
|
}, A.mod = A.modulo, A.rem = A.modulo, A.not = function() {
|
|
13902
13904
|
return _(~this.low, ~this.high, this.unsigned);
|
|
13903
|
-
}, A.and = function(
|
|
13904
|
-
return c(
|
|
13905
|
-
}, A.or = function(
|
|
13906
|
-
return c(
|
|
13907
|
-
}, A.xor = function(
|
|
13908
|
-
return c(
|
|
13909
|
-
}, A.shiftLeft = function(
|
|
13910
|
-
return c(
|
|
13911
|
-
}, A.shl = A.shiftLeft, A.shiftRight = function(
|
|
13912
|
-
return c(
|
|
13913
|
-
}, A.shr = A.shiftRight, A.shiftRightUnsigned = function(
|
|
13914
|
-
if (c(
|
|
13905
|
+
}, A.and = function(w) {
|
|
13906
|
+
return c(w) || (w = t(w)), _(this.low & w.low, this.high & w.high, this.unsigned);
|
|
13907
|
+
}, A.or = function(w) {
|
|
13908
|
+
return c(w) || (w = t(w)), _(this.low | w.low, this.high | w.high, this.unsigned);
|
|
13909
|
+
}, A.xor = function(w) {
|
|
13910
|
+
return c(w) || (w = t(w)), _(this.low ^ w.low, this.high ^ w.high, this.unsigned);
|
|
13911
|
+
}, A.shiftLeft = function(w) {
|
|
13912
|
+
return c(w) && (w = w.toInt()), (w &= 63) == 0 ? this : w < 32 ? _(this.low << w, this.high << w | this.low >>> 32 - w, this.unsigned) : _(0, this.low << w - 32, this.unsigned);
|
|
13913
|
+
}, A.shl = A.shiftLeft, A.shiftRight = function(w) {
|
|
13914
|
+
return c(w) && (w = w.toInt()), (w &= 63) == 0 ? this : w < 32 ? _(this.low >>> w | this.high << 32 - w, this.high >> w, this.unsigned) : _(this.high >> w - 32, this.high >= 0 ? 0 : -1, this.unsigned);
|
|
13915
|
+
}, A.shr = A.shiftRight, A.shiftRightUnsigned = function(w) {
|
|
13916
|
+
if (c(w) && (w = w.toInt()), (w &= 63) == 0) return this;
|
|
13915
13917
|
var x = this.high;
|
|
13916
|
-
return
|
|
13918
|
+
return w < 32 ? _(this.low >>> w | x << 32 - w, x >>> w, this.unsigned) : _(w === 32 ? x : x >>> w - 32, 0, this.unsigned);
|
|
13917
13919
|
}, A.shru = A.shiftRightUnsigned, A.shr_u = A.shiftRightUnsigned, A.toSigned = function() {
|
|
13918
13920
|
return this.unsigned ? _(this.low, this.high, !1) : this;
|
|
13919
13921
|
}, A.toUnsigned = function() {
|
|
13920
13922
|
return this.unsigned ? this : _(this.low, this.high, !0);
|
|
13921
|
-
}, A.toBytes = function(
|
|
13922
|
-
return
|
|
13923
|
+
}, A.toBytes = function(w) {
|
|
13924
|
+
return w ? this.toBytesLE() : this.toBytesBE();
|
|
13923
13925
|
}, A.toBytesLE = function() {
|
|
13924
|
-
var
|
|
13925
|
-
return [255 & x, x >>> 8 & 255, x >>> 16 & 255, x >>> 24, 255 &
|
|
13926
|
+
var w = this.high, x = this.low;
|
|
13927
|
+
return [255 & x, x >>> 8 & 255, x >>> 16 & 255, x >>> 24, 255 & w, w >>> 8 & 255, w >>> 16 & 255, w >>> 24];
|
|
13926
13928
|
}, A.toBytesBE = function() {
|
|
13927
|
-
var
|
|
13928
|
-
return [
|
|
13929
|
-
}, i.fromBytes = function(
|
|
13930
|
-
return N ? i.fromBytesLE(
|
|
13931
|
-
}, i.fromBytesLE = function(
|
|
13932
|
-
return new i(
|
|
13933
|
-
}, i.fromBytesBE = function(
|
|
13934
|
-
return new i(
|
|
13929
|
+
var w = this.high, x = this.low;
|
|
13930
|
+
return [w >>> 24, w >>> 16 & 255, w >>> 8 & 255, 255 & w, x >>> 24, x >>> 16 & 255, x >>> 8 & 255, 255 & x];
|
|
13931
|
+
}, i.fromBytes = function(w, x, N) {
|
|
13932
|
+
return N ? i.fromBytesLE(w, x) : i.fromBytesBE(w, x);
|
|
13933
|
+
}, i.fromBytesLE = function(w, x) {
|
|
13934
|
+
return new i(w[0] | w[1] << 8 | w[2] << 16 | w[3] << 24, w[4] | w[5] << 8 | w[6] << 16 | w[7] << 24, x);
|
|
13935
|
+
}, i.fromBytesBE = function(w, x) {
|
|
13936
|
+
return new i(w[4] << 24 | w[5] << 16 | w[6] << 8 | w[7], w[0] << 24 | w[1] << 16 | w[2] << 8 | w[3], x);
|
|
13935
13937
|
};
|
|
13936
13938
|
}, 1446: (s, n, i) => {
|
|
13937
13939
|
var c, l, f, u = i(2100), d = u.Reader, _ = u.Writer, p = u.util, a = u.roots.default || (u.roots.default = {});
|
|
@@ -16266,12 +16268,12 @@ function requireOrtWeb_min() {
|
|
|
16266
16268
|
}
|
|
16267
16269
|
getPackedSamplerAtOutputCoords(a, t, e, r) {
|
|
16268
16270
|
const o = t.unpackedShape, h = e.unpackedShape, b = r, g = (0, d.generateShaderFuncNameFromInputSamplerName)(b), y = o.length, m = h.length, S = c.BroadcastUtil.getBroadcastDims(o, h), T = (0, d.getCoordsDataType)(m), v = m - y;
|
|
16269
|
-
let
|
|
16271
|
+
let E;
|
|
16270
16272
|
const A = (0, d.getGlChannels)();
|
|
16271
|
-
|
|
16273
|
+
E = y === 0 ? "" : m < 2 && S.length >= 1 ? "coords = 0;" : S.map(((P) => `coords.${A[P + v]} = 0;`)).join(`
|
|
16272
16274
|
`);
|
|
16273
|
-
let
|
|
16274
|
-
|
|
16275
|
+
let w = "";
|
|
16276
|
+
w = m < 2 && y > 0 ? "coords" : o.map(((P, L) => `coords.${A[L + v]}`)).join(", ");
|
|
16275
16277
|
let x = "return outputValue;";
|
|
16276
16278
|
const N = c.ShapeUtil.size(o) === 1, D = c.ShapeUtil.size(h) === 1;
|
|
16277
16279
|
if (y !== 1 || N || D) {
|
|
@@ -16295,8 +16297,8 @@ function requireOrtWeb_min() {
|
|
|
16295
16297
|
coords.${A[m - 1]} = coords.${A[m - 2]};
|
|
16296
16298
|
coords.${A[m - 2]} = lastDim;
|
|
16297
16299
|
|
|
16298
|
-
${
|
|
16299
|
-
vec4 outputValue = ${g}(${
|
|
16300
|
+
${E}
|
|
16301
|
+
vec4 outputValue = ${g}(${w});
|
|
16300
16302
|
${x}
|
|
16301
16303
|
}
|
|
16302
16304
|
`;
|
|
@@ -16312,13 +16314,13 @@ function requireOrtWeb_min() {
|
|
|
16312
16314
|
`;
|
|
16313
16315
|
return new l.GlslLibRoutine(D, ["coordinates.sampleTexture"]);
|
|
16314
16316
|
}
|
|
16315
|
-
const T = (0, d.getCoordsDataType)(g), v = c.BroadcastUtil.getBroadcastDims(y, m),
|
|
16317
|
+
const T = (0, d.getCoordsDataType)(g), v = c.BroadcastUtil.getBroadcastDims(y, m), E = g - b;
|
|
16316
16318
|
let A;
|
|
16317
|
-
const
|
|
16318
|
-
A = b === 0 ? "" : g < 2 && v.length >= 1 ? "coords = 0;" : v.map(((D) => `coords.${
|
|
16319
|
+
const w = (0, d.getGlChannels)();
|
|
16320
|
+
A = b === 0 ? "" : g < 2 && v.length >= 1 ? "coords = 0;" : v.map(((D) => `coords.${w[D + E]} = 0;`)).join(`
|
|
16319
16321
|
`);
|
|
16320
16322
|
let x = "";
|
|
16321
|
-
x = g < 2 && b > 0 ? "coords" : t.unpackedShape.map(((D, M) => `coords.${
|
|
16323
|
+
x = g < 2 && b > 0 ? "coords" : t.unpackedShape.map(((D, M) => `coords.${w[M + E]}`)).join(", ");
|
|
16322
16324
|
const N = `
|
|
16323
16325
|
float ${a}() {
|
|
16324
16326
|
${T} coords = getOutputCoords();
|
|
@@ -16397,9 +16399,9 @@ function requireOrtWeb_min() {
|
|
|
16397
16399
|
getPackedSampler3D(a, t, e) {
|
|
16398
16400
|
const r = e.unpackedShape, o = [e.width, e.height], h = [o[0], o[1]], b = (0, f.getGlsl)(this.context.glContext.version);
|
|
16399
16401
|
if (r[0] === 1) {
|
|
16400
|
-
const T = r.slice(1), v = [1, 2],
|
|
16401
|
-
|
|
16402
|
-
const x = this.getPackedSamplerFromInput(a, t,
|
|
16402
|
+
const T = r.slice(1), v = [1, 2], E = (0, d.squeezeInputShape)(r, T), A = ["b", "row", "col"], w = JSON.parse(JSON.stringify(e));
|
|
16403
|
+
w.unpackedShape = E;
|
|
16404
|
+
const x = this.getPackedSamplerFromInput(a, t, w), N = `${x.routineBody}
|
|
16403
16405
|
vec4 ${a}(int b, int row, int col) {
|
|
16404
16406
|
return ${a}(${(0, d.getSqueezedParams)(A, v)});
|
|
16405
16407
|
} `;
|
|
@@ -16413,10 +16415,10 @@ function requireOrtWeb_min() {
|
|
|
16413
16415
|
}
|
|
16414
16416
|
getPackedSamplerND(a, t, e) {
|
|
16415
16417
|
const r = e.unpackedShape, o = r.length, h = [e.width, e.height], b = (0, f.getGlsl)(this.context.glContext.version), g = [h[0], h[1]], y = g[1], m = g[0], S = Math.ceil(r[o - 1] / 2);
|
|
16416
|
-
let T = S * Math.ceil(r[o - 2] / 2), v = "int b, int row, int col",
|
|
16417
|
-
for (let
|
|
16418
|
+
let T = S * Math.ceil(r[o - 2] / 2), v = "int b, int row, int col", E = `b * ${T} + (row / 2) * ${S} + (col / 2)`;
|
|
16419
|
+
for (let w = 2; w < o - 1; w++) v = `int b${w}, ` + v, T *= r[o - w - 1], E = `b${w} * ${T} + ` + E;
|
|
16418
16420
|
const A = `vec4 ${a}(${v}) {
|
|
16419
|
-
int index = ${
|
|
16421
|
+
int index = ${E};
|
|
16420
16422
|
int texR = index / ${m};
|
|
16421
16423
|
int texC = index - texR * ${m};
|
|
16422
16424
|
vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${m}, ${y});
|
|
@@ -16494,10 +16496,10 @@ function requireOrtWeb_min() {
|
|
|
16494
16496
|
if (g.length < r.length) {
|
|
16495
16497
|
const T = (0, d.squeezeInputShape)(r, g), v = JSON.parse(JSON.stringify(e));
|
|
16496
16498
|
v.unpackedShape = T;
|
|
16497
|
-
const
|
|
16499
|
+
const E = ["col", "row"], A = `
|
|
16498
16500
|
${this.getUnpackedSamplerFromInput(a, t, v).routineBody}
|
|
16499
16501
|
float ${a}(int row, int col) {
|
|
16500
|
-
return ${a}(${(0, d.getSqueezedParams)(
|
|
16502
|
+
return ${a}(${(0, d.getSqueezedParams)(E, b)});
|
|
16501
16503
|
}
|
|
16502
16504
|
`;
|
|
16503
16505
|
return new l.GlslLibRoutine(A, ["coordinates.sampleTexture"]);
|
|
@@ -16539,13 +16541,13 @@ function requireOrtWeb_min() {
|
|
|
16539
16541
|
if (y.length < r.length) {
|
|
16540
16542
|
const S = (0, d.squeezeInputShape)(r, y), T = ["batch", "col", "row"], v = JSON.parse(JSON.stringify(e));
|
|
16541
16543
|
v.unpackedShape = S;
|
|
16542
|
-
const
|
|
16543
|
-
${
|
|
16544
|
+
const E = this.getUnpackedSamplerFromInput(a, t, v), A = g.reverse(), w = `
|
|
16545
|
+
${E.routineBody}
|
|
16544
16546
|
float ${a}(int batch, int row, int col) {
|
|
16545
16547
|
return ${a}(${(0, d.getSqueezedParams)(T, A)});
|
|
16546
16548
|
}
|
|
16547
16549
|
`;
|
|
16548
|
-
return new l.GlslLibRoutine(
|
|
16550
|
+
return new l.GlslLibRoutine(w, E.dependencies);
|
|
16549
16551
|
}
|
|
16550
16552
|
const m = `
|
|
16551
16553
|
float ${a}(int depth, int row, int col) {
|
|
@@ -16571,10 +16573,10 @@ function requireOrtWeb_min() {
|
|
|
16571
16573
|
getUnpackedSampler5D(a, t, e) {
|
|
16572
16574
|
const r = e.unpackedShape, o = r[4], h = r[3] * o, b = r[2] * h, g = r[1] * b, { newShape: y, keptDims: m } = (0, u.squeezeShape)(r);
|
|
16573
16575
|
if (y.length < r.length) {
|
|
16574
|
-
const T = (0, d.squeezeInputShape)(r, y), v = ["row", "col", "depth", "depth2", "depth3"],
|
|
16575
|
-
|
|
16576
|
+
const T = (0, d.squeezeInputShape)(r, y), v = ["row", "col", "depth", "depth2", "depth3"], E = JSON.parse(JSON.stringify(e));
|
|
16577
|
+
E.unpackedShape = T;
|
|
16576
16578
|
const A = `
|
|
16577
|
-
${this.getUnpackedSamplerFromInput(a, t,
|
|
16579
|
+
${this.getUnpackedSamplerFromInput(a, t, E).routineBody}
|
|
16578
16580
|
float ${a}(int row, int col, int depth, int depth2, int depth3) {
|
|
16579
16581
|
return ${a}(${(0, d.getSqueezedParams)(v, m)});
|
|
16580
16582
|
}
|
|
@@ -16594,16 +16596,16 @@ function requireOrtWeb_min() {
|
|
|
16594
16596
|
getUnpackedSampler6D(a, t, e) {
|
|
16595
16597
|
const r = e.unpackedShape, o = r[5], h = r[4] * o, b = r[3] * h, g = r[2] * b, y = r[1] * g, { newShape: m, keptDims: S } = (0, u.squeezeShape)(r);
|
|
16596
16598
|
if (m.length < r.length) {
|
|
16597
|
-
const v = (0, d.squeezeInputShape)(r, m),
|
|
16599
|
+
const v = (0, d.squeezeInputShape)(r, m), E = ["row", "col", "depth", "depth2", "depth3", "depth4"], A = JSON.parse(JSON.stringify(e));
|
|
16598
16600
|
A.unpackedShape = v;
|
|
16599
|
-
const
|
|
16601
|
+
const w = `
|
|
16600
16602
|
${this.getUnpackedSamplerFromInput(a, t, A).routineBody}
|
|
16601
16603
|
float ${a}(int row, int col, int depth,
|
|
16602
16604
|
int depth2, int depth3, int depth4) {
|
|
16603
|
-
return ${a}(${(0, d.getSqueezedParams)(
|
|
16605
|
+
return ${a}(${(0, d.getSqueezedParams)(E, S)});
|
|
16604
16606
|
}
|
|
16605
16607
|
`;
|
|
16606
|
-
return new l.GlslLibRoutine(
|
|
16608
|
+
return new l.GlslLibRoutine(w, ["coordinates.sampleTexture", "coordinates.uvFromFlat"]);
|
|
16607
16609
|
}
|
|
16608
16610
|
const T = `
|
|
16609
16611
|
float ${a}(int row, int col, int depth,
|
|
@@ -17193,8 +17195,8 @@ function requireOrtWeb_min() {
|
|
|
17193
17195
|
for (let S = 0; S < e.inputNames.length; ++S) o[S] = this.getOrCreateTextureData(r[S], e.inputTypes[S]);
|
|
17194
17196
|
const h = ((S, T) => {
|
|
17195
17197
|
const v = T.map(((A) => `${A.unpackedShape.join(",")};${A.width}x${A.height}`)).join("_");
|
|
17196
|
-
let
|
|
17197
|
-
return S.cacheHint && (
|
|
17198
|
+
let E = S.name;
|
|
17199
|
+
return S.cacheHint && (E += "[" + S.cacheHint + "]"), E += ":" + v, E;
|
|
17198
17200
|
})(e, o);
|
|
17199
17201
|
let b = this.session.programManager.getArtifact(h);
|
|
17200
17202
|
const g = b ? b.programInfo : typeof e.get == "function" ? e.get() : e, y = (0, a.createTextureLayoutFromTextureType)(this.session.layoutStrategy, g.output.dims, g.output.textureType), m = this.createTextureData(y, g.output.type);
|
|
@@ -17219,11 +17221,11 @@ function requireOrtWeb_min() {
|
|
|
17219
17221
|
const m = [y[0], Math.ceil(y[1] * y[2] * y[3] / 4)], S = (0, a.createTextureLayoutFromTextureType)(this.session.layoutStrategy, m, r);
|
|
17220
17222
|
let T = e.numberData;
|
|
17221
17223
|
if (y[1] * y[2] * y[3] % 4 != 0) {
|
|
17222
|
-
const v = y[0],
|
|
17224
|
+
const v = y[0], E = y[1] * y[2] * y[3], A = Math.ceil(E * 1 / 4) * 4;
|
|
17223
17225
|
T = new Float32Array(v * A);
|
|
17224
|
-
for (let
|
|
17225
|
-
const x =
|
|
17226
|
-
T.set(e.numberData.subarray(x, x +
|
|
17226
|
+
for (let w = 0; w < v; ++w) {
|
|
17227
|
+
const x = w * E, N = w * A + w % 1 * E;
|
|
17228
|
+
T.set(e.numberData.subarray(x, x + E), N);
|
|
17227
17229
|
}
|
|
17228
17230
|
}
|
|
17229
17231
|
return this.createTextureData(S, e.type, T, e, 1);
|
|
@@ -17310,8 +17312,8 @@ function requireOrtWeb_min() {
|
|
|
17310
17312
|
return l(q, Z), q;
|
|
17311
17313
|
};
|
|
17312
17314
|
Object.defineProperty(n, "__esModule", { value: !0 }), n.WEBGL_OP_RESOLVE_RULES = void 0;
|
|
17313
|
-
const u = i(2898), d = f(i(7839)), _ = i(4196), p = i(2069), a = i(8138), t = i(9663), e = i(5193), r = i(7992), o = i(1253), h = i(4776), b = i(6572), g = i(3346), y = i(5623), m = i(2870), S = i(2143), T = i(4939), v = i(718),
|
|
17314
|
-
n.WEBGL_OP_RESOLVE_RULES = [["Abs", "", "6+", B.abs], ["Acos", "", "7+", B.acos], ["Add", "", "7+", d.add], ["And", "", "7+", d.and], ["Asin", "", "7+", B.asin], ["Atan", "", "7+", B.atan], ["AveragePool", "", "7+", S.averagePool, S.parseAveragePoolAttributes], ["BatchNormalization", "", "7+", u.batchNormalization, u.parseBatchNormalizationAttributes], ["Cast", "", "6+", _.cast, _.parseCastAttributes], ["Ceil", "", "6+", B.ceil], ["Clip", "", "6-10", B.clip, B.parseClipAttributes], ["Clip", "", "11+", B.clipV11], ["Concat", "", "4+", p.concat, p.parseConcatAttributes], ["Conv", "", "1+", a.conv, a.parseConvAttributes], ["ConvTranspose", "", "1+", t.convTranspose, t.parseConvTransposeAttributes], ["Cos", "", "7+", B.cos], ["Div", "", "7+", d.div], ["Dropout", "", "7+", B.identity], ["DepthToSpace", "", "1+", e.depthToSpace, e.parseDepthToSpaceAttributes], ["Equal", "", "7+", d.equal], ["Elu", "", "6+", B.elu, B.parseEluAttributes], ["Exp", "", "6+", B.exp], ["Flatten", "", "1+", r.flatten, r.parseFlattenAttributes], ["Floor", "", "6+", B.floor], ["FusedConv", "com.microsoft", "1+", a.conv, a.parseConvAttributes], ["Gather", "", "1+", o.gather, o.parseGatherAttributes], ["Gemm", "", "7-10", h.gemm, h.parseGemmAttributesV7], ["Gemm", "", "11+", h.gemm, h.parseGemmAttributesV11], ["GlobalAveragePool", "", "1+", S.globalAveragePool, S.parseGlobalAveragePoolAttributes], ["GlobalMaxPool", "", "1+", S.globalMaxPool], ["Greater", "", "7+", d.greater], ["Identity", "", "1+", B.identity], ["ImageScaler", "", "1+", b.imageScaler, b.parseImageScalerAttributes], ["InstanceNormalization", "", "6+", g.instanceNormalization, g.parseInstanceNormalizationAttributes], ["LeakyRelu", "", "6+", B.leakyRelu, B.parseLeakyReluAttributes], ["Less", "", "7+", d.less], ["Log", "", "6+", B.log], ["MatMul", "", "1+", y.matMul, y.parseMatMulAttributes], ["MaxPool", "", "1+", S.maxPool, S.parseMaxPoolAttributes], ["Mul", "", "7+", d.mul], ["Neg", "", "6+", B.neg], ["Not", "", "1+", B.not], ["Or", "", "7+", d.or], ["Pad", "", "2-10", m.padV2, m.parsePadAttributesV2], ["Pad", "", "11+", m.padV11, m.parsePadAttributesV11], ["Pow", "", "7+", d.pow], ["PRelu", "", "7+", d.pRelu], ["ReduceLogSum", "", "1+", T.reduceLogSum, T.parseReduceAttributes], ["ReduceMax", "", "1+", T.reduceMax, T.parseReduceAttributes], ["ReduceMean", "", "1+", T.reduceMean, T.parseReduceAttributes], ["ReduceMin", "", "1+", T.reduceMin, T.parseReduceAttributes], ["ReduceProd", "", "1+", T.reduceProd, T.parseReduceAttributes], ["ReduceSum", "", "1-12", T.reduceSum, T.parseReduceAttributes], ["ReduceSumSquare", "", "1+", T.reduceLogSumSquare, T.parseReduceAttributes], ["Relu", "", "6+", B.relu], ["Reshape", "", "5+", v.reshape], ["Resize", "", "10",
|
|
17315
|
+
const u = i(2898), d = f(i(7839)), _ = i(4196), p = i(2069), a = i(8138), t = i(9663), e = i(5193), r = i(7992), o = i(1253), h = i(4776), b = i(6572), g = i(3346), y = i(5623), m = i(2870), S = i(2143), T = i(4939), v = i(718), E = i(2268), A = i(8117), w = i(2278), x = i(5524), N = i(5975), D = i(3933), M = i(6558), P = i(5723), L = i(3738), B = f(i(4909)), V = i(8428), X = i(9793);
|
|
17316
|
+
n.WEBGL_OP_RESOLVE_RULES = [["Abs", "", "6+", B.abs], ["Acos", "", "7+", B.acos], ["Add", "", "7+", d.add], ["And", "", "7+", d.and], ["Asin", "", "7+", B.asin], ["Atan", "", "7+", B.atan], ["AveragePool", "", "7+", S.averagePool, S.parseAveragePoolAttributes], ["BatchNormalization", "", "7+", u.batchNormalization, u.parseBatchNormalizationAttributes], ["Cast", "", "6+", _.cast, _.parseCastAttributes], ["Ceil", "", "6+", B.ceil], ["Clip", "", "6-10", B.clip, B.parseClipAttributes], ["Clip", "", "11+", B.clipV11], ["Concat", "", "4+", p.concat, p.parseConcatAttributes], ["Conv", "", "1+", a.conv, a.parseConvAttributes], ["ConvTranspose", "", "1+", t.convTranspose, t.parseConvTransposeAttributes], ["Cos", "", "7+", B.cos], ["Div", "", "7+", d.div], ["Dropout", "", "7+", B.identity], ["DepthToSpace", "", "1+", e.depthToSpace, e.parseDepthToSpaceAttributes], ["Equal", "", "7+", d.equal], ["Elu", "", "6+", B.elu, B.parseEluAttributes], ["Exp", "", "6+", B.exp], ["Flatten", "", "1+", r.flatten, r.parseFlattenAttributes], ["Floor", "", "6+", B.floor], ["FusedConv", "com.microsoft", "1+", a.conv, a.parseConvAttributes], ["Gather", "", "1+", o.gather, o.parseGatherAttributes], ["Gemm", "", "7-10", h.gemm, h.parseGemmAttributesV7], ["Gemm", "", "11+", h.gemm, h.parseGemmAttributesV11], ["GlobalAveragePool", "", "1+", S.globalAveragePool, S.parseGlobalAveragePoolAttributes], ["GlobalMaxPool", "", "1+", S.globalMaxPool], ["Greater", "", "7+", d.greater], ["Identity", "", "1+", B.identity], ["ImageScaler", "", "1+", b.imageScaler, b.parseImageScalerAttributes], ["InstanceNormalization", "", "6+", g.instanceNormalization, g.parseInstanceNormalizationAttributes], ["LeakyRelu", "", "6+", B.leakyRelu, B.parseLeakyReluAttributes], ["Less", "", "7+", d.less], ["Log", "", "6+", B.log], ["MatMul", "", "1+", y.matMul, y.parseMatMulAttributes], ["MaxPool", "", "1+", S.maxPool, S.parseMaxPoolAttributes], ["Mul", "", "7+", d.mul], ["Neg", "", "6+", B.neg], ["Not", "", "1+", B.not], ["Or", "", "7+", d.or], ["Pad", "", "2-10", m.padV2, m.parsePadAttributesV2], ["Pad", "", "11+", m.padV11, m.parsePadAttributesV11], ["Pow", "", "7+", d.pow], ["PRelu", "", "7+", d.pRelu], ["ReduceLogSum", "", "1+", T.reduceLogSum, T.parseReduceAttributes], ["ReduceMax", "", "1+", T.reduceMax, T.parseReduceAttributes], ["ReduceMean", "", "1+", T.reduceMean, T.parseReduceAttributes], ["ReduceMin", "", "1+", T.reduceMin, T.parseReduceAttributes], ["ReduceProd", "", "1+", T.reduceProd, T.parseReduceAttributes], ["ReduceSum", "", "1-12", T.reduceSum, T.parseReduceAttributes], ["ReduceSumSquare", "", "1+", T.reduceLogSumSquare, T.parseReduceAttributes], ["Relu", "", "6+", B.relu], ["Reshape", "", "5+", v.reshape], ["Resize", "", "10", E.resize, E.parseResizeAttributesV10], ["Resize", "", "11+", E.resize, E.parseResizeAttributesV11], ["Shape", "", "1+", A.shape], ["Sigmoid", "", "6+", B.sigmoid], ["Sin", "", "7+", B.sin], ["Slice", "", "10+", w.sliceV10], ["Slice", "", "1-9", w.slice, w.parseSliceAttributes], ["Softmax", "", "1-12", x.softmax, x.parseSoftmaxAttributes], ["Softmax", "", "13+", x.softmaxV13, x.parseSoftmaxAttributesV13], ["Split", "", "2-12", N.split, N.parseSplitAttributes], ["Sqrt", "", "6+", B.sqrt], ["Squeeze", "", "1-12", D.squeeze, D.parseSqueezeAttributes], ["Squeeze", "", "13+", D.squeezeV13], ["Sub", "", "7+", d.sub], ["Sum", "", "6+", M.sum], ["Tan", "", "7+", B.tan], ["Tanh", "", "6+", B.tanh], ["Tile", "", "6+", P.tile], ["Transpose", "", "1+", L.transpose, L.parseTransposeAttributes], ["Upsample", "", "7-8", X.upsample, X.parseUpsampleAttributesV7], ["Upsample", "", "9", X.upsample, X.parseUpsampleAttributesV9], ["Unsqueeze", "", "1-12", V.unsqueeze, V.parseUnsqueezeAttributes], ["Unsqueeze", "", "13+", V.unsqueezeV13], ["Xor", "", "7+", d.xor]];
|
|
17315
17317
|
}, 2898: (s, n, i) => {
|
|
17316
17318
|
Object.defineProperty(n, "__esModule", { value: !0 }), n.parseBatchNormalizationAttributes = n.batchNormalization = void 0;
|
|
17317
17319
|
const c = i(246), l = i(5060), f = i(2039), u = { name: "BatchNormalization", inputNames: ["A", "Scale", "B", "Mean", "Variance"], inputTypes: [f.TextureType.unpacked, f.TextureType.unpacked, f.TextureType.unpacked, f.TextureType.unpacked, f.TextureType.unpacked] };
|
|
@@ -17501,11 +17503,11 @@ function requireOrtWeb_min() {
|
|
|
17501
17503
|
`, name: T, type: l.FunctionType.ValueBased };
|
|
17502
17504
|
}
|
|
17503
17505
|
n.glslAdd = d, n.glslDiv = _, n.glslMul = p, n.glslSub = a, n.glslEqual = t, n.glslGreater = e, n.glslLess = r, n.glslAnd = o, n.glslOr = h, n.glslXor = b, n.glslPow = g, n.glslPRelu = y;
|
|
17504
|
-
const m = (T, v,
|
|
17506
|
+
const m = (T, v, E, A = v[0].type, w) => {
|
|
17505
17507
|
const x = T.session.pack ? u.TextureType.packed : u.TextureType.unpacked;
|
|
17506
|
-
return { name:
|
|
17507
|
-
}, S = (T, v,
|
|
17508
|
-
const
|
|
17508
|
+
return { name: E.name, inputNames: ["A", "B"], inputTypes: [x, x], cacheHint: w, get: () => S(T, v, E, A) };
|
|
17509
|
+
}, S = (T, v, E, A = v[0].type) => {
|
|
17510
|
+
const w = T.session.pack ? u.TextureType.packed : u.TextureType.unpacked, x = !c.ShapeUtil.areEqual(v[0].dims, v[1].dims);
|
|
17509
17511
|
let N = v[0].dims;
|
|
17510
17512
|
const D = T.session.pack;
|
|
17511
17513
|
if (x) {
|
|
@@ -17513,33 +17515,33 @@ function requireOrtWeb_min() {
|
|
|
17513
17515
|
if (!L) throw new Error("Can't perform binary op on the given tensors");
|
|
17514
17516
|
N = L;
|
|
17515
17517
|
const B = N.length, V = v[0].dims.length !== 0 ? v[0].dims.length : 1, X = v[1].dims.length !== 0 ? v[1].dims.length : 1, Z = v[0].dims.length !== 0 ? "bcastIndices_A(indices, aindices);" : "aindices[0] = 0;", q = v[1].dims.length !== 0 ? "bcastIndices_B(indices, bindices);" : "bindices[0] = 0;", k = (0, f.getGlsl)(T.session.backend.glContext.version), I = D ? `
|
|
17516
|
-
${
|
|
17518
|
+
${E.body}
|
|
17517
17519
|
void main() {
|
|
17518
17520
|
vec4 a = getAAtOutCoords();
|
|
17519
17521
|
vec4 b = getBAtOutCoords();
|
|
17520
|
-
vec4 result = ${
|
|
17522
|
+
vec4 result = ${E.name}(a, b);
|
|
17521
17523
|
${k.output} = result;
|
|
17522
17524
|
}` : `
|
|
17523
|
-
${
|
|
17525
|
+
${E.body}
|
|
17524
17526
|
float process(int indices[${B}]) {
|
|
17525
17527
|
int aindices[${V}];
|
|
17526
17528
|
int bindices[${X}];
|
|
17527
17529
|
${Z}
|
|
17528
17530
|
${q}
|
|
17529
|
-
return ${
|
|
17531
|
+
return ${E.name}(_A(aindices), _B(bindices));
|
|
17530
17532
|
}`;
|
|
17531
|
-
return { name:
|
|
17533
|
+
return { name: E.name, inputNames: ["A", "B"], inputTypes: [w, w], output: { dims: N, type: A, textureType: w }, shaderSource: I, hasMain: D };
|
|
17532
17534
|
}
|
|
17533
17535
|
const M = (0, f.getGlsl)(T.session.backend.glContext.version), P = `
|
|
17534
|
-
${
|
|
17536
|
+
${E.body}
|
|
17535
17537
|
void main() {
|
|
17536
17538
|
vec4 v1 = ${M.texture2D}(A, TexCoords);
|
|
17537
17539
|
vec4 v2 = ${M.texture2D}(B, TexCoords);
|
|
17538
|
-
vec4 result = ${
|
|
17540
|
+
vec4 result = ${E.name}(v1, v2);
|
|
17539
17541
|
${M.output} = result;
|
|
17540
17542
|
}
|
|
17541
17543
|
`;
|
|
17542
|
-
return { name:
|
|
17544
|
+
return { name: E.name, inputNames: ["A", "B"], inputTypes: [w, w], output: { dims: v[0].dims, type: A, textureType: w }, shaderSource: P, hasMain: !0 };
|
|
17543
17545
|
};
|
|
17544
17546
|
n.add = (T, v) => [T.run(m(T, v, d()), v)], n.and = (T, v) => [T.run(m(T, v, o(), "bool"), v)], n.div = (T, v) => [T.run(m(T, v, _()), v)], n.equal = (T, v) => [T.run(m(T, v, t(), "bool"), v)], n.greater = (T, v) => [T.run(m(T, v, e(), "bool"), v)], n.less = (T, v) => [T.run(m(T, v, r(), "bool"), v)], n.mul = (T, v) => [T.run(m(T, v, p()), v)], n.or = (T, v) => [T.run(m(T, v, h(), "bool"), v)], n.pow = (T, v) => [T.run(m(T, v, g()), v)], n.pRelu = (T, v) => [T.run(m(T, v, y()), v)], n.sub = (T, v) => [T.run(m(T, v, a()), v)], n.xor = (T, v) => [T.run(m(T, v, b(), "bool"), v)];
|
|
17545
17547
|
}, 4196: (s, n, i) => {
|
|
@@ -17566,10 +17568,10 @@ function requireOrtWeb_min() {
|
|
|
17566
17568
|
for (let k = 0; k < y.length; k++) if (k === g) m[g] += q[k];
|
|
17567
17569
|
else if (y[k] !== q[k]) throw new Error("non concat dimensions must match");
|
|
17568
17570
|
}
|
|
17569
|
-
const S = m.length, T = (0, u.getChannels)("coords", S), v = (0, f.getCoordsDataType)(S),
|
|
17571
|
+
const S = m.length, T = (0, u.getChannels)("coords", S), v = (0, f.getCoordsDataType)(S), E = (0, u.unpackFromChannel)(), A = b.map(((Z) => Z.dims)), w = (0, f.getGlChannels)(S), x = new Array(A.length - 1);
|
|
17570
17572
|
x[0] = A[0][g];
|
|
17571
17573
|
for (let Z = 1; Z < x.length; Z++) x[Z] = x[Z - 1] + A[Z][g];
|
|
17572
|
-
const N =
|
|
17574
|
+
const N = w[g], D = w.slice(-2), M = w.join();
|
|
17573
17575
|
let P = `if (${N} < ${x[0]}) {
|
|
17574
17576
|
return getChannel(
|
|
17575
17577
|
getX0(${M}), vec2(${D.join()}));
|
|
@@ -17579,26 +17581,26 @@ function requireOrtWeb_min() {
|
|
|
17579
17581
|
P += `
|
|
17580
17582
|
if (${N} < ${x[Z]} && ${N} >= ${x[Z - 1]}) {
|
|
17581
17583
|
return getChannel(
|
|
17582
|
-
getX${Z}(${d(
|
|
17584
|
+
getX${Z}(${d(w, N, q)}),
|
|
17583
17585
|
vec2(${d(D, N, q)}));
|
|
17584
17586
|
}`;
|
|
17585
17587
|
}
|
|
17586
17588
|
const L = x.length, B = x[x.length - 1];
|
|
17587
17589
|
P += `
|
|
17588
17590
|
return getChannel(
|
|
17589
|
-
getX${L}(${d(
|
|
17591
|
+
getX${L}(${d(w, N, B)}),
|
|
17590
17592
|
vec2(${d(D, N, B)}));`;
|
|
17591
17593
|
const V = (0, c.getGlsl)(o.session.backend.glContext.version), X = `
|
|
17592
|
-
${
|
|
17593
|
-
float getValue(${
|
|
17594
|
+
${E}
|
|
17595
|
+
float getValue(${w.map(((Z) => "int " + Z))}) {
|
|
17594
17596
|
${P}
|
|
17595
17597
|
}
|
|
17596
17598
|
|
|
17597
17599
|
void main() {
|
|
17598
17600
|
${v} coords = getOutputCoords();
|
|
17599
|
-
int lastDim = coords.${
|
|
17600
|
-
coords.${
|
|
17601
|
-
coords.${
|
|
17601
|
+
int lastDim = coords.${w[S - 1]};
|
|
17602
|
+
coords.${w[S - 1]} = coords.${w[S - 2]};
|
|
17603
|
+
coords.${w[S - 2]} = lastDim;
|
|
17602
17604
|
|
|
17603
17605
|
vec4 result = vec4(getValue(${T}), 0., 0., 0.);
|
|
17604
17606
|
|
|
@@ -17638,20 +17640,20 @@ function requireOrtWeb_min() {
|
|
|
17638
17640
|
const v = S[0].dims.slice();
|
|
17639
17641
|
if (T >= v.length || T < -1 * v.length) throw new Error("axis specified for concat doesn't match input dimensionality");
|
|
17640
17642
|
T < 0 && (T = v.length + T);
|
|
17641
|
-
const
|
|
17643
|
+
const E = v.slice(0);
|
|
17642
17644
|
for (let M = 1; M < S.length; M++) {
|
|
17643
17645
|
const P = S[M].dims.slice();
|
|
17644
|
-
for (let L = 0; L < v.length; L++) if (L === T)
|
|
17646
|
+
for (let L = 0; L < v.length; L++) if (L === T) E[T] += P[L];
|
|
17645
17647
|
else if (v[L] !== P[L]) throw new Error("non concat dimensions must match");
|
|
17646
17648
|
}
|
|
17647
|
-
const A =
|
|
17649
|
+
const A = E.length, w = new Array(S.length);
|
|
17648
17650
|
let x = 0;
|
|
17649
|
-
for (let M = 0; M <
|
|
17651
|
+
for (let M = 0; M < w.length; ++M) x += S[M].dims[T], w[M] = x;
|
|
17650
17652
|
let N = "";
|
|
17651
|
-
N = S.length < 5 ? d(
|
|
17653
|
+
N = S.length < 5 ? d(w) : _(w);
|
|
17652
17654
|
const D = `
|
|
17653
17655
|
${p(S.length, A)}
|
|
17654
|
-
${a(
|
|
17656
|
+
${a(w)}
|
|
17655
17657
|
${N}
|
|
17656
17658
|
float process(int indices[${A}]) {
|
|
17657
17659
|
int textureIndex = getTextureWhereDataResides (indices[${T}]);
|
|
@@ -17662,7 +17664,7 @@ function requireOrtWeb_min() {
|
|
|
17662
17664
|
|
|
17663
17665
|
return fetchDataFromCorrectTexture(textureIndex, indices);
|
|
17664
17666
|
}`;
|
|
17665
|
-
return Object.assign(Object.assign({}, m), { output: { dims:
|
|
17667
|
+
return Object.assign(Object.assign({}, m), { output: { dims: E, type: S[0].type, textureType: l.TextureType.unpacked }, shaderSource: D });
|
|
17666
17668
|
})(0, h, r, o.axis) });
|
|
17667
17669
|
}, d = (e) => `int getTextureWhereDataResides(int index) {
|
|
17668
17670
|
${e.map(((r, o) => `if(index<${r}) {return ${o};}
|
|
@@ -17697,7 +17699,7 @@ function requireOrtWeb_min() {
|
|
|
17697
17699
|
return Object.assign(Object.assign({}, t), { get: () => ((o, h, b, g) => {
|
|
17698
17700
|
const y = h.length > 2 ? "value += getBias(output_channel);" : "", m = h[0].dims.slice(), S = h[1].dims.slice(), T = S[0] / g.group;
|
|
17699
17701
|
c.Logger.verbose("GroupedConv", `autpPad:${g.autoPad}, dilations:${g.dilations}, group:${g.group}, kernelShape:${g.kernelShape}, pads:${g.pads}, strides:${g.strides}`);
|
|
17700
|
-
const v = (0, u.calculateOutputShape)(m, S, g.dilations, g.pads, g.strides),
|
|
17702
|
+
const v = (0, u.calculateOutputShape)(m, S, g.dilations, g.pads, g.strides), E = (0, l.getGlsl)(o.session.backend.glContext.version), { activationFunction: A, applyActivation: w } = (0, d.getActivationSnippet)(g), x = `
|
|
17701
17703
|
const ivec2 strides = ivec2(${g.strides[0]}, ${g.strides[1]});
|
|
17702
17704
|
const ivec2 pads = ivec2(${g.pads[0]}, ${g.pads[1]});
|
|
17703
17705
|
${A}
|
|
@@ -17731,8 +17733,8 @@ function requireOrtWeb_min() {
|
|
|
17731
17733
|
}
|
|
17732
17734
|
}
|
|
17733
17735
|
${y}
|
|
17734
|
-
${
|
|
17735
|
-
${
|
|
17736
|
+
${w}
|
|
17737
|
+
${E.output} = vec4(value, .0, .0, .0);
|
|
17736
17738
|
}
|
|
17737
17739
|
`;
|
|
17738
17740
|
return Object.assign(Object.assign({}, b), { output: { dims: v, type: h[0].type, textureType: f.TextureType.unpacked }, shaderSource: x, hasMain: !0 });
|
|
@@ -17761,10 +17763,10 @@ function requireOrtWeb_min() {
|
|
|
17761
17763
|
}, a = (r, o, h) => r.run(((b, g, y) => {
|
|
17762
17764
|
const m = (S = g.length > 2, T = y.cacheKey, { name: "ConvTranspose", inputNames: S ? ["X", "W", "B"] : ["X", "W"], inputTypes: S ? [f.TextureType.unpacked, f.TextureType.unpacked, f.TextureType.unpacked] : [f.TextureType.unpacked, f.TextureType.unpacked], cacheHint: T });
|
|
17763
17765
|
var S, T;
|
|
17764
|
-
return Object.assign(Object.assign({}, m), { get: () => ((v,
|
|
17765
|
-
const x =
|
|
17766
|
-
const ivec2 strides = ivec2(${
|
|
17767
|
-
const ivec2 pads = ivec2(${
|
|
17766
|
+
return Object.assign(Object.assign({}, m), { get: () => ((v, E, A, w) => {
|
|
17767
|
+
const x = E.length > 2 ? "getB(output_channel)" : "0.0", N = E[0].dims, D = E[1].dims, M = D[1], P = D[0] / w.group, L = [E[0].dims[0], E[1].dims[1] * w.group, ...w.outputShape], B = (0, l.getGlsl)(v.session.backend.glContext.version), { activationFunction: V, applyActivation: X } = (0, u.getActivationSnippet)(w), Z = `
|
|
17768
|
+
const ivec2 strides = ivec2(${w.strides[0]}, ${w.strides[1]});
|
|
17769
|
+
const ivec2 pads = ivec2(${w.pads[0]}, ${w.pads[1]});
|
|
17768
17770
|
${V}
|
|
17769
17771
|
void main() {
|
|
17770
17772
|
ivec4 coords = getOutputCoords();
|
|
@@ -17781,7 +17783,7 @@ function requireOrtWeb_min() {
|
|
|
17781
17783
|
int input_channel = group_id * ${P} + inChannelOffset;
|
|
17782
17784
|
for (int wWOff = 0; wWOff < ${D[2]}; wWOff++) {
|
|
17783
17785
|
for (int wHOff = 0; wHOff < ${D[3]}; wHOff++) {
|
|
17784
|
-
ivec2 wOff = ivec2(wWOff * ${
|
|
17786
|
+
ivec2 wOff = ivec2(wWOff * ${w.dilations[0]}, wHOff * ${w.dilations[1]});
|
|
17785
17787
|
ivec2 wLoc = loc - wOff;
|
|
17786
17788
|
ivec2 wLocIn = wLoc / strides;
|
|
17787
17789
|
if (
|
|
@@ -17800,25 +17802,25 @@ function requireOrtWeb_min() {
|
|
|
17800
17802
|
${B.output} = vec4(value, .0, .0, .0);
|
|
17801
17803
|
}
|
|
17802
17804
|
`;
|
|
17803
|
-
return Object.assign(Object.assign({}, A), { output: { dims: L, type:
|
|
17805
|
+
return Object.assign(Object.assign({}, A), { output: { dims: L, type: E[0].type, textureType: f.TextureType.unpacked }, shaderSource: Z, hasMain: !0 });
|
|
17804
17806
|
})(b, g, m, y) });
|
|
17805
17807
|
})(r, o, h), o), t = (r, o) => {
|
|
17806
17808
|
const h = r.kernelShape.slice();
|
|
17807
17809
|
if (r.kernelShape.length === 0) for (let m = 2; m < o[1].dims.length; ++m) h.push(o[1].dims[m]);
|
|
17808
17810
|
const b = r.pads.slice(), g = r.outputShape.slice();
|
|
17809
|
-
((m, S, T, v,
|
|
17811
|
+
((m, S, T, v, E, A, w, x) => {
|
|
17810
17812
|
const N = m.length - 2, D = x.length === 0;
|
|
17811
17813
|
for (let M = 0; M < N; ++M) {
|
|
17812
|
-
const P = D ? m[M + 2] * A[M] : x[M], L = d(m[M + 2], A[M],
|
|
17813
|
-
_(L, v,
|
|
17814
|
+
const P = D ? m[M + 2] * A[M] : x[M], L = d(m[M + 2], A[M], E[M], S[M], T[M], P);
|
|
17815
|
+
_(L, v, E, M, M + N), D && x.push(A[M] * (m[M + 2] - 1) + w[M] + (S[M] - 1) * T[M] + 1 - E[M] - E[M + N]);
|
|
17814
17816
|
}
|
|
17815
17817
|
})(o[0].dims, h, r.dilations, r.autoPad, b, r.strides, r.outputPadding, g);
|
|
17816
17818
|
const y = Object.assign({}, r);
|
|
17817
17819
|
return Object.assign(y, { kernelShape: h, pads: b, outputShape: g, cacheKey: r.cacheKey }), y;
|
|
17818
17820
|
};
|
|
17819
17821
|
n.parseConvTransposeAttributes = (r) => {
|
|
17820
|
-
const o = r.attributes, h = (0, u.parseInternalActivationAttributes)(o), b = o.getString("auto_pad", "NOTSET"), g = o.getInts("dilations", [1, 1]), y = o.getInt("group", 1), m = o.getInts("kernel_shape", []), S = o.getInts("output_padding", [0, 0]), T = o.getInts("output_shape", []), v = o.getInts("pads", [0, 0, 0, 0]),
|
|
17821
|
-
return (0, c.createAttributeWithCacheKey)(Object.assign({ autoPad: b, dilations: g, group: y, kernelShape: m, outputPadding: S, outputShape: T, pads: v, strides:
|
|
17822
|
+
const o = r.attributes, h = (0, u.parseInternalActivationAttributes)(o), b = o.getString("auto_pad", "NOTSET"), g = o.getInts("dilations", [1, 1]), y = o.getInt("group", 1), m = o.getInts("kernel_shape", []), S = o.getInts("output_padding", [0, 0]), T = o.getInts("output_shape", []), v = o.getInts("pads", [0, 0, 0, 0]), E = o.getInts("strides", [1, 1]);
|
|
17823
|
+
return (0, c.createAttributeWithCacheKey)(Object.assign({ autoPad: b, dilations: g, group: y, kernelShape: m, outputPadding: S, outputShape: T, pads: v, strides: E }, h));
|
|
17822
17824
|
};
|
|
17823
17825
|
const e = (r, o) => {
|
|
17824
17826
|
if (!r || r.length !== 2 && r.length !== 3) throw new Error("Conv requires 2 or 3 inputs");
|
|
@@ -17840,18 +17842,18 @@ function requireOrtWeb_min() {
|
|
|
17840
17842
|
Object.defineProperty(n, "__esModule", { value: !0 }), n.parseConvAttributes = n.conv = n.calculateOutputShape = void 0;
|
|
17841
17843
|
const c = i(246), l = i(2517), f = i(4770), u = i(1386), d = i(9828), _ = i(2823), p = i(3248), a = i(5623);
|
|
17842
17844
|
n.calculateOutputShape = (b, g, y, m, S) => {
|
|
17843
|
-
const T = b[0], v = b.slice(2),
|
|
17845
|
+
const T = b[0], v = b.slice(2), E = v.length, A = g[0], w = g.slice(2).map(((N, D) => N + (N - 1) * (y[D] - 1))), x = v.map(((N, D) => N + m[D] + m[D + E])).map(((N, D) => Math.floor((N - w[D] + S[D]) / S[D])));
|
|
17844
17846
|
return [T, A].concat(...x);
|
|
17845
17847
|
}, n.conv = (b, g, y) => (h(g, y), t(b, g, y));
|
|
17846
17848
|
const t = (b, g, y) => {
|
|
17847
17849
|
const m = o(y, g), S = b.session.pack, T = m.kernelShape[0] === 1 && m.kernelShape[1] === 1;
|
|
17848
17850
|
return m.group > 1 ? [b.run((0, f.createUnpackedGroupedConvProgramInfoLoader)(b, g, m), g)] : T && S ? [e(b, g, m)] : S && g[0].dims.length === 4 && g[0].dims[0] === 1 && !T ? [(0, u.conv2DPacked)(b, g, m)] : [r(b, g, m)];
|
|
17849
17851
|
}, e = (b, g, y) => {
|
|
17850
|
-
const m = g[0].dims, S = g[1].dims, T = (0, n.calculateOutputShape)(m, S, y.dilations, y.pads, y.strides), v = b.reshapeUnpacked(g[0], [m[1], m[2] * m[3]]),
|
|
17851
|
-
return b.reshapeUnpacked(
|
|
17852
|
+
const m = g[0].dims, S = g[1].dims, T = (0, n.calculateOutputShape)(m, S, y.dilations, y.pads, y.strides), v = b.reshapeUnpacked(g[0], [m[1], m[2] * m[3]]), E = b.reshapeUnpacked(g[1], [S[0], S[1]]), A = g.length > 2 ? [E, v, g[2]] : [E, v], w = b.run((0, a.createMatmulProgramInfoLoader)(A, y), A);
|
|
17853
|
+
return b.reshapeUnpacked(w, T);
|
|
17852
17854
|
}, r = (b, g, y) => {
|
|
17853
|
-
const m = g[0].dims, S = g[1].dims, T = (0, n.calculateOutputShape)(m, S, y.dilations, y.pads, y.strides), v = b.run((0, p.createIm2ColProgramInfoLoader)(b, g[0], g[1], T, y), [g[0]]),
|
|
17854
|
-
return b.run((0, d.createDotProductProgramInfoLoader)(b, g, T, y),
|
|
17855
|
+
const m = g[0].dims, S = g[1].dims, T = (0, n.calculateOutputShape)(m, S, y.dilations, y.pads, y.strides), v = b.run((0, p.createIm2ColProgramInfoLoader)(b, g[0], g[1], T, y), [g[0]]), E = g.length === 3 ? [v, g[1], g[2]] : [v, g[1]];
|
|
17856
|
+
return b.run((0, d.createDotProductProgramInfoLoader)(b, g, T, y), E);
|
|
17855
17857
|
}, o = (b, g) => {
|
|
17856
17858
|
const y = b.kernelShape.slice();
|
|
17857
17859
|
if (b.kernelShape.length === 0) for (let T = 2; T < g[1].dims.length; ++T) y.push(g[1].dims[T]);
|
|
@@ -17861,8 +17863,8 @@ function requireOrtWeb_min() {
|
|
|
17861
17863
|
return Object.assign(S, { kernelShape: y, pads: m, cacheKey: b.cacheKey }), S;
|
|
17862
17864
|
};
|
|
17863
17865
|
n.parseConvAttributes = (b) => {
|
|
17864
|
-
const g = b.attributes, y = (0, _.parseInternalActivationAttributes)(g), m = g.getString("auto_pad", "NOTSET"), S = g.getInts("dilations", [1, 1]), T = g.getInt("group", 1), v = g.getInts("kernel_shape", []),
|
|
17865
|
-
return (0, c.createAttributeWithCacheKey)(Object.assign({ autoPad: m, dilations: S, group: T, kernelShape: v, pads:
|
|
17866
|
+
const g = b.attributes, y = (0, _.parseInternalActivationAttributes)(g), m = g.getString("auto_pad", "NOTSET"), S = g.getInts("dilations", [1, 1]), T = g.getInt("group", 1), v = g.getInts("kernel_shape", []), E = g.getInts("pads", [0, 0, 0, 0]), A = g.getInts("strides", [1, 1]);
|
|
17867
|
+
return (0, c.createAttributeWithCacheKey)(Object.assign({ autoPad: m, dilations: S, group: T, kernelShape: v, pads: E, strides: A }, y));
|
|
17866
17868
|
};
|
|
17867
17869
|
const h = (b, g) => {
|
|
17868
17870
|
if (!b || b.length !== 2 && b.length !== 3) throw new Error("Conv requires 2 or 3 inputs");
|
|
@@ -17901,7 +17903,7 @@ function requireOrtWeb_min() {
|
|
|
17901
17903
|
n.createDotProductProgramInfoLoader = (_, p, a, t) => {
|
|
17902
17904
|
const e = ((r, o) => ({ name: "ConvDotProduct", inputNames: r ? ["Im2Col", "K", "B"] : ["Im2Col", "K"], inputTypes: r ? [f.TextureType.unpacked, f.TextureType.packedLastDimension, f.TextureType.unpacked] : [f.TextureType.unpacked, f.TextureType.packedLastDimension], cacheKey: o.activationCacheKey }))(p.length > 2, t);
|
|
17903
17905
|
return Object.assign(Object.assign({}, e), { get: () => ((r, o, h, b, g) => {
|
|
17904
|
-
const y = h[0].dims, m = h[1].dims, S = [m[0], Math.ceil(y[1] * m[2] * m[3] / 4)], T = (0, d.calculateIm2ColDims)(y, m, b), [v,
|
|
17906
|
+
const y = h[0].dims, m = h[1].dims, S = [m[0], Math.ceil(y[1] * m[2] * m[3] / 4)], T = (0, d.calculateIm2ColDims)(y, m, b), [v, E] = r.calculateTextureWidthAndHeight(S, f.TextureType.packedLastDimension), A = c.ShapeUtil.computeStrides(T), [w, x] = r.calculateTextureWidthAndHeight(T, f.TextureType.packedLastDimension), N = b.length, D = h.length < 3 ? "0.0" : "_B(b)", M = Math.ceil(y[1] * m[2] * m[3] / 4), { activationFunction: P, applyActivation: L } = (0, u.getActivationSnippet)(g), B = (0, l.getGlsl)(r.session.backend.glContext.version), V = `
|
|
17905
17907
|
${P}
|
|
17906
17908
|
float process(int indices[${N}]) {
|
|
17907
17909
|
int b[1];
|
|
@@ -17914,8 +17916,8 @@ float process(int indices[${N}]) {
|
|
|
17914
17916
|
int kernelOffset = indices[1] * ${S[1]};
|
|
17915
17917
|
float value = ${D};
|
|
17916
17918
|
for (int i = 0; i < ${M}; ++i) {
|
|
17917
|
-
vec2 im2colCoords = offsetToCoords(im2colOffset, ${
|
|
17918
|
-
vec2 kernelCoords = offsetToCoords(kernelOffset, ${v}, ${
|
|
17919
|
+
vec2 im2colCoords = offsetToCoords(im2colOffset, ${w}, ${x});
|
|
17920
|
+
vec2 kernelCoords = offsetToCoords(kernelOffset, ${v}, ${E});
|
|
17919
17921
|
value += dot(${B.texture2D}(Im2Col, im2colCoords), ${B.texture2D}(K, kernelCoords));
|
|
17920
17922
|
++im2colOffset;
|
|
17921
17923
|
++kernelOffset;
|
|
@@ -17979,7 +17981,7 @@ float process(int indices[${N}]) {
|
|
|
17979
17981
|
const y = b[0].dims.slice(), m = b[1].dims.slice(), S = new Array(y.length + m.length - 1);
|
|
17980
17982
|
g = f.ShapeUtil.normalizeAxis(g, y.length);
|
|
17981
17983
|
const T = [];
|
|
17982
|
-
for (let
|
|
17984
|
+
for (let E = 0; E < S.length; E++) E < g ? (S[E] = y[E], T.push(`inputIdx[${E}] = outputIdx[${E}];`)) : E < g + m.length ? (S[E] = m[E - g], T.push(`indexDataIdx[${E - g}] = outputIdx[${E}];`)) : (S[E] = y[E - m.length + 1], T.push(`inputIdx[${E - m.length + 1}] = outputIdx[${E}];`));
|
|
17983
17985
|
const v = `
|
|
17984
17986
|
float process(int outputIdx[${S.length || 1}]) {
|
|
17985
17987
|
int inputIdx[${y.length}];
|
|
@@ -18055,7 +18057,7 @@ float process(int indices[${N}]) {
|
|
|
18055
18057
|
const t = (e = a.cacheKey, { name: "Im2Col (packed)", inputNames: ["A"], inputTypes: [l.TextureType.packed], cacheHint: e });
|
|
18056
18058
|
var e;
|
|
18057
18059
|
return Object.assign(Object.assign({}, t), { get: () => ((r, o, h, b, g, y) => {
|
|
18058
|
-
const m = h.dims, S = b.dims, T = g.length, v = [S[1] * S[2] * S[3], g[2] * g[3]],
|
|
18060
|
+
const m = h.dims, S = b.dims, T = g.length, v = [S[1] * S[2] * S[3], g[2] * g[3]], E = S[2] * S[3], A = (0, f.unpackFromChannel)(), w = (0, c.getGlsl)(r.session.backend.glContext.version);
|
|
18059
18061
|
let x = "";
|
|
18060
18062
|
for (let D = 0; D <= 1; D++) for (let M = 0; M <= 1; M++) x += `
|
|
18061
18063
|
blockIndex = rc.x + ${M};
|
|
@@ -18064,16 +18066,16 @@ float process(int indices[${N}]) {
|
|
|
18064
18066
|
if(blockIndex < ${v[1]} && pos < ${v[0]}) {
|
|
18065
18067
|
offsetY = int(blockIndex / (${g[T - 1]})) * ${y.strides[0]} -
|
|
18066
18068
|
${y.pads[0]};
|
|
18067
|
-
d0 = offsetY + ${y.dilations[0]} * (imod(pos, ${
|
|
18069
|
+
d0 = offsetY + ${y.dilations[0]} * (imod(pos, ${E}) / ${S[2]});
|
|
18068
18070
|
|
|
18069
18071
|
if(d0 < ${m[2]} && d0 >= 0) {
|
|
18070
18072
|
offsetX = imod(blockIndex, ${g[T - 1]}) * ${y.strides[1]} -
|
|
18071
18073
|
${y.pads[1]};
|
|
18072
|
-
d1 = offsetX + ${y.dilations[1]} * imod(imod(pos, ${
|
|
18074
|
+
d1 = offsetX + ${y.dilations[1]} * imod(imod(pos, ${E}), ${S[2]});
|
|
18073
18075
|
|
|
18074
18076
|
if(d1 < ${m[3]} && d1 >= 0) {
|
|
18075
18077
|
|
|
18076
|
-
ch = int(float(pos)/ ${
|
|
18078
|
+
ch = int(float(pos)/ ${E}.);
|
|
18077
18079
|
innerDims = vec2(d0, d1);
|
|
18078
18080
|
result[${2 * D + M}] = getChannel(
|
|
18079
18081
|
getA(0, ch, int(innerDims.x),
|
|
@@ -18092,7 +18094,7 @@ float process(int indices[${N}]) {
|
|
|
18092
18094
|
int blockIndex, pos, offsetY, d0, offsetX, d1, ch;
|
|
18093
18095
|
vec2 innerDims;
|
|
18094
18096
|
${x}
|
|
18095
|
-
${
|
|
18097
|
+
${w.output} = result;
|
|
18096
18098
|
}
|
|
18097
18099
|
`;
|
|
18098
18100
|
return Object.assign(Object.assign({}, o), { output: { dims: v, type: h.type, textureType: l.TextureType.packed }, shaderSource: N, hasMain: !0 });
|
|
@@ -18223,10 +18225,10 @@ float process(int indices[${N}]) {
|
|
|
18223
18225
|
})(f, a) }), d = { name: "InstanceNormalization_ComputeOutput", inputNames: ["X", "MeanAndVariance", "Scale", "B"], inputTypes: [l.TextureType.unpacked, l.TextureType.packedLastDimension, l.TextureType.unpacked, l.TextureType.unpacked] }, _ = (a, t, e, r) => {
|
|
18224
18226
|
const o = Object.assign(Object.assign({}, d), { cacheHint: `${e}` });
|
|
18225
18227
|
return Object.assign(Object.assign({}, o), { get: () => ((h, b, g, y, m) => {
|
|
18226
|
-
const S = (0, c.getGlsl)(h.session.backend.glContext.version), [T, v] = h.calculateTextureWidthAndHeight(m, l.TextureType.packedLastDimension), [
|
|
18228
|
+
const S = (0, c.getGlsl)(h.session.backend.glContext.version), [T, v] = h.calculateTextureWidthAndHeight(m, l.TextureType.packedLastDimension), [E, A] = [T / 4, v], w = `
|
|
18227
18229
|
vec4 get_MeanAndVariance(int[2] mv) {
|
|
18228
18230
|
int offset = indicesToOffset_MeanAndVariance(mv);
|
|
18229
|
-
vec2 coords = offsetToCoords(offset, ${
|
|
18231
|
+
vec2 coords = offsetToCoords(offset, ${E}, ${A});
|
|
18230
18232
|
return ${S.texture2D}(MeanAndVariance, coords);
|
|
18231
18233
|
}
|
|
18232
18234
|
|
|
@@ -18245,7 +18247,7 @@ float process(int indices[${N}]) {
|
|
|
18245
18247
|
|
|
18246
18248
|
return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;
|
|
18247
18249
|
}`;
|
|
18248
|
-
return Object.assign(Object.assign({}, b), { output: { dims: g.dims, type: g.type, textureType: l.TextureType.unpacked }, variables: [{ name: "epsilon", type: "float", data: y }], shaderSource:
|
|
18250
|
+
return Object.assign(Object.assign({}, b), { output: { dims: g.dims, type: g.type, textureType: l.TextureType.unpacked }, variables: [{ name: "epsilon", type: "float", data: y }], shaderSource: w });
|
|
18249
18251
|
})(a, o, t, e, r) });
|
|
18250
18252
|
}, p = (a) => {
|
|
18251
18253
|
if (!a || a.length !== 3) throw new Error("InstanceNormalization requires 3 inputs.");
|
|
@@ -18262,13 +18264,13 @@ float process(int indices[${N}]) {
|
|
|
18262
18264
|
const e = (r = a.length > 2, o = t.activationCacheKey, { name: "MatMul (packed)", inputNames: r ? ["A", "B", "Bias"] : ["A", "B"], inputTypes: r ? [f.TextureType.packed, f.TextureType.packed, f.TextureType.packed] : [f.TextureType.packed, f.TextureType.packed], cacheHint: o });
|
|
18263
18265
|
var r, o;
|
|
18264
18266
|
return Object.assign(Object.assign({}, e), { get: () => ((h, b, g, y) => {
|
|
18265
|
-
const m = g.length > 2, S = m ? "value += getBiasForMatmul();" : "", T = g[0].dims, v = g[1].dims,
|
|
18266
|
-
if (!
|
|
18267
|
-
const
|
|
18267
|
+
const m = g.length > 2, S = m ? "value += getBiasForMatmul();" : "", T = g[0].dims, v = g[1].dims, E = c.BroadcastUtil.calcShape(T, v, !0), A = !c.ShapeUtil.areEqual(g[0].dims, g[1].dims);
|
|
18268
|
+
if (!E) throw new Error("Can't use matmul on the given tensors");
|
|
18269
|
+
const w = T[T.length - 1], x = Math.ceil(w / 2), N = T.length, D = v.length, M = (0, l.getGlsl)(h.session.backend.glContext.version), P = (0, u.getCoordsDataType)(E.length), L = E.length, B = (0, u.getGlChannels)(), { activationFunction: V, applyActivation: X } = (0, d.getActivationSnippet)(y), Z = m ? `${(0, _.getBiasForMatmul)(P, B, g[2].dims, E, !0)}` : "", q = A ? `${(function(F, j, he, Xe) {
|
|
18268
18270
|
let Q = [], Ce = [];
|
|
18269
|
-
const rt = he[0].dims, ct = he[1].dims, yt = rt.length, mt = ct.length, ht = Xe.length,
|
|
18270
|
-
Q = rt.map(((gt, kt) => `coords.${j[kt +
|
|
18271
|
-
const Ht = c.BroadcastUtil.getBroadcastDims(rt, Xe), nn = c.BroadcastUtil.getBroadcastDims(ct, Xe), C = Ht.map(((gt) => `coords.${j[gt +
|
|
18271
|
+
const rt = he[0].dims, ct = he[1].dims, yt = rt.length, mt = ct.length, ht = Xe.length, Et = ht - yt, Ot = ht - mt;
|
|
18272
|
+
Q = rt.map(((gt, kt) => `coords.${j[kt + Et]}`)), Q[yt - 1] = "i*2", Q.join(", "), Ce = ct.map(((gt, kt) => `coords.${j[kt + Ot]}`)), Ce[mt - 2] = "i*2", Ce.join(", ");
|
|
18273
|
+
const Ht = c.BroadcastUtil.getBroadcastDims(rt, Xe), nn = c.BroadcastUtil.getBroadcastDims(ct, Xe), C = Ht.map(((gt) => `coords.${j[gt + Et]} = 0;`)).join(`
|
|
18272
18274
|
`), U = nn.map(((gt) => `coords.${j[gt + Ot]} = 0;`)).join(`
|
|
18273
18275
|
`), Tt = `int lastDim = coords.${j[ht - 1]};
|
|
18274
18276
|
coords.${j[ht - 1]} = coords.${j[ht - 2]};
|
|
@@ -18289,7 +18291,7 @@ vec4 getBAtOutCoordsMatmul(int i) {
|
|
|
18289
18291
|
vec4 outputValue = getB(${Ce});
|
|
18290
18292
|
return outputValue;
|
|
18291
18293
|
}`;
|
|
18292
|
-
})(P, B, g,
|
|
18294
|
+
})(P, B, g, E)}` : "", k = A ? "getAAtOutCoordsMatmul(i)" : `getA(${(function(F, j) {
|
|
18293
18295
|
let he = "";
|
|
18294
18296
|
for (let Xe = 0; Xe < j - 2; Xe++) he += `rc.${F[Xe]}, `;
|
|
18295
18297
|
return he += `rc.${F[j - 2]}, i*2`, he;
|
|
@@ -18319,7 +18321,7 @@ vec4 getBAtOutCoordsMatmul(int i) {
|
|
|
18319
18321
|
${X}
|
|
18320
18322
|
${M.output} = value;
|
|
18321
18323
|
}`;
|
|
18322
|
-
return Object.assign(Object.assign({}, b), { output: { dims:
|
|
18324
|
+
return Object.assign(Object.assign({}, b), { output: { dims: E, type: g[0].type, textureType: f.TextureType.packed }, shaderSource: O, hasMain: !0 });
|
|
18323
18325
|
})(p, e, a, t) });
|
|
18324
18326
|
};
|
|
18325
18327
|
}, 5623: (s, n, i) => {
|
|
@@ -18331,7 +18333,7 @@ vec4 getBAtOutCoordsMatmul(int i) {
|
|
|
18331
18333
|
return Object.assign(Object.assign({}, r), { get: () => (function(b, g, y) {
|
|
18332
18334
|
const m = g[0].dims, S = g[1].dims, T = c.BroadcastUtil.calcShape(m, S, !0);
|
|
18333
18335
|
if (!T) throw new Error("Can't use matmul on the given tensors");
|
|
18334
|
-
const v = (0, f.getCoordsDataType)(T.length),
|
|
18336
|
+
const v = (0, f.getCoordsDataType)(T.length), E = (0, f.getGlChannels)(), { activationFunction: A, applyActivation: w } = (0, u.getActivationSnippet)(y), x = g.length > 2, N = x ? "value += getBiasForMatmul();" : "", D = x ? `${a(v, E, g[2].dims, T, !1)}` : "", M = T.length, P = m.length, L = S.length, B = `
|
|
18335
18337
|
${A}
|
|
18336
18338
|
${D}
|
|
18337
18339
|
float process(int indices[${M}]) {
|
|
@@ -18347,7 +18349,7 @@ vec4 getBAtOutCoordsMatmul(int i) {
|
|
|
18347
18349
|
value += _A(a) * _B(b);
|
|
18348
18350
|
}
|
|
18349
18351
|
${N}
|
|
18350
|
-
${
|
|
18352
|
+
${w}
|
|
18351
18353
|
return value;
|
|
18352
18354
|
}`;
|
|
18353
18355
|
return Object.assign(Object.assign({}, b), { output: { dims: T, type: g[0].type, textureType: l.TextureType.unpacked }, shaderSource: B });
|
|
@@ -18363,7 +18365,7 @@ vec4 getBAtOutCoordsMatmul(int i) {
|
|
|
18363
18365
|
function a(t, e, r, o, h) {
|
|
18364
18366
|
let b = "";
|
|
18365
18367
|
const g = r.length, y = o.length, m = y - g;
|
|
18366
|
-
b = y < 2 && g > 0 ? "coords" : r.map(((v,
|
|
18368
|
+
b = y < 2 && g > 0 ? "coords" : r.map(((v, E) => `coords.${e[E + m]}`)).join(", ");
|
|
18367
18369
|
const S = c.BroadcastUtil.getBroadcastDims(r, o).map(((v) => `coords.${e[v + m]} = 0;`)).join(`
|
|
18368
18370
|
`);
|
|
18369
18371
|
let T = "vec4(outputValue.xx, outputValue.yy)";
|
|
@@ -18394,15 +18396,15 @@ float getBiasForMatmul() {
|
|
|
18394
18396
|
bool cEdge = cp1 >= ${T};
|
|
18395
18397
|
`);
|
|
18396
18398
|
var m, S, T, v;
|
|
18397
|
-
let
|
|
18398
|
-
|
|
18399
|
+
let E;
|
|
18400
|
+
E = o === 0 ? [1, 1] : o === 1 ? [r[0], 1] : [r[h - 1], r[h - 2]];
|
|
18399
18401
|
const A = (function(N, D, M) {
|
|
18400
18402
|
if (N === 0) return "false";
|
|
18401
18403
|
if (N === 1) return `rc > ${D[0]}`;
|
|
18402
18404
|
let P = "";
|
|
18403
18405
|
for (let L = N - 2; L < N; L++) P += `${M[L]} >= ${D[L - N + 2]}`, L < N - 1 && (P += "||");
|
|
18404
18406
|
return P;
|
|
18405
|
-
})(h,
|
|
18407
|
+
})(h, E, g), w = (function(N, D) {
|
|
18406
18408
|
const M = N.length;
|
|
18407
18409
|
if (M === 0) return "getA(), 0, 0, 0";
|
|
18408
18410
|
if (M === 1) return `getA(rc),
|
|
@@ -18423,7 +18425,7 @@ float getBiasForMatmul() {
|
|
|
18423
18425
|
} else {
|
|
18424
18426
|
${y}
|
|
18425
18427
|
|
|
18426
|
-
${e.output} = vec4(${
|
|
18428
|
+
${e.output} = vec4(${w});
|
|
18427
18429
|
}
|
|
18428
18430
|
}
|
|
18429
18431
|
`;
|
|
@@ -18494,16 +18496,16 @@ float getBiasForMatmul() {
|
|
|
18494
18496
|
throw new Error("Invalid mode");
|
|
18495
18497
|
}
|
|
18496
18498
|
}, r = (b, g, y, m, S, T, v) => {
|
|
18497
|
-
const
|
|
18499
|
+
const E = g.length;
|
|
18498
18500
|
let A = "";
|
|
18499
|
-
for (let
|
|
18500
|
-
k = m[${
|
|
18501
|
+
for (let w = E - 1; w >= 0; --w) A += `
|
|
18502
|
+
k = m[${w}] - ${T[w]};
|
|
18501
18503
|
if (k < 0) return constant;
|
|
18502
|
-
if (k >= ${g[
|
|
18503
|
-
offset += k * ${y[
|
|
18504
|
+
if (k >= ${g[w]}) return constant;
|
|
18505
|
+
offset += k * ${y[w]};
|
|
18504
18506
|
`;
|
|
18505
18507
|
return `
|
|
18506
|
-
float padA(int m[${
|
|
18508
|
+
float padA(int m[${E}]) {
|
|
18507
18509
|
const float constant = float(${v});
|
|
18508
18510
|
int offset = 0;
|
|
18509
18511
|
int k = 0;
|
|
@@ -18515,8 +18517,8 @@ float getBiasForMatmul() {
|
|
|
18515
18517
|
`;
|
|
18516
18518
|
}, o = (b, g, y, m, S, T) => {
|
|
18517
18519
|
const v = g.length;
|
|
18518
|
-
let
|
|
18519
|
-
for (let A = v - 1; A >= 0; --A)
|
|
18520
|
+
let E = "";
|
|
18521
|
+
for (let A = v - 1; A >= 0; --A) E += `
|
|
18520
18522
|
k = m[${A}] - ${T[A]};
|
|
18521
18523
|
if (k < 0) { k = -k; }
|
|
18522
18524
|
{
|
|
@@ -18530,7 +18532,7 @@ float getBiasForMatmul() {
|
|
|
18530
18532
|
float padA(int m[${v}]) {
|
|
18531
18533
|
int offset = 0;
|
|
18532
18534
|
int k = 0;
|
|
18533
|
-
${
|
|
18535
|
+
${E}
|
|
18534
18536
|
vec2 coords = offsetToCoords(offset, ${m}, ${S});
|
|
18535
18537
|
float value = getColorAsFloat(${b.texture2D}(A, coords));
|
|
18536
18538
|
return value;
|
|
@@ -18538,8 +18540,8 @@ float getBiasForMatmul() {
|
|
|
18538
18540
|
`;
|
|
18539
18541
|
}, h = (b, g, y, m, S, T) => {
|
|
18540
18542
|
const v = g.length;
|
|
18541
|
-
let
|
|
18542
|
-
for (let A = v - 1; A >= 0; --A)
|
|
18543
|
+
let E = "";
|
|
18544
|
+
for (let A = v - 1; A >= 0; --A) E += `
|
|
18543
18545
|
k = m[${A}] - ${T[A]};
|
|
18544
18546
|
if (k < 0) k = 0;
|
|
18545
18547
|
if (k >= ${g[A]}) k = ${g[A] - 1};
|
|
@@ -18549,7 +18551,7 @@ float getBiasForMatmul() {
|
|
|
18549
18551
|
float padA(int m[${v}]) {
|
|
18550
18552
|
int offset = 0;
|
|
18551
18553
|
int k = 0;
|
|
18552
|
-
${
|
|
18554
|
+
${E}
|
|
18553
18555
|
vec2 coords = offsetToCoords(offset, ${m}, ${S});
|
|
18554
18556
|
float value = getColorAsFloat(${b.texture2D}(A, coords));
|
|
18555
18557
|
return value;
|
|
@@ -18572,10 +18574,10 @@ float getBiasForMatmul() {
|
|
|
18572
18574
|
const [m, S] = _(h, y, g), T = l.ShapeUtil.size(m.kernelShape);
|
|
18573
18575
|
let v = "";
|
|
18574
18576
|
m.countIncludePad ? v += `value /= float(${T});` : v += `value /= float(${T} - pad);`;
|
|
18575
|
-
const
|
|
18577
|
+
const E = `
|
|
18576
18578
|
${e(h[0].dims, m, "value += _X(x);", v, "0.0")}
|
|
18577
18579
|
`;
|
|
18578
|
-
return Object.assign(Object.assign({}, b), { output: { dims: S, type: h[0].type, textureType: f.TextureType.unpacked }, shaderSource:
|
|
18580
|
+
return Object.assign(Object.assign({}, b), { output: { dims: S, type: h[0].type, textureType: f.TextureType.unpacked }, shaderSource: E });
|
|
18579
18581
|
};
|
|
18580
18582
|
n.globalAveragePool = (h, b, g) => {
|
|
18581
18583
|
t(b);
|
|
@@ -18602,10 +18604,10 @@ float getBiasForMatmul() {
|
|
|
18602
18604
|
`;
|
|
18603
18605
|
return Object.assign(Object.assign({}, b), { output: { dims: S, type: h[0].type, textureType: f.TextureType.unpacked }, shaderSource: T });
|
|
18604
18606
|
}, _ = (h, b, g) => {
|
|
18605
|
-
const y = h[0].dims.slice(), m = Object.hasOwnProperty.call(b, "dilations"), S = b.kernelShape.slice(), T = b.strides.slice(), v = m ? b.dilations.slice() : [],
|
|
18606
|
-
l.PoolConvUtil.adjustPoolAttributes(g, y, S, T, v,
|
|
18607
|
-
const A = l.PoolConvUtil.computePoolOutputShape(g, y, T, v, S,
|
|
18608
|
-
return m ? Object.assign(
|
|
18607
|
+
const y = h[0].dims.slice(), m = Object.hasOwnProperty.call(b, "dilations"), S = b.kernelShape.slice(), T = b.strides.slice(), v = m ? b.dilations.slice() : [], E = b.pads.slice();
|
|
18608
|
+
l.PoolConvUtil.adjustPoolAttributes(g, y, S, T, v, E);
|
|
18609
|
+
const A = l.PoolConvUtil.computePoolOutputShape(g, y, T, v, S, E, b.autoPad), w = Object.assign({}, b);
|
|
18610
|
+
return m ? Object.assign(w, { kernelShape: S, strides: T, pads: E, dilations: v, cacheKey: b.cacheKey }) : Object.assign(w, { kernelShape: S, strides: T, pads: E, cacheKey: b.cacheKey }), [w, A];
|
|
18609
18611
|
}, p = { autoPad: "", ceilMode: 0, countIncludePad: !1, kernelShape: [], strides: [], pads: [], storageOrder: 0, dilations: [], cacheKey: "" }, a = { name: "GlobalMaxPool", inputNames: ["X"], inputTypes: [f.TextureType.unpacked] };
|
|
18610
18612
|
n.globalMaxPool = (h, b) => (t(b), [h.run(Object.assign(Object.assign({}, a), { get: () => d(b, a, !0, p) }), b)]);
|
|
18611
18613
|
const t = (h) => {
|
|
@@ -18614,19 +18616,19 @@ float getBiasForMatmul() {
|
|
|
18614
18616
|
}, e = (h, b, g, y, m) => {
|
|
18615
18617
|
const S = h.length;
|
|
18616
18618
|
if (b.kernelShape.length <= 2) {
|
|
18617
|
-
const T = b.kernelShape[b.kernelShape.length - 1], v = b.strides[b.strides.length - 1],
|
|
18619
|
+
const T = b.kernelShape[b.kernelShape.length - 1], v = b.strides[b.strides.length - 1], E = b.pads[b.pads.length / 2 - 1], A = b.pads[b.pads.length - 1], w = h[S - 1];
|
|
18618
18620
|
let x = "", N = "", D = "";
|
|
18619
|
-
if (x =
|
|
18621
|
+
if (x = E + A !== 0 ? `
|
|
18620
18622
|
for (int i = 0; i < ${T}; i++) {
|
|
18621
|
-
x[${S} - 1] = indices[${S} - 1] * ${v} - ${
|
|
18622
|
-
if (x[${S} - 1] < 0 || x[${S} - 1] >= ${
|
|
18623
|
+
x[${S} - 1] = indices[${S} - 1] * ${v} - ${E} + i;
|
|
18624
|
+
if (x[${S} - 1] < 0 || x[${S} - 1] >= ${w}) {
|
|
18623
18625
|
pad++;
|
|
18624
18626
|
continue;
|
|
18625
18627
|
}
|
|
18626
18628
|
${g}
|
|
18627
18629
|
}` : `
|
|
18628
18630
|
for (int i = 0; i < ${T}; i++) {
|
|
18629
|
-
x[${S} - 1] = indices[${S} - 1] * ${v} - ${
|
|
18631
|
+
x[${S} - 1] = indices[${S} - 1] * ${v} - ${E} + i;
|
|
18630
18632
|
${g}
|
|
18631
18633
|
}`, b.kernelShape.length === 2) {
|
|
18632
18634
|
const M = b.kernelShape[b.kernelShape.length - 2], P = b.strides[b.strides.length - 2], L = b.pads[b.pads.length / 2 - 2], B = b.pads[b.pads.length - 2], V = h[S - 2];
|
|
@@ -18660,7 +18662,7 @@ float getBiasForMatmul() {
|
|
|
18660
18662
|
`;
|
|
18661
18663
|
}
|
|
18662
18664
|
{
|
|
18663
|
-
const T = l.ShapeUtil.size(b.kernelShape), v = l.ShapeUtil.computeStrides(b.kernelShape),
|
|
18665
|
+
const T = l.ShapeUtil.size(b.kernelShape), v = l.ShapeUtil.computeStrides(b.kernelShape), E = v.length, A = b.pads.length, w = o(E), x = r(h, "inputDims"), N = r(b.pads, "pads"), D = r(v, "kernelStrides"), M = r(b.strides, "strides");
|
|
18664
18666
|
let P = "";
|
|
18665
18667
|
return P = b.pads.reduce(((L, B) => L + B)) ? `
|
|
18666
18668
|
if (x[j] >= inputDims[j] || x[j] < 0) {
|
|
@@ -18675,15 +18677,15 @@ float getBiasForMatmul() {
|
|
|
18675
18677
|
}
|
|
18676
18678
|
${g}
|
|
18677
18679
|
`, `
|
|
18678
|
-
${
|
|
18680
|
+
${w}
|
|
18679
18681
|
float process(int indices[${S}]) {
|
|
18680
18682
|
int x[${S}];
|
|
18681
18683
|
copyVec(indices, x);
|
|
18682
|
-
int offset[${
|
|
18684
|
+
int offset[${E}];
|
|
18683
18685
|
int pads[${A}];
|
|
18684
18686
|
int inputDims[${S}];
|
|
18685
|
-
int kernelStrides[${
|
|
18686
|
-
int strides[${
|
|
18687
|
+
int kernelStrides[${E}];
|
|
18688
|
+
int strides[${E}];
|
|
18687
18689
|
${N}
|
|
18688
18690
|
${x}
|
|
18689
18691
|
${M}
|
|
@@ -18695,9 +18697,9 @@ float getBiasForMatmul() {
|
|
|
18695
18697
|
for (int i = 0; i < ${T}; i++) {
|
|
18696
18698
|
offsetToIndices(i, kernelStrides, offset);
|
|
18697
18699
|
isPad = false;
|
|
18698
|
-
for (int j = ${S} - ${
|
|
18699
|
-
x[j] = indices[j] * strides[j - ${S} + ${
|
|
18700
|
-
+ offset[j - ${S} + ${
|
|
18700
|
+
for (int j = ${S} - ${E}; j < ${S}; j++) {
|
|
18701
|
+
x[j] = indices[j] * strides[j - ${S} + ${E}]
|
|
18702
|
+
+ offset[j - ${S} + ${E}] - pads[j - 2];
|
|
18701
18703
|
${P}
|
|
18702
18704
|
}
|
|
18703
18705
|
${y}
|
|
@@ -18737,11 +18739,11 @@ float getBiasForMatmul() {
|
|
|
18737
18739
|
const _ = (a, t, e, r, o, h) => {
|
|
18738
18740
|
const b = [], g = t[0].dims.length || 1, y = [], m = f.ShapeUtil.normalizeAxes(e.axes, t[0].dims.length), S = o(t, m);
|
|
18739
18741
|
let T = S[1];
|
|
18740
|
-
for (let
|
|
18741
|
-
for(int j${
|
|
18742
|
-
inputIdx[${
|
|
18742
|
+
for (let E = 0; E < t[0].dims.length; E++) m.indexOf(E) >= 0 || m.length === 0 ? (e.keepDims && b.push(1), T = `
|
|
18743
|
+
for(int j${E} = 0; j${E} < ${t[0].dims[E]}; j${E}++) {
|
|
18744
|
+
inputIdx[${E}] = j${E};
|
|
18743
18745
|
${T}
|
|
18744
|
-
}`) : (y.push(`inputIdx[${
|
|
18746
|
+
}`) : (y.push(`inputIdx[${E}] = outputIdx[${b.length}];`), b.push(t[0].dims[E]));
|
|
18745
18747
|
const v = `
|
|
18746
18748
|
float process(int outputIdx[${b.length || 1}]) {
|
|
18747
18749
|
float value; // final result
|
|
@@ -18816,10 +18818,10 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
18816
18818
|
}
|
|
18817
18819
|
const y = (0, l.getGlsl)(t.session.backend.glContext.version), m = `
|
|
18818
18820
|
${(function(S) {
|
|
18819
|
-
const T = c.ShapeUtil.computeStrides(S), v = ["b", "r", "c"],
|
|
18821
|
+
const T = c.ShapeUtil.computeStrides(S), v = ["b", "r", "c"], E = "index";
|
|
18820
18822
|
return `
|
|
18821
18823
|
ivec3 inputCoordsFromReshapedOutCoords(int index) {
|
|
18822
|
-
${T.map(((A,
|
|
18824
|
+
${T.map(((A, w) => `int ${v[w]} = ${E} / ${A}; ${w === T.length - 1 ? `int ${v[w + 1]} = ${E} - ${v[w]} * ${A}` : `index -= ${v[w]} * ${A}`};`)).join("")}
|
|
18823
18825
|
return ivec3(b, r, c);
|
|
18824
18826
|
}
|
|
18825
18827
|
`;
|
|
@@ -18880,7 +18882,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
18880
18882
|
if (m < 2) throw new Error(`output dimension should be at least 2, but got ${m}`);
|
|
18881
18883
|
const S = y[m - 2], T = y[m - 1], v = o[0].dims;
|
|
18882
18884
|
if (m !== v.length) throw new Error(`output dimension should match input ${v.length}, but got ${m}`);
|
|
18883
|
-
const
|
|
18885
|
+
const E = v[m - 2], A = v[m - 1], w = g[m - 2], x = g[m - 1];
|
|
18884
18886
|
let N = "";
|
|
18885
18887
|
if (h.mode !== "linear") throw new Error(`resize (packed) does not support mode: '${h.mode}'`);
|
|
18886
18888
|
switch (h.coordinateTransformMode) {
|
|
@@ -18916,8 +18918,8 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
18916
18918
|
vec4 getSourceFracIndex(ivec4 coords) {
|
|
18917
18919
|
vec4 resized = vec4(${T}.0 - 1.0, ${S}.0 - 1.0, ${T}.0 - 1.0,
|
|
18918
18920
|
${S}.0 - 1.0);
|
|
18919
|
-
vec4 original = vec4(${A}.0 - 1.0, ${
|
|
18920
|
-
${
|
|
18921
|
+
vec4 original = vec4(${A}.0 - 1.0, ${E}.0 - 1.0, ${A}.0 - 1.0,
|
|
18922
|
+
${E}.0 - 1.0);
|
|
18921
18923
|
vec4 new_scale = original / resized;
|
|
18922
18924
|
return vec4(coords) * new_scale;
|
|
18923
18925
|
}
|
|
@@ -18927,8 +18929,8 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
18927
18929
|
throw new Error(`resize (packed) does not support coordinateTransformMode: '${h.coordinateTransformMode}'`);
|
|
18928
18930
|
}
|
|
18929
18931
|
const D = (0, f.getCoordsDataType)(m), M = `
|
|
18930
|
-
const vec2 inputWH = vec2(${
|
|
18931
|
-
const vec4 scaleWHWH = vec4(float(${
|
|
18932
|
+
const vec2 inputWH = vec2(${E}.0, ${A}.0);
|
|
18933
|
+
const vec4 scaleWHWH = vec4(float(${w}), float(${x}), float(${w}), float(${x}));
|
|
18932
18934
|
${(0, u.unpackFromChannel)()}
|
|
18933
18935
|
${N}
|
|
18934
18936
|
float getAValue(int x10, int r, int c, int d) {
|
|
@@ -19037,7 +19039,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19037
19039
|
return (0, c.createAttributeWithCacheKey)({ starts: r, ends: o, axes: h });
|
|
19038
19040
|
};
|
|
19039
19041
|
const _ = (e, r, o) => {
|
|
19040
|
-
const h = o.axes.length === 0 ? r.dims.slice(0).map(((v,
|
|
19042
|
+
const h = o.axes.length === 0 ? r.dims.slice(0).map(((v, E) => E)) : o.axes, b = f.ShapeUtil.normalizeAxes(h, r.dims.length), g = o.starts.map(((v, E) => v > r.dims[b[E]] - 1 ? r.dims[b[E]] : f.ShapeUtil.normalizeAxis(v, r.dims[b[E]]))), y = o.ends.map(((v, E) => v > r.dims[b[E]] - 1 ? r.dims[b[E]] : f.ShapeUtil.normalizeAxis(v, r.dims[b[E]]))), m = r.dims.slice(), S = [];
|
|
19041
19043
|
for (let v = 0; v < b.length; v++) m[b[v]] = y[v] - g[v], g[v] > 0 && S.push(`outputIdx[${b[v]}] += ${g[v]};`);
|
|
19042
19044
|
const T = `
|
|
19043
19045
|
float process(int outputIdx[${m.length}]) {
|
|
@@ -19076,22 +19078,22 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19076
19078
|
return t(b, g, y, T, v);
|
|
19077
19079
|
}, n.parseSoftmaxAttributes = (b) => (0, c.createAttributeWithCacheKey)({ axis: b.attributes.getInt("axis", 1) }), n.parseSoftmaxAttributesV13 = (b) => (0, c.createAttributeWithCacheKey)({ axis: b.attributes.getInt("axis", -1) }), n.softmaxV13 = (b, g, y) => {
|
|
19078
19080
|
h(g);
|
|
19079
|
-
const m = g[0].dims.slice(), S = l.ShapeUtil.normalizeAxis(y.axis, m.length), T = m.length, v = S !== T - 1,
|
|
19080
|
-
let A,
|
|
19081
|
-
v && (
|
|
19082
|
-
const N = v ? l.ShapeUtil.sizeToDimension(
|
|
19081
|
+
const m = g[0].dims.slice(), S = l.ShapeUtil.normalizeAxis(y.axis, m.length), T = m.length, v = S !== T - 1, E = [];
|
|
19082
|
+
let A, w = [], x = [];
|
|
19083
|
+
v && (w = Array.from({ length: T }).map(((P, L) => L)), w[S] = T - 1, w[T - 1] = S, w.map(((P) => E.push(m[P]))), A = (0, c.createAttributeWithCacheKey)({ perm: w }), x = (0, d.transpose)(b, g, A));
|
|
19084
|
+
const N = v ? l.ShapeUtil.sizeToDimension(E, T - 1) : l.ShapeUtil.sizeToDimension(m, T - 1), D = v ? l.ShapeUtil.sizeFromDimension(E, T - 1) : l.ShapeUtil.sizeFromDimension(m, T - 1), M = t(b, v ? x : g, y, N, D);
|
|
19083
19085
|
return v ? (0, d.transpose)(b, M, A) : M;
|
|
19084
19086
|
};
|
|
19085
19087
|
const t = (b, g, y, m, S) => {
|
|
19086
|
-
const T = e(b, g[0], m, S, [m]), v = b.run(Object.assign(Object.assign({}, _), { cacheHint: y.cacheKey, get: () => T }), g),
|
|
19087
|
-
return [b.run(Object.assign(Object.assign({}, a), { cacheHint: y.cacheKey, get: () =>
|
|
19088
|
+
const T = e(b, g[0], m, S, [m]), v = b.run(Object.assign(Object.assign({}, _), { cacheHint: y.cacheKey, get: () => T }), g), E = r(b, g[0], m, S, T.output.dims, [m]), A = b.run(Object.assign(Object.assign({}, p), { cacheHint: y.cacheKey, get: () => E }), [g[0], v]), w = o(b, g[0], m, S, T.output.dims, E.output.dims);
|
|
19089
|
+
return [b.run(Object.assign(Object.assign({}, a), { cacheHint: y.cacheKey, get: () => w }), [g[0], v, A])];
|
|
19088
19090
|
}, e = (b, g, y, m, S) => {
|
|
19089
|
-
const [T, v] = b.calculateTextureWidthAndHeight(g.dims, u.TextureType.unpacked),
|
|
19091
|
+
const [T, v] = b.calculateTextureWidthAndHeight(g.dims, u.TextureType.unpacked), E = S.length;
|
|
19090
19092
|
if (y < 1 || m < 1) throw new Error("Logical row count N and feature count D must be greater than or equal to 1");
|
|
19091
19093
|
if (S.length !== 1) throw new Error("Dimensionality of the output should be 1");
|
|
19092
19094
|
if (S[0] !== y) throw new Error("Shape of the output should be equal to logical row count");
|
|
19093
|
-
const A = (0, f.getGlsl)(b.session.backend.glContext.version),
|
|
19094
|
-
float process(int[${
|
|
19095
|
+
const A = (0, f.getGlsl)(b.session.backend.glContext.version), w = `
|
|
19096
|
+
float process(int[${E}] indices) {
|
|
19095
19097
|
int logical_row_start_offset = indices[0] * ${m};
|
|
19096
19098
|
|
|
19097
19099
|
float max = getColorAsFloat(${A.texture2D}(A, offsetToCoords(logical_row_start_offset, ${T},
|
|
@@ -19106,15 +19108,15 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19106
19108
|
|
|
19107
19109
|
return max;
|
|
19108
19110
|
}`;
|
|
19109
|
-
return Object.assign(Object.assign({}, _), { output: { dims: S, type: g.type, textureType: u.TextureType.unpacked }, shaderSource:
|
|
19111
|
+
return Object.assign(Object.assign({}, _), { output: { dims: S, type: g.type, textureType: u.TextureType.unpacked }, shaderSource: w });
|
|
19110
19112
|
}, r = (b, g, y, m, S, T) => {
|
|
19111
|
-
const [v,
|
|
19113
|
+
const [v, E] = b.calculateTextureWidthAndHeight(g.dims, u.TextureType.unpacked), A = T.length;
|
|
19112
19114
|
if (y < 1 || m < 1) throw new Error("Logical row count N and feature count D must be greater than or equal to 1");
|
|
19113
19115
|
if (T.length !== 1) throw new Error("Dimensionality of the output should be 1");
|
|
19114
19116
|
if (T[0] !== y) throw new Error("Shape of the output should be equal to logical row count");
|
|
19115
19117
|
if (S.length !== 1) throw new Error("Dimensionality of the intermediate results should be 1");
|
|
19116
19118
|
if (S[0] !== y) throw new Error("Shape of the intermediate results should be equal to logical row count");
|
|
19117
|
-
const
|
|
19119
|
+
const w = `
|
|
19118
19120
|
float process(int[${A}] indices) {
|
|
19119
19121
|
int logical_row_start_offset = indices[0] * ${m};
|
|
19120
19122
|
|
|
@@ -19123,22 +19125,22 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19123
19125
|
for(int i=0; i<${m}; ++i)
|
|
19124
19126
|
{
|
|
19125
19127
|
norm_factor += exp(getColorAsFloat(${(0, f.getGlsl)(b.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,
|
|
19126
|
-
${v}, ${
|
|
19128
|
+
${v}, ${E}))) - max);
|
|
19127
19129
|
}
|
|
19128
19130
|
|
|
19129
19131
|
return norm_factor;
|
|
19130
19132
|
}`;
|
|
19131
|
-
return Object.assign(Object.assign({}, p), { output: { dims: T, type: g.type, textureType: u.TextureType.unpacked }, shaderSource:
|
|
19133
|
+
return Object.assign(Object.assign({}, p), { output: { dims: T, type: g.type, textureType: u.TextureType.unpacked }, shaderSource: w });
|
|
19132
19134
|
}, o = (b, g, y, m, S, T) => {
|
|
19133
|
-
const [v,
|
|
19135
|
+
const [v, E] = b.calculateTextureWidthAndHeight(g.dims, u.TextureType.unpacked), A = g.dims.length;
|
|
19134
19136
|
if (y < 1 || m < 1) throw new Error("Logical row count N and feature count D must be greater than or equal to 1");
|
|
19135
19137
|
if (S.length !== 1 || T.length !== 1) throw new Error("Dimensionality of the intermediate results should be 1");
|
|
19136
19138
|
if (S[0] !== y || T[0] !== y) throw new Error("Shape of the intermediate results should be equal to logical row count");
|
|
19137
|
-
const
|
|
19139
|
+
const w = `
|
|
19138
19140
|
float process(int[${A}] indices) {
|
|
19139
19141
|
|
|
19140
19142
|
// get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)
|
|
19141
|
-
int offset = coordsToOffset(TexCoords, ${v}, ${
|
|
19143
|
+
int offset = coordsToOffset(TexCoords, ${v}, ${E});
|
|
19142
19144
|
|
|
19143
19145
|
//determine the logical row for this index
|
|
19144
19146
|
int logical_row_index[1];
|
|
@@ -19154,7 +19156,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19154
19156
|
|
|
19155
19157
|
return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;
|
|
19156
19158
|
}`;
|
|
19157
|
-
return Object.assign(Object.assign({}, a), { output: { dims: g.dims, type: g.type, textureType: u.TextureType.unpacked }, shaderSource:
|
|
19159
|
+
return Object.assign(Object.assign({}, a), { output: { dims: g.dims, type: g.type, textureType: u.TextureType.unpacked }, shaderSource: w });
|
|
19158
19160
|
}, h = (b) => {
|
|
19159
19161
|
if (!b || b.length !== 1) throw new Error("Softmax requires 1 input.");
|
|
19160
19162
|
if (b[0].type !== "float32" && b[0].type !== "float64") throw new Error("Invalid input type");
|
|
@@ -19439,7 +19441,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19439
19441
|
}
|
|
19440
19442
|
`, name: "not", type: f.FunctionType.ValueBased };
|
|
19441
19443
|
}
|
|
19442
|
-
function
|
|
19444
|
+
function E() {
|
|
19443
19445
|
return M("sin");
|
|
19444
19446
|
}
|
|
19445
19447
|
function A() {
|
|
@@ -19453,7 +19455,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19453
19455
|
}
|
|
19454
19456
|
`, name: B, type: f.FunctionType.ValueBased };
|
|
19455
19457
|
}
|
|
19456
|
-
function
|
|
19458
|
+
function w() {
|
|
19457
19459
|
const B = "sigmoid";
|
|
19458
19460
|
return { body: `
|
|
19459
19461
|
float ${B}_(float a) {
|
|
@@ -19495,7 +19497,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19495
19497
|
}
|
|
19496
19498
|
`, name: B, type: f.FunctionType.ValueBased };
|
|
19497
19499
|
}
|
|
19498
|
-
n.glslAbs = _, n.glslAcos = p, n.glslAsin = a, n.glslAtan = t, n.glslCeil = e, n.glslCos = r, n.glslElu = o, n.glslExp = h, n.glslFloor = b, n.glslClip = g, n.glslIdentity = y, n.glslLeakyRelu = m, n.glslLog = S, n.glslNeg = T, n.glslNot = v, n.glslSin =
|
|
19500
|
+
n.glslAbs = _, n.glslAcos = p, n.glslAsin = a, n.glslAtan = t, n.glslCeil = e, n.glslCos = r, n.glslElu = o, n.glslExp = h, n.glslFloor = b, n.glslClip = g, n.glslIdentity = y, n.glslLeakyRelu = m, n.glslLog = S, n.glslNeg = T, n.glslNot = v, n.glslSin = E, n.glslRelu = A, n.glslSigmoid = w, n.glslSqrt = x, n.glslTan = N, n.glslTanh = D;
|
|
19499
19501
|
const P = (B, V, X, Z) => {
|
|
19500
19502
|
const q = B.session.pack ? d.TextureType.packed : d.TextureType.unpacked, k = { name: X.name, inputTypes: [q], inputNames: ["A"], cacheHint: Z };
|
|
19501
19503
|
return Object.assign(Object.assign({}, k), { get: () => ((I, O, F, j) => {
|
|
@@ -19519,7 +19521,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19519
19521
|
const X = V.length >= 3 ? V[1].numberData[0] : l.MIN_CLIP, Z = V.length >= 3 ? V[2].numberData[0] : l.MAX_CLIP;
|
|
19520
19522
|
return (0, c.createAttributeWithCacheKey)({ min: X, max: Z });
|
|
19521
19523
|
};
|
|
19522
|
-
n.ceil = (B, V) => [B.run(P(B, V[0], e()), V)], n.cos = (B, V) => [B.run(P(B, V[0], r()), V)], n.elu = (B, V, X) => [B.run(P(B, V[0], o(X.alpha), X.cacheKey), V)], n.parseEluAttributes = (B) => (0, c.createAttributeWithCacheKey)({ alpha: B.attributes.getFloat("alpha", 1) }), n.exp = (B, V) => [B.run(P(B, V[0], h()), V)], n.floor = (B, V) => [B.run(P(B, V[0], b()), V)], n.identity = (B, V) => [B.run(P(B, V[0], y()), V)], n.leakyRelu = (B, V, X) => [B.run(P(B, V[0], m(X.alpha), X.cacheKey), V)], n.parseLeakyReluAttributes = (B) => (0, c.createAttributeWithCacheKey)({ alpha: B.attributes.getFloat("alpha", 0.01) }), n.log = (B, V) => [B.run(P(B, V[0], S()), V)], n.neg = (B, V) => [B.run(P(B, V[0], T()), V)], n.not = (B, V) => [B.run(P(B, V[0], v()), V)], n.relu = (B, V) => [B.run(P(B, V[0], A()), V)], n.sigmoid = (B, V) => [B.run(P(B, V[0],
|
|
19524
|
+
n.ceil = (B, V) => [B.run(P(B, V[0], e()), V)], n.cos = (B, V) => [B.run(P(B, V[0], r()), V)], n.elu = (B, V, X) => [B.run(P(B, V[0], o(X.alpha), X.cacheKey), V)], n.parseEluAttributes = (B) => (0, c.createAttributeWithCacheKey)({ alpha: B.attributes.getFloat("alpha", 1) }), n.exp = (B, V) => [B.run(P(B, V[0], h()), V)], n.floor = (B, V) => [B.run(P(B, V[0], b()), V)], n.identity = (B, V) => [B.run(P(B, V[0], y()), V)], n.leakyRelu = (B, V, X) => [B.run(P(B, V[0], m(X.alpha), X.cacheKey), V)], n.parseLeakyReluAttributes = (B) => (0, c.createAttributeWithCacheKey)({ alpha: B.attributes.getFloat("alpha", 0.01) }), n.log = (B, V) => [B.run(P(B, V[0], S()), V)], n.neg = (B, V) => [B.run(P(B, V[0], T()), V)], n.not = (B, V) => [B.run(P(B, V[0], v()), V)], n.relu = (B, V) => [B.run(P(B, V[0], A()), V)], n.sigmoid = (B, V) => [B.run(P(B, V[0], w()), V)], n.sin = (B, V) => [B.run(P(B, V[0], E()), V)], n.sqrt = (B, V) => [B.run(P(B, V[0], x()), V)], n.tan = (B, V) => [B.run(P(B, V[0], N()), V)], n.tanh = (B, V) => [B.run(P(B, V[0], D()), V)];
|
|
19523
19525
|
}, 5611: (s, n, i) => {
|
|
19524
19526
|
Object.defineProperty(n, "__esModule", { value: !0 }), n.createUnpackProgramInfoLoader = n.createUnpackProgramInfo = void 0;
|
|
19525
19527
|
const c = i(5060), l = i(2039), f = i(9390), u = i(2827), d = { name: "unpack", inputNames: ["A"], inputTypes: [l.TextureType.packed] };
|
|
@@ -19572,18 +19574,18 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19572
19574
|
const y = _.attributes.getFloat("cubic_coeff_a", -0.75), m = _.attributes.getInt("exclude_outside", 0) !== 0;
|
|
19573
19575
|
if (m && t !== "cubic") throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");
|
|
19574
19576
|
const S = p < 11 || t === "nearest" && o === "asymmetric" && g === "floor";
|
|
19575
|
-
let T = 0, v = 0,
|
|
19576
|
-
return p > 10 ? _.inputs.length > 2 ? (T = 1, v = 2,
|
|
19577
|
+
let T = 0, v = 0, E = 0;
|
|
19578
|
+
return p > 10 ? _.inputs.length > 2 ? (T = 1, v = 2, E = 3) : (v = 1, E = 2) : p === 9 && (v = 1), (0, c.createAttributeWithCacheKey)({ opset: p, isResize: a, mode: t, scales: e, extrapolationValue: r, coordinateTransformMode: o, useExtrapolation: b, needRoiInput: h, nearestMode: g, cubicCoefficientA: y, excludeOutside: m, useNearest2xOptimization: S, roiInputIdx: T, scalesInputIdx: v, sizesInputIdx: E });
|
|
19577
19579
|
};
|
|
19578
19580
|
const d = (_, p, a) => {
|
|
19579
|
-
const t = (0, l.getGlsl)(_.session.backend.glContext.version), [e, r] = _.calculateTextureWidthAndHeight(p[0].dims, f.TextureType.unpacked), o = p[0].dims.map(((
|
|
19581
|
+
const t = (0, l.getGlsl)(_.session.backend.glContext.version), [e, r] = _.calculateTextureWidthAndHeight(p[0].dims, f.TextureType.unpacked), o = p[0].dims.map(((E, A) => Math.floor(E * a.scales[A]))), [h, b] = _.calculateTextureWidthAndHeight(o, f.TextureType.unpacked), g = o.length, y = new Array(g), m = new Array(g);
|
|
19580
19582
|
let S = `
|
|
19581
19583
|
int output_pitches[${g}];
|
|
19582
19584
|
int input_pitches[${g}];
|
|
19583
19585
|
`;
|
|
19584
|
-
for (let
|
|
19585
|
-
output_pitches[${
|
|
19586
|
-
input_pitches[${
|
|
19586
|
+
for (let E = g - 1; E >= 0; E--) y[E] = E === g - 1 ? 1 : y[E + 1] * o[E + 1], m[E] = E === g - 1 ? 1 : m[E + 1] * p[0].dims[E + 1], S += `
|
|
19587
|
+
output_pitches[${E}] = ${y[E]};
|
|
19588
|
+
input_pitches[${E}] = ${m[E]};
|
|
19587
19589
|
`;
|
|
19588
19590
|
const T = `
|
|
19589
19591
|
float getInputFloat(int index) {
|
|
@@ -19716,7 +19718,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19716
19718
|
float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);
|
|
19717
19719
|
return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);
|
|
19718
19720
|
}`;
|
|
19719
|
-
return Object.assign(Object.assign({}, u), { output: { dims: o, type: p[0].type, textureType: f.TextureType.unpacked }, shaderSource: v, variables: [{ name: "scales", type: "int", arrayLength: a.scales.length, data: a.scales.map(((
|
|
19721
|
+
return Object.assign(Object.assign({}, u), { output: { dims: o, type: p[0].type, textureType: f.TextureType.unpacked }, shaderSource: v, variables: [{ name: "scales", type: "int", arrayLength: a.scales.length, data: a.scales.map(((E) => Math.ceil(E))) }] });
|
|
19720
19722
|
};
|
|
19721
19723
|
n.validateInputs = (_, p) => {
|
|
19722
19724
|
if (!_ || p.opset < 9 && _.length !== 1 || p.opset >= 9 && p.opset < 11 && _.length !== 2 || p.opset >= 11 && _.length < 2) throw new Error("invalid inputs.");
|
|
@@ -20510,14 +20512,14 @@ ${a}`);
|
|
|
20510
20512
|
const m = /* @__PURE__ */ new Set();
|
|
20511
20513
|
y.forEach(((S, T) => {
|
|
20512
20514
|
const v = h.node.outputs[T];
|
|
20513
|
-
for (const
|
|
20514
|
-
const A = t[
|
|
20515
|
-
let
|
|
20515
|
+
for (const E of a[v].to) {
|
|
20516
|
+
const A = t[E];
|
|
20517
|
+
let w = !0;
|
|
20516
20518
|
for (const x of A.inputs) if (!this._values[x]) {
|
|
20517
|
-
|
|
20519
|
+
w = !1;
|
|
20518
20520
|
break;
|
|
20519
20521
|
}
|
|
20520
|
-
|
|
20522
|
+
w && m.add(E);
|
|
20521
20523
|
}
|
|
20522
20524
|
})), p.push(...m);
|
|
20523
20525
|
}
|
|
@@ -20658,12 +20660,12 @@ ${a}`);
|
|
|
20658
20660
|
const T = r.inputs(S);
|
|
20659
20661
|
if (g.has(T)) throw new Error(`duplicated input name: ${T}`);
|
|
20660
20662
|
for (let v = 0; v < r.nodeArgsLength(); v++) if (((o = r.nodeArgs(v)) === null || o === void 0 ? void 0 : o.name()) === T) {
|
|
20661
|
-
const
|
|
20663
|
+
const E = new p();
|
|
20662
20664
|
if (((b = (h = r.nodeArgs(v)) === null || h === void 0 ? void 0 : h.type()) === null || b === void 0 ? void 0 : b.valueType()) !== _.TypeInfoValue.tensor_type) throw new Error("Unexpected value type for the nodeArg.");
|
|
20663
|
-
const A = r.nodeArgs(v).type().value(new _.TensorTypeAndShape()),
|
|
20665
|
+
const A = r.nodeArgs(v).type().value(new _.TensorTypeAndShape()), w = d.ProtoUtil.tensorDataTypeFromProto(A.elemType()), x = A.shape(), N = [];
|
|
20664
20666
|
for (let M = 0; M < x.dimLength(); M++) N.push(d.LongUtil.longToNumber(x.dim(M).value().dimValue()));
|
|
20665
|
-
|
|
20666
|
-
const D = this._allData.push(
|
|
20667
|
+
E.type = { shape: { dims: N }, tensorType: w };
|
|
20668
|
+
const D = this._allData.push(E) - 1;
|
|
20667
20669
|
g.set(T, D), m.push(T);
|
|
20668
20670
|
}
|
|
20669
20671
|
}
|
|
@@ -20671,8 +20673,8 @@ ${a}`);
|
|
|
20671
20673
|
const T = r.initializers(S);
|
|
20672
20674
|
let v = g.get(T.name());
|
|
20673
20675
|
if (v === void 0) {
|
|
20674
|
-
const
|
|
20675
|
-
|
|
20676
|
+
const E = new p(), A = d.ProtoUtil.tensorDimsFromORTFormat(T), w = d.ProtoUtil.tensorDataTypeFromProto(T.dataType());
|
|
20677
|
+
E.type = { shape: { dims: A }, tensorType: w }, v = this._allData.push(E) - 1, g.set(T.name(), v);
|
|
20676
20678
|
}
|
|
20677
20679
|
this._allData[v]._from = -1, this._allData[v].tensor = u.Tensor.fromOrtTensor(T);
|
|
20678
20680
|
}
|
|
@@ -20689,31 +20691,31 @@ ${a}`);
|
|
|
20689
20691
|
let v = T.name();
|
|
20690
20692
|
if (!v) for (let A = 0; v = `unnamed_${T.opType()}_${A}`, y.has(v); A++) ;
|
|
20691
20693
|
if (y.has(v)) throw new Error(`duplicated node name: ${v}`);
|
|
20692
|
-
const
|
|
20693
|
-
y.set(v,
|
|
20694
|
+
const E = this._nodes.push(new a(T, v)) - 1;
|
|
20695
|
+
y.set(v, E);
|
|
20694
20696
|
}
|
|
20695
20697
|
for (let S = 0; S < this._nodes.length; S++) {
|
|
20696
20698
|
const T = this._nodes[S], v = r.nodes(S);
|
|
20697
20699
|
if (v == null) throw new Error(`No node exists at index ${S}`);
|
|
20698
20700
|
if (v?.outputsLength() === 0) throw new Error(`missing output for node: ${v.name}`);
|
|
20699
|
-
for (let
|
|
20700
|
-
const A = v?.outputs(
|
|
20701
|
-
let
|
|
20702
|
-
if (
|
|
20703
|
-
if (this._allData[
|
|
20701
|
+
for (let E = 0; E < v?.outputsLength(); E++) {
|
|
20702
|
+
const A = v?.outputs(E);
|
|
20703
|
+
let w = g.get(A);
|
|
20704
|
+
if (w === void 0 && (w = this._allData.push(new p()) - 1, g.set(A, w)), T.outputs.push(w), this._allData[w]._from !== void 0) throw new Error(`multiple nodes output to one data value: ${w}`);
|
|
20705
|
+
if (this._allData[w]._from = S, v.opType() === "Constant") {
|
|
20704
20706
|
if (v.attributesLength() !== 1 || !v.attributes(0).t()) throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");
|
|
20705
20707
|
if (v.outputsLength() !== 1) throw new Error("missing output or incorrect number of outputs for this Constant operator");
|
|
20706
|
-
T.outputs.pop(), T.executeNode = !1, this._allData[
|
|
20708
|
+
T.outputs.pop(), T.executeNode = !1, this._allData[w]._from = -1, this._allData[w].tensor = u.Tensor.fromOrtTensor(v.attributes(0).t());
|
|
20707
20709
|
}
|
|
20708
20710
|
}
|
|
20709
20711
|
}
|
|
20710
20712
|
for (let S = 0; S < this._nodes.length; S++) {
|
|
20711
20713
|
const T = this._nodes[S], v = r.nodes(S);
|
|
20712
20714
|
if (v.inputsLength() === 0) throw new Error(`missing input for node: ${v.name}`);
|
|
20713
|
-
for (let
|
|
20714
|
-
const A = v.inputs(
|
|
20715
|
-
if (
|
|
20716
|
-
T.inputs.push(
|
|
20715
|
+
for (let E = 0; E < v.inputsLength(); E++) {
|
|
20716
|
+
const A = v.inputs(E), w = g.get(A);
|
|
20717
|
+
if (w === void 0) throw new Error(`unrecognized input '${A}' for node: ${v.name()}`);
|
|
20718
|
+
T.inputs.push(w), this._allData[w]._to.push(S);
|
|
20717
20719
|
}
|
|
20718
20720
|
}
|
|
20719
20721
|
}
|
|
@@ -21602,8 +21604,8 @@ ${a}`);
|
|
|
21602
21604
|
static endNode(t) {
|
|
21603
21605
|
return t.endObject();
|
|
21604
21606
|
}
|
|
21605
|
-
static createNode(t, e, r, o, h, b, g, y, m, S, T, v,
|
|
21606
|
-
return p.startNode(t), p.addName(t, e), p.addDocString(t, r), p.addDomain(t, o), p.addSinceVersion(t, h), p.addIndex(t, b), p.addOpType(t, g), p.addType(t, y), p.addExecutionProviderType(t, m), p.addInputs(t, S), p.addOutputs(t, T), p.addAttributes(t, v), p.addInputArgCounts(t,
|
|
21607
|
+
static createNode(t, e, r, o, h, b, g, y, m, S, T, v, E, A) {
|
|
21608
|
+
return p.startNode(t), p.addName(t, e), p.addDocString(t, r), p.addDomain(t, o), p.addSinceVersion(t, h), p.addIndex(t, b), p.addOpType(t, g), p.addType(t, y), p.addExecutionProviderType(t, m), p.addInputs(t, S), p.addOutputs(t, T), p.addAttributes(t, v), p.addInputArgCounts(t, E), p.addImplicitInputs(t, A), p.endNode(t);
|
|
21607
21609
|
}
|
|
21608
21610
|
}
|
|
21609
21611
|
_.Node = p;
|
|
@@ -22102,8 +22104,8 @@ ${a}`);
|
|
|
22102
22104
|
static endAttribute(t) {
|
|
22103
22105
|
return t.endObject();
|
|
22104
22106
|
}
|
|
22105
|
-
static createAttribute(t, e, r, o, h, b, g, y, m, S, T, v,
|
|
22106
|
-
return p.startAttribute(t), p.addName(t, e), p.addDocString(t, r), p.addType(t, o), p.addF(t, h), p.addI(t, b), p.addS(t, g), p.addT(t, y), p.addG(t, m), p.addFloats(t, S), p.addInts(t, T), p.addStrings(t, v), p.addTensors(t,
|
|
22107
|
+
static createAttribute(t, e, r, o, h, b, g, y, m, S, T, v, E, A) {
|
|
22108
|
+
return p.startAttribute(t), p.addName(t, e), p.addDocString(t, r), p.addType(t, o), p.addF(t, h), p.addI(t, b), p.addS(t, g), p.addT(t, y), p.addG(t, m), p.addFloats(t, S), p.addInts(t, T), p.addStrings(t, v), p.addTensors(t, E), p.addGraphs(t, A), p.endAttribute(t);
|
|
22107
22109
|
}
|
|
22108
22110
|
}
|
|
22109
22111
|
_.Attribute = p;
|
|
@@ -22808,19 +22810,19 @@ ${a}`);
|
|
|
22808
22810
|
}
|
|
22809
22811
|
constructor(b, g, y, m, S, T = l.Guid.create()) {
|
|
22810
22812
|
this.dims = b, this.type = g, this.dataProvider = y, this.asyncDataProvider = m, this.cache = S, this.dataId = T, this.size = _.ShapeUtil.validateDimsAndCalcSize(b);
|
|
22811
|
-
const v = this.size,
|
|
22813
|
+
const v = this.size, E = y === void 0 && m === void 0 && S === void 0;
|
|
22812
22814
|
if (S !== void 0 && S.length !== v) throw new RangeError("Input dims doesn't match data length.");
|
|
22813
22815
|
if (g === "string") {
|
|
22814
22816
|
if (!(S === void 0 || Array.isArray(S) && S.every(((A) => typeof A == "string")))) throw new TypeError("cache should be a string array");
|
|
22815
|
-
|
|
22817
|
+
E && (this.cache = new Array(v));
|
|
22816
22818
|
} else {
|
|
22817
22819
|
if (S !== void 0) {
|
|
22818
22820
|
const A = e(g);
|
|
22819
22821
|
if (!(S instanceof A)) throw new TypeError(`cache should be type ${A.name}`);
|
|
22820
22822
|
}
|
|
22821
|
-
if (
|
|
22822
|
-
const A = new ArrayBuffer(v * (function(
|
|
22823
|
-
switch (
|
|
22823
|
+
if (E) {
|
|
22824
|
+
const A = new ArrayBuffer(v * (function(w) {
|
|
22825
|
+
switch (w) {
|
|
22824
22826
|
case "bool":
|
|
22825
22827
|
case "int8":
|
|
22826
22828
|
case "uint8":
|
|
@@ -22835,11 +22837,11 @@ ${a}`);
|
|
|
22835
22837
|
case "float64":
|
|
22836
22838
|
return 8;
|
|
22837
22839
|
default:
|
|
22838
|
-
throw new Error(`cannot calculate sizeof() on type ${
|
|
22840
|
+
throw new Error(`cannot calculate sizeof() on type ${w}`);
|
|
22839
22841
|
}
|
|
22840
22842
|
})(g));
|
|
22841
|
-
this.cache = (function(
|
|
22842
|
-
return new (e(x))(
|
|
22843
|
+
this.cache = (function(w, x) {
|
|
22844
|
+
return new (e(x))(w);
|
|
22843
22845
|
})(A, g);
|
|
22844
22846
|
}
|
|
22845
22847
|
}
|
|
@@ -22851,12 +22853,12 @@ ${a}`);
|
|
|
22851
22853
|
m.data[T] = (0, _.decodeUtf8String)(S);
|
|
22852
22854
|
}));
|
|
22853
22855
|
else if (b.rawData && typeof b.rawData.byteLength == "number" && b.rawData.byteLength > 0) {
|
|
22854
|
-
const S = m.data, T = new DataView(b.rawData.buffer, b.rawData.byteOffset, b.rawData.byteLength), v = t(b.dataType),
|
|
22856
|
+
const S = m.data, T = new DataView(b.rawData.buffer, b.rawData.byteOffset, b.rawData.byteLength), v = t(b.dataType), E = b.rawData.byteLength / v;
|
|
22855
22857
|
if (b.rawData.byteLength % v != 0) throw new Error("invalid buffer length");
|
|
22856
|
-
if (S.length !==
|
|
22857
|
-
for (let A = 0; A <
|
|
22858
|
-
const
|
|
22859
|
-
S[A] =
|
|
22858
|
+
if (S.length !== E) throw new Error("buffer length mismatch");
|
|
22859
|
+
for (let A = 0; A < E; A++) {
|
|
22860
|
+
const w = o(T, b.dataType, A * v);
|
|
22861
|
+
S[A] = w;
|
|
22860
22862
|
}
|
|
22861
22863
|
} else {
|
|
22862
22864
|
let S;
|
|
@@ -22889,8 +22891,8 @@ ${a}`);
|
|
|
22889
22891
|
const T = m.data;
|
|
22890
22892
|
if (T.length !== S.length) throw new Error("array length mismatch");
|
|
22891
22893
|
for (let v = 0; v < S.length; v++) {
|
|
22892
|
-
const
|
|
22893
|
-
f.default.isLong(
|
|
22894
|
+
const E = S[v];
|
|
22895
|
+
f.default.isLong(E) ? T[v] = r(E, b.dataType) : T[v] = E;
|
|
22894
22896
|
}
|
|
22895
22897
|
}
|
|
22896
22898
|
return m;
|
|
@@ -22903,12 +22905,12 @@ ${a}`);
|
|
|
22903
22905
|
const g = _.ProtoUtil.tensorDimsFromORTFormat(b), y = _.ProtoUtil.tensorDataTypeFromProto(b.dataType()), m = new a(g, y);
|
|
22904
22906
|
if (y === "string") for (let S = 0; S < b.stringDataLength(); S++) m.data[S] = b.stringData(S);
|
|
22905
22907
|
else if (b.rawDataArray() && typeof b.rawDataLength() == "number" && b.rawDataLength() > 0) {
|
|
22906
|
-
const S = m.data, T = new DataView(b.rawDataArray().buffer, b.rawDataArray().byteOffset, b.rawDataLength()), v = t(b.dataType()),
|
|
22908
|
+
const S = m.data, T = new DataView(b.rawDataArray().buffer, b.rawDataArray().byteOffset, b.rawDataLength()), v = t(b.dataType()), E = b.rawDataLength() / v;
|
|
22907
22909
|
if (b.rawDataLength() % v != 0) throw new Error("invalid buffer length");
|
|
22908
|
-
if (S.length !==
|
|
22909
|
-
for (let A = 0; A <
|
|
22910
|
-
const
|
|
22911
|
-
S[A] =
|
|
22910
|
+
if (S.length !== E) throw new Error("buffer length mismatch");
|
|
22911
|
+
for (let A = 0; A < E; A++) {
|
|
22912
|
+
const w = o(T, b.dataType(), A * v);
|
|
22913
|
+
S[A] = w;
|
|
22912
22914
|
}
|
|
22913
22915
|
}
|
|
22914
22916
|
return m;
|
|
@@ -23031,19 +23033,19 @@ ${a}`);
|
|
|
23031
23033
|
const S = g.length, T = y.length;
|
|
23032
23034
|
if (S === 0) return y;
|
|
23033
23035
|
if (T === 0) return g;
|
|
23034
|
-
const v = Math.max(g.length, y.length),
|
|
23036
|
+
const v = Math.max(g.length, y.length), E = new Array(v);
|
|
23035
23037
|
if (m) {
|
|
23036
23038
|
if (S < 2 || T < 2) return;
|
|
23037
23039
|
const A = _.calcMatMulShape([g[S - 2], g[S - 1]], [y[T - 2], y[T - 1]]);
|
|
23038
23040
|
if (A === void 0) return;
|
|
23039
|
-
[
|
|
23041
|
+
[E[v - 2], E[v - 1]] = A;
|
|
23040
23042
|
}
|
|
23041
23043
|
for (let A = m ? 3 : 1; A <= v; A++) {
|
|
23042
|
-
const
|
|
23043
|
-
if (
|
|
23044
|
-
|
|
23044
|
+
const w = S - A < 0 ? 1 : g[S - A], x = T - A < 0 ? 1 : y[T - A];
|
|
23045
|
+
if (w !== x && w > 1 && x > 1) return;
|
|
23046
|
+
E[v - A] = Math.max(w, x);
|
|
23045
23047
|
}
|
|
23046
|
-
return
|
|
23048
|
+
return E;
|
|
23047
23049
|
}
|
|
23048
23050
|
static index(g, y) {
|
|
23049
23051
|
const m = new Array(y.length);
|
|
@@ -23057,16 +23059,16 @@ ${a}`);
|
|
|
23057
23059
|
const v = p.calcShape(g.dims, y.dims);
|
|
23058
23060
|
if (v) {
|
|
23059
23061
|
if (S && !e.areEqual(v, g.dims)) return;
|
|
23060
|
-
const
|
|
23062
|
+
const E = e.size(v), A = S ? g : new d.Tensor(v, T || g.type);
|
|
23061
23063
|
if (v.length === 0) A.set([], m(g.get([]), y.get([])));
|
|
23062
23064
|
else {
|
|
23063
|
-
const
|
|
23065
|
+
const w = new Array(v.length), x = new Array(g.dims.length), N = new Array(y.dims.length);
|
|
23064
23066
|
let D, M = 0, P = 0, L = !1, B = !1;
|
|
23065
23067
|
g.dims.length === 0 && (M = g.get([]), L = !0), y.dims.length === 0 && (P = y.get([]), B = !0);
|
|
23066
|
-
for (let V = 0; V <
|
|
23068
|
+
for (let V = 0; V < E; V++) {
|
|
23067
23069
|
D = V;
|
|
23068
|
-
for (let X = v.length - 1; X >= 0; X--)
|
|
23069
|
-
L || (p.fillIndex(
|
|
23070
|
+
for (let X = v.length - 1; X >= 0; X--) w[X] = D % v[X], D = Math.floor(D / v[X]);
|
|
23071
|
+
L || (p.fillIndex(w, g.dims, x), M = g.get(x)), B || (p.fillIndex(w, y.dims, N), P = y.get(N)), A.set(w, m(M, P));
|
|
23070
23072
|
}
|
|
23071
23073
|
}
|
|
23072
23074
|
return A;
|
|
@@ -23081,8 +23083,8 @@ ${a}`);
|
|
|
23081
23083
|
static getBroadcastDims(g, y) {
|
|
23082
23084
|
const m = g.length, S = [];
|
|
23083
23085
|
for (let T = 0; T < m; T++) {
|
|
23084
|
-
const v = m - 1 - T,
|
|
23085
|
-
(y[y.length - 1 - T] || 1) > 1 &&
|
|
23086
|
+
const v = m - 1 - T, E = g[v] || 1;
|
|
23087
|
+
(y[y.length - 1 - T] || 1) > 1 && E === 1 && S.unshift(v);
|
|
23086
23088
|
}
|
|
23087
23089
|
return S;
|
|
23088
23090
|
}
|
|
@@ -23096,13 +23098,13 @@ ${a}`);
|
|
|
23096
23098
|
}, n.GemmUtil = class {
|
|
23097
23099
|
static getShapeOfGemmResult(b, g, y, m, S) {
|
|
23098
23100
|
if (b.length !== 2 || y.length !== 2) throw new Error("shape need to be of size 2");
|
|
23099
|
-
let T, v,
|
|
23101
|
+
let T, v, E;
|
|
23100
23102
|
g ? (T = b[1], v = b[0]) : (T = b[0], v = b[1]);
|
|
23101
23103
|
let A = -1;
|
|
23102
|
-
if (m ? (
|
|
23103
|
-
if (T <= 0 ||
|
|
23104
|
-
if (S && !p.isValidBroadcast(S, [T,
|
|
23105
|
-
return [T,
|
|
23104
|
+
if (m ? (E = y[0], A = 1) : (E = y[1], A = 0), y[A] !== v) throw new Error("dimension mismatch");
|
|
23105
|
+
if (T <= 0 || E <= 0 || v <= 0) throw new Error("invalid shape specified");
|
|
23106
|
+
if (S && !p.isValidBroadcast(S, [T, E])) throw new Error("gemm: invalid bias shape for broadcast");
|
|
23107
|
+
return [T, E, v];
|
|
23106
23108
|
}
|
|
23107
23109
|
};
|
|
23108
23110
|
class a {
|
|
@@ -23272,11 +23274,11 @@ ${a}`);
|
|
|
23272
23274
|
v *= S[A];
|
|
23273
23275
|
}
|
|
23274
23276
|
}
|
|
23275
|
-
const
|
|
23277
|
+
const E = e.size(g);
|
|
23276
23278
|
if (T !== -1) {
|
|
23277
|
-
if (
|
|
23278
|
-
S[T] =
|
|
23279
|
-
} else if (v !==
|
|
23279
|
+
if (E % v != 0) throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${g}] Output shape: [${y}]`);
|
|
23280
|
+
S[T] = E / v;
|
|
23281
|
+
} else if (v !== E) throw new Error("reshapedDims and originalDims don't have matching sizes");
|
|
23280
23282
|
return S;
|
|
23281
23283
|
}
|
|
23282
23284
|
static sortBasedOnPerm(g, y) {
|
|
@@ -23366,10 +23368,10 @@ ${a}`);
|
|
|
23366
23368
|
r.determineSplit(g[y], S, m);
|
|
23367
23369
|
}
|
|
23368
23370
|
const T = [], v = [0];
|
|
23369
|
-
for (let
|
|
23370
|
-
|
|
23371
|
+
for (let E = 0; E < m.length; ++E) {
|
|
23372
|
+
E !== 0 && v.push(v[E - 1] + m[E - 1]);
|
|
23371
23373
|
const A = g.slice();
|
|
23372
|
-
A[y] = m[
|
|
23374
|
+
A[y] = m[E], T.push(A);
|
|
23373
23375
|
}
|
|
23374
23376
|
return [T, v];
|
|
23375
23377
|
}
|
|
@@ -23383,18 +23385,18 @@ ${a}`);
|
|
|
23383
23385
|
static calcReduce(g, y, m, S, T) {
|
|
23384
23386
|
const v = g.dims.slice(0);
|
|
23385
23387
|
y.length === 0 && v.forEach(((M, P) => y.push(P)));
|
|
23386
|
-
const
|
|
23388
|
+
const E = o.calcReduceShape(v, y, !0), A = e.size(E), w = new d.Tensor(E, g.type), x = e.computeStrides(E), N = e.computeStrides(v), D = new Array(v.length);
|
|
23387
23389
|
for (let M = 0; M < A; M++) {
|
|
23388
23390
|
const P = e.offsetToIndices(M, x);
|
|
23389
|
-
p.fillIndex(P, v, D),
|
|
23391
|
+
p.fillIndex(P, v, D), w.set(P, o.calcReduceByAxis(g.numberData, y, v, 0, e.indicesToOffset(D, N), S, T));
|
|
23390
23392
|
}
|
|
23391
|
-
return m ?
|
|
23393
|
+
return m ? w : new d.Tensor(o.calcReduceShape(v, y, m), w.type, void 0, void 0, w.data, w.dataId);
|
|
23392
23394
|
}
|
|
23393
|
-
static calcReduceByAxis(g, y, m, S, T, v,
|
|
23395
|
+
static calcReduceByAxis(g, y, m, S, T, v, E) {
|
|
23394
23396
|
let A = 0;
|
|
23395
23397
|
if (S >= y.length) return v(g[T]);
|
|
23396
|
-
const
|
|
23397
|
-
for (let N = 0; N < m[
|
|
23398
|
+
const w = y[S], x = w >= m.length ? 1 : e.size(m.slice(w + 1));
|
|
23399
|
+
for (let N = 0; N < m[w]; N++) A = N === 0 ? o.calcReduceByAxis(g, y, m, S + 1, T, v, E) : E(A, o.calcReduceByAxis(g, y, m, S + 1, T, v, E)), T += x;
|
|
23398
23400
|
return A;
|
|
23399
23401
|
}
|
|
23400
23402
|
static calcReduceShape(g, y, m) {
|
|
@@ -23407,19 +23409,19 @@ ${a}`);
|
|
|
23407
23409
|
class h {
|
|
23408
23410
|
static adjustPoolAttributes(g, y, m, S, T, v) {
|
|
23409
23411
|
if (!g && m.length !== y.length - 2) throw new Error("length of specified kernel shapes should be 2 less than length of input dimensions");
|
|
23410
|
-
if (g) for (let
|
|
23411
|
-
for (let
|
|
23412
|
-
if (S[
|
|
23412
|
+
if (g) for (let E = 0; E < y.length - 2; E++) E >= m.length ? m.push(y[E + 2]) : m[E] = y[E + 2];
|
|
23413
|
+
for (let E = 0; E < m.length; E++) if (E < S.length) {
|
|
23414
|
+
if (S[E] < 0) throw new Error("strides should be greater than or equal to 1");
|
|
23413
23415
|
} else S.push(1);
|
|
23414
|
-
for (let
|
|
23415
|
-
if (T[
|
|
23416
|
+
for (let E = 0; E < m.length; E++) if (E < T.length) {
|
|
23417
|
+
if (T[E] < 0) throw new Error("dilations should be greater than or equal to 1");
|
|
23416
23418
|
} else T.push(1);
|
|
23417
|
-
for (let
|
|
23418
|
-
if (v[
|
|
23419
|
+
for (let E = 0; E < 2 * m.length; E++) if (E < v.length) {
|
|
23420
|
+
if (v[E] < 0) throw new Error("pad should be greater than or equal to 1");
|
|
23419
23421
|
} else v.push(0);
|
|
23420
|
-
for (let
|
|
23421
|
-
if (m[
|
|
23422
|
-
if (v[
|
|
23422
|
+
for (let E = 0; E < m.length; E++) {
|
|
23423
|
+
if (m[E] <= 0) throw new Error("kernel shapes need to be greater than 0");
|
|
23424
|
+
if (v[E] >= m[E] || v[E + m.length] >= m[E]) throw new Error("pads should be smaller than kernel");
|
|
23423
23425
|
}
|
|
23424
23426
|
}
|
|
23425
23427
|
static adjustPadsBasedOnAutoPad(g, y, m, S, T, v) {
|
|
@@ -23427,35 +23429,35 @@ ${a}`);
|
|
|
23427
23429
|
if (T.length !== 2 * (g.length - 2)) throw new Error("length of pads should be twice the length of data dimensions");
|
|
23428
23430
|
if (y.length !== g.length - 2) throw new Error("length of strides should be the length of data dimensions");
|
|
23429
23431
|
if (S.length !== g.length - 2) throw new Error("length of kernel shapes should be the length of data dimensions");
|
|
23430
|
-
for (let
|
|
23432
|
+
for (let E = 0; E < g.length - 2; E++) h.adjustPadAndReturnShape(g[E + 2], y[E], m[E], S[E], T, E, E + g.length - 2, v);
|
|
23431
23433
|
}
|
|
23432
23434
|
}
|
|
23433
|
-
static computePoolOutputShape(g, y, m, S, T, v,
|
|
23435
|
+
static computePoolOutputShape(g, y, m, S, T, v, E) {
|
|
23434
23436
|
if (y.length <= 0) throw new Error("input shape must be of size greater than 0");
|
|
23435
23437
|
const A = [y[0], y[1]];
|
|
23436
|
-
return h.computeShapeHelper(g, y, A, m, S, T, v,
|
|
23438
|
+
return h.computeShapeHelper(g, y, A, m, S, T, v, E), A;
|
|
23437
23439
|
}
|
|
23438
|
-
static computeConvOutputShape(g, y, m, S, T, v,
|
|
23440
|
+
static computeConvOutputShape(g, y, m, S, T, v, E) {
|
|
23439
23441
|
if (g.length <= 0 || y.length <= 0) throw new Error("invalid input tensor dims or invalid filter tensor dims");
|
|
23440
23442
|
const A = [g[0], y[0]];
|
|
23441
|
-
return h.computeShapeHelper(!1, g, A, m, S, T, v,
|
|
23443
|
+
return h.computeShapeHelper(!1, g, A, m, S, T, v, E), A;
|
|
23442
23444
|
}
|
|
23443
|
-
static computeShapeHelper(g, y, m, S, T, v,
|
|
23444
|
-
if (g) for (let
|
|
23445
|
-
else for (let
|
|
23445
|
+
static computeShapeHelper(g, y, m, S, T, v, E, A) {
|
|
23446
|
+
if (g) for (let w = 0; w < y.length - 2; w++) m.push(1);
|
|
23447
|
+
else for (let w = 0; w < y.length - 2; w++) m.push(h.adjustPadAndReturnShape(y[w + 2], S[w], T[w], v[w], E, w, w + y.length - 2, A));
|
|
23446
23448
|
}
|
|
23447
|
-
static adjustPadAndReturnShape(g, y, m, S, T, v,
|
|
23448
|
-
const
|
|
23449
|
-
if (!A || A === "NOTSET") return Math.floor((g + T[v] + T[
|
|
23449
|
+
static adjustPadAndReturnShape(g, y, m, S, T, v, E, A) {
|
|
23450
|
+
const w = m * (S - 1) + 1;
|
|
23451
|
+
if (!A || A === "NOTSET") return Math.floor((g + T[v] + T[E] - w) / y + 1);
|
|
23450
23452
|
switch (A) {
|
|
23451
23453
|
case "VALID":
|
|
23452
|
-
return T[v] = 0, T[
|
|
23454
|
+
return T[v] = 0, T[E] = 0, Math.floor((g - w) / y + 1);
|
|
23453
23455
|
case "SAME_LOWER":
|
|
23454
23456
|
case "SAME_UPPER":
|
|
23455
23457
|
if (m !== 1) throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");
|
|
23456
23458
|
{
|
|
23457
23459
|
const x = ((g + y - 1) / y - 1) * y + S - g;
|
|
23458
|
-
return T[v] = Math.floor(A === "SAME_LOWER" ? (x + 1) / 2 : x / 2), T[
|
|
23460
|
+
return T[v] = Math.floor(A === "SAME_LOWER" ? (x + 1) / 2 : x / 2), T[E] = x - T[v], Math.floor((g + x - S) / y + 1);
|
|
23459
23461
|
}
|
|
23460
23462
|
default:
|
|
23461
23463
|
throw new Error("Unsupported AutoPad type");
|
|
@@ -23503,7 +23505,7 @@ ${a}`);
|
|
|
23503
23505
|
Object.defineProperty(n, "__esModule", { value: !0 }), n.endProfiling = n.run = n.releaseSession = n.createSession = n.createSessionFinalize = n.createSessionAllocate = n.initOrt = n.initWasm = void 0;
|
|
23504
23506
|
const d = i(1670), _ = u(i(349)), p = i(6361), a = () => !!d.env.wasm.proxy && typeof document < "u";
|
|
23505
23507
|
let t, e, r, o = !1, h = !1, b = !1;
|
|
23506
|
-
const g = [], y = [], m = [], S = [], T = [], v = [],
|
|
23508
|
+
const g = [], y = [], m = [], S = [], T = [], v = [], E = () => {
|
|
23507
23509
|
if (o || !h || b || !t) throw new Error("worker not ready");
|
|
23508
23510
|
}, A = (x) => {
|
|
23509
23511
|
switch (x.data.type) {
|
|
@@ -23531,13 +23533,13 @@ ${a}`);
|
|
|
23531
23533
|
case "end-profiling":
|
|
23532
23534
|
x.data.err ? v.shift()[1](x.data.err) : v.shift()[0]();
|
|
23533
23535
|
}
|
|
23534
|
-
},
|
|
23536
|
+
}, w = typeof document < "u" ? (c = document?.currentScript) === null || c === void 0 ? void 0 : c.src : void 0;
|
|
23535
23537
|
n.initWasm = async () => {
|
|
23536
23538
|
if (a()) {
|
|
23537
23539
|
if (h) return;
|
|
23538
23540
|
if (o) throw new Error("multiple calls to 'initWasm()' detected.");
|
|
23539
23541
|
if (b) throw new Error("previous call to 'initWasm()' failed.");
|
|
23540
|
-
return o = !0, d.env.wasm.wasmPaths === void 0 &&
|
|
23542
|
+
return o = !0, d.env.wasm.wasmPaths === void 0 && w && w.indexOf("blob:") !== 0 && (d.env.wasm.wasmPaths = w.substr(0, +w.lastIndexOf("/") + 1)), new Promise(((x, N) => {
|
|
23541
23543
|
t?.terminate(), t = i(9710).Z(), t.onmessage = A, e = [x, N];
|
|
23542
23544
|
const D = { type: "init-wasm", in: d.env.wasm };
|
|
23543
23545
|
t.postMessage(D);
|
|
@@ -23545,37 +23547,37 @@ ${a}`);
|
|
|
23545
23547
|
}
|
|
23546
23548
|
return (0, p.initializeWebAssembly)(d.env.wasm);
|
|
23547
23549
|
}, n.initOrt = async (x, N) => {
|
|
23548
|
-
if (a()) return
|
|
23550
|
+
if (a()) return E(), new Promise(((D, M) => {
|
|
23549
23551
|
r = [D, M];
|
|
23550
23552
|
const P = { type: "init-ort", in: { numThreads: x, loggingLevel: N } };
|
|
23551
23553
|
t.postMessage(P);
|
|
23552
23554
|
}));
|
|
23553
23555
|
_.initOrt(x, N);
|
|
23554
|
-
}, n.createSessionAllocate = async (x) => a() ? (
|
|
23556
|
+
}, n.createSessionAllocate = async (x) => a() ? (E(), new Promise(((N, D) => {
|
|
23555
23557
|
g.push([N, D]);
|
|
23556
23558
|
const M = { type: "create_allocate", in: { model: x } };
|
|
23557
23559
|
t.postMessage(M, [x.buffer]);
|
|
23558
|
-
}))) : _.createSessionAllocate(x), n.createSessionFinalize = async (x, N) => a() ? (
|
|
23560
|
+
}))) : _.createSessionAllocate(x), n.createSessionFinalize = async (x, N) => a() ? (E(), new Promise(((D, M) => {
|
|
23559
23561
|
y.push([D, M]);
|
|
23560
23562
|
const P = { type: "create_finalize", in: { modeldata: x, options: N } };
|
|
23561
23563
|
t.postMessage(P);
|
|
23562
|
-
}))) : _.createSessionFinalize(x, N), n.createSession = async (x, N) => a() ? (
|
|
23564
|
+
}))) : _.createSessionFinalize(x, N), n.createSession = async (x, N) => a() ? (E(), new Promise(((D, M) => {
|
|
23563
23565
|
m.push([D, M]);
|
|
23564
23566
|
const P = { type: "create", in: { model: x, options: N } };
|
|
23565
23567
|
t.postMessage(P, [x.buffer]);
|
|
23566
23568
|
}))) : _.createSession(x, N), n.releaseSession = async (x) => {
|
|
23567
|
-
if (a()) return
|
|
23569
|
+
if (a()) return E(), new Promise(((N, D) => {
|
|
23568
23570
|
S.push([N, D]);
|
|
23569
23571
|
const M = { type: "release", in: x };
|
|
23570
23572
|
t.postMessage(M);
|
|
23571
23573
|
}));
|
|
23572
23574
|
_.releaseSession(x);
|
|
23573
|
-
}, n.run = async (x, N, D, M, P) => a() ? (
|
|
23575
|
+
}, n.run = async (x, N, D, M, P) => a() ? (E(), new Promise(((L, B) => {
|
|
23574
23576
|
T.push([L, B]);
|
|
23575
23577
|
const V = { type: "run", in: { sessionId: x, inputIndices: N, inputs: D, outputIndices: M, options: P } };
|
|
23576
23578
|
t.postMessage(V, _.extractTransferableBuffers(D));
|
|
23577
23579
|
}))) : _.run(x, N, D, M, P), n.endProfiling = async (x) => {
|
|
23578
|
-
if (a()) return
|
|
23580
|
+
if (a()) return E(), new Promise(((N, D) => {
|
|
23579
23581
|
v.push([N, D]);
|
|
23580
23582
|
const M = { type: "end-profiling", in: x };
|
|
23581
23583
|
t.postMessage(M);
|
|
@@ -23761,13 +23763,13 @@ ${a}`);
|
|
|
23761
23763
|
r._free(t[0]), r._OrtReleaseSessionOptions(h), b.forEach(r._free);
|
|
23762
23764
|
}
|
|
23763
23765
|
const g = r._OrtGetInputCount(o), y = r._OrtGetOutputCount(o), m = [], S = [], T = [], v = [];
|
|
23764
|
-
for (let
|
|
23765
|
-
const A = r._OrtGetInputName(o,
|
|
23766
|
+
for (let E = 0; E < g; E++) {
|
|
23767
|
+
const A = r._OrtGetInputName(o, E);
|
|
23766
23768
|
if (A === 0) throw new Error("Can't get an input name");
|
|
23767
23769
|
S.push(A), m.push(r.UTF8ToString(A));
|
|
23768
23770
|
}
|
|
23769
|
-
for (let
|
|
23770
|
-
const A = r._OrtGetOutputName(o,
|
|
23771
|
+
for (let E = 0; E < y; E++) {
|
|
23772
|
+
const A = r._OrtGetOutputName(o, E);
|
|
23771
23773
|
if (A === 0) throw new Error("Can't get an output name");
|
|
23772
23774
|
v.push(A), T.push(r.UTF8ToString(A));
|
|
23773
23775
|
}
|
|
@@ -23870,10 +23872,10 @@ ${a}`);
|
|
|
23870
23872
|
const b = (0, u.getInstance)(), g = d.get(t);
|
|
23871
23873
|
if (!g) throw new Error("invalid session id");
|
|
23872
23874
|
const y = g[0], m = g[1], S = g[2], T = e.length, v = o.length;
|
|
23873
|
-
let
|
|
23874
|
-
const
|
|
23875
|
+
let E = 0, A = [];
|
|
23876
|
+
const w = [], x = [];
|
|
23875
23877
|
try {
|
|
23876
|
-
[
|
|
23878
|
+
[E, A] = (0, c.setRunOptions)(h);
|
|
23877
23879
|
for (let B = 0; B < T; B++) {
|
|
23878
23880
|
const V = r[B][0], X = r[B][1], Z = r[B][2];
|
|
23879
23881
|
let q, k;
|
|
@@ -23891,7 +23893,7 @@ ${a}`);
|
|
|
23891
23893
|
X.forEach(((he) => b.HEAP32[F++] = he));
|
|
23892
23894
|
const j = b._OrtCreateTensor(_(V), q, k, O, X.length);
|
|
23893
23895
|
if (j === 0) throw new Error("Can't create a tensor");
|
|
23894
|
-
|
|
23896
|
+
w.push(j);
|
|
23895
23897
|
} finally {
|
|
23896
23898
|
b.stackRestore(I);
|
|
23897
23899
|
}
|
|
@@ -23899,9 +23901,9 @@ ${a}`);
|
|
|
23899
23901
|
const N = b.stackSave(), D = b.stackAlloc(4 * T), M = b.stackAlloc(4 * T), P = b.stackAlloc(4 * v), L = b.stackAlloc(4 * v);
|
|
23900
23902
|
try {
|
|
23901
23903
|
let B = D / 4, V = M / 4, X = P / 4, Z = L / 4;
|
|
23902
|
-
for (let I = 0; I < T; I++) b.HEAPU32[B++] =
|
|
23904
|
+
for (let I = 0; I < T; I++) b.HEAPU32[B++] = w[I], b.HEAPU32[V++] = m[e[I]];
|
|
23903
23905
|
for (let I = 0; I < v; I++) b.HEAPU32[X++] = 0, b.HEAPU32[Z++] = S[o[I]];
|
|
23904
|
-
let q = b._OrtRun(y, M, D, T, L, v, P,
|
|
23906
|
+
let q = b._OrtRun(y, M, D, T, L, v, P, E);
|
|
23905
23907
|
const k = [];
|
|
23906
23908
|
if (q === 0) for (let I = 0; I < v; I++) {
|
|
23907
23909
|
const O = b.HEAPU32[P / 4 + I], F = b.stackSave(), j = b.stackAlloc(16);
|
|
@@ -23914,12 +23916,12 @@ ${a}`);
|
|
|
23914
23916
|
const rt = b.HEAPU32[Q++], ct = b.HEAPU32[Q++], yt = [];
|
|
23915
23917
|
for (let ht = 0; ht < ct; ht++) yt.push(b.HEAPU32[rt / 4 + ht]);
|
|
23916
23918
|
b._OrtFree(rt);
|
|
23917
|
-
const mt = yt.length === 0 ? 1 : yt.reduce(((ht,
|
|
23919
|
+
const mt = yt.length === 0 ? 1 : yt.reduce(((ht, Et) => ht * Et));
|
|
23918
23920
|
if (he = p(Ce), he === "string") {
|
|
23919
23921
|
const ht = [];
|
|
23920
|
-
let
|
|
23922
|
+
let Et = Xe / 4;
|
|
23921
23923
|
for (let Ot = 0; Ot < mt; Ot++) {
|
|
23922
|
-
const Ht = b.HEAPU32[
|
|
23924
|
+
const Ht = b.HEAPU32[Et++], nn = Ot === mt - 1 ? void 0 : b.HEAPU32[Et] - Ht;
|
|
23923
23925
|
ht.push(b.UTF8ToString(Ht, nn));
|
|
23924
23926
|
}
|
|
23925
23927
|
k.push([he, yt, ht]);
|
|
@@ -23937,7 +23939,7 @@ ${a}`);
|
|
|
23937
23939
|
b.stackRestore(N);
|
|
23938
23940
|
}
|
|
23939
23941
|
} finally {
|
|
23940
|
-
|
|
23942
|
+
w.forEach(b._OrtReleaseTensor), x.forEach(b._free), b._OrtReleaseRunOptions(E), A.forEach(b._free);
|
|
23941
23943
|
}
|
|
23942
23944
|
}, n.endProfiling = (t) => {
|
|
23943
23945
|
const e = (0, u.getInstance)(), r = d.get(t);
|
|
@@ -23995,15 +23997,15 @@ ${a}`);
|
|
|
23995
23997
|
} catch {
|
|
23996
23998
|
return !1;
|
|
23997
23999
|
}
|
|
23998
|
-
})(), T = typeof h.wasmPaths == "string" ? h.wasmPaths : void 0, v = o(!1, m),
|
|
23999
|
-
let
|
|
24000
|
+
})(), T = typeof h.wasmPaths == "string" ? h.wasmPaths : void 0, v = o(!1, m), E = o(S, m), A = typeof h.wasmPaths == "object" ? h.wasmPaths[E] : void 0;
|
|
24001
|
+
let w = !1;
|
|
24000
24002
|
const x = [];
|
|
24001
24003
|
if (b > 0 && x.push(new Promise(((N) => {
|
|
24002
24004
|
setTimeout((() => {
|
|
24003
|
-
|
|
24005
|
+
w = !0, N();
|
|
24004
24006
|
}), b);
|
|
24005
24007
|
}))), x.push(new Promise(((N, D) => {
|
|
24006
|
-
const M = m ? p : _.default, P = { locateFile: (L, B) => m && L.endsWith(".worker.js") && typeof Blob < "u" ? URL.createObjectURL(new Blob([i(4154)], { type: "text/javascript" })) : L === v ? A ?? (T ?? B) +
|
|
24008
|
+
const M = m ? p : _.default, P = { locateFile: (L, B) => m && L.endsWith(".worker.js") && typeof Blob < "u" ? URL.createObjectURL(new Blob([i(4154)], { type: "text/javascript" })) : L === v ? A ?? (T ?? B) + E : B + L };
|
|
24007
24009
|
if (m) if (typeof Blob > "u") P.mainScriptUrlOrBlob = d.join("/", "ort-wasm-threaded.js");
|
|
24008
24010
|
else {
|
|
24009
24011
|
const L = `var ortWasmThreaded=(function(){var _scriptDir;return ${M.toString()}})();`;
|
|
@@ -24014,7 +24016,7 @@ ${a}`);
|
|
|
24014
24016
|
}), ((L) => {
|
|
24015
24017
|
e = !1, r = !0, D(L);
|
|
24016
24018
|
}));
|
|
24017
|
-
}))), await Promise.race(x),
|
|
24019
|
+
}))), await Promise.race(x), w) throw new Error(`WebAssembly backend initializing failed due to timeout: ${b}ms`);
|
|
24018
24020
|
}, n.getInstance = () => {
|
|
24019
24021
|
if (t && a) return a;
|
|
24020
24022
|
throw new Error("WebAssembly is not initialized yet.");
|
|
@@ -24772,11 +24774,11 @@ function requireRealTimeVad() {
|
|
|
24772
24774
|
}) : S = m.stream;
|
|
24773
24775
|
const T = new AudioContext(), v = new MediaStreamAudioSourceNode(T, {
|
|
24774
24776
|
mediaStream: S
|
|
24775
|
-
}),
|
|
24776
|
-
return
|
|
24777
|
+
}), E = await b.new(T, m);
|
|
24778
|
+
return E.receive(v), new h(m, T, S, E, v);
|
|
24777
24779
|
}
|
|
24778
|
-
constructor(y, m, S, T, v,
|
|
24779
|
-
this.options = y, this.audioContext = m, this.stream = S, this.audioNodeVAD = T, this.sourceNode = v, this.listening =
|
|
24780
|
+
constructor(y, m, S, T, v, E = !1) {
|
|
24781
|
+
this.options = y, this.audioContext = m, this.stream = S, this.audioNodeVAD = T, this.sourceNode = v, this.listening = E, this.pause = () => {
|
|
24780
24782
|
this.audioNodeVAD.pause(), this.listening = !1;
|
|
24781
24783
|
}, this.start = () => {
|
|
24782
24784
|
this.audioNodeVAD.start(), this.listening = !0;
|
|
@@ -24793,14 +24795,14 @@ function requireRealTimeVad() {
|
|
|
24793
24795
|
...m
|
|
24794
24796
|
};
|
|
24795
24797
|
(0, u.validateOptions)(S), s.ort.env.wasm.wasmPaths = S.onnxWASMBasePath, S.ortConfig !== void 0 && S.ortConfig(s.ort);
|
|
24796
|
-
const T = S.model === "v5" ? e : r, v = S.baseAssetPath + T,
|
|
24798
|
+
const T = S.model === "v5" ? e : r, v = S.baseAssetPath + T, E = S.model === "v5" ? p.SileroV5.new : p.SileroLegacy.new;
|
|
24797
24799
|
let A;
|
|
24798
24800
|
try {
|
|
24799
|
-
A = await
|
|
24801
|
+
A = await E(s.ort, () => (0, f.defaultModelFetcher)(v));
|
|
24800
24802
|
} catch (N) {
|
|
24801
24803
|
throw console.error(`Encountered an error while loading model file ${v}`), N;
|
|
24802
24804
|
}
|
|
24803
|
-
const
|
|
24805
|
+
const w = new u.FrameProcessor(A.process, A.reset_state, {
|
|
24804
24806
|
frameSamples: S.frameSamples,
|
|
24805
24807
|
positiveSpeechThreshold: S.positiveSpeechThreshold,
|
|
24806
24808
|
negativeSpeechThreshold: S.negativeSpeechThreshold,
|
|
@@ -24808,7 +24810,7 @@ function requireRealTimeVad() {
|
|
|
24808
24810
|
preSpeechPadFrames: S.preSpeechPadFrames,
|
|
24809
24811
|
minSpeechFrames: S.minSpeechFrames,
|
|
24810
24812
|
submitUserSpeechOnPause: S.submitUserSpeechOnPause
|
|
24811
|
-
}), x = new b(y, S,
|
|
24813
|
+
}), x = new b(y, S, w);
|
|
24812
24814
|
return await x.setupAudioNode(), x;
|
|
24813
24815
|
}
|
|
24814
24816
|
constructor(y, m, S) {
|
|
@@ -24849,13 +24851,13 @@ function requireRealTimeVad() {
|
|
|
24849
24851
|
v.processorOptions = {
|
|
24850
24852
|
...v.processorOptions ?? {},
|
|
24851
24853
|
frameSamples: this.options.frameSamples
|
|
24852
|
-
}, this.audioNode = new AudioWorkletNode(this.ctx, "vad-helper-worklet", v), this.audioNode.port.onmessage = async (
|
|
24853
|
-
switch (
|
|
24854
|
+
}, this.audioNode = new AudioWorkletNode(this.ctx, "vad-helper-worklet", v), this.audioNode.port.onmessage = async (E) => {
|
|
24855
|
+
switch (E.data?.message) {
|
|
24854
24856
|
case _.Message.AudioFrame:
|
|
24855
|
-
let A =
|
|
24856
|
-
A instanceof ArrayBuffer || (A = new ArrayBuffer(
|
|
24857
|
-
const
|
|
24858
|
-
await this.processFrame(
|
|
24857
|
+
let A = E.data.data;
|
|
24858
|
+
A instanceof ArrayBuffer || (A = new ArrayBuffer(E.data.data.byteLength), new Uint8Array(A).set(new Uint8Array(E.data.data)));
|
|
24859
|
+
const w = new Float32Array(A);
|
|
24860
|
+
await this.processFrame(w);
|
|
24859
24861
|
break;
|
|
24860
24862
|
}
|
|
24861
24863
|
};
|
|
@@ -24878,8 +24880,8 @@ function requireRealTimeVad() {
|
|
|
24878
24880
|
const v = T.inputBuffer.getChannelData(0);
|
|
24879
24881
|
if (T.outputBuffer.getChannelData(0).fill(0), this.resampler) {
|
|
24880
24882
|
const A = this.resampler.process(v);
|
|
24881
|
-
for (const
|
|
24882
|
-
await this.processFrame(
|
|
24883
|
+
for (const w of A)
|
|
24884
|
+
await this.processFrame(w);
|
|
24883
24885
|
}
|
|
24884
24886
|
} catch (v) {
|
|
24885
24887
|
console.error("Error processing audio:", v);
|
|
@@ -31561,28 +31563,30 @@ async function getV1SessionSuggestedMedications(s) {
|
|
|
31561
31563
|
}
|
|
31562
31564
|
async function postV1Document({
|
|
31563
31565
|
session_id: s,
|
|
31564
|
-
document_name: n
|
|
31566
|
+
document_name: n,
|
|
31567
|
+
type: i
|
|
31565
31568
|
}) {
|
|
31566
31569
|
try {
|
|
31567
|
-
const
|
|
31568
|
-
|
|
31569
|
-
const
|
|
31570
|
+
const c = new Headers();
|
|
31571
|
+
c.append("Content-Type", "application/json");
|
|
31572
|
+
const f = {
|
|
31570
31573
|
method: "POST",
|
|
31571
|
-
headers:
|
|
31574
|
+
headers: c,
|
|
31572
31575
|
body: JSON.stringify({
|
|
31573
31576
|
session_id: s,
|
|
31574
|
-
document_name: n
|
|
31577
|
+
document_name: n,
|
|
31578
|
+
type: i
|
|
31575
31579
|
})
|
|
31576
|
-
},
|
|
31577
|
-
let
|
|
31578
|
-
return
|
|
31579
|
-
...
|
|
31580
|
-
code:
|
|
31581
|
-
},
|
|
31582
|
-
} catch (
|
|
31583
|
-
return console.error("%c postV1Document -> error", "color:#f5ce50",
|
|
31580
|
+
}, u = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/documents`, f);
|
|
31581
|
+
let d = await u.json();
|
|
31582
|
+
return d = {
|
|
31583
|
+
...d,
|
|
31584
|
+
code: u.status
|
|
31585
|
+
}, d;
|
|
31586
|
+
} catch (c) {
|
|
31587
|
+
return console.error("%c postV1Document -> error", "color:#f5ce50", c), {
|
|
31584
31588
|
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31585
|
-
message: `Something went wrong! ${
|
|
31589
|
+
message: `Something went wrong! ${c}`
|
|
31586
31590
|
};
|
|
31587
31591
|
}
|
|
31588
31592
|
}
|
|
@@ -31619,7 +31623,56 @@ const REQUEST_TIMEOUT_MS = 1e4, fetchChunkTranscript = async (s, n) => {
|
|
|
31619
31623
|
} catch {
|
|
31620
31624
|
return { success: !1, error: "network_error" };
|
|
31621
31625
|
}
|
|
31622
|
-
}
|
|
31626
|
+
};
|
|
31627
|
+
async function patchSessionContext(s, n) {
|
|
31628
|
+
try {
|
|
31629
|
+
const i = new Headers();
|
|
31630
|
+
i.append("Content-Type", "application/json");
|
|
31631
|
+
const c = {
|
|
31632
|
+
method: "PATCH",
|
|
31633
|
+
headers: i,
|
|
31634
|
+
body: JSON.stringify({ context: n })
|
|
31635
|
+
}, l = await fetchWrapper(
|
|
31636
|
+
`${GET_EKA_VOICE_HOST_V1()}/sessions/${s}/context`,
|
|
31637
|
+
c
|
|
31638
|
+
);
|
|
31639
|
+
let f = await l.json();
|
|
31640
|
+
return f = {
|
|
31641
|
+
...f,
|
|
31642
|
+
code: l.status
|
|
31643
|
+
}, f;
|
|
31644
|
+
} catch (i) {
|
|
31645
|
+
return console.error("%c patchSessionContext -> error", "color:#f5ce50", i), {
|
|
31646
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31647
|
+
message: `Something went wrong! ${i}`
|
|
31648
|
+
};
|
|
31649
|
+
}
|
|
31650
|
+
}
|
|
31651
|
+
async function deleteSessionContext(s, n) {
|
|
31652
|
+
try {
|
|
31653
|
+
const i = new Headers();
|
|
31654
|
+
i.append("Content-Type", "application/json");
|
|
31655
|
+
const c = {
|
|
31656
|
+
method: "DELETE",
|
|
31657
|
+
headers: i,
|
|
31658
|
+
body: JSON.stringify({ context: n })
|
|
31659
|
+
}, l = await fetchWrapper(
|
|
31660
|
+
`${GET_EKA_VOICE_HOST_V1()}/sessions/${s}/context`,
|
|
31661
|
+
c
|
|
31662
|
+
);
|
|
31663
|
+
let f = await l.json();
|
|
31664
|
+
return f = {
|
|
31665
|
+
...f,
|
|
31666
|
+
code: l.status
|
|
31667
|
+
}, f;
|
|
31668
|
+
} catch (i) {
|
|
31669
|
+
return console.error("%c deleteSessionContext -> error", "color:#f5ce50", i), {
|
|
31670
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31671
|
+
message: `Something went wrong! ${i}`
|
|
31672
|
+
};
|
|
31673
|
+
}
|
|
31674
|
+
}
|
|
31675
|
+
const _n = class _n {
|
|
31623
31676
|
// SystemCompatibilityManager Instance
|
|
31624
31677
|
// Private constructor to prevent direct instantiation
|
|
31625
31678
|
constructor() {
|
|
@@ -31727,29 +31780,21 @@ const REQUEST_TIMEOUT_MS = 1e4, fetchChunkTranscript = async (s, n) => {
|
|
|
31727
31780
|
const i = await retryUploadFailedFiles({ force_commit: n });
|
|
31728
31781
|
return console.log("%c Line:138 🍖 retryUploadResponse", "color:#3f7cff", i), i;
|
|
31729
31782
|
}
|
|
31730
|
-
async patchSessionStatus({
|
|
31731
|
-
sessionId: n,
|
|
31732
|
-
processing_status: i,
|
|
31733
|
-
processing_error: c
|
|
31734
|
-
}) {
|
|
31783
|
+
async patchSessionStatus(n) {
|
|
31735
31784
|
try {
|
|
31736
|
-
const
|
|
31785
|
+
const i = EkaScribeStore$1.eventCallback;
|
|
31737
31786
|
this.vadInstance.pauseVad(), this.vadInstance.destroyVad();
|
|
31738
|
-
const
|
|
31739
|
-
|
|
31740
|
-
processing_status: i,
|
|
31741
|
-
processing_error: c
|
|
31742
|
-
});
|
|
31743
|
-
return this.resetEkaScribe(), l && l({
|
|
31787
|
+
const c = await patchTransactionStatus(n);
|
|
31788
|
+
return this.resetEkaScribe(), i && i({
|
|
31744
31789
|
callback_type: CALLBACK_TYPE.TRANSACTION_STATUS,
|
|
31745
31790
|
status: "info",
|
|
31746
|
-
message: `Transaction cancel status: ${
|
|
31791
|
+
message: `Transaction cancel status: ${c.code}`,
|
|
31747
31792
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
31748
|
-
}),
|
|
31749
|
-
} catch (
|
|
31793
|
+
}), c;
|
|
31794
|
+
} catch (i) {
|
|
31750
31795
|
return {
|
|
31751
31796
|
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31752
|
-
message: `Failed to cancel recording session, ${
|
|
31797
|
+
message: `Failed to cancel recording session, ${i}`
|
|
31753
31798
|
};
|
|
31754
31799
|
}
|
|
31755
31800
|
}
|
|
@@ -31987,6 +32032,12 @@ const REQUEST_TIMEOUT_MS = 1e4, fetchChunkTranscript = async (s, n) => {
|
|
|
31987
32032
|
async getChunkTranscript(n, i) {
|
|
31988
32033
|
return fetchChunkTranscript(n, i);
|
|
31989
32034
|
}
|
|
32035
|
+
async addSessionContext({ txn_id: n, context: i }) {
|
|
32036
|
+
return await patchSessionContext(n, i);
|
|
32037
|
+
}
|
|
32038
|
+
async removeSessionContext({ txn_id: n, context: i }) {
|
|
32039
|
+
return await deleteSessionContext(n, i);
|
|
32040
|
+
}
|
|
31990
32041
|
};
|
|
31991
32042
|
_n.instance = null;
|
|
31992
32043
|
let EkaScribe = _n;
|