@eka-care/ekascribe-ts-sdk 2.1.30 → 2.1.32
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 +20 -1
- package/dist/index.mjs +872 -813
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -545,7 +545,7 @@ class AwsV4Signer {
|
|
|
545
545
|
m.add(S);
|
|
546
546
|
}
|
|
547
547
|
return !0;
|
|
548
|
-
}).map((S) => S.map((T) => encodeRfc3986(encodeURIComponent(T)))).sort(([S, T], [v,
|
|
548
|
+
}).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
549
|
}
|
|
550
550
|
async sign() {
|
|
551
551
|
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 +1406,12 @@ function Da() {
|
|
|
1406
1406
|
];
|
|
1407
1407
|
function o(g, y, m) {
|
|
1408
1408
|
for (var S = 10, T = y + 238 - 14 - 286, v = -15; v < 0; v++) {
|
|
1409
|
-
var
|
|
1410
|
-
|
|
1409
|
+
var E, A, w;
|
|
1410
|
+
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
1411
|
}
|
|
1412
1412
|
{
|
|
1413
|
-
var A,
|
|
1414
|
-
|
|
1413
|
+
var A, w, x, N;
|
|
1414
|
+
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
1415
|
}
|
|
1416
1416
|
{
|
|
1417
1417
|
var D;
|
|
@@ -1420,15 +1420,15 @@ function Da() {
|
|
|
1420
1420
|
}
|
|
1421
1421
|
function h(g, y) {
|
|
1422
1422
|
for (var m = 0; m < 3; m++) {
|
|
1423
|
-
var S, T, v,
|
|
1424
|
-
|
|
1423
|
+
var S, T, v, E, A, w;
|
|
1424
|
+
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
1425
|
}
|
|
1426
1426
|
}
|
|
1427
1427
|
function b(g, y, m) {
|
|
1428
1428
|
var S, T;
|
|
1429
1429
|
{
|
|
1430
|
-
var v,
|
|
1431
|
-
v = m[17] - m[9], A = m[15] - m[11],
|
|
1430
|
+
var v, E, A, w, x, N, D, M;
|
|
1431
|
+
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
1432
|
}
|
|
1433
1433
|
{
|
|
1434
1434
|
var P, L, B, V, X, Z, q, k;
|
|
@@ -1437,13 +1437,13 @@ function Da() {
|
|
|
1437
1437
|
}
|
|
1438
1438
|
this.mdct_sub48 = function(g, y, m) {
|
|
1439
1439
|
for (var S = y, T = 286, v = 0; v < g.channels_out; v++) {
|
|
1440
|
-
for (var
|
|
1441
|
-
for (var A,
|
|
1440
|
+
for (var E = 0; E < g.mode_gr; E++) {
|
|
1441
|
+
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
1442
|
for (o(S, T, D[M]), o(S, T + 32, D[M + 1]), M += 2, T += 64, A = 1; A < 32; A += 2)
|
|
1443
1443
|
D[M - 1][A] *= -1;
|
|
1444
1444
|
for (A = 0; A < 32; A++, N += 18) {
|
|
1445
|
-
var L =
|
|
1446
|
-
if (
|
|
1445
|
+
var L = w.block_type, B = g.sb_sample[v][E], V = g.sb_sample[v][1 - E];
|
|
1446
|
+
if (w.mixed_block_flag != 0 && A < 2 && (L = 0), g.amp_filter[A] < 1e-12)
|
|
1447
1447
|
c.fill(
|
|
1448
1448
|
x,
|
|
1449
1449
|
N + 0,
|
|
@@ -1550,50 +1550,50 @@ function t1() {
|
|
|
1550
1550
|
var p = Da(), a = Ga(), t = j1, e = _.FFTOFFSET, r = _.MPG_MD_MS_LR, o = null;
|
|
1551
1551
|
this.psy = null;
|
|
1552
1552
|
var h = null, b = null, g = null;
|
|
1553
|
-
this.setModules = function(v,
|
|
1554
|
-
o = v, this.psy =
|
|
1553
|
+
this.setModules = function(v, E, A, w) {
|
|
1554
|
+
o = v, this.psy = E, h = E, b = w, g = A;
|
|
1555
1555
|
};
|
|
1556
1556
|
var y = new p();
|
|
1557
1557
|
function m(v) {
|
|
1558
|
-
var
|
|
1558
|
+
var E, A;
|
|
1559
1559
|
if (v.ATH.useAdjust == 0) {
|
|
1560
1560
|
v.ATH.adjust = 1;
|
|
1561
1561
|
return;
|
|
1562
1562
|
}
|
|
1563
|
-
if (A = v.loudness_sq[0][0],
|
|
1563
|
+
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
1564
|
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
1565
|
else {
|
|
1566
|
-
var
|
|
1567
|
-
v.ATH.adjust >=
|
|
1566
|
+
var w = 31.98 * A + 625e-6;
|
|
1567
|
+
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
1568
|
}
|
|
1569
1569
|
}
|
|
1570
1570
|
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]++),
|
|
1571
|
+
var E, A;
|
|
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]++), E = 0; E < v.mode_gr; ++E)
|
|
1573
1573
|
for (A = 0; A < v.channels_out; ++A) {
|
|
1574
|
-
var
|
|
1575
|
-
v.l3_side.tt[
|
|
1574
|
+
var w = v.l3_side.tt[E][A].block_type | 0;
|
|
1575
|
+
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
1576
|
}
|
|
1577
1577
|
}
|
|
1578
|
-
function T(v,
|
|
1579
|
-
var A = v.internal_flags,
|
|
1578
|
+
function T(v, E) {
|
|
1579
|
+
var A = v.internal_flags, w, x;
|
|
1580
1580
|
if (A.lame_encode_frame_init == 0) {
|
|
1581
1581
|
var N, D, M = l(2014), P = l(2014);
|
|
1582
1582
|
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] =
|
|
1583
|
+
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
1584
|
for (x = 0; x < A.mode_gr; x++)
|
|
1585
|
-
for (
|
|
1586
|
-
A.l3_side.tt[x][
|
|
1585
|
+
for (w = 0; w < A.channels_out; w++)
|
|
1586
|
+
A.l3_side.tt[x][w].block_type = _.SHORT_TYPE;
|
|
1587
1587
|
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
1588
|
}
|
|
1589
1589
|
}
|
|
1590
|
-
this.lame_encode_mp3_frame = function(v,
|
|
1590
|
+
this.lame_encode_mp3_frame = function(v, E, A, w, x, N) {
|
|
1591
1591
|
var D, M = c([2, 2]);
|
|
1592
1592
|
M[0][0] = new a(), M[0][1] = new a(), M[1][0] = new a(), M[1][1] = new a();
|
|
1593
1593
|
var P = c([2, 2]);
|
|
1594
1594
|
P[0][0] = new a(), P[0][1] = new a(), P[1][0] = new a(), P[1][1] = new a();
|
|
1595
1595
|
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] =
|
|
1596
|
+
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
1597
|
var j, he = [null, null], Xe = 0, Q = u(2);
|
|
1598
1598
|
for (F = 0; F < V.mode_gr; F++) {
|
|
1599
1599
|
for (O = 0; O < V.channels_out; O++)
|
|
@@ -1660,19 +1660,19 @@ function t1() {
|
|
|
1660
1660
|
V.pinfo.energy[F][O].length
|
|
1661
1661
|
));
|
|
1662
1662
|
if (v.VBR == i.vbr_off || v.VBR == i.vbr_abr) {
|
|
1663
|
-
var ht,
|
|
1663
|
+
var ht, Et;
|
|
1664
1664
|
for (ht = 0; ht < 18; ht++)
|
|
1665
1665
|
V.nsPsy.pefirbuf[ht] = V.nsPsy.pefirbuf[ht + 1];
|
|
1666
|
-
for (
|
|
1666
|
+
for (Et = 0, F = 0; F < V.mode_gr; F++)
|
|
1667
1667
|
for (O = 0; O < V.channels_out; O++)
|
|
1668
|
-
|
|
1669
|
-
for (V.nsPsy.pefirbuf[18] =
|
|
1670
|
-
|
|
1671
|
-
for (
|
|
1668
|
+
Et += I[F][O];
|
|
1669
|
+
for (V.nsPsy.pefirbuf[18] = Et, Et = V.nsPsy.pefirbuf[9], ht = 0; ht < 9; ht++)
|
|
1670
|
+
Et += (V.nsPsy.pefirbuf[ht] + V.nsPsy.pefirbuf[18 - ht]) * _.fircoef[ht];
|
|
1671
|
+
for (Et = 670 * 5 * V.mode_gr * V.channels_out / Et, F = 0; F < V.mode_gr; F++)
|
|
1672
1672
|
for (O = 0; O < V.channels_out; O++)
|
|
1673
|
-
I[F][O] *=
|
|
1673
|
+
I[F][O] *= Et;
|
|
1674
1674
|
}
|
|
1675
|
-
if (V.iteration_loop.iteration_loop(v, I, Z, L), o.format_bitstream(v), D = o.copy_buffer(V,
|
|
1675
|
+
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
1676
|
for (O = 0; O < V.channels_out; O++) {
|
|
1677
1677
|
var Ot;
|
|
1678
1678
|
for (Ot = 0; Ot < e; Ot++)
|
|
@@ -1708,15 +1708,15 @@ function $a() {
|
|
|
1708
1708
|
var r, o, h, b, g, y, m;
|
|
1709
1709
|
m = p >> 1, b = p, g = p << 1, y = g + b, p = g << 1, a = u, t = a + m;
|
|
1710
1710
|
do {
|
|
1711
|
-
var S, T, v,
|
|
1712
|
-
T = f[a + 0] - f[a + b], S = f[a + 0] + f[a + b],
|
|
1711
|
+
var S, T, v, E;
|
|
1712
|
+
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
1713
|
} while (a < e);
|
|
1714
1714
|
for (o = i[_ + 0], r = i[_ + 1], h = 1; h < m; h++) {
|
|
1715
|
-
var A,
|
|
1716
|
-
A = 1 - 2 * r * r,
|
|
1715
|
+
var A, w;
|
|
1716
|
+
A = 1 - 2 * r * r, w = 2 * r * o, a = u + h, t = u + b - h;
|
|
1717
1717
|
do {
|
|
1718
|
-
var x, N, D, S, T, M, v, P,
|
|
1719
|
-
N =
|
|
1718
|
+
var x, N, D, S, T, M, v, P, E, L;
|
|
1719
|
+
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
1720
|
} while (a < e);
|
|
1721
1721
|
A = o, o = A * i[_ + 0] - r * i[_ + 1], r = A * i[_ + 1] + r * i[_ + 0];
|
|
1722
1722
|
}
|
|
@@ -1923,7 +1923,7 @@ function Ua() {
|
|
|
1923
1923
|
}
|
|
1924
1924
|
$.athaa_loudapprox == 2 && me < 2 && (ke.loudness_sq[fe][me] = ke.loudness_sq_save[me], ke.loudness_sq_save[me] = b(G, ke));
|
|
1925
1925
|
}
|
|
1926
|
-
var y = 8, m = 23, S = 15, T, v,
|
|
1926
|
+
var y = 8, m = 23, S = 15, T, v, E, A = [
|
|
1927
1927
|
1,
|
|
1928
1928
|
0.79433,
|
|
1929
1929
|
0.63096,
|
|
@@ -1934,8 +1934,8 @@ function Ua() {
|
|
|
1934
1934
|
0.25119,
|
|
1935
1935
|
0.11749
|
|
1936
1936
|
];
|
|
1937
|
-
function
|
|
1938
|
-
T = Math.pow(10, (y + 1) / 16), v = Math.pow(10, (m + 1) / 16),
|
|
1937
|
+
function w() {
|
|
1938
|
+
T = Math.pow(10, (y + 1) / 16), v = Math.pow(10, (m + 1) / 16), E = Math.pow(10, S / 10);
|
|
1939
1939
|
}
|
|
1940
1940
|
var x = [
|
|
1941
1941
|
3.3246 * 3.3246,
|
|
@@ -2009,7 +2009,7 @@ function Ua() {
|
|
|
2009
2009
|
return $ * N[fe];
|
|
2010
2010
|
}
|
|
2011
2011
|
var fe = 0 | n1.FAST_LOG10_X(be, 16);
|
|
2012
|
-
if (G = ve.ATH.cb_l[z] * ve.ATH.adjust, $ <
|
|
2012
|
+
if (G = ve.ATH.cb_l[z] * ve.ATH.adjust, $ < E * G) {
|
|
2013
2013
|
if ($ > G) {
|
|
2014
2014
|
var me, st;
|
|
2015
2015
|
return me = 1, fe <= 13 && (me = D[fe]), st = n1.FAST_LOG10_X($ / G, 10 / 15), $ * ((x[fe] - me) * st + me);
|
|
@@ -2314,20 +2314,20 @@ function Ua() {
|
|
|
2314
2314
|
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
2315
|
}
|
|
2316
2316
|
for (ft = 0; ft < Vt; ft++) {
|
|
2317
|
-
var bt, Ct,
|
|
2317
|
+
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
2318
|
for (C0(qe.npart_s <= r0.CBANDS), C0(qe.npart_l <= r0.CBANDS), dt = 0; dt < 3; dt++)
|
|
2319
|
-
|
|
2319
|
+
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
2320
|
if (ft == 2)
|
|
2321
2321
|
for (dt = 0; dt < 576; dt++) {
|
|
2322
|
-
var vn,
|
|
2323
|
-
vn = jt[0][dt],
|
|
2322
|
+
var vn, En;
|
|
2323
|
+
vn = jt[0][dt], En = jt[1][dt], jt[0][dt] = vn + En, jt[1][dt] = vn - En;
|
|
2324
2324
|
}
|
|
2325
2325
|
{
|
|
2326
2326
|
var kn = jt[ft & 1], cn = 0;
|
|
2327
2327
|
for (dt = 0; dt < 9; dt++) {
|
|
2328
2328
|
for (var On = cn + 64, un = 1; cn < On; cn++)
|
|
2329
2329
|
un < Math.abs(kn[cn]) && (un = Math.abs(kn[cn]));
|
|
2330
|
-
qe.nsPsy.last_en_subshort[ft][dt] =
|
|
2330
|
+
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
2331
|
}
|
|
2332
2332
|
}
|
|
2333
2333
|
if ($.analysis) {
|
|
@@ -2380,7 +2380,7 @@ function Ua() {
|
|
|
2380
2380
|
);
|
|
2381
2381
|
ln = Math.min(ln, un);
|
|
2382
2382
|
}
|
|
2383
|
-
Mn =
|
|
2383
|
+
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
2384
|
}
|
|
2385
2385
|
}
|
|
2386
2386
|
for (qe.nsPsy.lastAttacks[ft] = Ut[2], Qt = 0, It = 0; It < qe.npart_l; It++) {
|
|
@@ -2407,8 +2407,8 @@ function Ua() {
|
|
|
2407
2407
|
V(qe), Pn = $.msfix, Math.abs(Pn) > 0 && X(qe, Pn, $.ATHlower * qe.ATH.adjust);
|
|
2408
2408
|
}
|
|
2409
2409
|
for (I($, xt, st, tt), ft = 0; ft < Vt; ft++) {
|
|
2410
|
-
var Tn, bn = 0,
|
|
2411
|
-
ft > 1 ? (Tn = fe, bn = -2,
|
|
2410
|
+
var Tn, bn = 0, wn, An;
|
|
2411
|
+
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
2412
|
}
|
|
2413
2413
|
return 0;
|
|
2414
2414
|
};
|
|
@@ -2466,7 +2466,7 @@ function Ua() {
|
|
|
2466
2466
|
-552212e-22 * 2,
|
|
2467
2467
|
-0.313819 * 2
|
|
2468
2468
|
];
|
|
2469
|
-
function
|
|
2469
|
+
function Et($, G, z, oe, ve, Y, be, fe, me, st) {
|
|
2470
2470
|
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
2471
|
firbuf = G[lt];
|
|
2472
2472
|
for (var Pt = z + 576 - 350 - o + 192, tt = 0; tt < 576; tt++) {
|
|
@@ -2504,8 +2504,8 @@ function Ua() {
|
|
|
2504
2504
|
for (var tt = 0; tt < 12; tt++)
|
|
2505
2505
|
me[lt][tt / 3] == 0 && It[tt] > Bt && (me[lt][tt / 3] = tt % 3 + 1);
|
|
2506
2506
|
for (var tt = 1; tt < 4; tt++) {
|
|
2507
|
-
var bt = Nt[tt - 1], Ct = Nt[tt],
|
|
2508
|
-
|
|
2507
|
+
var bt = Nt[tt - 1], Ct = Nt[tt], wt = Math.max(bt, Ct);
|
|
2508
|
+
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
2509
|
}
|
|
2510
2510
|
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
2511
|
}
|
|
@@ -2624,7 +2624,7 @@ function Ua() {
|
|
|
2624
2624
|
[0, 0, 0, 0],
|
|
2625
2625
|
[0, 0, 0, 0]
|
|
2626
2626
|
], Nt = L1(2), Qt = $.mode == s.JOINT_STEREO ? 4 : qe.channels_out;
|
|
2627
|
-
|
|
2627
|
+
Et(
|
|
2628
2628
|
$,
|
|
2629
2629
|
G,
|
|
2630
2630
|
z,
|
|
@@ -2961,7 +2961,7 @@ function Ua() {
|
|
|
2961
2961
|
ke,
|
|
2962
2962
|
ot,
|
|
2963
2963
|
oe
|
|
2964
|
-
),
|
|
2964
|
+
), w(), n.init_fft(G), G.decay = Math.exp(-1 * i / (p * pt / 192));
|
|
2965
2965
|
{
|
|
2966
2966
|
var dt;
|
|
2967
2967
|
dt = r, $.exp_nspsytune & 2 && (dt = 1), Math.abs($.msfix) > 0 && (dt = $.msfix), $.msfix = dt;
|
|
@@ -3432,7 +3432,7 @@ function j0() {
|
|
|
3432
3432
|
return t * t;
|
|
3433
3433
|
}
|
|
3434
3434
|
this.AnalyzeSamples = function(t, e, r, o, h, b, g) {
|
|
3435
|
-
var y, m, S, T, v,
|
|
3435
|
+
var y, m, S, T, v, E, A;
|
|
3436
3436
|
if (b == 0)
|
|
3437
3437
|
return GAIN_ANALYSIS_OK;
|
|
3438
3438
|
switch (A = 0, v = b, g) {
|
|
@@ -3469,26 +3469,26 @@ function j0() {
|
|
|
3469
3469
|
MAX_ORDER,
|
|
3470
3470
|
MAX_ORDER
|
|
3471
3471
|
)); v > 0; ) {
|
|
3472
|
-
|
|
3472
|
+
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
3473
|
t.lstepbuf,
|
|
3474
3474
|
t.lstep + t.totsamp,
|
|
3475
3475
|
t.loutbuf,
|
|
3476
3476
|
t.lout + t.totsamp,
|
|
3477
|
-
|
|
3477
|
+
E,
|
|
3478
3478
|
f[t.reqindex]
|
|
3479
3479
|
), d(
|
|
3480
3480
|
t.rstepbuf,
|
|
3481
3481
|
t.rstep + t.totsamp,
|
|
3482
3482
|
t.routbuf,
|
|
3483
3483
|
t.rout + t.totsamp,
|
|
3484
|
-
|
|
3484
|
+
E,
|
|
3485
3485
|
f[t.reqindex]
|
|
3486
3486
|
), y = t.lout + t.totsamp, m = t.loutbuf, S = t.rout + t.totsamp, T = t.routbuf;
|
|
3487
|
-
for (var
|
|
3487
|
+
for (var w = E % 8; w-- != 0; )
|
|
3488
3488
|
t.lsum += p(m[y++]), t.rsum += p(T[S++]);
|
|
3489
|
-
for (
|
|
3489
|
+
for (w = E / 8; w-- != 0; )
|
|
3490
3490
|
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 -=
|
|
3491
|
+
if (v -= E, A += E, t.totsamp += E, t.totsamp == t.sampleWindow) {
|
|
3492
3492
|
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
3493
|
N >= t.A.length && (N = t.A.length - 1), t.A[N]++, t.lsum = t.rsum = 0, _1.arraycopy(
|
|
3494
3494
|
t.loutbuf,
|
|
@@ -7122,7 +7122,7 @@ function Va() {
|
|
|
7122
7122
|
return d(0 <= L + t.Q_MAX2 && L < t.Q_MAX), A[L + t.Q_MAX2];
|
|
7123
7123
|
}
|
|
7124
7124
|
this.IPOW20 = function(L) {
|
|
7125
|
-
return d(0 <= L && L < t.Q_MAX),
|
|
7125
|
+
return d(0 <= L && L < t.Q_MAX), w[L];
|
|
7126
7126
|
};
|
|
7127
7127
|
var g = 2220446049250313e-31, y = t.IXMAX_VAL, m = y + 2, S = t.Q_MAX, T = t.Q_MAX2;
|
|
7128
7128
|
t.LARGE_BITS;
|
|
@@ -7135,7 +7135,7 @@ function Va() {
|
|
|
7135
7135
|
[[6, 6, 6, 3], [12, 9, 9, 6], [6, 12, 9, 6]],
|
|
7136
7136
|
[[8, 8, 5, 0], [15, 12, 9, 0], [6, 18, 9, 0]]
|
|
7137
7137
|
];
|
|
7138
|
-
var
|
|
7138
|
+
var E = [
|
|
7139
7139
|
0,
|
|
7140
7140
|
0,
|
|
7141
7141
|
0,
|
|
@@ -7159,7 +7159,7 @@ function Va() {
|
|
|
7159
7159
|
2,
|
|
7160
7160
|
0
|
|
7161
7161
|
];
|
|
7162
|
-
this.pretab =
|
|
7162
|
+
this.pretab = E, this.sfBandIndex = [
|
|
7163
7163
|
// Table B.2.b: 22.05 kHz
|
|
7164
7164
|
new s(
|
|
7165
7165
|
[
|
|
@@ -7495,7 +7495,7 @@ function Va() {
|
|
|
7495
7495
|
/* sfb12 pseudo sub bands */
|
|
7496
7496
|
)
|
|
7497
7497
|
];
|
|
7498
|
-
var A = f(S + T + 1),
|
|
7498
|
+
var A = f(S + T + 1), w = f(S), x = f(m), N = f(m);
|
|
7499
7499
|
this.adj43 = N;
|
|
7500
7500
|
function D(L, B) {
|
|
7501
7501
|
var V = h.ATHformula(B, L);
|
|
@@ -7559,7 +7559,7 @@ function Va() {
|
|
|
7559
7559
|
0.75
|
|
7560
7560
|
);
|
|
7561
7561
|
for (N[X] = 0.5, X = 0; X < S; X++)
|
|
7562
|
-
|
|
7562
|
+
w[X] = Math.pow(2, (X - 210) * -0.1875);
|
|
7563
7563
|
for (X = 0; X <= S + T; X++)
|
|
7564
7564
|
A[X] = Math.pow(2, (X - 210 - T) * 0.25);
|
|
7565
7565
|
r.huffman_init(B);
|
|
@@ -7615,8 +7615,8 @@ function Va() {
|
|
|
7615
7615
|
var Q, Ce, rt, ct, yt, mt;
|
|
7616
7616
|
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
7617
|
do {
|
|
7618
|
-
var ht,
|
|
7619
|
-
ht = j[I] * j[I], Q += ht, ct += ht < rt ? ht : rt, I++,
|
|
7618
|
+
var ht, Et;
|
|
7619
|
+
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
7620
|
} while (--mt > 0);
|
|
7621
7621
|
if (Q > Ce && O++, k == _.SBPSY_l) {
|
|
7622
7622
|
var Ot = Ce * q.nsPsy.longfact[k];
|
|
@@ -7642,8 +7642,8 @@ function Va() {
|
|
|
7642
7642
|
var Q = 0, Ce, rt, ct, mt = yt >> 1;
|
|
7643
7643
|
rt = gt / yt, ct = g;
|
|
7644
7644
|
do {
|
|
7645
|
-
var ht,
|
|
7646
|
-
ht = j[I] * j[I], Q += ht, ct += ht < rt ? ht : rt, I++,
|
|
7645
|
+
var ht, Et;
|
|
7646
|
+
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
7647
|
} while (--mt > 0);
|
|
7648
7648
|
if (Q > gt && O++, U == _.SBPSY_s) {
|
|
7649
7649
|
var Ot = gt * q.nsPsy.shortfact[U];
|
|
@@ -7687,7 +7687,7 @@ function Va() {
|
|
|
7687
7687
|
}, this.calc_noise = function(L, B, V, X, Z) {
|
|
7688
7688
|
var q = 0, k = 0, I, O, F = 0, j = 0, he = 0, Xe = -20, Q = 0, Ce = L.scalefac, rt = 0;
|
|
7689
7689
|
for (X.over_SSD = 0, I = 0; I < L.psymax; I++) {
|
|
7690
|
-
var ct = L.global_gain - (Ce[rt++] + (L.preflag != 0 ?
|
|
7690
|
+
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
7691
|
if (Z != null && Z.step[I] == ct)
|
|
7692
7692
|
yt = Z.noise[I], Q += L.width[I], V[q++] = yt / B[k++], yt = Z.noise_log[I];
|
|
7693
7693
|
else {
|
|
@@ -7696,8 +7696,8 @@ function Va() {
|
|
|
7696
7696
|
var ht;
|
|
7697
7697
|
ht = L.max_nonzero_coeff - Q + 1, ht > 0 ? O = ht >> 1 : O = 0;
|
|
7698
7698
|
}
|
|
7699
|
-
var
|
|
7700
|
-
yt = this.calc_noise_core(L,
|
|
7699
|
+
var Et = new P(Q);
|
|
7700
|
+
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
7701
|
}
|
|
7702
7702
|
if (Z != null && (Z.global_gain = L.global_gain), he += yt, yt > 0) {
|
|
7703
7703
|
var Ot;
|
|
@@ -7714,17 +7714,17 @@ function Va() {
|
|
|
7714
7714
|
var yt = q.scalefac_band.l[k], mt = q.scalefac_band.l[k + 1], ht = mt - yt;
|
|
7715
7715
|
for (F = 0; ct < mt; ct++)
|
|
7716
7716
|
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 *
|
|
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 * E[k]), k < _.SBPSY_l && (d(Xe[k] >= 0), q.pinfo.LAMEsfb[X][Z][k] -= he * Xe[k]);
|
|
7718
7718
|
}
|
|
7719
7719
|
if (B.block_type == _.SHORT_TYPE)
|
|
7720
7720
|
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,
|
|
7721
|
+
for (var yt = q.scalefac_band.s[k], mt = q.scalefac_band.s[k + 1], ht = mt - yt, Et = 0; Et < 3; Et++) {
|
|
7722
7722
|
for (F = 0, O = yt; O < mt; O++)
|
|
7723
7723
|
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][
|
|
7724
|
+
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(
|
|
7725
|
+
F * V.thm.s[k][Et],
|
|
7726
7726
|
q.ATH.s[k]
|
|
7727
|
-
), q.pinfo.LAMEsfb_s[X][Z][3 * k +
|
|
7727
|
+
), 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
7728
|
}
|
|
7729
7729
|
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
7730
|
};
|
|
@@ -7811,7 +7811,7 @@ function Oa() {
|
|
|
7811
7811
|
}
|
|
7812
7812
|
}
|
|
7813
7813
|
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,
|
|
7814
|
+
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
7815
|
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
7816
|
var nn = -1;
|
|
7817
7817
|
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 +7821,14 @@ function Oa() {
|
|
|
7821
7821
|
Ot,
|
|
7822
7822
|
Ht,
|
|
7823
7823
|
ht,
|
|
7824
|
-
|
|
7824
|
+
Et
|
|
7825
7825
|
), Ce = 0), rt != 0 && (r(
|
|
7826
7826
|
rt,
|
|
7827
7827
|
I,
|
|
7828
7828
|
Ot,
|
|
7829
7829
|
Ht,
|
|
7830
7830
|
ht,
|
|
7831
|
-
|
|
7831
|
+
Et
|
|
7832
7832
|
), rt = 0);
|
|
7833
7833
|
else {
|
|
7834
7834
|
var C = O.width[j];
|
|
@@ -7836,35 +7836,35 @@ function Oa() {
|
|
|
7836
7836
|
var U;
|
|
7837
7837
|
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
7838
|
}
|
|
7839
|
-
if (Ce == 0 && rt == 0 && (ht = yt,
|
|
7839
|
+
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
7840
|
Ce,
|
|
7841
7841
|
I,
|
|
7842
7842
|
Ot,
|
|
7843
7843
|
Ht,
|
|
7844
7844
|
ht,
|
|
7845
|
-
|
|
7846
|
-
), Ce = 0, ht = yt,
|
|
7845
|
+
Et
|
|
7846
|
+
), Ce = 0, ht = yt, Et = mt, Ot = q, Ht = ct), rt += C) : (rt != 0 && (r(
|
|
7847
7847
|
rt,
|
|
7848
7848
|
I,
|
|
7849
7849
|
Ot,
|
|
7850
7850
|
Ht,
|
|
7851
7851
|
ht,
|
|
7852
|
-
|
|
7853
|
-
), rt = 0, ht = yt,
|
|
7852
|
+
Et
|
|
7853
|
+
), rt = 0, ht = yt, Et = mt, Ot = q, Ht = ct), Ce += C), C <= 0) {
|
|
7854
7854
|
rt != 0 && (r(
|
|
7855
7855
|
rt,
|
|
7856
7856
|
I,
|
|
7857
7857
|
Ot,
|
|
7858
7858
|
Ht,
|
|
7859
7859
|
ht,
|
|
7860
|
-
|
|
7860
|
+
Et
|
|
7861
7861
|
), rt = 0), Ce != 0 && (o(
|
|
7862
7862
|
Ce,
|
|
7863
7863
|
I,
|
|
7864
7864
|
Ot,
|
|
7865
7865
|
Ht,
|
|
7866
7866
|
ht,
|
|
7867
|
-
|
|
7867
|
+
Et
|
|
7868
7868
|
), Ce = 0);
|
|
7869
7869
|
break;
|
|
7870
7870
|
}
|
|
@@ -7877,14 +7877,14 @@ function Oa() {
|
|
|
7877
7877
|
Ot,
|
|
7878
7878
|
Ht,
|
|
7879
7879
|
ht,
|
|
7880
|
-
|
|
7880
|
+
Et
|
|
7881
7881
|
), Ce = 0), rt != 0 && (r(
|
|
7882
7882
|
rt,
|
|
7883
7883
|
I,
|
|
7884
7884
|
Ot,
|
|
7885
7885
|
Ht,
|
|
7886
7886
|
ht,
|
|
7887
|
-
|
|
7887
|
+
Et
|
|
7888
7888
|
), rt = 0);
|
|
7889
7889
|
}
|
|
7890
7890
|
function b(q, k, I) {
|
|
@@ -8048,7 +8048,7 @@ function Oa() {
|
|
|
8048
8048
|
}
|
|
8049
8049
|
return this.noquant_count_bits(q, I, O);
|
|
8050
8050
|
};
|
|
8051
|
-
function
|
|
8051
|
+
function E(q, k, I, O, F, j, he) {
|
|
8052
8052
|
for (var Xe = k.big_values, Q = 0; Q <= 22; Q++)
|
|
8053
8053
|
O[Q] = _.LARGE_BITS;
|
|
8054
8054
|
for (var Q = 0; Q < 16; Q++) {
|
|
@@ -8061,10 +8061,10 @@ function Oa() {
|
|
|
8061
8061
|
var ht = q.scalefac_band.l[Q + mt + 2];
|
|
8062
8062
|
if (ht >= Xe)
|
|
8063
8063
|
break;
|
|
8064
|
-
var
|
|
8065
|
-
ct = new t(
|
|
8064
|
+
var Et = rt;
|
|
8065
|
+
ct = new t(Et);
|
|
8066
8066
|
var Ot = v(I, Ce, ht, ct);
|
|
8067
|
-
|
|
8067
|
+
Et = ct.bits, O[Q + mt] > Et && (O[Q + mt] = Et, F[Q + mt] = Q, j[Q + mt] = yt, he[Q + mt] = Ot);
|
|
8068
8068
|
}
|
|
8069
8069
|
}
|
|
8070
8070
|
}
|
|
@@ -8083,7 +8083,7 @@ function Oa() {
|
|
|
8083
8083
|
this.best_huffman_divide = function(q, k) {
|
|
8084
8084
|
var I = new d(), O = k.l3_enc, F = c(23), j = c(23), he = c(23), Xe = c(23);
|
|
8085
8085
|
if (!(k.block_type == f.SHORT_TYPE && q.mode_gr == 1)) {
|
|
8086
|
-
I.assign(k), k.block_type == f.NORM_TYPE && (
|
|
8086
|
+
I.assign(k), k.block_type == f.NORM_TYPE && (E(q, k, O, F, j, he, Xe), A(
|
|
8087
8087
|
q,
|
|
8088
8088
|
I,
|
|
8089
8089
|
k,
|
|
@@ -8125,7 +8125,7 @@ function Oa() {
|
|
|
8125
8125
|
}
|
|
8126
8126
|
}
|
|
8127
8127
|
};
|
|
8128
|
-
var
|
|
8128
|
+
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
8129
|
p.slen1_tab = N, p.slen2_tab = D;
|
|
8130
8130
|
function M(q, k) {
|
|
8131
8131
|
for (var I, O = k.tt[1][q], F = k.tt[0][q], j = 0; j < u.scfsi_band.length - 1; j++) {
|
|
@@ -8143,7 +8143,7 @@ function Oa() {
|
|
|
8143
8143
|
for (var Q = 0, Ce = 0; I < f.SBPSY_l; I++)
|
|
8144
8144
|
O.scalefac[I] != -1 && (Ce++, Q < O.scalefac[I] && (Q = O.scalefac[I]));
|
|
8145
8145
|
for (var j = 0; j < 16; j++)
|
|
8146
|
-
if (he <
|
|
8146
|
+
if (he < w[j] && Q < x[j]) {
|
|
8147
8147
|
var rt = N[j] * Xe + D[j] * Ce;
|
|
8148
8148
|
O.part2_length > rt && (O.part2_length = rt, O.scalefac_compress = j);
|
|
8149
8149
|
}
|
|
@@ -8255,7 +8255,7 @@ function Oa() {
|
|
|
8255
8255
|
for (; I < q.sfbmax; I++)
|
|
8256
8256
|
F < he[I] && (F = he[I]);
|
|
8257
8257
|
for (q.part2_length = _.LARGE_BITS, k = 0; k < 16; k++)
|
|
8258
|
-
O <
|
|
8258
|
+
O < w[k] && F < x[k] && q.part2_length > j[k] && (q.part2_length = j[k], q.scalefac_compress = k);
|
|
8259
8259
|
return q.part2_length == _.LARGE_BITS;
|
|
8260
8260
|
};
|
|
8261
8261
|
var X = [
|
|
@@ -8287,15 +8287,15 @@ function Oa() {
|
|
|
8287
8287
|
for (Xe = !1, F = 0; F < 4; F++)
|
|
8288
8288
|
rt[F] > X[I][F] && (Xe = !0);
|
|
8289
8289
|
if (!Xe) {
|
|
8290
|
-
var mt, ht,
|
|
8290
|
+
var mt, ht, Et, Ot;
|
|
8291
8291
|
for (k.sfb_partition_table = a.nr_of_sfb_block[I][O], F = 0; F < 4; F++)
|
|
8292
8292
|
k.slen[F] = Z[rt[F]];
|
|
8293
|
-
switch (mt = k.slen[0], ht = k.slen[1],
|
|
8293
|
+
switch (mt = k.slen[0], ht = k.slen[1], Et = k.slen[2], Ot = k.slen[3], I) {
|
|
8294
8294
|
case 0:
|
|
8295
|
-
k.scalefac_compress = (mt * 5 + ht << 4) + (
|
|
8295
|
+
k.scalefac_compress = (mt * 5 + ht << 4) + (Et << 2) + Ot;
|
|
8296
8296
|
break;
|
|
8297
8297
|
case 1:
|
|
8298
|
-
k.scalefac_compress = 400 + (mt * 5 + ht << 2) +
|
|
8298
|
+
k.scalefac_compress = 400 + (mt * 5 + ht << 2) + Et;
|
|
8299
8299
|
break;
|
|
8300
8300
|
case 2:
|
|
8301
8301
|
k.scalefac_compress = 500 + mt * 3 + ht;
|
|
@@ -8366,16 +8366,16 @@ function Ve() {
|
|
|
8366
8366
|
var F = 0 | (k.version + 1) * 72e3 * O / k.out_samplerate + I.padding;
|
|
8367
8367
|
return 8 * F;
|
|
8368
8368
|
};
|
|
8369
|
-
function
|
|
8369
|
+
function E(k) {
|
|
8370
8370
|
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
8371
|
}
|
|
8372
8372
|
function A(k, I, O) {
|
|
8373
8373
|
for (; O > 0; ) {
|
|
8374
8374
|
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 &&
|
|
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 && E(k), m[T] = 0), F = Math.min(O, v), O -= F, v -= F, m[T] |= I >> O << v, S += F;
|
|
8376
8376
|
}
|
|
8377
8377
|
}
|
|
8378
|
-
function
|
|
8378
|
+
function w(k, I, O) {
|
|
8379
8379
|
for (; O > 0; ) {
|
|
8380
8380
|
var F;
|
|
8381
8381
|
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 +8450,19 @@ function Ve() {
|
|
|
8450
8450
|
if (I == 0)
|
|
8451
8451
|
return Xe;
|
|
8452
8452
|
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],
|
|
8453
|
+
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
8454
|
if (ht != 0 && (j.xr[Q] < 0 && mt++, Ce--), I > 15) {
|
|
8455
8455
|
if (ht > 14) {
|
|
8456
8456
|
var Ot = ht - 15;
|
|
8457
8457
|
u(Ot <= he.linmax), mt |= Ot << 1, rt = ct, ht = 15;
|
|
8458
8458
|
}
|
|
8459
|
-
if (
|
|
8460
|
-
var Ht =
|
|
8461
|
-
u(Ht <= he.linmax), mt <<= ct, mt |= Ht, rt += ct,
|
|
8459
|
+
if (Et > 14) {
|
|
8460
|
+
var Ht = Et - 15;
|
|
8461
|
+
u(Ht <= he.linmax), mt <<= ct, mt |= Ht, rt += ct, Et = 15;
|
|
8462
8462
|
}
|
|
8463
8463
|
yt = 16;
|
|
8464
8464
|
}
|
|
8465
|
-
|
|
8465
|
+
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
8466
|
}
|
|
8467
8467
|
return Xe;
|
|
8468
8468
|
}
|
|
@@ -8513,8 +8513,8 @@ function Ve() {
|
|
|
8513
8513
|
var Ce = Q.tt[I][O], yt, mt, ht = 0;
|
|
8514
8514
|
if (u(Ce.sfb_partition_table != null), j = 0, F = 0, mt = 0, Ce.block_type == p.SHORT_TYPE) {
|
|
8515
8515
|
for (; mt < 4; mt++) {
|
|
8516
|
-
var
|
|
8517
|
-
for (yt = 0; yt <
|
|
8516
|
+
var Et = Ce.sfb_partition_table[mt] / 3, Ot = Ce.slen[mt];
|
|
8517
|
+
for (yt = 0; yt < Et; yt++, F++)
|
|
8518
8518
|
A(
|
|
8519
8519
|
Xe,
|
|
8520
8520
|
Math.max(Ce.scalefac[F * 3 + 0], 0),
|
|
@@ -8532,8 +8532,8 @@ function Ve() {
|
|
|
8532
8532
|
j += B(Xe, Ce);
|
|
8533
8533
|
} else {
|
|
8534
8534
|
for (; mt < 4; mt++) {
|
|
8535
|
-
var
|
|
8536
|
-
for (yt = 0; yt <
|
|
8535
|
+
var Et = Ce.sfb_partition_table[mt], Ot = Ce.slen[mt];
|
|
8536
|
+
for (yt = 0; yt < Et; yt++, F++)
|
|
8537
8537
|
A(Xe, Math.max(Ce.scalefac[F], 0), Ot), ht += Ot;
|
|
8538
8538
|
}
|
|
8539
8539
|
j += V(Xe, Ce);
|
|
@@ -8561,7 +8561,7 @@ function Ve() {
|
|
|
8561
8561
|
}
|
|
8562
8562
|
}, this.add_dummy_byte = function(k, I, O) {
|
|
8563
8563
|
for (var F = k.internal_flags, j; O-- > 0; )
|
|
8564
|
-
for (
|
|
8564
|
+
for (w(F, I, 8), j = 0; j < a.MAX_HEADER_BUF; ++j)
|
|
8565
8565
|
F.header[j].write_timing += 8;
|
|
8566
8566
|
}, this.format_bitstream = function(k) {
|
|
8567
8567
|
var I = k.internal_flags, O;
|
|
@@ -8652,9 +8652,9 @@ function Oe() {
|
|
|
8652
8652
|
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
8653
|
var T = 16384 + S;
|
|
8654
8654
|
g.LAME_MAXMP3BUFFER = T;
|
|
8655
|
-
var v,
|
|
8655
|
+
var v, E, A, w, x, N = new _(), D, M, P;
|
|
8656
8656
|
this.enc = new b(), this.setModules = function(C, U, Tt, gt, kt, Dt, _t, Rt, Lt) {
|
|
8657
|
-
v = C,
|
|
8657
|
+
v = C, E = U, A = Tt, w = gt, x = kt, D = Dt, M = Rt, P = Lt, this.enc.setModules(E, N, w, D);
|
|
8658
8658
|
};
|
|
8659
8659
|
function L() {
|
|
8660
8660
|
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 +8959,16 @@ function Oe() {
|
|
|
8959
8959
|
return C.internal_flags = null, -1;
|
|
8960
8960
|
} else
|
|
8961
8961
|
U.bitrate_index = 1;
|
|
8962
|
-
C.analysis && (C.bWriteVbrTag = !1), U.pinfo != null && (C.bWriteVbrTag = !1),
|
|
8962
|
+
C.analysis && (C.bWriteVbrTag = !1), U.pinfo != null && (C.bWriteVbrTag = !1), E.init_bit_stream_w(U);
|
|
8963
8963
|
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] =
|
|
8964
|
+
U.scalefac_band.l[St] = w.sfBandIndex[Mt].l[St];
|
|
8965
8965
|
for (var St = 0; St < b.PSFB21 + 1; St++) {
|
|
8966
8966
|
var Wt = (U.scalefac_band.l[22] - U.scalefac_band.l[21]) / b.PSFB21, en = U.scalefac_band.l[21] + St * Wt;
|
|
8967
8967
|
U.scalefac_band.psfb21[St] = en;
|
|
8968
8968
|
}
|
|
8969
8969
|
U.scalefac_band.psfb21[b.PSFB21] = 576;
|
|
8970
8970
|
for (var St = 0; St < b.SBMAX_s + 1; St++)
|
|
8971
|
-
U.scalefac_band.s[St] =
|
|
8971
|
+
U.scalefac_band.s[St] = w.sfBandIndex[Mt].s[St];
|
|
8972
8972
|
for (var St = 0; St < b.PSFB12 + 1; St++) {
|
|
8973
8973
|
var Wt = (U.scalefac_band.s[13] - U.scalefac_band.s[12]) / b.PSFB12, en = U.scalefac_band.s[12] + St * Wt;
|
|
8974
8974
|
U.scalefac_band.psfb12[St] = en;
|
|
@@ -9024,7 +9024,7 @@ function Oe() {
|
|
|
9024
9024
|
C.VBR_mean_bitrate_kbps
|
|
9025
9025
|
);
|
|
9026
9026
|
}
|
|
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),
|
|
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), w.iteration_init(C), N.psymodel_init(C), d(C.scale >= 0), 0;
|
|
9028
9028
|
};
|
|
9029
9029
|
function Ce(C, U) {
|
|
9030
9030
|
(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 +9045,7 @@ function Oe() {
|
|
|
9045
9045
|
Lt
|
|
9046
9046
|
), Tt += _t, Rt += _t, St -= G != C.frameNum ? 1 : 0;
|
|
9047
9047
|
}
|
|
9048
|
-
if (kt.mf_samples_to_encode = 0, _t < 0 || (Lt = gt - Rt, gt == 0 && (Lt = 0),
|
|
9048
|
+
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
9049
|
kt,
|
|
9050
9050
|
U,
|
|
9051
9051
|
Tt,
|
|
@@ -9054,7 +9054,7 @@ function Oe() {
|
|
|
9054
9054
|
), _t < 0))
|
|
9055
9055
|
return _t;
|
|
9056
9056
|
if (Tt += _t, Rt += _t, Lt = gt - Rt, gt == 0 && (Lt = 0), C.write_id3tag_automatic) {
|
|
9057
|
-
if (M.id3tag_write_v1(C), _t =
|
|
9057
|
+
if (M.id3tag_write_v1(C), _t = E.copy_buffer(
|
|
9058
9058
|
kt,
|
|
9059
9059
|
U,
|
|
9060
9060
|
Tt,
|
|
@@ -9094,7 +9094,7 @@ function Oe() {
|
|
|
9094
9094
|
return -3;
|
|
9095
9095
|
if (gt == 0)
|
|
9096
9096
|
return 0;
|
|
9097
|
-
if ($ =
|
|
9097
|
+
if ($ = E.copy_buffer(Rt, kt, Dt, _t, 0), $ < 0)
|
|
9098
9098
|
return $;
|
|
9099
9099
|
if (Dt += $, Lt += $, z[0] = U, z[1] = Tt, o.NEQ(C.scale, 0) && o.NEQ(C.scale, 1))
|
|
9100
9100
|
for (St = 0; St < gt; ++St)
|
|
@@ -9165,8 +9165,8 @@ function Oe() {
|
|
|
9165
9165
|
function ht() {
|
|
9166
9166
|
this.num_used = 0;
|
|
9167
9167
|
}
|
|
9168
|
-
function
|
|
9169
|
-
return U != 0 ?
|
|
9168
|
+
function Et(C, U) {
|
|
9169
|
+
return U != 0 ? Et(U, C % U) : C;
|
|
9170
9170
|
}
|
|
9171
9171
|
function Ot(C, U, Tt) {
|
|
9172
9172
|
var gt = Math.PI * U;
|
|
@@ -9175,7 +9175,7 @@ function Oe() {
|
|
|
9175
9175
|
return Math.abs(kt) < 1e-9 ? gt / Math.PI : Dt * Math.sin(Tt * gt * kt) / (Math.PI * Tt * kt);
|
|
9176
9176
|
}
|
|
9177
9177
|
function Ht(C, U, Tt, gt, kt, Dt, _t, Rt, Lt) {
|
|
9178
|
-
var Mt = C.internal_flags, St, Wt = 0, en, $ = C.out_samplerate /
|
|
9178
|
+
var Mt = C.internal_flags, St, Wt = 0, en, $ = C.out_samplerate / Et(C.out_samplerate, C.in_samplerate);
|
|
9179
9179
|
$ > a.BPC && ($ = a.BPC);
|
|
9180
9180
|
var G = Math.abs(Mt.resample_ratio - Math.floor(0.5 + Mt.resample_ratio)) < 1e-4 ? 1 : 0, z = 1 / Mt.resample_ratio;
|
|
9181
9181
|
z > 1 && (z = 1);
|
|
@@ -9254,11 +9254,11 @@ function Oe() {
|
|
|
9254
9254
|
var p2 = Q0, M1 = p2.VbrMode;
|
|
9255
9255
|
function H2() {
|
|
9256
9256
|
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 =
|
|
9257
|
+
function n(a, t, e, r, o, h, b, g, y, m, S, T, v, E, A) {
|
|
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 = E, this.msfix = A;
|
|
9259
9259
|
}
|
|
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 =
|
|
9260
|
+
function i(a, t, e, r, o, h, b, g, y, m, S, T, v, E) {
|
|
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 = E;
|
|
9262
9262
|
}
|
|
9263
9263
|
var c;
|
|
9264
9264
|
this.setModules = function(a) {
|
|
@@ -9440,8 +9440,8 @@ function $2() {
|
|
|
9440
9440
|
if (y.xrpow_max = 0, X1.fill(m, T, 576, 0), S = f(y, m, T, S), S > 1e-20) {
|
|
9441
9441
|
var v = 0;
|
|
9442
9442
|
g.substep_shaping & 2 && (v = 1);
|
|
9443
|
-
for (var
|
|
9444
|
-
g.pseudohalf[
|
|
9443
|
+
for (var E = 0; E < y.psymax; E++)
|
|
9444
|
+
g.pseudohalf[E] = v;
|
|
9445
9445
|
return !0;
|
|
9446
9446
|
}
|
|
9447
9447
|
return X1.fill(y.l3_enc, 0, 576, 0), !1;
|
|
@@ -9450,14 +9450,14 @@ function $2() {
|
|
|
9450
9450
|
var m = g.ATH, S = y.xr;
|
|
9451
9451
|
if (y.block_type != D0.SHORT_TYPE)
|
|
9452
9452
|
for (var T = !1, v = D0.PSFB21 - 1; v >= 0 && !T; v--) {
|
|
9453
|
-
var
|
|
9453
|
+
var E = g.scalefac_band.psfb21[v], A = g.scalefac_band.psfb21[v + 1], w = i.athAdjust(
|
|
9454
9454
|
m.adjust,
|
|
9455
9455
|
m.psfb21[v],
|
|
9456
9456
|
m.floor
|
|
9457
9457
|
);
|
|
9458
|
-
g.nsPsy.longfact[21] > 1e-12 && (
|
|
9459
|
-
for (var x = A - 1; x >=
|
|
9460
|
-
if (Math.abs(S[x]) <
|
|
9458
|
+
g.nsPsy.longfact[21] > 1e-12 && (w *= g.nsPsy.longfact[21]);
|
|
9459
|
+
for (var x = A - 1; x >= E; x--)
|
|
9460
|
+
if (Math.abs(S[x]) < w)
|
|
9461
9461
|
S[x] = 0;
|
|
9462
9462
|
else {
|
|
9463
9463
|
T = !0;
|
|
@@ -9467,13 +9467,13 @@ function $2() {
|
|
|
9467
9467
|
else
|
|
9468
9468
|
for (var N = 0; N < 3; N++)
|
|
9469
9469
|
for (var T = !1, v = D0.PSFB12 - 1; v >= 0 && !T; v--) {
|
|
9470
|
-
var
|
|
9470
|
+
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
9471
|
m.adjust,
|
|
9472
9472
|
m.psfb12[v],
|
|
9473
9473
|
m.floor
|
|
9474
9474
|
);
|
|
9475
9475
|
g.nsPsy.shortfact[12] > 1e-12 && (D *= g.nsPsy.shortfact[12]);
|
|
9476
|
-
for (var x = A - 1; x >=
|
|
9476
|
+
for (var x = A - 1; x >= E; x--)
|
|
9477
9477
|
if (Math.abs(S[x]) < D)
|
|
9478
9478
|
S[x] = 0;
|
|
9479
9479
|
else {
|
|
@@ -9492,9 +9492,9 @@ function $2() {
|
|
|
9492
9492
|
var T = g.scalefac_band.l[y.sfb_lmax];
|
|
9493
9493
|
y1.arraycopy(y.xr, 0, S, 0, 576);
|
|
9494
9494
|
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 *
|
|
9495
|
+
for (var v = g.scalefac_band.s[m], E = g.scalefac_band.s[m + 1], A = 0; A < 3; A++)
|
|
9496
|
+
for (var w = v; w < E; w++)
|
|
9497
|
+
y.xr[T++] = S[3 * w + A];
|
|
9498
9498
|
for (var x = y.sfb_lmax, m = y.sfb_smin; m < D0.SBMAX_s; m++)
|
|
9499
9499
|
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
9500
|
}
|
|
@@ -9505,44 +9505,44 @@ function $2() {
|
|
|
9505
9505
|
}
|
|
9506
9506
|
d.BINSEARCH_NONE = new d(0), d.BINSEARCH_UP = new d(1), d.BINSEARCH_DOWN = new d(2);
|
|
9507
9507
|
function _(g, y, m, S, T) {
|
|
9508
|
-
var v,
|
|
9509
|
-
for (y.global_gain =
|
|
9508
|
+
var v, E = g.CurrentStep[S], A = !1, w = g.OldValue[S], x = d.BINSEARCH_NONE;
|
|
9509
|
+
for (y.global_gain = w, m -= y.part2_length; ; ) {
|
|
9510
9510
|
var N;
|
|
9511
|
-
if (v = l.count_bits(g, T, y, null),
|
|
9511
|
+
if (v = l.count_bits(g, T, y, null), E == 1 || v == m)
|
|
9512
9512
|
break;
|
|
9513
|
-
v > m ? (x == d.BINSEARCH_DOWN && (A = !0), A && (
|
|
9513
|
+
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
9514
|
}
|
|
9515
9515
|
for (U1(y.global_gain >= 0), U1(y.global_gain < 256); v > m && y.global_gain < 255; )
|
|
9516
9516
|
y.global_gain++, v = l.count_bits(g, T, y, null);
|
|
9517
|
-
return g.CurrentStep[S] =
|
|
9517
|
+
return g.CurrentStep[S] = w - y.global_gain >= 4 ? 4 : 2, g.OldValue[S] = y.global_gain, y.part2_3_length = v, v;
|
|
9518
9518
|
}
|
|
9519
9519
|
this.trancate_smallspectrums = function(g, y, m, S) {
|
|
9520
9520
|
var T = K1(va.SFBMAX);
|
|
9521
9521
|
if (!(!(g.substep_shaping & 4) && y.block_type == D0.SHORT_TYPE || g.substep_shaping & 128)) {
|
|
9522
9522
|
i.calc_noise(y, m, T, new we(), null);
|
|
9523
|
-
for (var
|
|
9523
|
+
for (var E = 0; E < 576; E++) {
|
|
9524
9524
|
var v = 0;
|
|
9525
|
-
y.l3_enc[
|
|
9525
|
+
y.l3_enc[E] != 0 && (v = Math.abs(y.xr[E])), S[E] = v;
|
|
9526
9526
|
}
|
|
9527
|
-
var
|
|
9527
|
+
var E = 0, A = 8;
|
|
9528
9528
|
y.block_type == D0.SHORT_TYPE && (A = 6);
|
|
9529
9529
|
do {
|
|
9530
|
-
var
|
|
9531
|
-
if (
|
|
9532
|
-
|
|
9530
|
+
var w, x, N, D, M = y.width[A];
|
|
9531
|
+
if (E += M, !(T[A] >= 1) && (X1.sort(S, E - M, M), !BitStream.EQ(S[E - 1], 0))) {
|
|
9532
|
+
w = (1 - T[A]) * m[A], x = 0, D = 0;
|
|
9533
9533
|
do {
|
|
9534
9534
|
var P;
|
|
9535
|
-
for (N = 1; D + N < M && !BitStream.NEQ(S[D +
|
|
9535
|
+
for (N = 1; D + N < M && !BitStream.NEQ(S[D + E - M], S[D + E + N - M]); N++)
|
|
9536
9536
|
;
|
|
9537
|
-
if (P = S[D +
|
|
9538
|
-
D != 0 && (x = S[D +
|
|
9537
|
+
if (P = S[D + E - M] * S[D + E - M] * N, w < P) {
|
|
9538
|
+
D != 0 && (x = S[D + E - M - 1]);
|
|
9539
9539
|
break;
|
|
9540
9540
|
}
|
|
9541
|
-
|
|
9541
|
+
w -= P, D += N;
|
|
9542
9542
|
} while (D < M);
|
|
9543
9543
|
if (!BitStream.EQ(x, 0))
|
|
9544
9544
|
do
|
|
9545
|
-
Math.abs(y.xr[
|
|
9545
|
+
Math.abs(y.xr[E - M]) <= x && (y.l3_enc[E - M] = 0);
|
|
9546
9546
|
while (--M > 0);
|
|
9547
9547
|
}
|
|
9548
9548
|
} while (++A < y.psymax);
|
|
@@ -9601,10 +9601,10 @@ function $2() {
|
|
|
9601
9601
|
return y.over_count == 0 && (v = v && m.bits < y.bits), v;
|
|
9602
9602
|
}
|
|
9603
9603
|
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[
|
|
9604
|
+
var v = g.internal_flags, E;
|
|
9605
|
+
y.scalefac_scale == 0 ? E = 1.2968395546510096 : E = 1.6817928305074292;
|
|
9606
|
+
for (var A = 0, w = 0; w < y.sfbmax; w++)
|
|
9607
|
+
A < m[w] && (A = m[w]);
|
|
9608
9608
|
var x = v.noise_shaping_amp;
|
|
9609
9609
|
switch (x == 3 && (T ? x = 2 : x = 1), x) {
|
|
9610
9610
|
case 2:
|
|
@@ -9617,13 +9617,13 @@ function $2() {
|
|
|
9617
9617
|
A > 1 ? A = 1 : A *= 0.95;
|
|
9618
9618
|
break;
|
|
9619
9619
|
}
|
|
9620
|
-
for (var N = 0,
|
|
9621
|
-
var D = y.width[
|
|
9622
|
-
if (N += D, !(m[
|
|
9623
|
-
if (v.substep_shaping & 2 && (v.pseudohalf[
|
|
9620
|
+
for (var N = 0, w = 0; w < y.sfbmax; w++) {
|
|
9621
|
+
var D = y.width[w], M;
|
|
9622
|
+
if (N += D, !(m[w] < A)) {
|
|
9623
|
+
if (v.substep_shaping & 2 && (v.pseudohalf[w] = v.pseudohalf[w] == 0 ? 1 : 0, v.pseudohalf[w] == 0 && v.noise_shaping_amp == 2))
|
|
9624
9624
|
return;
|
|
9625
|
-
for (y.scalefac[
|
|
9626
|
-
S[N + M] *=
|
|
9625
|
+
for (y.scalefac[w]++, M = -D; M < 0; M++)
|
|
9626
|
+
S[N + M] *= E, S[N + M] > y.xrpow_max && (y.xrpow_max = S[N + M]);
|
|
9627
9627
|
if (v.noise_shaping_amp == 2)
|
|
9628
9628
|
return;
|
|
9629
9629
|
}
|
|
@@ -9631,13 +9631,13 @@ function $2() {
|
|
|
9631
9631
|
}
|
|
9632
9632
|
function o(g, y) {
|
|
9633
9633
|
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
|
-
|
|
9634
|
+
var v = g.width[T], E = g.scalefac[T];
|
|
9635
|
+
if (g.preflag != 0 && (E += i.pretab[T]), S += v, E & 1) {
|
|
9636
|
+
E++;
|
|
9637
9637
|
for (var A = -v; A < 0; A++)
|
|
9638
9638
|
y[S + A] *= m, y[S + A] > g.xrpow_max && (g.xrpow_max = y[S + A]);
|
|
9639
9639
|
}
|
|
9640
|
-
g.scalefac[T] =
|
|
9640
|
+
g.scalefac[T] = E >> 1;
|
|
9641
9641
|
}
|
|
9642
9642
|
g.preflag = 0, g.scalefac_scale = 1;
|
|
9643
9643
|
}
|
|
@@ -9647,20 +9647,20 @@ function $2() {
|
|
|
9647
9647
|
if (T[S] >= 16)
|
|
9648
9648
|
return !0;
|
|
9649
9649
|
for (var v = 0; v < 3; v++) {
|
|
9650
|
-
var
|
|
9650
|
+
var E = 0, A = 0;
|
|
9651
9651
|
for (S = y.sfb_lmax + v; S < y.sfbdivide; S += 3)
|
|
9652
|
-
|
|
9652
|
+
E < T[S] && (E = T[S]);
|
|
9653
9653
|
for (; S < y.sfbmax; S += 3)
|
|
9654
9654
|
A < T[S] && (A = T[S]);
|
|
9655
|
-
if (!(
|
|
9655
|
+
if (!(E < 16 && A < 8)) {
|
|
9656
9656
|
if (y.subblock_gain[v] >= 7)
|
|
9657
9657
|
return !0;
|
|
9658
9658
|
y.subblock_gain[v]++;
|
|
9659
|
-
var
|
|
9659
|
+
var w = g.scalefac_band.l[y.sfb_lmax];
|
|
9660
9660
|
for (S = y.sfb_lmax + v; S < y.sfbmax; S += 3) {
|
|
9661
9661
|
var x, N = y.width[S], D = T[S];
|
|
9662
9662
|
if (D = D - (4 >> y.scalefac_scale), D >= 0) {
|
|
9663
|
-
T[S] = D,
|
|
9663
|
+
T[S] = D, w += N * 3;
|
|
9664
9664
|
continue;
|
|
9665
9665
|
}
|
|
9666
9666
|
T[S] = 0;
|
|
@@ -9668,16 +9668,16 @@ function $2() {
|
|
|
9668
9668
|
var M = 210 + (D << y.scalefac_scale + 1);
|
|
9669
9669
|
x = i.IPOW20(M);
|
|
9670
9670
|
}
|
|
9671
|
-
|
|
9671
|
+
w += N * (v + 1);
|
|
9672
9672
|
for (var P = -N; P < 0; P++)
|
|
9673
|
-
m[
|
|
9674
|
-
|
|
9673
|
+
m[w + P] *= x, m[w + P] > y.xrpow_max && (y.xrpow_max = m[w + P]);
|
|
9674
|
+
w += N * (3 - v - 1);
|
|
9675
9675
|
}
|
|
9676
9676
|
{
|
|
9677
9677
|
var x = i.IPOW20(202);
|
|
9678
|
-
|
|
9678
|
+
w += y.width[S] * (v + 1);
|
|
9679
9679
|
for (var P = -y.width[S]; P < 0; P++)
|
|
9680
|
-
m[
|
|
9680
|
+
m[w + P] *= x, m[w + P] > y.xrpow_max && (y.xrpow_max = m[w + P]);
|
|
9681
9681
|
}
|
|
9682
9682
|
}
|
|
9683
9683
|
}
|
|
@@ -9686,12 +9686,12 @@ function $2() {
|
|
|
9686
9686
|
function b(g, y, m, S, T) {
|
|
9687
9687
|
var v = g.internal_flags;
|
|
9688
9688
|
r(g, y, m, S, T);
|
|
9689
|
-
var
|
|
9690
|
-
return
|
|
9689
|
+
var E = p(y);
|
|
9690
|
+
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
9691
|
}
|
|
9692
9692
|
this.outer_loop = function(g, y, m, S, T, v) {
|
|
9693
|
-
var
|
|
9694
|
-
if (_(
|
|
9693
|
+
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;
|
|
9694
|
+
if (_(E, y, v, T, S), E.noise_shaping == 0)
|
|
9695
9695
|
return 100;
|
|
9696
9696
|
i.calc_noise(
|
|
9697
9697
|
y,
|
|
@@ -9701,17 +9701,17 @@ function $2() {
|
|
|
9701
9701
|
M
|
|
9702
9702
|
), N.bits = y.part2_3_length, A.assign(y);
|
|
9703
9703
|
var X = 0;
|
|
9704
|
-
for (y1.arraycopy(S, 0,
|
|
9704
|
+
for (y1.arraycopy(S, 0, w, 0, 576); !L; ) {
|
|
9705
9705
|
do {
|
|
9706
9706
|
var Z = new we(), q, k = 255;
|
|
9707
|
-
if (
|
|
9707
|
+
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
9708
|
break;
|
|
9709
9709
|
A.scalefac_scale != 0 && (k = 254);
|
|
9710
9710
|
var I = v - A.part2_length;
|
|
9711
9711
|
if (I <= 0)
|
|
9712
9712
|
break;
|
|
9713
9713
|
for (; (A.part2_3_length = l.count_bits(
|
|
9714
|
-
|
|
9714
|
+
E,
|
|
9715
9715
|
S,
|
|
9716
9716
|
A,
|
|
9717
9717
|
M
|
|
@@ -9721,7 +9721,7 @@ function $2() {
|
|
|
9721
9721
|
break;
|
|
9722
9722
|
if (N.over_count == 0) {
|
|
9723
9723
|
for (; (A.part2_3_length = l.count_bits(
|
|
9724
|
-
|
|
9724
|
+
E,
|
|
9725
9725
|
S,
|
|
9726
9726
|
A,
|
|
9727
9727
|
M
|
|
@@ -9743,23 +9743,23 @@ function $2() {
|
|
|
9743
9743
|
A,
|
|
9744
9744
|
x
|
|
9745
9745
|
) ? 1 : 0, D != 0)
|
|
9746
|
-
P = y.part2_3_length, N = Z, y.assign(A), X = 0, y1.arraycopy(S, 0,
|
|
9747
|
-
else if (
|
|
9746
|
+
P = y.part2_3_length, N = Z, y.assign(A), X = 0, y1.arraycopy(S, 0, w, 0, 576);
|
|
9747
|
+
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
9748
|
break;
|
|
9749
9749
|
} while (A.global_gain + A.scalefac_scale < 255);
|
|
9750
|
-
|
|
9750
|
+
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
9751
|
}
|
|
9752
|
-
return U1(y.global_gain + y.scalefac_scale <= 255), g.VBR == _a.vbr_rh || g.VBR == _a.vbr_mtrh ? y1.arraycopy(
|
|
9752
|
+
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
9753
|
}, this.iteration_finish_one = function(g, y, m) {
|
|
9754
9754
|
var S = g.l3_side, T = S.tt[y][m];
|
|
9755
9755
|
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(
|
|
9756
|
+
}, this.VBR_encode_granule = function(g, y, m, S, T, v, E) {
|
|
9757
|
+
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;
|
|
9758
|
+
U1(N <= LameInternalFlags.MAX_BITS_PER_CHANNEL), X1.fill(w.l3_enc, 0);
|
|
9759
9759
|
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,
|
|
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, 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
9761
|
while (P > 12);
|
|
9762
|
-
A.sfb21_extra = V, B == 2 && y1.arraycopy(
|
|
9762
|
+
A.sfb21_extra = V, B == 2 && y1.arraycopy(w.l3_enc, 0, y.l3_enc, 0, 576), U1(y.part2_3_length <= N);
|
|
9763
9763
|
}, this.get_framebits = function(g, y) {
|
|
9764
9764
|
var m = g.internal_flags;
|
|
9765
9765
|
m.bitrate_index = m.VBR_min_bitrate;
|
|
@@ -9770,7 +9770,7 @@ function $2() {
|
|
|
9770
9770
|
var v = new MeanBits(S);
|
|
9771
9771
|
y[T] = n.ResvFrameBegin(g, v), S = v.bits;
|
|
9772
9772
|
}
|
|
9773
|
-
}, this.VBR_old_prepare = function(g, y, m, S, T, v,
|
|
9773
|
+
}, this.VBR_old_prepare = function(g, y, m, S, T, v, E, A, w) {
|
|
9774
9774
|
var x = g.internal_flags, N, D = 0, M = 1, P = 0;
|
|
9775
9775
|
x.bitrate_index = x.VBR_max_bitrate;
|
|
9776
9776
|
var L = n.ResvFrameBegin(g, new MeanBits(0)) / x.mode_gr;
|
|
@@ -9783,50 +9783,50 @@ function $2() {
|
|
|
9783
9783
|
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
9784
|
10,
|
|
9785
9785
|
N * 0.1
|
|
9786
|
-
), init_outer_loop(x, Z),
|
|
9786
|
+
), init_outer_loop(x, Z), w[B][X] = i.calc_xmin(
|
|
9787
9787
|
g,
|
|
9788
9788
|
S[B][X],
|
|
9789
9789
|
Z,
|
|
9790
9790
|
T[B][X]
|
|
9791
|
-
),
|
|
9791
|
+
), w[B][X] != 0 && (M = 0), E[B][X] = 126, P += A[B][X];
|
|
9792
9792
|
}
|
|
9793
9793
|
}
|
|
9794
9794
|
for (var B = 0; B < x.mode_gr; B++)
|
|
9795
9795
|
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),
|
|
9796
|
+
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
9797
|
return M;
|
|
9798
9798
|
}, this.bitpressure_strategy = function(g, y, m, S) {
|
|
9799
9799
|
for (var T = 0; T < g.mode_gr; T++)
|
|
9800
9800
|
for (var v = 0; v < g.channels_out; v++) {
|
|
9801
|
-
for (var
|
|
9802
|
-
A[
|
|
9803
|
-
if (
|
|
9804
|
-
for (var x =
|
|
9805
|
-
A[
|
|
9801
|
+
for (var E = g.l3_side.tt[T][v], A = y[T][v], w = 0, x = 0; x < E.psy_lmax; x++)
|
|
9802
|
+
A[w++] *= 1 + 0.029 * x * x / D0.SBMAX_l / D0.SBMAX_l;
|
|
9803
|
+
if (E.block_type == D0.SHORT_TYPE)
|
|
9804
|
+
for (var x = E.sfb_smin; x < D0.SBMAX_s; x++)
|
|
9805
|
+
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
9806
|
S[T][v] = 0 | Math.max(
|
|
9807
9807
|
m[T][v],
|
|
9808
9808
|
0.9 * S[T][v]
|
|
9809
9809
|
);
|
|
9810
9810
|
}
|
|
9811
9811
|
}, this.VBR_new_prepare = function(g, y, m, S, T, v) {
|
|
9812
|
-
var
|
|
9812
|
+
var E = g.internal_flags, A = 1, w = 0, x = 0, N;
|
|
9813
9813
|
if (g.free_format) {
|
|
9814
|
-
|
|
9815
|
-
var D = new MeanBits(
|
|
9816
|
-
N = n.ResvFrameBegin(g, D),
|
|
9814
|
+
E.bitrate_index = 0;
|
|
9815
|
+
var D = new MeanBits(w);
|
|
9816
|
+
N = n.ResvFrameBegin(g, D), w = D.bits, T[0] = N;
|
|
9817
9817
|
} 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
|
-
|
|
9818
|
+
E.bitrate_index = E.VBR_max_bitrate;
|
|
9819
|
+
var D = new MeanBits(w);
|
|
9820
|
+
n.ResvFrameBegin(g, D), w = D.bits, get_framebits(g, T), N = T[E.VBR_max_bitrate];
|
|
9821
|
+
}
|
|
9822
|
+
for (var M = 0; M < E.mode_gr; M++) {
|
|
9823
|
+
i.on_pe(g, y, v[M], w, M, 0), E.mode_ext == D0.MPG_MD_MS_LR && ms_convert(E.l3_side, M);
|
|
9824
|
+
for (var P = 0; P < E.channels_out; ++P) {
|
|
9825
|
+
var L = E.l3_side.tt[M][P];
|
|
9826
|
+
E.masking_lower = Math.pow(
|
|
9827
9827
|
10,
|
|
9828
|
-
|
|
9829
|
-
), init_outer_loop(
|
|
9828
|
+
E.PSY.mask_adjust * 0.1
|
|
9829
|
+
), init_outer_loop(E, L), i.calc_xmin(
|
|
9830
9830
|
g,
|
|
9831
9831
|
m[M][P],
|
|
9832
9832
|
L,
|
|
@@ -9834,41 +9834,41 @@ function $2() {
|
|
|
9834
9834
|
) != 0 && (A = 0), x += v[M][P];
|
|
9835
9835
|
}
|
|
9836
9836
|
}
|
|
9837
|
-
for (var M = 0; M <
|
|
9838
|
-
for (var P = 0; P <
|
|
9837
|
+
for (var M = 0; M < E.mode_gr; M++)
|
|
9838
|
+
for (var P = 0; P < E.channels_out; P++)
|
|
9839
9839
|
x > N && (v[M][P] *= N, v[M][P] /= x);
|
|
9840
9840
|
return A;
|
|
9841
9841
|
}, this.calc_target_bits = function(g, y, m, S, T, v) {
|
|
9842
|
-
var
|
|
9843
|
-
|
|
9842
|
+
var E = g.internal_flags, A = E.l3_side, w, x, N, D, M = 0;
|
|
9843
|
+
E.bitrate_index = E.VBR_max_bitrate;
|
|
9844
9844
|
var P = new MeanBits(M);
|
|
9845
|
-
for (v[0] = n.ResvFrameBegin(g, P), M = P.bits,
|
|
9845
|
+
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
9846
|
var L = 0;
|
|
9847
|
-
for (N = 0; N <
|
|
9848
|
-
if (S[x][N] = int(
|
|
9847
|
+
for (N = 0; N < E.channels_out; N++) {
|
|
9848
|
+
if (S[x][N] = int(w * M), y[x][N] > 700) {
|
|
9849
9849
|
var B = int((y[x][N] - 700) / 1.4), V = A.tt[x][N];
|
|
9850
|
-
S[x][N] = int(
|
|
9850
|
+
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
9851
|
}
|
|
9852
9852
|
S[x][N] > LameInternalFlags.MAX_BITS_PER_CHANNEL && (S[x][N] = LameInternalFlags.MAX_BITS_PER_CHANNEL), L += S[x][N];
|
|
9853
9853
|
}
|
|
9854
9854
|
if (L > LameInternalFlags.MAX_BITS_PER_GRANULE)
|
|
9855
|
-
for (N = 0; N <
|
|
9855
|
+
for (N = 0; N < E.channels_out; ++N)
|
|
9856
9856
|
S[x][N] *= LameInternalFlags.MAX_BITS_PER_GRANULE, S[x][N] /= L;
|
|
9857
9857
|
}
|
|
9858
|
-
if (
|
|
9859
|
-
for (x = 0; x <
|
|
9858
|
+
if (E.mode_ext == D0.MPG_MD_MS_LR)
|
|
9859
|
+
for (x = 0; x < E.mode_gr; x++)
|
|
9860
9860
|
i.reduce_side(
|
|
9861
9861
|
S[x],
|
|
9862
9862
|
m[x],
|
|
9863
|
-
M *
|
|
9863
|
+
M * E.channels_out,
|
|
9864
9864
|
LameInternalFlags.MAX_BITS_PER_GRANULE
|
|
9865
9865
|
);
|
|
9866
|
-
for (D = 0, x = 0; x <
|
|
9867
|
-
for (N = 0; N <
|
|
9866
|
+
for (D = 0, x = 0; x < E.mode_gr; x++)
|
|
9867
|
+
for (N = 0; N < E.channels_out; N++)
|
|
9868
9868
|
S[x][N] > LameInternalFlags.MAX_BITS_PER_CHANNEL && (S[x][N] = LameInternalFlags.MAX_BITS_PER_CHANNEL), D += S[x][N];
|
|
9869
9869
|
if (D > v[0])
|
|
9870
|
-
for (x = 0; x <
|
|
9871
|
-
for (N = 0; N <
|
|
9870
|
+
for (x = 0; x < E.mode_gr; x++)
|
|
9871
|
+
for (N = 0; N < E.channels_out; N++)
|
|
9872
9872
|
S[x][N] *= v[0], S[x][N] /= D;
|
|
9873
9873
|
};
|
|
9874
9874
|
}
|
|
@@ -10216,13 +10216,13 @@ function Q1() {
|
|
|
10216
10216
|
function v(M, P, L) {
|
|
10217
10217
|
M[P + 0] = 255 & (L >> 8 & 255), M[P + 1] = 255 & (L & 255);
|
|
10218
10218
|
}
|
|
10219
|
-
function
|
|
10219
|
+
function E(M, P) {
|
|
10220
10220
|
return new String(M, P, h.length(), o).equals(h) || new String(M, P, b.length(), o).equals(b);
|
|
10221
10221
|
}
|
|
10222
10222
|
function A(M, P, L) {
|
|
10223
10223
|
return 255 & (M << P | L & ~(-1 << P));
|
|
10224
10224
|
}
|
|
10225
|
-
function
|
|
10225
|
+
function w(M, P) {
|
|
10226
10226
|
var L = M.internal_flags;
|
|
10227
10227
|
P[0] = A(P[0], 8, 255), P[1] = A(P[1], 3, 7), P[1] = A(
|
|
10228
10228
|
P[1],
|
|
@@ -10242,7 +10242,7 @@ function Q1() {
|
|
|
10242
10242
|
var P = new VBRTagData(), L = 0;
|
|
10243
10243
|
P.flags = 0;
|
|
10244
10244
|
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, !
|
|
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, !E(M, L))
|
|
10246
10246
|
return null;
|
|
10247
10247
|
L += 4, P.hId = B;
|
|
10248
10248
|
var q = P.flags = S(M, L);
|
|
@@ -10267,7 +10267,7 @@ function Q1() {
|
|
|
10267
10267
|
}
|
|
10268
10268
|
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
10269
|
var X = te(_);
|
|
10270
|
-
|
|
10270
|
+
w(M, X);
|
|
10271
10271
|
for (var Z = P.VBR_seek_table.TotalFrameSize, q = 0; q < Z; ++q)
|
|
10272
10272
|
n.add_dummy_byte(M, X[q] & 255, 1);
|
|
10273
10273
|
};
|
|
@@ -10280,7 +10280,7 @@ function Q1() {
|
|
|
10280
10280
|
M[0] = x(P[L + V], M[0]);
|
|
10281
10281
|
};
|
|
10282
10282
|
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,
|
|
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, 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
10284
|
switch (M.VBR) {
|
|
10285
10285
|
case vbr_abr:
|
|
10286
10286
|
Rt = M.VBR_mean_bitrate_kbps;
|
|
@@ -10309,8 +10309,8 @@ function Q1() {
|
|
|
10309
10309
|
mt = 7;
|
|
10310
10310
|
break;
|
|
10311
10311
|
}
|
|
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) + (
|
|
10312
|
+
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" */
|
|
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) + (Et << 6), Ht = X.nMusicCRC, T(L, B + Z, I), Z += 4;
|
|
10314
10314
|
for (var Lt = 0; Lt < 9; Lt++)
|
|
10315
10315
|
L[B + Z + Lt] = 255 & O.charAt(Lt);
|
|
10316
10316
|
Z += 9, L[B + Z] = 255 & he, Z++, L[B + Z] = 255 & Q, Z++, T(
|
|
@@ -10343,7 +10343,7 @@ function Q1() {
|
|
|
10343
10343
|
return 0;
|
|
10344
10344
|
if (P.length < L.VBR_seek_table.TotalFrameSize)
|
|
10345
10345
|
return L.VBR_seek_table.TotalFrameSize;
|
|
10346
|
-
z2.fill(P, 0, L.VBR_seek_table.TotalFrameSize, 0),
|
|
10346
|
+
z2.fill(P, 0, L.VBR_seek_table.TotalFrameSize, 0), w(M, P);
|
|
10347
10347
|
var B = te(d);
|
|
10348
10348
|
if (M.free_format)
|
|
10349
10349
|
for (var V = 1; V < d; ++V)
|
|
@@ -10393,8 +10393,8 @@ function cr(s, n, i) {
|
|
|
10393
10393
|
var y = 1152, m = 0 | 1.25 * y + 7200, S = ua(m);
|
|
10394
10394
|
this.encodeBuffer = function(T, v) {
|
|
10395
10395
|
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,
|
|
10396
|
+
var E = c.lame_encode_buffer(g, T, v, T.length, S, 0, m);
|
|
10397
|
+
return new Int8Array(S.subarray(0, E));
|
|
10398
10398
|
}, this.flush = function() {
|
|
10399
10399
|
var T = c.lame_encode_flush(g, S, 0, m);
|
|
10400
10400
|
return new Int8Array(S.subarray(0, T));
|
|
@@ -11353,11 +11353,11 @@ function requireOrtWeb_min() {
|
|
|
11353
11353
|
}));
|
|
11354
11354
|
var o, h, b, g, y, m, S = Object.assign({}, t), T = "./this.program", v = (R, H) => {
|
|
11355
11355
|
throw H;
|
|
11356
|
-
},
|
|
11356
|
+
}, 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
11357
|
function D(R) {
|
|
11358
11358
|
return t.locateFile ? t.locateFile(R, N) : N + R;
|
|
11359
11359
|
}
|
|
11360
|
-
if (
|
|
11360
|
+
if (w) {
|
|
11361
11361
|
let R;
|
|
11362
11362
|
N = A ? i(908).dirname(N) + "/" : "//", m = () => {
|
|
11363
11363
|
y || (g = i(1384), y = i(908));
|
|
@@ -11383,7 +11383,7 @@ function requireOrtWeb_min() {
|
|
|
11383
11383
|
throw console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?'), H;
|
|
11384
11384
|
}
|
|
11385
11385
|
i.g.Worker = R.Worker;
|
|
11386
|
-
} else (
|
|
11386
|
+
} 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
11387
|
var H = new XMLHttpRequest();
|
|
11388
11388
|
return H.open("GET", R, !1), H.send(null), H.responseText;
|
|
11389
11389
|
}, A && (b = (R) => {
|
|
@@ -11395,9 +11395,9 @@ function requireOrtWeb_min() {
|
|
|
11395
11395
|
le.status == 200 || le.status == 0 && le.response ? H(le.response) : K();
|
|
11396
11396
|
}, le.onerror = K, le.send(null);
|
|
11397
11397
|
}));
|
|
11398
|
-
|
|
11398
|
+
w && typeof performance > "u" && (i.g.performance = i(6953).performance);
|
|
11399
11399
|
var M = console.log.bind(console), P = console.warn.bind(console);
|
|
11400
|
-
|
|
11400
|
+
w && (m(), M = (R) => g.writeSync(1, R + `
|
|
11401
11401
|
`), P = (R) => g.writeSync(2, R + `
|
|
11402
11402
|
`));
|
|
11403
11403
|
var L, B = t.print || M, V = t.printErr || P;
|
|
@@ -11467,9 +11467,9 @@ function requireOrtWeb_min() {
|
|
|
11467
11467
|
var ht = t.INITIAL_MEMORY || 16777216;
|
|
11468
11468
|
if (x) Z = t.wasmMemory, k = t.buffer;
|
|
11469
11469
|
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"),
|
|
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"), 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
11471
|
Z && (k = Z.buffer), ht = k.byteLength, mt(k);
|
|
11472
|
-
var
|
|
11472
|
+
var Et, Ot = [], Ht = [], nn = [], C = [];
|
|
11473
11473
|
function U() {
|
|
11474
11474
|
return X || !1;
|
|
11475
11475
|
}
|
|
@@ -11512,12 +11512,12 @@ function requireOrtWeb_min() {
|
|
|
11512
11512
|
}, H.loaded && (H.$b(), delete H.$b), 0;
|
|
11513
11513
|
}
|
|
11514
11514
|
function $(R) {
|
|
11515
|
-
if (x) return
|
|
11515
|
+
if (x) return wt(1, 1, R);
|
|
11516
11516
|
U() || (z.oc(), t.onExit && t.onExit(R), Xe = !0), v(R, new St(R));
|
|
11517
11517
|
}
|
|
11518
11518
|
function G(R, H) {
|
|
11519
11519
|
if (!H && x) throw Y(R), "unwind";
|
|
11520
|
-
U() || x || (Pn(), oe(nn), mn(0), vn[1].length &&
|
|
11520
|
+
U() || x || (Pn(), oe(nn), mn(0), vn[1].length && En(1, 10), vn[2].length && En(2, 10), z.oc()), $(R);
|
|
11521
11521
|
}
|
|
11522
11522
|
var z = { Yb: [], ac: [], qc: [], Vb: {}, fc: function() {
|
|
11523
11523
|
x && z.Ec();
|
|
@@ -11545,7 +11545,7 @@ function requireOrtWeb_min() {
|
|
|
11545
11545
|
z.Bc = void 0;
|
|
11546
11546
|
}, R.onerror = (K) => {
|
|
11547
11547
|
throw V("worker sent an error! " + K.filename + ":" + K.lineno + ": " + K.message), K;
|
|
11548
|
-
},
|
|
11548
|
+
}, w && (R.on("message", (function(K) {
|
|
11549
11549
|
R.onmessage({ data: K });
|
|
11550
11550
|
})), R.on("error", (function(K) {
|
|
11551
11551
|
R.onerror(K);
|
|
@@ -11565,7 +11565,7 @@ function requireOrtWeb_min() {
|
|
|
11565
11565
|
return R = R(), Gt(H), R;
|
|
11566
11566
|
}
|
|
11567
11567
|
function Y(R) {
|
|
11568
|
-
if (x) return
|
|
11568
|
+
if (x) return wt(2, 0, R);
|
|
11569
11569
|
try {
|
|
11570
11570
|
G(R);
|
|
11571
11571
|
} catch (H) {
|
|
@@ -11579,7 +11579,7 @@ function requireOrtWeb_min() {
|
|
|
11579
11579
|
var be = [];
|
|
11580
11580
|
function fe(R) {
|
|
11581
11581
|
var H = be[R];
|
|
11582
|
-
return H || (R >= be.length && (be.length = R + 1), be[R] = H =
|
|
11582
|
+
return H || (R >= be.length && (be.length = R + 1), be[R] = H = Et.get(R)), H;
|
|
11583
11583
|
}
|
|
11584
11584
|
t.invokeEntryPoint = function(R, H) {
|
|
11585
11585
|
R = fe(R)(H), U() ? z.nc(R) : Bn(R);
|
|
@@ -11624,7 +11624,7 @@ function requireOrtWeb_min() {
|
|
|
11624
11624
|
return Dn(new pt(R).Sb);
|
|
11625
11625
|
}
|
|
11626
11626
|
function Pt(R, H, K, le) {
|
|
11627
|
-
return x ?
|
|
11627
|
+
return x ? wt(3, 1, R, H, K, le) : tt(R, H, K, le);
|
|
11628
11628
|
}
|
|
11629
11629
|
function tt(R, H, K, le) {
|
|
11630
11630
|
if (typeof SharedArrayBuffer > "u") return V("Current environment does not support SharedArrayBuffer, pthreads are not available!"), 6;
|
|
@@ -11632,43 +11632,43 @@ function requireOrtWeb_min() {
|
|
|
11632
11632
|
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
11633
|
}
|
|
11634
11634
|
function xt(R, H, K) {
|
|
11635
|
-
return x ?
|
|
11635
|
+
return x ? wt(4, 1, R, H, K) : 0;
|
|
11636
11636
|
}
|
|
11637
11637
|
function Vt(R, H) {
|
|
11638
|
-
if (x) return
|
|
11638
|
+
if (x) return wt(5, 1, R, H);
|
|
11639
11639
|
}
|
|
11640
11640
|
function ft(R, H) {
|
|
11641
|
-
if (x) return
|
|
11641
|
+
if (x) return wt(6, 1, R, H);
|
|
11642
11642
|
}
|
|
11643
11643
|
function It(R, H, K) {
|
|
11644
|
-
if (x) return
|
|
11644
|
+
if (x) return wt(7, 1, R, H, K);
|
|
11645
11645
|
}
|
|
11646
11646
|
function dt(R, H, K) {
|
|
11647
|
-
return x ?
|
|
11647
|
+
return x ? wt(8, 1, R, H, K) : 0;
|
|
11648
11648
|
}
|
|
11649
11649
|
function Nt(R, H) {
|
|
11650
|
-
if (x) return
|
|
11650
|
+
if (x) return wt(9, 1, R, H);
|
|
11651
11651
|
}
|
|
11652
11652
|
function Qt(R, H, K) {
|
|
11653
|
-
if (x) return
|
|
11653
|
+
if (x) return wt(10, 1, R, H, K);
|
|
11654
11654
|
}
|
|
11655
11655
|
function vt(R, H, K, le) {
|
|
11656
|
-
if (x) return
|
|
11656
|
+
if (x) return wt(11, 1, R, H, K, le);
|
|
11657
11657
|
}
|
|
11658
11658
|
function Bt(R, H, K, le) {
|
|
11659
|
-
if (x) return
|
|
11659
|
+
if (x) return wt(12, 1, R, H, K, le);
|
|
11660
11660
|
}
|
|
11661
11661
|
function jt(R, H, K, le) {
|
|
11662
|
-
if (x) return
|
|
11662
|
+
if (x) return wt(13, 1, R, H, K, le);
|
|
11663
11663
|
}
|
|
11664
11664
|
function tn(R) {
|
|
11665
|
-
if (x) return
|
|
11665
|
+
if (x) return wt(14, 1, R);
|
|
11666
11666
|
}
|
|
11667
11667
|
function W(R, H) {
|
|
11668
|
-
if (x) return
|
|
11668
|
+
if (x) return wt(15, 1, R, H);
|
|
11669
11669
|
}
|
|
11670
11670
|
function J(R, H, K) {
|
|
11671
|
-
if (x) return
|
|
11671
|
+
if (x) return wt(16, 1, R, H, K);
|
|
11672
11672
|
}
|
|
11673
11673
|
function ue(R) {
|
|
11674
11674
|
Atomics.store(_(), R >> 2, 1), gn() && An(R), Atomics.compareExchange(_(), R >> 2, 1, 0);
|
|
@@ -11677,10 +11677,10 @@ function requireOrtWeb_min() {
|
|
|
11677
11677
|
return p()[R >>> 2] + 4294967296 * _()[R + 4 >>> 2];
|
|
11678
11678
|
}
|
|
11679
11679
|
function et(R, H, K, le, Ye, at) {
|
|
11680
|
-
return x ?
|
|
11680
|
+
return x ? wt(17, 1, R, H, K, le, Ye, at) : -52;
|
|
11681
11681
|
}
|
|
11682
11682
|
function nt(R, H, K, le, Ye, at) {
|
|
11683
|
-
if (x) return
|
|
11683
|
+
if (x) return wt(18, 1, R, H, K, le, Ye, at);
|
|
11684
11684
|
}
|
|
11685
11685
|
function bt(R) {
|
|
11686
11686
|
var H = yt(R) + 1, K = hn(H);
|
|
@@ -11690,23 +11690,23 @@ function requireOrtWeb_min() {
|
|
|
11690
11690
|
function le(Kt) {
|
|
11691
11691
|
return (Kt = Kt.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? Kt[1] : "GMT";
|
|
11692
11692
|
}
|
|
11693
|
-
if (x) return
|
|
11693
|
+
if (x) return wt(19, 1, R, H, K);
|
|
11694
11694
|
var Ye = (/* @__PURE__ */ new Date()).getFullYear(), at = new Date(Ye, 0, 1), At = new Date(Ye, 6, 1);
|
|
11695
11695
|
Ye = at.getTimezoneOffset();
|
|
11696
11696
|
var Ft = At.getTimezoneOffset(), Yt = Math.max(Ye, Ft);
|
|
11697
11697
|
_()[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
11698
|
}
|
|
11699
|
-
function
|
|
11699
|
+
function wt(R, H) {
|
|
11700
11700
|
var K = arguments.length - 2, le = arguments;
|
|
11701
11701
|
return ve((() => {
|
|
11702
11702
|
for (var Ye = Fn(8 * K), at = Ye >> 3, At = 0; At < K; At++) {
|
|
11703
11703
|
var Ft = le[2 + At];
|
|
11704
11704
|
a()[at + At >>> 0] = Ft;
|
|
11705
11705
|
}
|
|
11706
|
-
return
|
|
11706
|
+
return wn(R, K, Ye, H);
|
|
11707
11707
|
}));
|
|
11708
11708
|
}
|
|
11709
|
-
t.executeNotifiedProxyingQueue = ue, st =
|
|
11709
|
+
t.executeNotifiedProxyingQueue = ue, st = w ? () => {
|
|
11710
11710
|
var R = process.hrtime();
|
|
11711
11711
|
return 1e3 * R[0] + R[1] / 1e6;
|
|
11712
11712
|
} : x ? () => performance.now() - t.__performance_now_clock_drift : () => performance.now();
|
|
@@ -11722,7 +11722,7 @@ function requireOrtWeb_min() {
|
|
|
11722
11722
|
return $t;
|
|
11723
11723
|
}
|
|
11724
11724
|
function it(R, H) {
|
|
11725
|
-
if (x) return
|
|
11725
|
+
if (x) return wt(20, 1, R, H);
|
|
11726
11726
|
var K = 0;
|
|
11727
11727
|
return on().forEach((function(le, Ye) {
|
|
11728
11728
|
var at = H + K;
|
|
@@ -11731,7 +11731,7 @@ function requireOrtWeb_min() {
|
|
|
11731
11731
|
})), 0;
|
|
11732
11732
|
}
|
|
11733
11733
|
function zt(R, H) {
|
|
11734
|
-
if (x) return
|
|
11734
|
+
if (x) return wt(21, 1, R, H);
|
|
11735
11735
|
var K = on();
|
|
11736
11736
|
p()[R >> 2 >>> 0] = K.length;
|
|
11737
11737
|
var le = 0;
|
|
@@ -11740,25 +11740,25 @@ function requireOrtWeb_min() {
|
|
|
11740
11740
|
})), p()[H >> 2 >>> 0] = le, 0;
|
|
11741
11741
|
}
|
|
11742
11742
|
function Ut(R) {
|
|
11743
|
-
return x ?
|
|
11743
|
+
return x ? wt(22, 1, R) : 52;
|
|
11744
11744
|
}
|
|
11745
11745
|
function fn(R, H, K, le) {
|
|
11746
|
-
return x ?
|
|
11746
|
+
return x ? wt(23, 1, R, H, K, le) : 52;
|
|
11747
11747
|
}
|
|
11748
11748
|
function dn(R, H, K, le, Ye) {
|
|
11749
|
-
return x ?
|
|
11749
|
+
return x ? wt(24, 1, R, H, K, le, Ye) : 70;
|
|
11750
11750
|
}
|
|
11751
11751
|
var vn = [null, [], []];
|
|
11752
|
-
function
|
|
11752
|
+
function En(R, H) {
|
|
11753
11753
|
var K = vn[R];
|
|
11754
11754
|
H === 0 || H === 10 ? ((R === 1 ? B : V)(Ce(K, 0)), K.length = 0) : K.push(H);
|
|
11755
11755
|
}
|
|
11756
11756
|
function kn(R, H, K, le) {
|
|
11757
|
-
if (x) return
|
|
11757
|
+
if (x) return wt(25, 1, R, H, K, le);
|
|
11758
11758
|
for (var Ye = 0, at = 0; at < K; at++) {
|
|
11759
11759
|
var At = p()[H >> 2 >>> 0], Ft = p()[H + 4 >> 2 >>> 0];
|
|
11760
11760
|
H += 8;
|
|
11761
|
-
for (var Yt = 0; Yt < Ft; Yt++)
|
|
11761
|
+
for (var Yt = 0; Yt < Ft; Yt++) En(R, d()[At + Yt >>> 0]);
|
|
11762
11762
|
Ye += Ft;
|
|
11763
11763
|
}
|
|
11764
11764
|
return p()[le >> 2 >>> 0] = Ye, 0;
|
|
@@ -11954,7 +11954,7 @@ function requireOrtWeb_min() {
|
|
|
11954
11954
|
}, pa: function() {
|
|
11955
11955
|
return ke;
|
|
11956
11956
|
}, Fa: function(R) {
|
|
11957
|
-
Tn(R, !A, 1, !
|
|
11957
|
+
Tn(R, !A, 1, !E), z.pc();
|
|
11958
11958
|
}, T: function(R) {
|
|
11959
11959
|
x ? postMessage({ cmd: "cleanupThread", thread: R }) : Wt(R);
|
|
11960
11960
|
}, xa: tt, j: function(R) {
|
|
@@ -11994,16 +11994,16 @@ function requireOrtWeb_min() {
|
|
|
11994
11994
|
}, y: function() {
|
|
11995
11995
|
_t("");
|
|
11996
11996
|
}, U: function() {
|
|
11997
|
-
if (!
|
|
11997
|
+
if (!w && !A) {
|
|
11998
11998
|
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,
|
|
11999
|
+
me || (me = {}), me[R] || (me[R] = 1, w && (R = "warning: " + R), V(R));
|
|
12000
12000
|
}
|
|
12001
12001
|
}, ra: function() {
|
|
12002
12002
|
return 4294901760;
|
|
12003
12003
|
}, B: st, Ia: function(R, H, K) {
|
|
12004
12004
|
d().copyWithin(R >>> 0, H >>> 0, H + K >>> 0);
|
|
12005
12005
|
}, F: function() {
|
|
12006
|
-
return
|
|
12006
|
+
return w ? i(3993).cpus().length : navigator.hardwareConcurrency;
|
|
12007
12007
|
}, Da: function(R, H, K) {
|
|
12008
12008
|
Jt.length = H, K >>= 3;
|
|
12009
12009
|
for (var le = 0; le < H; le++) Jt[le] = a()[K + le >>> 0];
|
|
@@ -12038,7 +12038,7 @@ function requireOrtWeb_min() {
|
|
|
12038
12038
|
var Ye = new Uint8Array(1);
|
|
12039
12039
|
return () => (crypto.getRandomValues(Ye), Ye[0]);
|
|
12040
12040
|
}
|
|
12041
|
-
if (
|
|
12041
|
+
if (w) try {
|
|
12042
12042
|
var at = i(Object((function() {
|
|
12043
12043
|
var At = new Error("Cannot find module 'crypto'");
|
|
12044
12044
|
throw At.code = "MODULE_NOT_FOUND", At;
|
|
@@ -12347,14 +12347,14 @@ function requireOrtWeb_min() {
|
|
|
12347
12347
|
} };
|
|
12348
12348
|
(function() {
|
|
12349
12349
|
function R(Ye, at) {
|
|
12350
|
-
t.asm = Ye.exports, z.qc.push(t.asm.sb),
|
|
12350
|
+
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
12351
|
}
|
|
12352
12352
|
function H(Ye) {
|
|
12353
12353
|
R(Ye.instance, Ye.module);
|
|
12354
12354
|
}
|
|
12355
12355
|
function K(Ye) {
|
|
12356
12356
|
return (function() {
|
|
12357
|
-
if (!L && (
|
|
12357
|
+
if (!L && (E || A)) {
|
|
12358
12358
|
if (typeof fetch == "function" && !gt.startsWith("file://")) return fetch(gt, { credentials: "same-origin" }).then((function(at) {
|
|
12359
12359
|
if (!at.ok) throw "failed to load wasm binary file at '" + gt + "'";
|
|
12360
12360
|
return at.arrayBuffer();
|
|
@@ -12384,7 +12384,7 @@ function requireOrtWeb_min() {
|
|
|
12384
12384
|
} catch (Ye) {
|
|
12385
12385
|
return V("Module.instantiateWasm callback failed with error: " + Ye), !1;
|
|
12386
12386
|
}
|
|
12387
|
-
(L || typeof WebAssembly.instantiateStreaming != "function" || Rt() || gt.startsWith("file://") ||
|
|
12387
|
+
(L || typeof WebAssembly.instantiateStreaming != "function" || Rt() || gt.startsWith("file://") || w || typeof fetch != "function" ? K(H) : fetch(gt, { credentials: "same-origin" }).then((function(Ye) {
|
|
12388
12388
|
return WebAssembly.instantiateStreaming(Ye, le).then(H, (function(at) {
|
|
12389
12389
|
return V("wasm streaming compile failed: " + at), V("falling back to ArrayBuffer instantiation"), K(H);
|
|
12390
12390
|
}));
|
|
@@ -12452,8 +12452,8 @@ function requireOrtWeb_min() {
|
|
|
12452
12452
|
t.__emscripten_thread_crashed = function() {
|
|
12453
12453
|
return (t.__emscripten_thread_crashed = t.asm.wb).apply(null, arguments);
|
|
12454
12454
|
};
|
|
12455
|
-
var bn,
|
|
12456
|
-
return (
|
|
12455
|
+
var bn, wn = t._emscripten_run_in_main_runtime_thread_js = function() {
|
|
12456
|
+
return (wn = t._emscripten_run_in_main_runtime_thread_js = t.asm.xb).apply(null, arguments);
|
|
12457
12457
|
}, An = t.__emscripten_proxy_execute_task_queue = function() {
|
|
12458
12458
|
return (An = t.__emscripten_proxy_execute_task_queue = t.asm.yb).apply(null, arguments);
|
|
12459
12459
|
}, Ln = t.__emscripten_thread_free_data = function() {
|
|
@@ -12545,7 +12545,7 @@ function requireOrtWeb_min() {
|
|
|
12545
12545
|
})), process.on("unhandledRejection", (function(W) {
|
|
12546
12546
|
throw W;
|
|
12547
12547
|
})), g = (W, J) => {
|
|
12548
|
-
if (
|
|
12548
|
+
if (w || 0 < Q) throw process.exitCode = W, J;
|
|
12549
12549
|
J instanceof Ht || A("exiting due to exception: " + J), process.exit(W);
|
|
12550
12550
|
}, u.inspect = function() {
|
|
12551
12551
|
return "[Emscripten Module object]";
|
|
@@ -12561,9 +12561,9 @@ function requireOrtWeb_min() {
|
|
|
12561
12561
|
Fe.status == 200 || Fe.status == 0 && Fe.response ? J(Fe.response) : ue();
|
|
12562
12562
|
}, Fe.onerror = ue, Fe.send(null);
|
|
12563
12563
|
});
|
|
12564
|
-
var v,
|
|
12564
|
+
var v, E = u.print || console.log.bind(console), A = u.printErr || console.warn.bind(console);
|
|
12565
12565
|
Object.assign(u, h), h = null, u.thisProgram && (b = u.thisProgram), u.quit && (g = u.quit), u.wasmBinary && (v = u.wasmBinary);
|
|
12566
|
-
var
|
|
12566
|
+
var w = u.noExitRuntime || !1;
|
|
12567
12567
|
typeof WebAssembly != "object" && mt("no native wasm support detected");
|
|
12568
12568
|
var x, N, D, M, P, L, B = !1, V = typeof TextDecoder < "u" ? new TextDecoder("utf8") : void 0;
|
|
12569
12569
|
function X(W, J, ue) {
|
|
@@ -12638,8 +12638,8 @@ function requireOrtWeb_min() {
|
|
|
12638
12638
|
return rt.startsWith("data:application/octet-stream;base64,");
|
|
12639
12639
|
}
|
|
12640
12640
|
if (rt = "ort-wasm.wasm", !ht()) {
|
|
12641
|
-
var
|
|
12642
|
-
rt = u.locateFile ? u.locateFile(
|
|
12641
|
+
var Et = rt;
|
|
12642
|
+
rt = u.locateFile ? u.locateFile(Et, T) : T + Et;
|
|
12643
12643
|
}
|
|
12644
12644
|
function Ot() {
|
|
12645
12645
|
var W = rt;
|
|
@@ -12720,7 +12720,7 @@ function requireOrtWeb_min() {
|
|
|
12720
12720
|
var St, Wt = [null, [], []];
|
|
12721
12721
|
function en(W, J) {
|
|
12722
12722
|
var ue = Wt[W];
|
|
12723
|
-
J === 0 || J === 10 ? ((W === 1 ?
|
|
12723
|
+
J === 0 || J === 10 ? ((W === 1 ? E : A)(X(ue, 0)), ue.length = 0) : ue.push(J);
|
|
12724
12724
|
}
|
|
12725
12725
|
var $ = 0;
|
|
12726
12726
|
function G(W) {
|
|
@@ -12760,7 +12760,7 @@ function requireOrtWeb_min() {
|
|
|
12760
12760
|
return new Date(it.getFullYear() - 1, 11, 30);
|
|
12761
12761
|
}
|
|
12762
12762
|
}
|
|
12763
|
-
function
|
|
12763
|
+
function wt(it) {
|
|
12764
12764
|
var zt = it.Bb;
|
|
12765
12765
|
for (it = new Date(new Date(it.Cb + 1900, 0, 1).getTime()); 0 < zt; ) {
|
|
12766
12766
|
var Ut = it.getMonth(), fn = (G(it.getFullYear()) ? z : oe)[Ut];
|
|
@@ -12790,9 +12790,9 @@ function requireOrtWeb_min() {
|
|
|
12790
12790
|
}, "%e": function(it) {
|
|
12791
12791
|
return et(it.Kb, 2, " ");
|
|
12792
12792
|
}, "%g": function(it) {
|
|
12793
|
-
return
|
|
12793
|
+
return wt(it).toString().substring(2);
|
|
12794
12794
|
}, "%G": function(it) {
|
|
12795
|
-
return
|
|
12795
|
+
return wt(it);
|
|
12796
12796
|
}, "%H": function(it) {
|
|
12797
12797
|
return nt(it.Gb, 2);
|
|
12798
12798
|
}, "%I": function(it) {
|
|
@@ -12954,10 +12954,10 @@ function requireOrtWeb_min() {
|
|
|
12954
12954
|
function Ct(on) {
|
|
12955
12955
|
return (on = on.toTimeString().match(/\(([A-Za-z ]+)\)$/)) ? on[1] : "GMT";
|
|
12956
12956
|
}
|
|
12957
|
-
var
|
|
12958
|
-
|
|
12957
|
+
var wt = (/* @__PURE__ */ new Date()).getFullYear(), $t = new Date(wt, 0, 1), Jt = new Date(wt, 6, 1);
|
|
12958
|
+
wt = $t.getTimezoneOffset();
|
|
12959
12959
|
var sn = Jt.getTimezoneOffset();
|
|
12960
|
-
P[et >> 2 >>> 0] = 60 * Math.max(
|
|
12960
|
+
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
12961
|
})(J, ue, Fe));
|
|
12962
12962
|
}, B: function() {
|
|
12963
12963
|
mt("");
|
|
@@ -13003,7 +13003,7 @@ function requireOrtWeb_min() {
|
|
|
13003
13003
|
Fe += et.length + 1;
|
|
13004
13004
|
})), L[J >> 2 >>> 0] = Fe, 0;
|
|
13005
13005
|
}, ba: function(W) {
|
|
13006
|
-
|
|
13006
|
+
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
13007
|
}, E: function() {
|
|
13008
13008
|
return 52;
|
|
13009
13009
|
}, Q: function() {
|
|
@@ -13014,7 +13014,7 @@ function requireOrtWeb_min() {
|
|
|
13014
13014
|
for (var et = 0, nt = 0; nt < ue; nt++) {
|
|
13015
13015
|
var bt = L[J >> 2 >>> 0], Ct = L[J + 4 >> 2 >>> 0];
|
|
13016
13016
|
J += 8;
|
|
13017
|
-
for (var
|
|
13017
|
+
for (var wt = 0; wt < Ct; wt++) en(W, M[bt + wt >>> 0]);
|
|
13018
13018
|
et += Ct;
|
|
13019
13019
|
}
|
|
13020
13020
|
return L[Fe >> 2 >>> 0] = et, 0;
|
|
@@ -13130,40 +13130,40 @@ function requireOrtWeb_min() {
|
|
|
13130
13130
|
var Ct = ot();
|
|
13131
13131
|
try {
|
|
13132
13132
|
return _t(W)(J, ue, Fe, et, nt, bt);
|
|
13133
|
-
} catch (
|
|
13134
|
-
if (pt(Ct),
|
|
13133
|
+
} catch (wt) {
|
|
13134
|
+
if (pt(Ct), wt !== wt + 0) throw wt;
|
|
13135
13135
|
ke(1, 0);
|
|
13136
13136
|
}
|
|
13137
13137
|
}, K: function(W, J, ue, Fe, et, nt, bt, Ct) {
|
|
13138
|
-
var
|
|
13138
|
+
var wt = ot();
|
|
13139
13139
|
try {
|
|
13140
13140
|
return _t(W)(J, ue, Fe, et, nt, bt, Ct);
|
|
13141
13141
|
} catch ($t) {
|
|
13142
|
-
if (pt(
|
|
13142
|
+
if (pt(wt), $t !== $t + 0) throw $t;
|
|
13143
13143
|
ke(1, 0);
|
|
13144
13144
|
}
|
|
13145
|
-
}, D: function(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13145
|
+
}, D: function(W, J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn) {
|
|
13146
13146
|
var on = ot();
|
|
13147
13147
|
try {
|
|
13148
|
-
return _t(W)(J, ue, Fe, et, nt, bt, Ct,
|
|
13148
|
+
return _t(W)(J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn);
|
|
13149
13149
|
} catch (it) {
|
|
13150
13150
|
if (pt(on), it !== it + 0) throw it;
|
|
13151
13151
|
ke(1, 0);
|
|
13152
13152
|
}
|
|
13153
13153
|
}, X: function(W, J, ue, Fe, et, nt, bt, Ct) {
|
|
13154
|
-
var
|
|
13154
|
+
var wt = ot();
|
|
13155
13155
|
try {
|
|
13156
13156
|
return Bt(W, J, ue, Fe, et, nt, bt, Ct);
|
|
13157
13157
|
} catch ($t) {
|
|
13158
|
-
if (pt(
|
|
13158
|
+
if (pt(wt), $t !== $t + 0) throw $t;
|
|
13159
13159
|
ke(1, 0);
|
|
13160
13160
|
}
|
|
13161
13161
|
}, V: function(W, J, ue, Fe, et, nt, bt) {
|
|
13162
13162
|
var Ct = ot();
|
|
13163
13163
|
try {
|
|
13164
13164
|
return Vt(W, J, ue, Fe, et, nt, bt);
|
|
13165
|
-
} catch (
|
|
13166
|
-
if (pt(Ct),
|
|
13165
|
+
} catch (wt) {
|
|
13166
|
+
if (pt(Ct), wt !== wt + 0) throw wt;
|
|
13167
13167
|
ke(1, 0);
|
|
13168
13168
|
}
|
|
13169
13169
|
}, U: function(W, J, ue, Fe, et) {
|
|
@@ -13266,54 +13266,54 @@ function requireOrtWeb_min() {
|
|
|
13266
13266
|
var Ct = ot();
|
|
13267
13267
|
try {
|
|
13268
13268
|
_t(W)(J, ue, Fe, et, nt, bt);
|
|
13269
|
-
} catch (
|
|
13270
|
-
if (pt(Ct),
|
|
13269
|
+
} catch (wt) {
|
|
13270
|
+
if (pt(Ct), wt !== wt + 0) throw wt;
|
|
13271
13271
|
ke(1, 0);
|
|
13272
13272
|
}
|
|
13273
13273
|
}, z: function(W, J, ue, Fe, et, nt, bt, Ct) {
|
|
13274
|
-
var
|
|
13274
|
+
var wt = ot();
|
|
13275
13275
|
try {
|
|
13276
13276
|
_t(W)(J, ue, Fe, et, nt, bt, Ct);
|
|
13277
13277
|
} catch ($t) {
|
|
13278
|
-
if (pt(
|
|
13278
|
+
if (pt(wt), $t !== $t + 0) throw $t;
|
|
13279
13279
|
ke(1, 0);
|
|
13280
13280
|
}
|
|
13281
|
-
}, ga: function(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13281
|
+
}, ga: function(W, J, ue, Fe, et, nt, bt, Ct, wt) {
|
|
13282
13282
|
var $t = ot();
|
|
13283
13283
|
try {
|
|
13284
|
-
_t(W)(J, ue, Fe, et, nt, bt, Ct,
|
|
13284
|
+
_t(W)(J, ue, Fe, et, nt, bt, Ct, wt);
|
|
13285
13285
|
} catch (Jt) {
|
|
13286
13286
|
if (pt($t), Jt !== Jt + 0) throw Jt;
|
|
13287
13287
|
ke(1, 0);
|
|
13288
13288
|
}
|
|
13289
|
-
}, A: function(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13289
|
+
}, A: function(W, J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt) {
|
|
13290
13290
|
var sn = ot();
|
|
13291
13291
|
try {
|
|
13292
|
-
_t(W)(J, ue, Fe, et, nt, bt, Ct,
|
|
13292
|
+
_t(W)(J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt);
|
|
13293
13293
|
} catch (on) {
|
|
13294
13294
|
if (pt(sn), on !== on + 0) throw on;
|
|
13295
13295
|
ke(1, 0);
|
|
13296
13296
|
}
|
|
13297
|
-
}, C: function(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13297
|
+
}, C: function(W, J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn, on, it, zt, Ut) {
|
|
13298
13298
|
var fn = ot();
|
|
13299
13299
|
try {
|
|
13300
|
-
_t(W)(J, ue, Fe, et, nt, bt, Ct,
|
|
13300
|
+
_t(W)(J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn, on, it, zt, Ut);
|
|
13301
13301
|
} catch (dn) {
|
|
13302
13302
|
if (pt(fn), dn !== dn + 0) throw dn;
|
|
13303
13303
|
ke(1, 0);
|
|
13304
13304
|
}
|
|
13305
13305
|
}, aa: function(W, J, ue, Fe, et, nt, bt, Ct) {
|
|
13306
|
-
var
|
|
13306
|
+
var wt = ot();
|
|
13307
13307
|
try {
|
|
13308
13308
|
It(W, J, ue, Fe, et, nt, bt, Ct);
|
|
13309
13309
|
} catch ($t) {
|
|
13310
|
-
if (pt(
|
|
13310
|
+
if (pt(wt), $t !== $t + 0) throw $t;
|
|
13311
13311
|
ke(1, 0);
|
|
13312
13312
|
}
|
|
13313
|
-
}, _: function(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13313
|
+
}, _: function(W, J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn) {
|
|
13314
13314
|
var on = ot();
|
|
13315
13315
|
try {
|
|
13316
|
-
Nt(W, J, ue, Fe, et, nt, bt, Ct,
|
|
13316
|
+
Nt(W, J, ue, Fe, et, nt, bt, Ct, wt, $t, Jt, sn);
|
|
13317
13317
|
} catch (it) {
|
|
13318
13318
|
if (pt(on), it !== it + 0) throw it;
|
|
13319
13319
|
ke(1, 0);
|
|
@@ -13732,43 +13732,43 @@ function requireOrtWeb_min() {
|
|
|
13732
13732
|
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
13733
|
} catch {
|
|
13734
13734
|
}
|
|
13735
|
-
function i(
|
|
13736
|
-
this.low = 0 |
|
|
13735
|
+
function i(w, x, N) {
|
|
13736
|
+
this.low = 0 | w, this.high = 0 | x, this.unsigned = !!N;
|
|
13737
13737
|
}
|
|
13738
|
-
function c(
|
|
13739
|
-
return (
|
|
13738
|
+
function c(w) {
|
|
13739
|
+
return (w && w.__isLong__) === !0;
|
|
13740
13740
|
}
|
|
13741
13741
|
i.prototype.__isLong__, Object.defineProperty(i.prototype, "__isLong__", { value: !0 }), i.isLong = c;
|
|
13742
13742
|
var l = {}, f = {};
|
|
13743
|
-
function u(
|
|
13743
|
+
function u(w, x) {
|
|
13744
13744
|
var N, D, M;
|
|
13745
|
-
return x ? (M = 0 <= (
|
|
13745
|
+
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
13746
|
}
|
|
13747
|
-
function d(
|
|
13748
|
-
if (isNaN(
|
|
13747
|
+
function d(w, x) {
|
|
13748
|
+
if (isNaN(w)) return x ? g : b;
|
|
13749
13749
|
if (x) {
|
|
13750
|
-
if (
|
|
13751
|
-
if (
|
|
13750
|
+
if (w < 0) return g;
|
|
13751
|
+
if (w >= r) return v;
|
|
13752
13752
|
} else {
|
|
13753
|
-
if (
|
|
13754
|
-
if (
|
|
13753
|
+
if (w <= -o) return E;
|
|
13754
|
+
if (w + 1 >= o) return T;
|
|
13755
13755
|
}
|
|
13756
|
-
return
|
|
13756
|
+
return w < 0 ? d(-w, x).neg() : _(w % e | 0, w / e | 0, x);
|
|
13757
13757
|
}
|
|
13758
|
-
function _(
|
|
13759
|
-
return new i(
|
|
13758
|
+
function _(w, x, N) {
|
|
13759
|
+
return new i(w, x, N);
|
|
13760
13760
|
}
|
|
13761
13761
|
i.fromInt = u, i.fromNumber = d, i.fromBits = _;
|
|
13762
13762
|
var p = Math.pow;
|
|
13763
|
-
function a(
|
|
13764
|
-
if (
|
|
13765
|
-
if (
|
|
13763
|
+
function a(w, x, N) {
|
|
13764
|
+
if (w.length === 0) throw Error("empty string");
|
|
13765
|
+
if (w === "NaN" || w === "Infinity" || w === "+Infinity" || w === "-Infinity") return b;
|
|
13766
13766
|
if (typeof x == "number" ? (N = x, x = !1) : x = !!x, (N = N || 10) < 2 || 36 < N) throw RangeError("radix");
|
|
13767
13767
|
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,
|
|
13768
|
+
if ((D = w.indexOf("-")) > 0) throw Error("interior hyphen");
|
|
13769
|
+
if (D === 0) return a(w.substring(1), x, N).neg();
|
|
13770
|
+
for (var M = d(p(N, 8)), P = b, L = 0; L < w.length; L += 8) {
|
|
13771
|
+
var B = Math.min(8, w.length - L), V = parseInt(w.substring(L, L + B), N);
|
|
13772
13772
|
if (B < 8) {
|
|
13773
13773
|
var X = d(p(N, B));
|
|
13774
13774
|
P = P.mul(X).add(d(V));
|
|
@@ -13776,8 +13776,8 @@ function requireOrtWeb_min() {
|
|
|
13776
13776
|
}
|
|
13777
13777
|
return P.unsigned = x, P;
|
|
13778
13778
|
}
|
|
13779
|
-
function t(
|
|
13780
|
-
return typeof
|
|
13779
|
+
function t(w, x) {
|
|
13780
|
+
return typeof w == "number" ? d(w, x) : typeof w == "string" ? a(w, x) : _(w.low, w.high, typeof x == "boolean" ? x : w.unsigned);
|
|
13781
13781
|
}
|
|
13782
13782
|
i.fromString = a, i.fromValue = t;
|
|
13783
13783
|
var e = 4294967296, r = e * e, o = r / 2, h = u(1 << 24), b = u(0);
|
|
@@ -13794,25 +13794,25 @@ function requireOrtWeb_min() {
|
|
|
13794
13794
|
i.MAX_VALUE = T;
|
|
13795
13795
|
var v = _(-1, -1, !0);
|
|
13796
13796
|
i.MAX_UNSIGNED_VALUE = v;
|
|
13797
|
-
var
|
|
13798
|
-
i.MIN_VALUE =
|
|
13797
|
+
var E = _(0, -2147483648, !1);
|
|
13798
|
+
i.MIN_VALUE = E;
|
|
13799
13799
|
var A = i.prototype;
|
|
13800
13800
|
A.toInt = function() {
|
|
13801
13801
|
return this.unsigned ? this.low >>> 0 : this.low;
|
|
13802
13802
|
}, A.toNumber = function() {
|
|
13803
13803
|
return this.unsigned ? (this.high >>> 0) * e + (this.low >>> 0) : this.high * e + (this.low >>> 0);
|
|
13804
|
-
}, A.toString = function(
|
|
13805
|
-
if ((
|
|
13804
|
+
}, A.toString = function(w) {
|
|
13805
|
+
if ((w = w || 10) < 2 || 36 < w) throw RangeError("radix");
|
|
13806
13806
|
if (this.isZero()) return "0";
|
|
13807
13807
|
if (this.isNegative()) {
|
|
13808
|
-
if (this.eq(
|
|
13809
|
-
var x = d(
|
|
13810
|
-
return N.toString(
|
|
13808
|
+
if (this.eq(E)) {
|
|
13809
|
+
var x = d(w), N = this.div(x), D = N.mul(x).sub(this);
|
|
13810
|
+
return N.toString(w) + D.toInt().toString(w);
|
|
13811
13811
|
}
|
|
13812
|
-
return "-" + this.neg().toString(
|
|
13812
|
+
return "-" + this.neg().toString(w);
|
|
13813
13813
|
}
|
|
13814
|
-
for (var M = d(p(
|
|
13815
|
-
var B = P.div(M), V = (P.sub(B.mul(M)).toInt() >>> 0).toString(
|
|
13814
|
+
for (var M = d(p(w, 6), this.unsigned), P = this, L = ""; ; ) {
|
|
13815
|
+
var B = P.div(M), V = (P.sub(B.mul(M)).toInt() >>> 0).toString(w);
|
|
13816
13816
|
if ((P = B).isZero()) return V + L;
|
|
13817
13817
|
for (; V.length < 6; ) V = "0" + V;
|
|
13818
13818
|
L = "" + V + L;
|
|
@@ -13826,8 +13826,8 @@ function requireOrtWeb_min() {
|
|
|
13826
13826
|
}, A.getLowBitsUnsigned = function() {
|
|
13827
13827
|
return this.low >>> 0;
|
|
13828
13828
|
}, A.getNumBitsAbs = function() {
|
|
13829
|
-
if (this.isNegative()) return this.eq(
|
|
13830
|
-
for (var
|
|
13829
|
+
if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
|
|
13830
|
+
for (var w = this.high != 0 ? this.high : this.low, x = 31; x > 0 && (w & 1 << x) == 0; x--) ;
|
|
13831
13831
|
return this.high != 0 ? x + 33 : x + 1;
|
|
13832
13832
|
}, A.isZero = function() {
|
|
13833
13833
|
return this.high === 0 && this.low === 0;
|
|
@@ -13839,99 +13839,99 @@ function requireOrtWeb_min() {
|
|
|
13839
13839
|
return (1 & this.low) == 1;
|
|
13840
13840
|
}, A.isEven = function() {
|
|
13841
13841
|
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 ?
|
|
13842
|
+
}, A.equals = function(w) {
|
|
13843
|
+
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;
|
|
13844
|
+
}, A.eq = A.equals, A.notEquals = function(w) {
|
|
13845
|
+
return !this.eq(w);
|
|
13846
|
+
}, A.neq = A.notEquals, A.ne = A.notEquals, A.lessThan = function(w) {
|
|
13847
|
+
return this.comp(w) < 0;
|
|
13848
|
+
}, A.lt = A.lessThan, A.lessThanOrEqual = function(w) {
|
|
13849
|
+
return this.comp(w) <= 0;
|
|
13850
|
+
}, A.lte = A.lessThanOrEqual, A.le = A.lessThanOrEqual, A.greaterThan = function(w) {
|
|
13851
|
+
return this.comp(w) > 0;
|
|
13852
|
+
}, A.gt = A.greaterThan, A.greaterThanOrEqual = function(w) {
|
|
13853
|
+
return this.comp(w) >= 0;
|
|
13854
|
+
}, A.gte = A.greaterThanOrEqual, A.ge = A.greaterThanOrEqual, A.compare = function(w) {
|
|
13855
|
+
if (c(w) || (w = t(w)), this.eq(w)) return 0;
|
|
13856
|
+
var x = this.isNegative(), N = w.isNegative();
|
|
13857
|
+
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
13858
|
}, 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(
|
|
13859
|
+
return !this.unsigned && this.eq(E) ? E : this.not().add(y);
|
|
13860
|
+
}, A.neg = A.negate, A.add = function(w) {
|
|
13861
|
+
c(w) || (w = t(w));
|
|
13862
|
+
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;
|
|
13863
|
+
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);
|
|
13864
|
+
}, A.subtract = function(w) {
|
|
13865
|
+
return c(w) || (w = t(w)), this.add(w.neg());
|
|
13866
|
+
}, A.sub = A.subtract, A.multiply = function(w) {
|
|
13867
13867
|
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 =
|
|
13868
|
+
if (c(w) || (w = t(w)), n) return _(n.mul(this.low, this.high, w.low, w.high), n.get_high(), this.unsigned);
|
|
13869
|
+
if (w.isZero()) return b;
|
|
13870
|
+
if (this.eq(E)) return w.isOdd() ? E : b;
|
|
13871
|
+
if (w.eq(E)) return this.isOdd() ? E : b;
|
|
13872
|
+
if (this.isNegative()) return w.isNegative() ? this.neg().mul(w.neg()) : this.neg().mul(w).neg();
|
|
13873
|
+
if (w.isNegative()) return this.mul(w.neg()).neg();
|
|
13874
|
+
if (this.lt(h) && w.lt(h)) return d(this.toNumber() * w.toNumber(), this.unsigned);
|
|
13875
|
+
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
13876
|
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(
|
|
13877
|
+
}, A.mul = A.multiply, A.divide = function(w) {
|
|
13878
|
+
if (c(w) || (w = t(w)), w.isZero()) throw Error("division by zero");
|
|
13879
13879
|
var x, N, D;
|
|
13880
|
-
if (n) return this.unsigned || this.high !== -2147483648 ||
|
|
13880
|
+
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
13881
|
if (this.isZero()) return this.unsigned ? g : b;
|
|
13882
13882
|
if (this.unsigned) {
|
|
13883
|
-
if (
|
|
13884
|
-
if (
|
|
13883
|
+
if (w.unsigned || (w = w.toUnsigned()), w.gt(this)) return g;
|
|
13884
|
+
if (w.gt(this.shru(1))) return m;
|
|
13885
13885
|
D = g;
|
|
13886
13886
|
} else {
|
|
13887
|
-
if (this.eq(
|
|
13888
|
-
if (
|
|
13889
|
-
if (this.isNegative()) return
|
|
13890
|
-
if (
|
|
13887
|
+
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)));
|
|
13888
|
+
if (w.eq(E)) return this.unsigned ? g : b;
|
|
13889
|
+
if (this.isNegative()) return w.isNegative() ? this.neg().div(w.neg()) : this.neg().div(w).neg();
|
|
13890
|
+
if (w.isNegative()) return this.div(w.neg()).neg();
|
|
13891
13891
|
D = b;
|
|
13892
13892
|
}
|
|
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(
|
|
13893
|
+
for (N = this; N.gte(w); ) {
|
|
13894
|
+
x = Math.max(1, Math.floor(N.toNumber() / w.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(w); B.isNegative() || B.gt(N); ) B = (L = d(x -= P, this.unsigned)).mul(w);
|
|
13896
13896
|
L.isZero() && (L = y), D = D.add(L), N = N.sub(B);
|
|
13897
13897
|
}
|
|
13898
13898
|
return D;
|
|
13899
|
-
}, A.div = A.divide, A.modulo = function(
|
|
13900
|
-
return c(
|
|
13899
|
+
}, A.div = A.divide, A.modulo = function(w) {
|
|
13900
|
+
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
13901
|
}, A.mod = A.modulo, A.rem = A.modulo, A.not = function() {
|
|
13902
13902
|
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(
|
|
13903
|
+
}, A.and = function(w) {
|
|
13904
|
+
return c(w) || (w = t(w)), _(this.low & w.low, this.high & w.high, this.unsigned);
|
|
13905
|
+
}, A.or = function(w) {
|
|
13906
|
+
return c(w) || (w = t(w)), _(this.low | w.low, this.high | w.high, this.unsigned);
|
|
13907
|
+
}, A.xor = function(w) {
|
|
13908
|
+
return c(w) || (w = t(w)), _(this.low ^ w.low, this.high ^ w.high, this.unsigned);
|
|
13909
|
+
}, A.shiftLeft = function(w) {
|
|
13910
|
+
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);
|
|
13911
|
+
}, A.shl = A.shiftLeft, A.shiftRight = function(w) {
|
|
13912
|
+
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);
|
|
13913
|
+
}, A.shr = A.shiftRight, A.shiftRightUnsigned = function(w) {
|
|
13914
|
+
if (c(w) && (w = w.toInt()), (w &= 63) == 0) return this;
|
|
13915
13915
|
var x = this.high;
|
|
13916
|
-
return
|
|
13916
|
+
return w < 32 ? _(this.low >>> w | x << 32 - w, x >>> w, this.unsigned) : _(w === 32 ? x : x >>> w - 32, 0, this.unsigned);
|
|
13917
13917
|
}, A.shru = A.shiftRightUnsigned, A.shr_u = A.shiftRightUnsigned, A.toSigned = function() {
|
|
13918
13918
|
return this.unsigned ? _(this.low, this.high, !1) : this;
|
|
13919
13919
|
}, A.toUnsigned = function() {
|
|
13920
13920
|
return this.unsigned ? this : _(this.low, this.high, !0);
|
|
13921
|
-
}, A.toBytes = function(
|
|
13922
|
-
return
|
|
13921
|
+
}, A.toBytes = function(w) {
|
|
13922
|
+
return w ? this.toBytesLE() : this.toBytesBE();
|
|
13923
13923
|
}, A.toBytesLE = function() {
|
|
13924
|
-
var
|
|
13925
|
-
return [255 & x, x >>> 8 & 255, x >>> 16 & 255, x >>> 24, 255 &
|
|
13924
|
+
var w = this.high, x = this.low;
|
|
13925
|
+
return [255 & x, x >>> 8 & 255, x >>> 16 & 255, x >>> 24, 255 & w, w >>> 8 & 255, w >>> 16 & 255, w >>> 24];
|
|
13926
13926
|
}, 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(
|
|
13927
|
+
var w = this.high, x = this.low;
|
|
13928
|
+
return [w >>> 24, w >>> 16 & 255, w >>> 8 & 255, 255 & w, x >>> 24, x >>> 16 & 255, x >>> 8 & 255, 255 & x];
|
|
13929
|
+
}, i.fromBytes = function(w, x, N) {
|
|
13930
|
+
return N ? i.fromBytesLE(w, x) : i.fromBytesBE(w, x);
|
|
13931
|
+
}, i.fromBytesLE = function(w, x) {
|
|
13932
|
+
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);
|
|
13933
|
+
}, i.fromBytesBE = function(w, x) {
|
|
13934
|
+
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
13935
|
};
|
|
13936
13936
|
}, 1446: (s, n, i) => {
|
|
13937
13937
|
var c, l, f, u = i(2100), d = u.Reader, _ = u.Writer, p = u.util, a = u.roots.default || (u.roots.default = {});
|
|
@@ -16266,12 +16266,12 @@ function requireOrtWeb_min() {
|
|
|
16266
16266
|
}
|
|
16267
16267
|
getPackedSamplerAtOutputCoords(a, t, e, r) {
|
|
16268
16268
|
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
|
|
16269
|
+
let E;
|
|
16270
16270
|
const A = (0, d.getGlChannels)();
|
|
16271
|
-
|
|
16271
|
+
E = y === 0 ? "" : m < 2 && S.length >= 1 ? "coords = 0;" : S.map(((P) => `coords.${A[P + v]} = 0;`)).join(`
|
|
16272
16272
|
`);
|
|
16273
|
-
let
|
|
16274
|
-
|
|
16273
|
+
let w = "";
|
|
16274
|
+
w = m < 2 && y > 0 ? "coords" : o.map(((P, L) => `coords.${A[L + v]}`)).join(", ");
|
|
16275
16275
|
let x = "return outputValue;";
|
|
16276
16276
|
const N = c.ShapeUtil.size(o) === 1, D = c.ShapeUtil.size(h) === 1;
|
|
16277
16277
|
if (y !== 1 || N || D) {
|
|
@@ -16295,8 +16295,8 @@ function requireOrtWeb_min() {
|
|
|
16295
16295
|
coords.${A[m - 1]} = coords.${A[m - 2]};
|
|
16296
16296
|
coords.${A[m - 2]} = lastDim;
|
|
16297
16297
|
|
|
16298
|
-
${
|
|
16299
|
-
vec4 outputValue = ${g}(${
|
|
16298
|
+
${E}
|
|
16299
|
+
vec4 outputValue = ${g}(${w});
|
|
16300
16300
|
${x}
|
|
16301
16301
|
}
|
|
16302
16302
|
`;
|
|
@@ -16312,13 +16312,13 @@ function requireOrtWeb_min() {
|
|
|
16312
16312
|
`;
|
|
16313
16313
|
return new l.GlslLibRoutine(D, ["coordinates.sampleTexture"]);
|
|
16314
16314
|
}
|
|
16315
|
-
const T = (0, d.getCoordsDataType)(g), v = c.BroadcastUtil.getBroadcastDims(y, m),
|
|
16315
|
+
const T = (0, d.getCoordsDataType)(g), v = c.BroadcastUtil.getBroadcastDims(y, m), E = g - b;
|
|
16316
16316
|
let A;
|
|
16317
|
-
const
|
|
16318
|
-
A = b === 0 ? "" : g < 2 && v.length >= 1 ? "coords = 0;" : v.map(((D) => `coords.${
|
|
16317
|
+
const w = (0, d.getGlChannels)();
|
|
16318
|
+
A = b === 0 ? "" : g < 2 && v.length >= 1 ? "coords = 0;" : v.map(((D) => `coords.${w[D + E]} = 0;`)).join(`
|
|
16319
16319
|
`);
|
|
16320
16320
|
let x = "";
|
|
16321
|
-
x = g < 2 && b > 0 ? "coords" : t.unpackedShape.map(((D, M) => `coords.${
|
|
16321
|
+
x = g < 2 && b > 0 ? "coords" : t.unpackedShape.map(((D, M) => `coords.${w[M + E]}`)).join(", ");
|
|
16322
16322
|
const N = `
|
|
16323
16323
|
float ${a}() {
|
|
16324
16324
|
${T} coords = getOutputCoords();
|
|
@@ -16397,9 +16397,9 @@ function requireOrtWeb_min() {
|
|
|
16397
16397
|
getPackedSampler3D(a, t, e) {
|
|
16398
16398
|
const r = e.unpackedShape, o = [e.width, e.height], h = [o[0], o[1]], b = (0, f.getGlsl)(this.context.glContext.version);
|
|
16399
16399
|
if (r[0] === 1) {
|
|
16400
|
-
const T = r.slice(1), v = [1, 2],
|
|
16401
|
-
|
|
16402
|
-
const x = this.getPackedSamplerFromInput(a, t,
|
|
16400
|
+
const T = r.slice(1), v = [1, 2], E = (0, d.squeezeInputShape)(r, T), A = ["b", "row", "col"], w = JSON.parse(JSON.stringify(e));
|
|
16401
|
+
w.unpackedShape = E;
|
|
16402
|
+
const x = this.getPackedSamplerFromInput(a, t, w), N = `${x.routineBody}
|
|
16403
16403
|
vec4 ${a}(int b, int row, int col) {
|
|
16404
16404
|
return ${a}(${(0, d.getSqueezedParams)(A, v)});
|
|
16405
16405
|
} `;
|
|
@@ -16413,10 +16413,10 @@ function requireOrtWeb_min() {
|
|
|
16413
16413
|
}
|
|
16414
16414
|
getPackedSamplerND(a, t, e) {
|
|
16415
16415
|
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
|
|
16416
|
+
let T = S * Math.ceil(r[o - 2] / 2), v = "int b, int row, int col", E = `b * ${T} + (row / 2) * ${S} + (col / 2)`;
|
|
16417
|
+
for (let w = 2; w < o - 1; w++) v = `int b${w}, ` + v, T *= r[o - w - 1], E = `b${w} * ${T} + ` + E;
|
|
16418
16418
|
const A = `vec4 ${a}(${v}) {
|
|
16419
|
-
int index = ${
|
|
16419
|
+
int index = ${E};
|
|
16420
16420
|
int texR = index / ${m};
|
|
16421
16421
|
int texC = index - texR * ${m};
|
|
16422
16422
|
vec2 uv = (vec2(texC, texR) + halfCR) / vec2(${m}, ${y});
|
|
@@ -16494,10 +16494,10 @@ function requireOrtWeb_min() {
|
|
|
16494
16494
|
if (g.length < r.length) {
|
|
16495
16495
|
const T = (0, d.squeezeInputShape)(r, g), v = JSON.parse(JSON.stringify(e));
|
|
16496
16496
|
v.unpackedShape = T;
|
|
16497
|
-
const
|
|
16497
|
+
const E = ["col", "row"], A = `
|
|
16498
16498
|
${this.getUnpackedSamplerFromInput(a, t, v).routineBody}
|
|
16499
16499
|
float ${a}(int row, int col) {
|
|
16500
|
-
return ${a}(${(0, d.getSqueezedParams)(
|
|
16500
|
+
return ${a}(${(0, d.getSqueezedParams)(E, b)});
|
|
16501
16501
|
}
|
|
16502
16502
|
`;
|
|
16503
16503
|
return new l.GlslLibRoutine(A, ["coordinates.sampleTexture"]);
|
|
@@ -16539,13 +16539,13 @@ function requireOrtWeb_min() {
|
|
|
16539
16539
|
if (y.length < r.length) {
|
|
16540
16540
|
const S = (0, d.squeezeInputShape)(r, y), T = ["batch", "col", "row"], v = JSON.parse(JSON.stringify(e));
|
|
16541
16541
|
v.unpackedShape = S;
|
|
16542
|
-
const
|
|
16543
|
-
${
|
|
16542
|
+
const E = this.getUnpackedSamplerFromInput(a, t, v), A = g.reverse(), w = `
|
|
16543
|
+
${E.routineBody}
|
|
16544
16544
|
float ${a}(int batch, int row, int col) {
|
|
16545
16545
|
return ${a}(${(0, d.getSqueezedParams)(T, A)});
|
|
16546
16546
|
}
|
|
16547
16547
|
`;
|
|
16548
|
-
return new l.GlslLibRoutine(
|
|
16548
|
+
return new l.GlslLibRoutine(w, E.dependencies);
|
|
16549
16549
|
}
|
|
16550
16550
|
const m = `
|
|
16551
16551
|
float ${a}(int depth, int row, int col) {
|
|
@@ -16571,10 +16571,10 @@ function requireOrtWeb_min() {
|
|
|
16571
16571
|
getUnpackedSampler5D(a, t, e) {
|
|
16572
16572
|
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
16573
|
if (y.length < r.length) {
|
|
16574
|
-
const T = (0, d.squeezeInputShape)(r, y), v = ["row", "col", "depth", "depth2", "depth3"],
|
|
16575
|
-
|
|
16574
|
+
const T = (0, d.squeezeInputShape)(r, y), v = ["row", "col", "depth", "depth2", "depth3"], E = JSON.parse(JSON.stringify(e));
|
|
16575
|
+
E.unpackedShape = T;
|
|
16576
16576
|
const A = `
|
|
16577
|
-
${this.getUnpackedSamplerFromInput(a, t,
|
|
16577
|
+
${this.getUnpackedSamplerFromInput(a, t, E).routineBody}
|
|
16578
16578
|
float ${a}(int row, int col, int depth, int depth2, int depth3) {
|
|
16579
16579
|
return ${a}(${(0, d.getSqueezedParams)(v, m)});
|
|
16580
16580
|
}
|
|
@@ -16594,16 +16594,16 @@ function requireOrtWeb_min() {
|
|
|
16594
16594
|
getUnpackedSampler6D(a, t, e) {
|
|
16595
16595
|
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
16596
|
if (m.length < r.length) {
|
|
16597
|
-
const v = (0, d.squeezeInputShape)(r, m),
|
|
16597
|
+
const v = (0, d.squeezeInputShape)(r, m), E = ["row", "col", "depth", "depth2", "depth3", "depth4"], A = JSON.parse(JSON.stringify(e));
|
|
16598
16598
|
A.unpackedShape = v;
|
|
16599
|
-
const
|
|
16599
|
+
const w = `
|
|
16600
16600
|
${this.getUnpackedSamplerFromInput(a, t, A).routineBody}
|
|
16601
16601
|
float ${a}(int row, int col, int depth,
|
|
16602
16602
|
int depth2, int depth3, int depth4) {
|
|
16603
|
-
return ${a}(${(0, d.getSqueezedParams)(
|
|
16603
|
+
return ${a}(${(0, d.getSqueezedParams)(E, S)});
|
|
16604
16604
|
}
|
|
16605
16605
|
`;
|
|
16606
|
-
return new l.GlslLibRoutine(
|
|
16606
|
+
return new l.GlslLibRoutine(w, ["coordinates.sampleTexture", "coordinates.uvFromFlat"]);
|
|
16607
16607
|
}
|
|
16608
16608
|
const T = `
|
|
16609
16609
|
float ${a}(int row, int col, int depth,
|
|
@@ -17193,8 +17193,8 @@ function requireOrtWeb_min() {
|
|
|
17193
17193
|
for (let S = 0; S < e.inputNames.length; ++S) o[S] = this.getOrCreateTextureData(r[S], e.inputTypes[S]);
|
|
17194
17194
|
const h = ((S, T) => {
|
|
17195
17195
|
const v = T.map(((A) => `${A.unpackedShape.join(",")};${A.width}x${A.height}`)).join("_");
|
|
17196
|
-
let
|
|
17197
|
-
return S.cacheHint && (
|
|
17196
|
+
let E = S.name;
|
|
17197
|
+
return S.cacheHint && (E += "[" + S.cacheHint + "]"), E += ":" + v, E;
|
|
17198
17198
|
})(e, o);
|
|
17199
17199
|
let b = this.session.programManager.getArtifact(h);
|
|
17200
17200
|
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 +17219,11 @@ function requireOrtWeb_min() {
|
|
|
17219
17219
|
const m = [y[0], Math.ceil(y[1] * y[2] * y[3] / 4)], S = (0, a.createTextureLayoutFromTextureType)(this.session.layoutStrategy, m, r);
|
|
17220
17220
|
let T = e.numberData;
|
|
17221
17221
|
if (y[1] * y[2] * y[3] % 4 != 0) {
|
|
17222
|
-
const v = y[0],
|
|
17222
|
+
const v = y[0], E = y[1] * y[2] * y[3], A = Math.ceil(E * 1 / 4) * 4;
|
|
17223
17223
|
T = new Float32Array(v * A);
|
|
17224
|
-
for (let
|
|
17225
|
-
const x =
|
|
17226
|
-
T.set(e.numberData.subarray(x, x +
|
|
17224
|
+
for (let w = 0; w < v; ++w) {
|
|
17225
|
+
const x = w * E, N = w * A + w % 1 * E;
|
|
17226
|
+
T.set(e.numberData.subarray(x, x + E), N);
|
|
17227
17227
|
}
|
|
17228
17228
|
}
|
|
17229
17229
|
return this.createTextureData(S, e.type, T, e, 1);
|
|
@@ -17310,8 +17310,8 @@ function requireOrtWeb_min() {
|
|
|
17310
17310
|
return l(q, Z), q;
|
|
17311
17311
|
};
|
|
17312
17312
|
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",
|
|
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), 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);
|
|
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", 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
17315
|
}, 2898: (s, n, i) => {
|
|
17316
17316
|
Object.defineProperty(n, "__esModule", { value: !0 }), n.parseBatchNormalizationAttributes = n.batchNormalization = void 0;
|
|
17317
17317
|
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 +17501,11 @@ function requireOrtWeb_min() {
|
|
|
17501
17501
|
`, name: T, type: l.FunctionType.ValueBased };
|
|
17502
17502
|
}
|
|
17503
17503
|
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,
|
|
17504
|
+
const m = (T, v, E, A = v[0].type, w) => {
|
|
17505
17505
|
const x = T.session.pack ? u.TextureType.packed : u.TextureType.unpacked;
|
|
17506
|
-
return { name:
|
|
17507
|
-
}, S = (T, v,
|
|
17508
|
-
const
|
|
17506
|
+
return { name: E.name, inputNames: ["A", "B"], inputTypes: [x, x], cacheHint: w, get: () => S(T, v, E, A) };
|
|
17507
|
+
}, S = (T, v, E, A = v[0].type) => {
|
|
17508
|
+
const w = T.session.pack ? u.TextureType.packed : u.TextureType.unpacked, x = !c.ShapeUtil.areEqual(v[0].dims, v[1].dims);
|
|
17509
17509
|
let N = v[0].dims;
|
|
17510
17510
|
const D = T.session.pack;
|
|
17511
17511
|
if (x) {
|
|
@@ -17513,33 +17513,33 @@ function requireOrtWeb_min() {
|
|
|
17513
17513
|
if (!L) throw new Error("Can't perform binary op on the given tensors");
|
|
17514
17514
|
N = L;
|
|
17515
17515
|
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
|
-
${
|
|
17516
|
+
${E.body}
|
|
17517
17517
|
void main() {
|
|
17518
17518
|
vec4 a = getAAtOutCoords();
|
|
17519
17519
|
vec4 b = getBAtOutCoords();
|
|
17520
|
-
vec4 result = ${
|
|
17520
|
+
vec4 result = ${E.name}(a, b);
|
|
17521
17521
|
${k.output} = result;
|
|
17522
17522
|
}` : `
|
|
17523
|
-
${
|
|
17523
|
+
${E.body}
|
|
17524
17524
|
float process(int indices[${B}]) {
|
|
17525
17525
|
int aindices[${V}];
|
|
17526
17526
|
int bindices[${X}];
|
|
17527
17527
|
${Z}
|
|
17528
17528
|
${q}
|
|
17529
|
-
return ${
|
|
17529
|
+
return ${E.name}(_A(aindices), _B(bindices));
|
|
17530
17530
|
}`;
|
|
17531
|
-
return { name:
|
|
17531
|
+
return { name: E.name, inputNames: ["A", "B"], inputTypes: [w, w], output: { dims: N, type: A, textureType: w }, shaderSource: I, hasMain: D };
|
|
17532
17532
|
}
|
|
17533
17533
|
const M = (0, f.getGlsl)(T.session.backend.glContext.version), P = `
|
|
17534
|
-
${
|
|
17534
|
+
${E.body}
|
|
17535
17535
|
void main() {
|
|
17536
17536
|
vec4 v1 = ${M.texture2D}(A, TexCoords);
|
|
17537
17537
|
vec4 v2 = ${M.texture2D}(B, TexCoords);
|
|
17538
|
-
vec4 result = ${
|
|
17538
|
+
vec4 result = ${E.name}(v1, v2);
|
|
17539
17539
|
${M.output} = result;
|
|
17540
17540
|
}
|
|
17541
17541
|
`;
|
|
17542
|
-
return { name:
|
|
17542
|
+
return { name: E.name, inputNames: ["A", "B"], inputTypes: [w, w], output: { dims: v[0].dims, type: A, textureType: w }, shaderSource: P, hasMain: !0 };
|
|
17543
17543
|
};
|
|
17544
17544
|
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
17545
|
}, 4196: (s, n, i) => {
|
|
@@ -17566,10 +17566,10 @@ function requireOrtWeb_min() {
|
|
|
17566
17566
|
for (let k = 0; k < y.length; k++) if (k === g) m[g] += q[k];
|
|
17567
17567
|
else if (y[k] !== q[k]) throw new Error("non concat dimensions must match");
|
|
17568
17568
|
}
|
|
17569
|
-
const S = m.length, T = (0, u.getChannels)("coords", S), v = (0, f.getCoordsDataType)(S),
|
|
17569
|
+
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
17570
|
x[0] = A[0][g];
|
|
17571
17571
|
for (let Z = 1; Z < x.length; Z++) x[Z] = x[Z - 1] + A[Z][g];
|
|
17572
|
-
const N =
|
|
17572
|
+
const N = w[g], D = w.slice(-2), M = w.join();
|
|
17573
17573
|
let P = `if (${N} < ${x[0]}) {
|
|
17574
17574
|
return getChannel(
|
|
17575
17575
|
getX0(${M}), vec2(${D.join()}));
|
|
@@ -17579,26 +17579,26 @@ function requireOrtWeb_min() {
|
|
|
17579
17579
|
P += `
|
|
17580
17580
|
if (${N} < ${x[Z]} && ${N} >= ${x[Z - 1]}) {
|
|
17581
17581
|
return getChannel(
|
|
17582
|
-
getX${Z}(${d(
|
|
17582
|
+
getX${Z}(${d(w, N, q)}),
|
|
17583
17583
|
vec2(${d(D, N, q)}));
|
|
17584
17584
|
}`;
|
|
17585
17585
|
}
|
|
17586
17586
|
const L = x.length, B = x[x.length - 1];
|
|
17587
17587
|
P += `
|
|
17588
17588
|
return getChannel(
|
|
17589
|
-
getX${L}(${d(
|
|
17589
|
+
getX${L}(${d(w, N, B)}),
|
|
17590
17590
|
vec2(${d(D, N, B)}));`;
|
|
17591
17591
|
const V = (0, c.getGlsl)(o.session.backend.glContext.version), X = `
|
|
17592
|
-
${
|
|
17593
|
-
float getValue(${
|
|
17592
|
+
${E}
|
|
17593
|
+
float getValue(${w.map(((Z) => "int " + Z))}) {
|
|
17594
17594
|
${P}
|
|
17595
17595
|
}
|
|
17596
17596
|
|
|
17597
17597
|
void main() {
|
|
17598
17598
|
${v} coords = getOutputCoords();
|
|
17599
|
-
int lastDim = coords.${
|
|
17600
|
-
coords.${
|
|
17601
|
-
coords.${
|
|
17599
|
+
int lastDim = coords.${w[S - 1]};
|
|
17600
|
+
coords.${w[S - 1]} = coords.${w[S - 2]};
|
|
17601
|
+
coords.${w[S - 2]} = lastDim;
|
|
17602
17602
|
|
|
17603
17603
|
vec4 result = vec4(getValue(${T}), 0., 0., 0.);
|
|
17604
17604
|
|
|
@@ -17638,20 +17638,20 @@ function requireOrtWeb_min() {
|
|
|
17638
17638
|
const v = S[0].dims.slice();
|
|
17639
17639
|
if (T >= v.length || T < -1 * v.length) throw new Error("axis specified for concat doesn't match input dimensionality");
|
|
17640
17640
|
T < 0 && (T = v.length + T);
|
|
17641
|
-
const
|
|
17641
|
+
const E = v.slice(0);
|
|
17642
17642
|
for (let M = 1; M < S.length; M++) {
|
|
17643
17643
|
const P = S[M].dims.slice();
|
|
17644
|
-
for (let L = 0; L < v.length; L++) if (L === T)
|
|
17644
|
+
for (let L = 0; L < v.length; L++) if (L === T) E[T] += P[L];
|
|
17645
17645
|
else if (v[L] !== P[L]) throw new Error("non concat dimensions must match");
|
|
17646
17646
|
}
|
|
17647
|
-
const A =
|
|
17647
|
+
const A = E.length, w = new Array(S.length);
|
|
17648
17648
|
let x = 0;
|
|
17649
|
-
for (let M = 0; M <
|
|
17649
|
+
for (let M = 0; M < w.length; ++M) x += S[M].dims[T], w[M] = x;
|
|
17650
17650
|
let N = "";
|
|
17651
|
-
N = S.length < 5 ? d(
|
|
17651
|
+
N = S.length < 5 ? d(w) : _(w);
|
|
17652
17652
|
const D = `
|
|
17653
17653
|
${p(S.length, A)}
|
|
17654
|
-
${a(
|
|
17654
|
+
${a(w)}
|
|
17655
17655
|
${N}
|
|
17656
17656
|
float process(int indices[${A}]) {
|
|
17657
17657
|
int textureIndex = getTextureWhereDataResides (indices[${T}]);
|
|
@@ -17662,7 +17662,7 @@ function requireOrtWeb_min() {
|
|
|
17662
17662
|
|
|
17663
17663
|
return fetchDataFromCorrectTexture(textureIndex, indices);
|
|
17664
17664
|
}`;
|
|
17665
|
-
return Object.assign(Object.assign({}, m), { output: { dims:
|
|
17665
|
+
return Object.assign(Object.assign({}, m), { output: { dims: E, type: S[0].type, textureType: l.TextureType.unpacked }, shaderSource: D });
|
|
17666
17666
|
})(0, h, r, o.axis) });
|
|
17667
17667
|
}, d = (e) => `int getTextureWhereDataResides(int index) {
|
|
17668
17668
|
${e.map(((r, o) => `if(index<${r}) {return ${o};}
|
|
@@ -17697,7 +17697,7 @@ function requireOrtWeb_min() {
|
|
|
17697
17697
|
return Object.assign(Object.assign({}, t), { get: () => ((o, h, b, g) => {
|
|
17698
17698
|
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
17699
|
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),
|
|
17700
|
+
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
17701
|
const ivec2 strides = ivec2(${g.strides[0]}, ${g.strides[1]});
|
|
17702
17702
|
const ivec2 pads = ivec2(${g.pads[0]}, ${g.pads[1]});
|
|
17703
17703
|
${A}
|
|
@@ -17731,8 +17731,8 @@ function requireOrtWeb_min() {
|
|
|
17731
17731
|
}
|
|
17732
17732
|
}
|
|
17733
17733
|
${y}
|
|
17734
|
-
${
|
|
17735
|
-
${
|
|
17734
|
+
${w}
|
|
17735
|
+
${E.output} = vec4(value, .0, .0, .0);
|
|
17736
17736
|
}
|
|
17737
17737
|
`;
|
|
17738
17738
|
return Object.assign(Object.assign({}, b), { output: { dims: v, type: h[0].type, textureType: f.TextureType.unpacked }, shaderSource: x, hasMain: !0 });
|
|
@@ -17761,10 +17761,10 @@ function requireOrtWeb_min() {
|
|
|
17761
17761
|
}, a = (r, o, h) => r.run(((b, g, y) => {
|
|
17762
17762
|
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
17763
|
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(${
|
|
17764
|
+
return Object.assign(Object.assign({}, m), { get: () => ((v, E, A, w) => {
|
|
17765
|
+
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 = `
|
|
17766
|
+
const ivec2 strides = ivec2(${w.strides[0]}, ${w.strides[1]});
|
|
17767
|
+
const ivec2 pads = ivec2(${w.pads[0]}, ${w.pads[1]});
|
|
17768
17768
|
${V}
|
|
17769
17769
|
void main() {
|
|
17770
17770
|
ivec4 coords = getOutputCoords();
|
|
@@ -17781,7 +17781,7 @@ function requireOrtWeb_min() {
|
|
|
17781
17781
|
int input_channel = group_id * ${P} + inChannelOffset;
|
|
17782
17782
|
for (int wWOff = 0; wWOff < ${D[2]}; wWOff++) {
|
|
17783
17783
|
for (int wHOff = 0; wHOff < ${D[3]}; wHOff++) {
|
|
17784
|
-
ivec2 wOff = ivec2(wWOff * ${
|
|
17784
|
+
ivec2 wOff = ivec2(wWOff * ${w.dilations[0]}, wHOff * ${w.dilations[1]});
|
|
17785
17785
|
ivec2 wLoc = loc - wOff;
|
|
17786
17786
|
ivec2 wLocIn = wLoc / strides;
|
|
17787
17787
|
if (
|
|
@@ -17800,25 +17800,25 @@ function requireOrtWeb_min() {
|
|
|
17800
17800
|
${B.output} = vec4(value, .0, .0, .0);
|
|
17801
17801
|
}
|
|
17802
17802
|
`;
|
|
17803
|
-
return Object.assign(Object.assign({}, A), { output: { dims: L, type:
|
|
17803
|
+
return Object.assign(Object.assign({}, A), { output: { dims: L, type: E[0].type, textureType: f.TextureType.unpacked }, shaderSource: Z, hasMain: !0 });
|
|
17804
17804
|
})(b, g, m, y) });
|
|
17805
17805
|
})(r, o, h), o), t = (r, o) => {
|
|
17806
17806
|
const h = r.kernelShape.slice();
|
|
17807
17807
|
if (r.kernelShape.length === 0) for (let m = 2; m < o[1].dims.length; ++m) h.push(o[1].dims[m]);
|
|
17808
17808
|
const b = r.pads.slice(), g = r.outputShape.slice();
|
|
17809
|
-
((m, S, T, v,
|
|
17809
|
+
((m, S, T, v, E, A, w, x) => {
|
|
17810
17810
|
const N = m.length - 2, D = x.length === 0;
|
|
17811
17811
|
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,
|
|
17812
|
+
const P = D ? m[M + 2] * A[M] : x[M], L = d(m[M + 2], A[M], E[M], S[M], T[M], P);
|
|
17813
|
+
_(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
17814
|
}
|
|
17815
17815
|
})(o[0].dims, h, r.dilations, r.autoPad, b, r.strides, r.outputPadding, g);
|
|
17816
17816
|
const y = Object.assign({}, r);
|
|
17817
17817
|
return Object.assign(y, { kernelShape: h, pads: b, outputShape: g, cacheKey: r.cacheKey }), y;
|
|
17818
17818
|
};
|
|
17819
17819
|
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:
|
|
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]), E = o.getInts("strides", [1, 1]);
|
|
17821
|
+
return (0, c.createAttributeWithCacheKey)(Object.assign({ autoPad: b, dilations: g, group: y, kernelShape: m, outputPadding: S, outputShape: T, pads: v, strides: E }, h));
|
|
17822
17822
|
};
|
|
17823
17823
|
const e = (r, o) => {
|
|
17824
17824
|
if (!r || r.length !== 2 && r.length !== 3) throw new Error("Conv requires 2 or 3 inputs");
|
|
@@ -17840,18 +17840,18 @@ function requireOrtWeb_min() {
|
|
|
17840
17840
|
Object.defineProperty(n, "__esModule", { value: !0 }), n.parseConvAttributes = n.conv = n.calculateOutputShape = void 0;
|
|
17841
17841
|
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
17842
|
n.calculateOutputShape = (b, g, y, m, S) => {
|
|
17843
|
-
const T = b[0], v = b.slice(2),
|
|
17843
|
+
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
17844
|
return [T, A].concat(...x);
|
|
17845
17845
|
}, n.conv = (b, g, y) => (h(g, y), t(b, g, y));
|
|
17846
17846
|
const t = (b, g, y) => {
|
|
17847
17847
|
const m = o(y, g), S = b.session.pack, T = m.kernelShape[0] === 1 && m.kernelShape[1] === 1;
|
|
17848
17848
|
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
17849
|
}, 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(
|
|
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]]), 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);
|
|
17851
|
+
return b.reshapeUnpacked(w, T);
|
|
17852
17852
|
}, 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),
|
|
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]]), E = g.length === 3 ? [v, g[1], g[2]] : [v, g[1]];
|
|
17854
|
+
return b.run((0, d.createDotProductProgramInfoLoader)(b, g, T, y), E);
|
|
17855
17855
|
}, o = (b, g) => {
|
|
17856
17856
|
const y = b.kernelShape.slice();
|
|
17857
17857
|
if (b.kernelShape.length === 0) for (let T = 2; T < g[1].dims.length; ++T) y.push(g[1].dims[T]);
|
|
@@ -17861,8 +17861,8 @@ function requireOrtWeb_min() {
|
|
|
17861
17861
|
return Object.assign(S, { kernelShape: y, pads: m, cacheKey: b.cacheKey }), S;
|
|
17862
17862
|
};
|
|
17863
17863
|
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:
|
|
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", []), E = g.getInts("pads", [0, 0, 0, 0]), A = g.getInts("strides", [1, 1]);
|
|
17865
|
+
return (0, c.createAttributeWithCacheKey)(Object.assign({ autoPad: m, dilations: S, group: T, kernelShape: v, pads: E, strides: A }, y));
|
|
17866
17866
|
};
|
|
17867
17867
|
const h = (b, g) => {
|
|
17868
17868
|
if (!b || b.length !== 2 && b.length !== 3) throw new Error("Conv requires 2 or 3 inputs");
|
|
@@ -17901,7 +17901,7 @@ function requireOrtWeb_min() {
|
|
|
17901
17901
|
n.createDotProductProgramInfoLoader = (_, p, a, t) => {
|
|
17902
17902
|
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
17903
|
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,
|
|
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, 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
17905
|
${P}
|
|
17906
17906
|
float process(int indices[${N}]) {
|
|
17907
17907
|
int b[1];
|
|
@@ -17914,8 +17914,8 @@ float process(int indices[${N}]) {
|
|
|
17914
17914
|
int kernelOffset = indices[1] * ${S[1]};
|
|
17915
17915
|
float value = ${D};
|
|
17916
17916
|
for (int i = 0; i < ${M}; ++i) {
|
|
17917
|
-
vec2 im2colCoords = offsetToCoords(im2colOffset, ${
|
|
17918
|
-
vec2 kernelCoords = offsetToCoords(kernelOffset, ${v}, ${
|
|
17917
|
+
vec2 im2colCoords = offsetToCoords(im2colOffset, ${w}, ${x});
|
|
17918
|
+
vec2 kernelCoords = offsetToCoords(kernelOffset, ${v}, ${E});
|
|
17919
17919
|
value += dot(${B.texture2D}(Im2Col, im2colCoords), ${B.texture2D}(K, kernelCoords));
|
|
17920
17920
|
++im2colOffset;
|
|
17921
17921
|
++kernelOffset;
|
|
@@ -17979,7 +17979,7 @@ float process(int indices[${N}]) {
|
|
|
17979
17979
|
const y = b[0].dims.slice(), m = b[1].dims.slice(), S = new Array(y.length + m.length - 1);
|
|
17980
17980
|
g = f.ShapeUtil.normalizeAxis(g, y.length);
|
|
17981
17981
|
const T = [];
|
|
17982
|
-
for (let
|
|
17982
|
+
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
17983
|
const v = `
|
|
17984
17984
|
float process(int outputIdx[${S.length || 1}]) {
|
|
17985
17985
|
int inputIdx[${y.length}];
|
|
@@ -18055,7 +18055,7 @@ float process(int indices[${N}]) {
|
|
|
18055
18055
|
const t = (e = a.cacheKey, { name: "Im2Col (packed)", inputNames: ["A"], inputTypes: [l.TextureType.packed], cacheHint: e });
|
|
18056
18056
|
var e;
|
|
18057
18057
|
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]],
|
|
18058
|
+
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
18059
|
let x = "";
|
|
18060
18060
|
for (let D = 0; D <= 1; D++) for (let M = 0; M <= 1; M++) x += `
|
|
18061
18061
|
blockIndex = rc.x + ${M};
|
|
@@ -18064,16 +18064,16 @@ float process(int indices[${N}]) {
|
|
|
18064
18064
|
if(blockIndex < ${v[1]} && pos < ${v[0]}) {
|
|
18065
18065
|
offsetY = int(blockIndex / (${g[T - 1]})) * ${y.strides[0]} -
|
|
18066
18066
|
${y.pads[0]};
|
|
18067
|
-
d0 = offsetY + ${y.dilations[0]} * (imod(pos, ${
|
|
18067
|
+
d0 = offsetY + ${y.dilations[0]} * (imod(pos, ${E}) / ${S[2]});
|
|
18068
18068
|
|
|
18069
18069
|
if(d0 < ${m[2]} && d0 >= 0) {
|
|
18070
18070
|
offsetX = imod(blockIndex, ${g[T - 1]}) * ${y.strides[1]} -
|
|
18071
18071
|
${y.pads[1]};
|
|
18072
|
-
d1 = offsetX + ${y.dilations[1]} * imod(imod(pos, ${
|
|
18072
|
+
d1 = offsetX + ${y.dilations[1]} * imod(imod(pos, ${E}), ${S[2]});
|
|
18073
18073
|
|
|
18074
18074
|
if(d1 < ${m[3]} && d1 >= 0) {
|
|
18075
18075
|
|
|
18076
|
-
ch = int(float(pos)/ ${
|
|
18076
|
+
ch = int(float(pos)/ ${E}.);
|
|
18077
18077
|
innerDims = vec2(d0, d1);
|
|
18078
18078
|
result[${2 * D + M}] = getChannel(
|
|
18079
18079
|
getA(0, ch, int(innerDims.x),
|
|
@@ -18092,7 +18092,7 @@ float process(int indices[${N}]) {
|
|
|
18092
18092
|
int blockIndex, pos, offsetY, d0, offsetX, d1, ch;
|
|
18093
18093
|
vec2 innerDims;
|
|
18094
18094
|
${x}
|
|
18095
|
-
${
|
|
18095
|
+
${w.output} = result;
|
|
18096
18096
|
}
|
|
18097
18097
|
`;
|
|
18098
18098
|
return Object.assign(Object.assign({}, o), { output: { dims: v, type: h.type, textureType: l.TextureType.packed }, shaderSource: N, hasMain: !0 });
|
|
@@ -18223,10 +18223,10 @@ float process(int indices[${N}]) {
|
|
|
18223
18223
|
})(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
18224
|
const o = Object.assign(Object.assign({}, d), { cacheHint: `${e}` });
|
|
18225
18225
|
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), [
|
|
18226
|
+
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
18227
|
vec4 get_MeanAndVariance(int[2] mv) {
|
|
18228
18228
|
int offset = indicesToOffset_MeanAndVariance(mv);
|
|
18229
|
-
vec2 coords = offsetToCoords(offset, ${
|
|
18229
|
+
vec2 coords = offsetToCoords(offset, ${E}, ${A});
|
|
18230
18230
|
return ${S.texture2D}(MeanAndVariance, coords);
|
|
18231
18231
|
}
|
|
18232
18232
|
|
|
@@ -18245,7 +18245,7 @@ float process(int indices[${N}]) {
|
|
|
18245
18245
|
|
|
18246
18246
|
return scale * (_X(indices) - mean) / sqrt(variance + epsilon) + b;
|
|
18247
18247
|
}`;
|
|
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:
|
|
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: w });
|
|
18249
18249
|
})(a, o, t, e, r) });
|
|
18250
18250
|
}, p = (a) => {
|
|
18251
18251
|
if (!a || a.length !== 3) throw new Error("InstanceNormalization requires 3 inputs.");
|
|
@@ -18262,13 +18262,13 @@ float process(int indices[${N}]) {
|
|
|
18262
18262
|
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
18263
|
var r, o;
|
|
18264
18264
|
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
|
|
18265
|
+
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);
|
|
18266
|
+
if (!E) throw new Error("Can't use matmul on the given tensors");
|
|
18267
|
+
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
18268
|
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 +
|
|
18269
|
+
const rt = he[0].dims, ct = he[1].dims, yt = rt.length, mt = ct.length, ht = Xe.length, Et = ht - yt, Ot = ht - mt;
|
|
18270
|
+
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(", ");
|
|
18271
|
+
const Ht = c.BroadcastUtil.getBroadcastDims(rt, Xe), nn = c.BroadcastUtil.getBroadcastDims(ct, Xe), C = Ht.map(((gt) => `coords.${j[gt + Et]} = 0;`)).join(`
|
|
18272
18272
|
`), U = nn.map(((gt) => `coords.${j[gt + Ot]} = 0;`)).join(`
|
|
18273
18273
|
`), Tt = `int lastDim = coords.${j[ht - 1]};
|
|
18274
18274
|
coords.${j[ht - 1]} = coords.${j[ht - 2]};
|
|
@@ -18289,7 +18289,7 @@ vec4 getBAtOutCoordsMatmul(int i) {
|
|
|
18289
18289
|
vec4 outputValue = getB(${Ce});
|
|
18290
18290
|
return outputValue;
|
|
18291
18291
|
}`;
|
|
18292
|
-
})(P, B, g,
|
|
18292
|
+
})(P, B, g, E)}` : "", k = A ? "getAAtOutCoordsMatmul(i)" : `getA(${(function(F, j) {
|
|
18293
18293
|
let he = "";
|
|
18294
18294
|
for (let Xe = 0; Xe < j - 2; Xe++) he += `rc.${F[Xe]}, `;
|
|
18295
18295
|
return he += `rc.${F[j - 2]}, i*2`, he;
|
|
@@ -18319,7 +18319,7 @@ vec4 getBAtOutCoordsMatmul(int i) {
|
|
|
18319
18319
|
${X}
|
|
18320
18320
|
${M.output} = value;
|
|
18321
18321
|
}`;
|
|
18322
|
-
return Object.assign(Object.assign({}, b), { output: { dims:
|
|
18322
|
+
return Object.assign(Object.assign({}, b), { output: { dims: E, type: g[0].type, textureType: f.TextureType.packed }, shaderSource: O, hasMain: !0 });
|
|
18323
18323
|
})(p, e, a, t) });
|
|
18324
18324
|
};
|
|
18325
18325
|
}, 5623: (s, n, i) => {
|
|
@@ -18331,7 +18331,7 @@ vec4 getBAtOutCoordsMatmul(int i) {
|
|
|
18331
18331
|
return Object.assign(Object.assign({}, r), { get: () => (function(b, g, y) {
|
|
18332
18332
|
const m = g[0].dims, S = g[1].dims, T = c.BroadcastUtil.calcShape(m, S, !0);
|
|
18333
18333
|
if (!T) throw new Error("Can't use matmul on the given tensors");
|
|
18334
|
-
const v = (0, f.getCoordsDataType)(T.length),
|
|
18334
|
+
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
18335
|
${A}
|
|
18336
18336
|
${D}
|
|
18337
18337
|
float process(int indices[${M}]) {
|
|
@@ -18347,7 +18347,7 @@ vec4 getBAtOutCoordsMatmul(int i) {
|
|
|
18347
18347
|
value += _A(a) * _B(b);
|
|
18348
18348
|
}
|
|
18349
18349
|
${N}
|
|
18350
|
-
${
|
|
18350
|
+
${w}
|
|
18351
18351
|
return value;
|
|
18352
18352
|
}`;
|
|
18353
18353
|
return Object.assign(Object.assign({}, b), { output: { dims: T, type: g[0].type, textureType: l.TextureType.unpacked }, shaderSource: B });
|
|
@@ -18363,7 +18363,7 @@ vec4 getBAtOutCoordsMatmul(int i) {
|
|
|
18363
18363
|
function a(t, e, r, o, h) {
|
|
18364
18364
|
let b = "";
|
|
18365
18365
|
const g = r.length, y = o.length, m = y - g;
|
|
18366
|
-
b = y < 2 && g > 0 ? "coords" : r.map(((v,
|
|
18366
|
+
b = y < 2 && g > 0 ? "coords" : r.map(((v, E) => `coords.${e[E + m]}`)).join(", ");
|
|
18367
18367
|
const S = c.BroadcastUtil.getBroadcastDims(r, o).map(((v) => `coords.${e[v + m]} = 0;`)).join(`
|
|
18368
18368
|
`);
|
|
18369
18369
|
let T = "vec4(outputValue.xx, outputValue.yy)";
|
|
@@ -18394,15 +18394,15 @@ float getBiasForMatmul() {
|
|
|
18394
18394
|
bool cEdge = cp1 >= ${T};
|
|
18395
18395
|
`);
|
|
18396
18396
|
var m, S, T, v;
|
|
18397
|
-
let
|
|
18398
|
-
|
|
18397
|
+
let E;
|
|
18398
|
+
E = o === 0 ? [1, 1] : o === 1 ? [r[0], 1] : [r[h - 1], r[h - 2]];
|
|
18399
18399
|
const A = (function(N, D, M) {
|
|
18400
18400
|
if (N === 0) return "false";
|
|
18401
18401
|
if (N === 1) return `rc > ${D[0]}`;
|
|
18402
18402
|
let P = "";
|
|
18403
18403
|
for (let L = N - 2; L < N; L++) P += `${M[L]} >= ${D[L - N + 2]}`, L < N - 1 && (P += "||");
|
|
18404
18404
|
return P;
|
|
18405
|
-
})(h,
|
|
18405
|
+
})(h, E, g), w = (function(N, D) {
|
|
18406
18406
|
const M = N.length;
|
|
18407
18407
|
if (M === 0) return "getA(), 0, 0, 0";
|
|
18408
18408
|
if (M === 1) return `getA(rc),
|
|
@@ -18423,7 +18423,7 @@ float getBiasForMatmul() {
|
|
|
18423
18423
|
} else {
|
|
18424
18424
|
${y}
|
|
18425
18425
|
|
|
18426
|
-
${e.output} = vec4(${
|
|
18426
|
+
${e.output} = vec4(${w});
|
|
18427
18427
|
}
|
|
18428
18428
|
}
|
|
18429
18429
|
`;
|
|
@@ -18494,16 +18494,16 @@ float getBiasForMatmul() {
|
|
|
18494
18494
|
throw new Error("Invalid mode");
|
|
18495
18495
|
}
|
|
18496
18496
|
}, r = (b, g, y, m, S, T, v) => {
|
|
18497
|
-
const
|
|
18497
|
+
const E = g.length;
|
|
18498
18498
|
let A = "";
|
|
18499
|
-
for (let
|
|
18500
|
-
k = m[${
|
|
18499
|
+
for (let w = E - 1; w >= 0; --w) A += `
|
|
18500
|
+
k = m[${w}] - ${T[w]};
|
|
18501
18501
|
if (k < 0) return constant;
|
|
18502
|
-
if (k >= ${g[
|
|
18503
|
-
offset += k * ${y[
|
|
18502
|
+
if (k >= ${g[w]}) return constant;
|
|
18503
|
+
offset += k * ${y[w]};
|
|
18504
18504
|
`;
|
|
18505
18505
|
return `
|
|
18506
|
-
float padA(int m[${
|
|
18506
|
+
float padA(int m[${E}]) {
|
|
18507
18507
|
const float constant = float(${v});
|
|
18508
18508
|
int offset = 0;
|
|
18509
18509
|
int k = 0;
|
|
@@ -18515,8 +18515,8 @@ float getBiasForMatmul() {
|
|
|
18515
18515
|
`;
|
|
18516
18516
|
}, o = (b, g, y, m, S, T) => {
|
|
18517
18517
|
const v = g.length;
|
|
18518
|
-
let
|
|
18519
|
-
for (let A = v - 1; A >= 0; --A)
|
|
18518
|
+
let E = "";
|
|
18519
|
+
for (let A = v - 1; A >= 0; --A) E += `
|
|
18520
18520
|
k = m[${A}] - ${T[A]};
|
|
18521
18521
|
if (k < 0) { k = -k; }
|
|
18522
18522
|
{
|
|
@@ -18530,7 +18530,7 @@ float getBiasForMatmul() {
|
|
|
18530
18530
|
float padA(int m[${v}]) {
|
|
18531
18531
|
int offset = 0;
|
|
18532
18532
|
int k = 0;
|
|
18533
|
-
${
|
|
18533
|
+
${E}
|
|
18534
18534
|
vec2 coords = offsetToCoords(offset, ${m}, ${S});
|
|
18535
18535
|
float value = getColorAsFloat(${b.texture2D}(A, coords));
|
|
18536
18536
|
return value;
|
|
@@ -18538,8 +18538,8 @@ float getBiasForMatmul() {
|
|
|
18538
18538
|
`;
|
|
18539
18539
|
}, h = (b, g, y, m, S, T) => {
|
|
18540
18540
|
const v = g.length;
|
|
18541
|
-
let
|
|
18542
|
-
for (let A = v - 1; A >= 0; --A)
|
|
18541
|
+
let E = "";
|
|
18542
|
+
for (let A = v - 1; A >= 0; --A) E += `
|
|
18543
18543
|
k = m[${A}] - ${T[A]};
|
|
18544
18544
|
if (k < 0) k = 0;
|
|
18545
18545
|
if (k >= ${g[A]}) k = ${g[A] - 1};
|
|
@@ -18549,7 +18549,7 @@ float getBiasForMatmul() {
|
|
|
18549
18549
|
float padA(int m[${v}]) {
|
|
18550
18550
|
int offset = 0;
|
|
18551
18551
|
int k = 0;
|
|
18552
|
-
${
|
|
18552
|
+
${E}
|
|
18553
18553
|
vec2 coords = offsetToCoords(offset, ${m}, ${S});
|
|
18554
18554
|
float value = getColorAsFloat(${b.texture2D}(A, coords));
|
|
18555
18555
|
return value;
|
|
@@ -18572,10 +18572,10 @@ float getBiasForMatmul() {
|
|
|
18572
18572
|
const [m, S] = _(h, y, g), T = l.ShapeUtil.size(m.kernelShape);
|
|
18573
18573
|
let v = "";
|
|
18574
18574
|
m.countIncludePad ? v += `value /= float(${T});` : v += `value /= float(${T} - pad);`;
|
|
18575
|
-
const
|
|
18575
|
+
const E = `
|
|
18576
18576
|
${e(h[0].dims, m, "value += _X(x);", v, "0.0")}
|
|
18577
18577
|
`;
|
|
18578
|
-
return Object.assign(Object.assign({}, b), { output: { dims: S, type: h[0].type, textureType: f.TextureType.unpacked }, shaderSource:
|
|
18578
|
+
return Object.assign(Object.assign({}, b), { output: { dims: S, type: h[0].type, textureType: f.TextureType.unpacked }, shaderSource: E });
|
|
18579
18579
|
};
|
|
18580
18580
|
n.globalAveragePool = (h, b, g) => {
|
|
18581
18581
|
t(b);
|
|
@@ -18602,10 +18602,10 @@ float getBiasForMatmul() {
|
|
|
18602
18602
|
`;
|
|
18603
18603
|
return Object.assign(Object.assign({}, b), { output: { dims: S, type: h[0].type, textureType: f.TextureType.unpacked }, shaderSource: T });
|
|
18604
18604
|
}, _ = (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(
|
|
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() : [], E = b.pads.slice();
|
|
18606
|
+
l.PoolConvUtil.adjustPoolAttributes(g, y, S, T, v, E);
|
|
18607
|
+
const A = l.PoolConvUtil.computePoolOutputShape(g, y, T, v, S, E, b.autoPad), w = Object.assign({}, b);
|
|
18608
|
+
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
18609
|
}, p = { autoPad: "", ceilMode: 0, countIncludePad: !1, kernelShape: [], strides: [], pads: [], storageOrder: 0, dilations: [], cacheKey: "" }, a = { name: "GlobalMaxPool", inputNames: ["X"], inputTypes: [f.TextureType.unpacked] };
|
|
18610
18610
|
n.globalMaxPool = (h, b) => (t(b), [h.run(Object.assign(Object.assign({}, a), { get: () => d(b, a, !0, p) }), b)]);
|
|
18611
18611
|
const t = (h) => {
|
|
@@ -18614,19 +18614,19 @@ float getBiasForMatmul() {
|
|
|
18614
18614
|
}, e = (h, b, g, y, m) => {
|
|
18615
18615
|
const S = h.length;
|
|
18616
18616
|
if (b.kernelShape.length <= 2) {
|
|
18617
|
-
const T = b.kernelShape[b.kernelShape.length - 1], v = b.strides[b.strides.length - 1],
|
|
18617
|
+
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
18618
|
let x = "", N = "", D = "";
|
|
18619
|
-
if (x =
|
|
18619
|
+
if (x = E + A !== 0 ? `
|
|
18620
18620
|
for (int i = 0; i < ${T}; i++) {
|
|
18621
|
-
x[${S} - 1] = indices[${S} - 1] * ${v} - ${
|
|
18622
|
-
if (x[${S} - 1] < 0 || x[${S} - 1] >= ${
|
|
18621
|
+
x[${S} - 1] = indices[${S} - 1] * ${v} - ${E} + i;
|
|
18622
|
+
if (x[${S} - 1] < 0 || x[${S} - 1] >= ${w}) {
|
|
18623
18623
|
pad++;
|
|
18624
18624
|
continue;
|
|
18625
18625
|
}
|
|
18626
18626
|
${g}
|
|
18627
18627
|
}` : `
|
|
18628
18628
|
for (int i = 0; i < ${T}; i++) {
|
|
18629
|
-
x[${S} - 1] = indices[${S} - 1] * ${v} - ${
|
|
18629
|
+
x[${S} - 1] = indices[${S} - 1] * ${v} - ${E} + i;
|
|
18630
18630
|
${g}
|
|
18631
18631
|
}`, b.kernelShape.length === 2) {
|
|
18632
18632
|
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 +18660,7 @@ float getBiasForMatmul() {
|
|
|
18660
18660
|
`;
|
|
18661
18661
|
}
|
|
18662
18662
|
{
|
|
18663
|
-
const T = l.ShapeUtil.size(b.kernelShape), v = l.ShapeUtil.computeStrides(b.kernelShape),
|
|
18663
|
+
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
18664
|
let P = "";
|
|
18665
18665
|
return P = b.pads.reduce(((L, B) => L + B)) ? `
|
|
18666
18666
|
if (x[j] >= inputDims[j] || x[j] < 0) {
|
|
@@ -18675,15 +18675,15 @@ float getBiasForMatmul() {
|
|
|
18675
18675
|
}
|
|
18676
18676
|
${g}
|
|
18677
18677
|
`, `
|
|
18678
|
-
${
|
|
18678
|
+
${w}
|
|
18679
18679
|
float process(int indices[${S}]) {
|
|
18680
18680
|
int x[${S}];
|
|
18681
18681
|
copyVec(indices, x);
|
|
18682
|
-
int offset[${
|
|
18682
|
+
int offset[${E}];
|
|
18683
18683
|
int pads[${A}];
|
|
18684
18684
|
int inputDims[${S}];
|
|
18685
|
-
int kernelStrides[${
|
|
18686
|
-
int strides[${
|
|
18685
|
+
int kernelStrides[${E}];
|
|
18686
|
+
int strides[${E}];
|
|
18687
18687
|
${N}
|
|
18688
18688
|
${x}
|
|
18689
18689
|
${M}
|
|
@@ -18695,9 +18695,9 @@ float getBiasForMatmul() {
|
|
|
18695
18695
|
for (int i = 0; i < ${T}; i++) {
|
|
18696
18696
|
offsetToIndices(i, kernelStrides, offset);
|
|
18697
18697
|
isPad = false;
|
|
18698
|
-
for (int j = ${S} - ${
|
|
18699
|
-
x[j] = indices[j] * strides[j - ${S} + ${
|
|
18700
|
-
+ offset[j - ${S} + ${
|
|
18698
|
+
for (int j = ${S} - ${E}; j < ${S}; j++) {
|
|
18699
|
+
x[j] = indices[j] * strides[j - ${S} + ${E}]
|
|
18700
|
+
+ offset[j - ${S} + ${E}] - pads[j - 2];
|
|
18701
18701
|
${P}
|
|
18702
18702
|
}
|
|
18703
18703
|
${y}
|
|
@@ -18737,11 +18737,11 @@ float getBiasForMatmul() {
|
|
|
18737
18737
|
const _ = (a, t, e, r, o, h) => {
|
|
18738
18738
|
const b = [], g = t[0].dims.length || 1, y = [], m = f.ShapeUtil.normalizeAxes(e.axes, t[0].dims.length), S = o(t, m);
|
|
18739
18739
|
let T = S[1];
|
|
18740
|
-
for (let
|
|
18741
|
-
for(int j${
|
|
18742
|
-
inputIdx[${
|
|
18740
|
+
for (let E = 0; E < t[0].dims.length; E++) m.indexOf(E) >= 0 || m.length === 0 ? (e.keepDims && b.push(1), T = `
|
|
18741
|
+
for(int j${E} = 0; j${E} < ${t[0].dims[E]}; j${E}++) {
|
|
18742
|
+
inputIdx[${E}] = j${E};
|
|
18743
18743
|
${T}
|
|
18744
|
-
}`) : (y.push(`inputIdx[${
|
|
18744
|
+
}`) : (y.push(`inputIdx[${E}] = outputIdx[${b.length}];`), b.push(t[0].dims[E]));
|
|
18745
18745
|
const v = `
|
|
18746
18746
|
float process(int outputIdx[${b.length || 1}]) {
|
|
18747
18747
|
float value; // final result
|
|
@@ -18816,10 +18816,10 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
18816
18816
|
}
|
|
18817
18817
|
const y = (0, l.getGlsl)(t.session.backend.glContext.version), m = `
|
|
18818
18818
|
${(function(S) {
|
|
18819
|
-
const T = c.ShapeUtil.computeStrides(S), v = ["b", "r", "c"],
|
|
18819
|
+
const T = c.ShapeUtil.computeStrides(S), v = ["b", "r", "c"], E = "index";
|
|
18820
18820
|
return `
|
|
18821
18821
|
ivec3 inputCoordsFromReshapedOutCoords(int index) {
|
|
18822
|
-
${T.map(((A,
|
|
18822
|
+
${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
18823
|
return ivec3(b, r, c);
|
|
18824
18824
|
}
|
|
18825
18825
|
`;
|
|
@@ -18880,7 +18880,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
18880
18880
|
if (m < 2) throw new Error(`output dimension should be at least 2, but got ${m}`);
|
|
18881
18881
|
const S = y[m - 2], T = y[m - 1], v = o[0].dims;
|
|
18882
18882
|
if (m !== v.length) throw new Error(`output dimension should match input ${v.length}, but got ${m}`);
|
|
18883
|
-
const
|
|
18883
|
+
const E = v[m - 2], A = v[m - 1], w = g[m - 2], x = g[m - 1];
|
|
18884
18884
|
let N = "";
|
|
18885
18885
|
if (h.mode !== "linear") throw new Error(`resize (packed) does not support mode: '${h.mode}'`);
|
|
18886
18886
|
switch (h.coordinateTransformMode) {
|
|
@@ -18916,8 +18916,8 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
18916
18916
|
vec4 getSourceFracIndex(ivec4 coords) {
|
|
18917
18917
|
vec4 resized = vec4(${T}.0 - 1.0, ${S}.0 - 1.0, ${T}.0 - 1.0,
|
|
18918
18918
|
${S}.0 - 1.0);
|
|
18919
|
-
vec4 original = vec4(${A}.0 - 1.0, ${
|
|
18920
|
-
${
|
|
18919
|
+
vec4 original = vec4(${A}.0 - 1.0, ${E}.0 - 1.0, ${A}.0 - 1.0,
|
|
18920
|
+
${E}.0 - 1.0);
|
|
18921
18921
|
vec4 new_scale = original / resized;
|
|
18922
18922
|
return vec4(coords) * new_scale;
|
|
18923
18923
|
}
|
|
@@ -18927,8 +18927,8 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
18927
18927
|
throw new Error(`resize (packed) does not support coordinateTransformMode: '${h.coordinateTransformMode}'`);
|
|
18928
18928
|
}
|
|
18929
18929
|
const D = (0, f.getCoordsDataType)(m), M = `
|
|
18930
|
-
const vec2 inputWH = vec2(${
|
|
18931
|
-
const vec4 scaleWHWH = vec4(float(${
|
|
18930
|
+
const vec2 inputWH = vec2(${E}.0, ${A}.0);
|
|
18931
|
+
const vec4 scaleWHWH = vec4(float(${w}), float(${x}), float(${w}), float(${x}));
|
|
18932
18932
|
${(0, u.unpackFromChannel)()}
|
|
18933
18933
|
${N}
|
|
18934
18934
|
float getAValue(int x10, int r, int c, int d) {
|
|
@@ -19037,7 +19037,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19037
19037
|
return (0, c.createAttributeWithCacheKey)({ starts: r, ends: o, axes: h });
|
|
19038
19038
|
};
|
|
19039
19039
|
const _ = (e, r, o) => {
|
|
19040
|
-
const h = o.axes.length === 0 ? r.dims.slice(0).map(((v,
|
|
19040
|
+
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
19041
|
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
19042
|
const T = `
|
|
19043
19043
|
float process(int outputIdx[${m.length}]) {
|
|
@@ -19076,22 +19076,22 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19076
19076
|
return t(b, g, y, T, v);
|
|
19077
19077
|
}, 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
19078
|
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(
|
|
19079
|
+
const m = g[0].dims.slice(), S = l.ShapeUtil.normalizeAxis(y.axis, m.length), T = m.length, v = S !== T - 1, E = [];
|
|
19080
|
+
let A, w = [], x = [];
|
|
19081
|
+
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));
|
|
19082
|
+
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
19083
|
return v ? (0, d.transpose)(b, M, A) : M;
|
|
19084
19084
|
};
|
|
19085
19085
|
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: () =>
|
|
19086
|
+
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);
|
|
19087
|
+
return [b.run(Object.assign(Object.assign({}, a), { cacheHint: y.cacheKey, get: () => w }), [g[0], v, A])];
|
|
19088
19088
|
}, e = (b, g, y, m, S) => {
|
|
19089
|
-
const [T, v] = b.calculateTextureWidthAndHeight(g.dims, u.TextureType.unpacked),
|
|
19089
|
+
const [T, v] = b.calculateTextureWidthAndHeight(g.dims, u.TextureType.unpacked), E = S.length;
|
|
19090
19090
|
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
19091
|
if (S.length !== 1) throw new Error("Dimensionality of the output should be 1");
|
|
19092
19092
|
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[${
|
|
19093
|
+
const A = (0, f.getGlsl)(b.session.backend.glContext.version), w = `
|
|
19094
|
+
float process(int[${E}] indices) {
|
|
19095
19095
|
int logical_row_start_offset = indices[0] * ${m};
|
|
19096
19096
|
|
|
19097
19097
|
float max = getColorAsFloat(${A.texture2D}(A, offsetToCoords(logical_row_start_offset, ${T},
|
|
@@ -19106,15 +19106,15 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19106
19106
|
|
|
19107
19107
|
return max;
|
|
19108
19108
|
}`;
|
|
19109
|
-
return Object.assign(Object.assign({}, _), { output: { dims: S, type: g.type, textureType: u.TextureType.unpacked }, shaderSource:
|
|
19109
|
+
return Object.assign(Object.assign({}, _), { output: { dims: S, type: g.type, textureType: u.TextureType.unpacked }, shaderSource: w });
|
|
19110
19110
|
}, r = (b, g, y, m, S, T) => {
|
|
19111
|
-
const [v,
|
|
19111
|
+
const [v, E] = b.calculateTextureWidthAndHeight(g.dims, u.TextureType.unpacked), A = T.length;
|
|
19112
19112
|
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
19113
|
if (T.length !== 1) throw new Error("Dimensionality of the output should be 1");
|
|
19114
19114
|
if (T[0] !== y) throw new Error("Shape of the output should be equal to logical row count");
|
|
19115
19115
|
if (S.length !== 1) throw new Error("Dimensionality of the intermediate results should be 1");
|
|
19116
19116
|
if (S[0] !== y) throw new Error("Shape of the intermediate results should be equal to logical row count");
|
|
19117
|
-
const
|
|
19117
|
+
const w = `
|
|
19118
19118
|
float process(int[${A}] indices) {
|
|
19119
19119
|
int logical_row_start_offset = indices[0] * ${m};
|
|
19120
19120
|
|
|
@@ -19123,22 +19123,22 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19123
19123
|
for(int i=0; i<${m}; ++i)
|
|
19124
19124
|
{
|
|
19125
19125
|
norm_factor += exp(getColorAsFloat(${(0, f.getGlsl)(b.session.backend.glContext.version).texture2D}(A, offsetToCoords(logical_row_start_offset + i,
|
|
19126
|
-
${v}, ${
|
|
19126
|
+
${v}, ${E}))) - max);
|
|
19127
19127
|
}
|
|
19128
19128
|
|
|
19129
19129
|
return norm_factor;
|
|
19130
19130
|
}`;
|
|
19131
|
-
return Object.assign(Object.assign({}, p), { output: { dims: T, type: g.type, textureType: u.TextureType.unpacked }, shaderSource:
|
|
19131
|
+
return Object.assign(Object.assign({}, p), { output: { dims: T, type: g.type, textureType: u.TextureType.unpacked }, shaderSource: w });
|
|
19132
19132
|
}, o = (b, g, y, m, S, T) => {
|
|
19133
|
-
const [v,
|
|
19133
|
+
const [v, E] = b.calculateTextureWidthAndHeight(g.dims, u.TextureType.unpacked), A = g.dims.length;
|
|
19134
19134
|
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
19135
|
if (S.length !== 1 || T.length !== 1) throw new Error("Dimensionality of the intermediate results should be 1");
|
|
19136
19136
|
if (S[0] !== y || T[0] !== y) throw new Error("Shape of the intermediate results should be equal to logical row count");
|
|
19137
|
-
const
|
|
19137
|
+
const w = `
|
|
19138
19138
|
float process(int[${A}] indices) {
|
|
19139
19139
|
|
|
19140
19140
|
// get offset of current logical tensor index from the 2-D texture coordinates (TexCoords)
|
|
19141
|
-
int offset = coordsToOffset(TexCoords, ${v}, ${
|
|
19141
|
+
int offset = coordsToOffset(TexCoords, ${v}, ${E});
|
|
19142
19142
|
|
|
19143
19143
|
//determine the logical row for this index
|
|
19144
19144
|
int logical_row_index[1];
|
|
@@ -19154,7 +19154,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19154
19154
|
|
|
19155
19155
|
return exp(_A(indices) - _Max(logical_row_index)) / norm_factor;
|
|
19156
19156
|
}`;
|
|
19157
|
-
return Object.assign(Object.assign({}, a), { output: { dims: g.dims, type: g.type, textureType: u.TextureType.unpacked }, shaderSource:
|
|
19157
|
+
return Object.assign(Object.assign({}, a), { output: { dims: g.dims, type: g.type, textureType: u.TextureType.unpacked }, shaderSource: w });
|
|
19158
19158
|
}, h = (b) => {
|
|
19159
19159
|
if (!b || b.length !== 1) throw new Error("Softmax requires 1 input.");
|
|
19160
19160
|
if (b[0].type !== "float32" && b[0].type !== "float64") throw new Error("Invalid input type");
|
|
@@ -19439,7 +19439,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19439
19439
|
}
|
|
19440
19440
|
`, name: "not", type: f.FunctionType.ValueBased };
|
|
19441
19441
|
}
|
|
19442
|
-
function
|
|
19442
|
+
function E() {
|
|
19443
19443
|
return M("sin");
|
|
19444
19444
|
}
|
|
19445
19445
|
function A() {
|
|
@@ -19453,7 +19453,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19453
19453
|
}
|
|
19454
19454
|
`, name: B, type: f.FunctionType.ValueBased };
|
|
19455
19455
|
}
|
|
19456
|
-
function
|
|
19456
|
+
function w() {
|
|
19457
19457
|
const B = "sigmoid";
|
|
19458
19458
|
return { body: `
|
|
19459
19459
|
float ${B}_(float a) {
|
|
@@ -19495,7 +19495,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19495
19495
|
}
|
|
19496
19496
|
`, name: B, type: f.FunctionType.ValueBased };
|
|
19497
19497
|
}
|
|
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 =
|
|
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 = E, n.glslRelu = A, n.glslSigmoid = w, n.glslSqrt = x, n.glslTan = N, n.glslTanh = D;
|
|
19499
19499
|
const P = (B, V, X, Z) => {
|
|
19500
19500
|
const q = B.session.pack ? d.TextureType.packed : d.TextureType.unpacked, k = { name: X.name, inputTypes: [q], inputNames: ["A"], cacheHint: Z };
|
|
19501
19501
|
return Object.assign(Object.assign({}, k), { get: () => ((I, O, F, j) => {
|
|
@@ -19519,7 +19519,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19519
19519
|
const X = V.length >= 3 ? V[1].numberData[0] : l.MIN_CLIP, Z = V.length >= 3 ? V[2].numberData[0] : l.MAX_CLIP;
|
|
19520
19520
|
return (0, c.createAttributeWithCacheKey)({ min: X, max: Z });
|
|
19521
19521
|
};
|
|
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],
|
|
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], 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
19523
|
}, 5611: (s, n, i) => {
|
|
19524
19524
|
Object.defineProperty(n, "__esModule", { value: !0 }), n.createUnpackProgramInfoLoader = n.createUnpackProgramInfo = void 0;
|
|
19525
19525
|
const c = i(5060), l = i(2039), f = i(9390), u = i(2827), d = { name: "unpack", inputNames: ["A"], inputTypes: [l.TextureType.packed] };
|
|
@@ -19572,18 +19572,18 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19572
19572
|
const y = _.attributes.getFloat("cubic_coeff_a", -0.75), m = _.attributes.getInt("exclude_outside", 0) !== 0;
|
|
19573
19573
|
if (m && t !== "cubic") throw new Error("exclude_outside can be set to 1 only when mode is CUBIC.");
|
|
19574
19574
|
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,
|
|
19575
|
+
let T = 0, v = 0, E = 0;
|
|
19576
|
+
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
19577
|
};
|
|
19578
19578
|
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(((
|
|
19579
|
+
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
19580
|
let S = `
|
|
19581
19581
|
int output_pitches[${g}];
|
|
19582
19582
|
int input_pitches[${g}];
|
|
19583
19583
|
`;
|
|
19584
|
-
for (let
|
|
19585
|
-
output_pitches[${
|
|
19586
|
-
input_pitches[${
|
|
19584
|
+
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 += `
|
|
19585
|
+
output_pitches[${E}] = ${y[E]};
|
|
19586
|
+
input_pitches[${E}] = ${m[E]};
|
|
19587
19587
|
`;
|
|
19588
19588
|
const T = `
|
|
19589
19589
|
float getInputFloat(int index) {
|
|
@@ -19716,7 +19716,7 @@ value = _A(inputIdx);`, "value = min(value, _A(inputIdx));", ""];
|
|
|
19716
19716
|
float y1 = x10 + float(y_offset) * (x11 - x10) / float(scales[0]);
|
|
19717
19717
|
return y0 + float(x_offset) * (y1 - y0) / float(scales[1]);
|
|
19718
19718
|
}`;
|
|
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(((
|
|
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(((E) => Math.ceil(E))) }] });
|
|
19720
19720
|
};
|
|
19721
19721
|
n.validateInputs = (_, p) => {
|
|
19722
19722
|
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 +20510,14 @@ ${a}`);
|
|
|
20510
20510
|
const m = /* @__PURE__ */ new Set();
|
|
20511
20511
|
y.forEach(((S, T) => {
|
|
20512
20512
|
const v = h.node.outputs[T];
|
|
20513
|
-
for (const
|
|
20514
|
-
const A = t[
|
|
20515
|
-
let
|
|
20513
|
+
for (const E of a[v].to) {
|
|
20514
|
+
const A = t[E];
|
|
20515
|
+
let w = !0;
|
|
20516
20516
|
for (const x of A.inputs) if (!this._values[x]) {
|
|
20517
|
-
|
|
20517
|
+
w = !1;
|
|
20518
20518
|
break;
|
|
20519
20519
|
}
|
|
20520
|
-
|
|
20520
|
+
w && m.add(E);
|
|
20521
20521
|
}
|
|
20522
20522
|
})), p.push(...m);
|
|
20523
20523
|
}
|
|
@@ -20658,12 +20658,12 @@ ${a}`);
|
|
|
20658
20658
|
const T = r.inputs(S);
|
|
20659
20659
|
if (g.has(T)) throw new Error(`duplicated input name: ${T}`);
|
|
20660
20660
|
for (let v = 0; v < r.nodeArgsLength(); v++) if (((o = r.nodeArgs(v)) === null || o === void 0 ? void 0 : o.name()) === T) {
|
|
20661
|
-
const
|
|
20661
|
+
const E = new p();
|
|
20662
20662
|
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()),
|
|
20663
|
+
const A = r.nodeArgs(v).type().value(new _.TensorTypeAndShape()), w = d.ProtoUtil.tensorDataTypeFromProto(A.elemType()), x = A.shape(), N = [];
|
|
20664
20664
|
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(
|
|
20665
|
+
E.type = { shape: { dims: N }, tensorType: w };
|
|
20666
|
+
const D = this._allData.push(E) - 1;
|
|
20667
20667
|
g.set(T, D), m.push(T);
|
|
20668
20668
|
}
|
|
20669
20669
|
}
|
|
@@ -20671,8 +20671,8 @@ ${a}`);
|
|
|
20671
20671
|
const T = r.initializers(S);
|
|
20672
20672
|
let v = g.get(T.name());
|
|
20673
20673
|
if (v === void 0) {
|
|
20674
|
-
const
|
|
20675
|
-
|
|
20674
|
+
const E = new p(), A = d.ProtoUtil.tensorDimsFromORTFormat(T), w = d.ProtoUtil.tensorDataTypeFromProto(T.dataType());
|
|
20675
|
+
E.type = { shape: { dims: A }, tensorType: w }, v = this._allData.push(E) - 1, g.set(T.name(), v);
|
|
20676
20676
|
}
|
|
20677
20677
|
this._allData[v]._from = -1, this._allData[v].tensor = u.Tensor.fromOrtTensor(T);
|
|
20678
20678
|
}
|
|
@@ -20689,31 +20689,31 @@ ${a}`);
|
|
|
20689
20689
|
let v = T.name();
|
|
20690
20690
|
if (!v) for (let A = 0; v = `unnamed_${T.opType()}_${A}`, y.has(v); A++) ;
|
|
20691
20691
|
if (y.has(v)) throw new Error(`duplicated node name: ${v}`);
|
|
20692
|
-
const
|
|
20693
|
-
y.set(v,
|
|
20692
|
+
const E = this._nodes.push(new a(T, v)) - 1;
|
|
20693
|
+
y.set(v, E);
|
|
20694
20694
|
}
|
|
20695
20695
|
for (let S = 0; S < this._nodes.length; S++) {
|
|
20696
20696
|
const T = this._nodes[S], v = r.nodes(S);
|
|
20697
20697
|
if (v == null) throw new Error(`No node exists at index ${S}`);
|
|
20698
20698
|
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[
|
|
20699
|
+
for (let E = 0; E < v?.outputsLength(); E++) {
|
|
20700
|
+
const A = v?.outputs(E);
|
|
20701
|
+
let w = g.get(A);
|
|
20702
|
+
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}`);
|
|
20703
|
+
if (this._allData[w]._from = S, v.opType() === "Constant") {
|
|
20704
20704
|
if (v.attributesLength() !== 1 || !v.attributes(0).t()) throw new Error("missing attributes or missing tensor value in attributes for this Constant operator");
|
|
20705
20705
|
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[
|
|
20706
|
+
T.outputs.pop(), T.executeNode = !1, this._allData[w]._from = -1, this._allData[w].tensor = u.Tensor.fromOrtTensor(v.attributes(0).t());
|
|
20707
20707
|
}
|
|
20708
20708
|
}
|
|
20709
20709
|
}
|
|
20710
20710
|
for (let S = 0; S < this._nodes.length; S++) {
|
|
20711
20711
|
const T = this._nodes[S], v = r.nodes(S);
|
|
20712
20712
|
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(
|
|
20713
|
+
for (let E = 0; E < v.inputsLength(); E++) {
|
|
20714
|
+
const A = v.inputs(E), w = g.get(A);
|
|
20715
|
+
if (w === void 0) throw new Error(`unrecognized input '${A}' for node: ${v.name()}`);
|
|
20716
|
+
T.inputs.push(w), this._allData[w]._to.push(S);
|
|
20717
20717
|
}
|
|
20718
20718
|
}
|
|
20719
20719
|
}
|
|
@@ -21602,8 +21602,8 @@ ${a}`);
|
|
|
21602
21602
|
static endNode(t) {
|
|
21603
21603
|
return t.endObject();
|
|
21604
21604
|
}
|
|
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,
|
|
21605
|
+
static createNode(t, e, r, o, h, b, g, y, m, S, T, v, E, A) {
|
|
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, E), p.addImplicitInputs(t, A), p.endNode(t);
|
|
21607
21607
|
}
|
|
21608
21608
|
}
|
|
21609
21609
|
_.Node = p;
|
|
@@ -22102,8 +22102,8 @@ ${a}`);
|
|
|
22102
22102
|
static endAttribute(t) {
|
|
22103
22103
|
return t.endObject();
|
|
22104
22104
|
}
|
|
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,
|
|
22105
|
+
static createAttribute(t, e, r, o, h, b, g, y, m, S, T, v, E, A) {
|
|
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, E), p.addGraphs(t, A), p.endAttribute(t);
|
|
22107
22107
|
}
|
|
22108
22108
|
}
|
|
22109
22109
|
_.Attribute = p;
|
|
@@ -22808,19 +22808,19 @@ ${a}`);
|
|
|
22808
22808
|
}
|
|
22809
22809
|
constructor(b, g, y, m, S, T = l.Guid.create()) {
|
|
22810
22810
|
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,
|
|
22811
|
+
const v = this.size, E = y === void 0 && m === void 0 && S === void 0;
|
|
22812
22812
|
if (S !== void 0 && S.length !== v) throw new RangeError("Input dims doesn't match data length.");
|
|
22813
22813
|
if (g === "string") {
|
|
22814
22814
|
if (!(S === void 0 || Array.isArray(S) && S.every(((A) => typeof A == "string")))) throw new TypeError("cache should be a string array");
|
|
22815
|
-
|
|
22815
|
+
E && (this.cache = new Array(v));
|
|
22816
22816
|
} else {
|
|
22817
22817
|
if (S !== void 0) {
|
|
22818
22818
|
const A = e(g);
|
|
22819
22819
|
if (!(S instanceof A)) throw new TypeError(`cache should be type ${A.name}`);
|
|
22820
22820
|
}
|
|
22821
|
-
if (
|
|
22822
|
-
const A = new ArrayBuffer(v * (function(
|
|
22823
|
-
switch (
|
|
22821
|
+
if (E) {
|
|
22822
|
+
const A = new ArrayBuffer(v * (function(w) {
|
|
22823
|
+
switch (w) {
|
|
22824
22824
|
case "bool":
|
|
22825
22825
|
case "int8":
|
|
22826
22826
|
case "uint8":
|
|
@@ -22835,11 +22835,11 @@ ${a}`);
|
|
|
22835
22835
|
case "float64":
|
|
22836
22836
|
return 8;
|
|
22837
22837
|
default:
|
|
22838
|
-
throw new Error(`cannot calculate sizeof() on type ${
|
|
22838
|
+
throw new Error(`cannot calculate sizeof() on type ${w}`);
|
|
22839
22839
|
}
|
|
22840
22840
|
})(g));
|
|
22841
|
-
this.cache = (function(
|
|
22842
|
-
return new (e(x))(
|
|
22841
|
+
this.cache = (function(w, x) {
|
|
22842
|
+
return new (e(x))(w);
|
|
22843
22843
|
})(A, g);
|
|
22844
22844
|
}
|
|
22845
22845
|
}
|
|
@@ -22851,12 +22851,12 @@ ${a}`);
|
|
|
22851
22851
|
m.data[T] = (0, _.decodeUtf8String)(S);
|
|
22852
22852
|
}));
|
|
22853
22853
|
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),
|
|
22854
|
+
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
22855
|
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] =
|
|
22856
|
+
if (S.length !== E) throw new Error("buffer length mismatch");
|
|
22857
|
+
for (let A = 0; A < E; A++) {
|
|
22858
|
+
const w = o(T, b.dataType, A * v);
|
|
22859
|
+
S[A] = w;
|
|
22860
22860
|
}
|
|
22861
22861
|
} else {
|
|
22862
22862
|
let S;
|
|
@@ -22889,8 +22889,8 @@ ${a}`);
|
|
|
22889
22889
|
const T = m.data;
|
|
22890
22890
|
if (T.length !== S.length) throw new Error("array length mismatch");
|
|
22891
22891
|
for (let v = 0; v < S.length; v++) {
|
|
22892
|
-
const
|
|
22893
|
-
f.default.isLong(
|
|
22892
|
+
const E = S[v];
|
|
22893
|
+
f.default.isLong(E) ? T[v] = r(E, b.dataType) : T[v] = E;
|
|
22894
22894
|
}
|
|
22895
22895
|
}
|
|
22896
22896
|
return m;
|
|
@@ -22903,12 +22903,12 @@ ${a}`);
|
|
|
22903
22903
|
const g = _.ProtoUtil.tensorDimsFromORTFormat(b), y = _.ProtoUtil.tensorDataTypeFromProto(b.dataType()), m = new a(g, y);
|
|
22904
22904
|
if (y === "string") for (let S = 0; S < b.stringDataLength(); S++) m.data[S] = b.stringData(S);
|
|
22905
22905
|
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()),
|
|
22906
|
+
const S = m.data, T = new DataView(b.rawDataArray().buffer, b.rawDataArray().byteOffset, b.rawDataLength()), v = t(b.dataType()), E = b.rawDataLength() / v;
|
|
22907
22907
|
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] =
|
|
22908
|
+
if (S.length !== E) throw new Error("buffer length mismatch");
|
|
22909
|
+
for (let A = 0; A < E; A++) {
|
|
22910
|
+
const w = o(T, b.dataType(), A * v);
|
|
22911
|
+
S[A] = w;
|
|
22912
22912
|
}
|
|
22913
22913
|
}
|
|
22914
22914
|
return m;
|
|
@@ -23031,19 +23031,19 @@ ${a}`);
|
|
|
23031
23031
|
const S = g.length, T = y.length;
|
|
23032
23032
|
if (S === 0) return y;
|
|
23033
23033
|
if (T === 0) return g;
|
|
23034
|
-
const v = Math.max(g.length, y.length),
|
|
23034
|
+
const v = Math.max(g.length, y.length), E = new Array(v);
|
|
23035
23035
|
if (m) {
|
|
23036
23036
|
if (S < 2 || T < 2) return;
|
|
23037
23037
|
const A = _.calcMatMulShape([g[S - 2], g[S - 1]], [y[T - 2], y[T - 1]]);
|
|
23038
23038
|
if (A === void 0) return;
|
|
23039
|
-
[
|
|
23039
|
+
[E[v - 2], E[v - 1]] = A;
|
|
23040
23040
|
}
|
|
23041
23041
|
for (let A = m ? 3 : 1; A <= v; A++) {
|
|
23042
|
-
const
|
|
23043
|
-
if (
|
|
23044
|
-
|
|
23042
|
+
const w = S - A < 0 ? 1 : g[S - A], x = T - A < 0 ? 1 : y[T - A];
|
|
23043
|
+
if (w !== x && w > 1 && x > 1) return;
|
|
23044
|
+
E[v - A] = Math.max(w, x);
|
|
23045
23045
|
}
|
|
23046
|
-
return
|
|
23046
|
+
return E;
|
|
23047
23047
|
}
|
|
23048
23048
|
static index(g, y) {
|
|
23049
23049
|
const m = new Array(y.length);
|
|
@@ -23057,16 +23057,16 @@ ${a}`);
|
|
|
23057
23057
|
const v = p.calcShape(g.dims, y.dims);
|
|
23058
23058
|
if (v) {
|
|
23059
23059
|
if (S && !e.areEqual(v, g.dims)) return;
|
|
23060
|
-
const
|
|
23060
|
+
const E = e.size(v), A = S ? g : new d.Tensor(v, T || g.type);
|
|
23061
23061
|
if (v.length === 0) A.set([], m(g.get([]), y.get([])));
|
|
23062
23062
|
else {
|
|
23063
|
-
const
|
|
23063
|
+
const w = new Array(v.length), x = new Array(g.dims.length), N = new Array(y.dims.length);
|
|
23064
23064
|
let D, M = 0, P = 0, L = !1, B = !1;
|
|
23065
23065
|
g.dims.length === 0 && (M = g.get([]), L = !0), y.dims.length === 0 && (P = y.get([]), B = !0);
|
|
23066
|
-
for (let V = 0; V <
|
|
23066
|
+
for (let V = 0; V < E; V++) {
|
|
23067
23067
|
D = V;
|
|
23068
|
-
for (let X = v.length - 1; X >= 0; X--)
|
|
23069
|
-
L || (p.fillIndex(
|
|
23068
|
+
for (let X = v.length - 1; X >= 0; X--) w[X] = D % v[X], D = Math.floor(D / v[X]);
|
|
23069
|
+
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
23070
|
}
|
|
23071
23071
|
}
|
|
23072
23072
|
return A;
|
|
@@ -23081,8 +23081,8 @@ ${a}`);
|
|
|
23081
23081
|
static getBroadcastDims(g, y) {
|
|
23082
23082
|
const m = g.length, S = [];
|
|
23083
23083
|
for (let T = 0; T < m; T++) {
|
|
23084
|
-
const v = m - 1 - T,
|
|
23085
|
-
(y[y.length - 1 - T] || 1) > 1 &&
|
|
23084
|
+
const v = m - 1 - T, E = g[v] || 1;
|
|
23085
|
+
(y[y.length - 1 - T] || 1) > 1 && E === 1 && S.unshift(v);
|
|
23086
23086
|
}
|
|
23087
23087
|
return S;
|
|
23088
23088
|
}
|
|
@@ -23096,13 +23096,13 @@ ${a}`);
|
|
|
23096
23096
|
}, n.GemmUtil = class {
|
|
23097
23097
|
static getShapeOfGemmResult(b, g, y, m, S) {
|
|
23098
23098
|
if (b.length !== 2 || y.length !== 2) throw new Error("shape need to be of size 2");
|
|
23099
|
-
let T, v,
|
|
23099
|
+
let T, v, E;
|
|
23100
23100
|
g ? (T = b[1], v = b[0]) : (T = b[0], v = b[1]);
|
|
23101
23101
|
let A = -1;
|
|
23102
|
-
if (m ? (
|
|
23103
|
-
if (T <= 0 ||
|
|
23104
|
-
if (S && !p.isValidBroadcast(S, [T,
|
|
23105
|
-
return [T,
|
|
23102
|
+
if (m ? (E = y[0], A = 1) : (E = y[1], A = 0), y[A] !== v) throw new Error("dimension mismatch");
|
|
23103
|
+
if (T <= 0 || E <= 0 || v <= 0) throw new Error("invalid shape specified");
|
|
23104
|
+
if (S && !p.isValidBroadcast(S, [T, E])) throw new Error("gemm: invalid bias shape for broadcast");
|
|
23105
|
+
return [T, E, v];
|
|
23106
23106
|
}
|
|
23107
23107
|
};
|
|
23108
23108
|
class a {
|
|
@@ -23272,11 +23272,11 @@ ${a}`);
|
|
|
23272
23272
|
v *= S[A];
|
|
23273
23273
|
}
|
|
23274
23274
|
}
|
|
23275
|
-
const
|
|
23275
|
+
const E = e.size(g);
|
|
23276
23276
|
if (T !== -1) {
|
|
23277
|
-
if (
|
|
23278
|
-
S[T] =
|
|
23279
|
-
} else if (v !==
|
|
23277
|
+
if (E % v != 0) throw new Error(`the input tensor cannot be reshaped to the requested shape. Input shape: [${g}] Output shape: [${y}]`);
|
|
23278
|
+
S[T] = E / v;
|
|
23279
|
+
} else if (v !== E) throw new Error("reshapedDims and originalDims don't have matching sizes");
|
|
23280
23280
|
return S;
|
|
23281
23281
|
}
|
|
23282
23282
|
static sortBasedOnPerm(g, y) {
|
|
@@ -23366,10 +23366,10 @@ ${a}`);
|
|
|
23366
23366
|
r.determineSplit(g[y], S, m);
|
|
23367
23367
|
}
|
|
23368
23368
|
const T = [], v = [0];
|
|
23369
|
-
for (let
|
|
23370
|
-
|
|
23369
|
+
for (let E = 0; E < m.length; ++E) {
|
|
23370
|
+
E !== 0 && v.push(v[E - 1] + m[E - 1]);
|
|
23371
23371
|
const A = g.slice();
|
|
23372
|
-
A[y] = m[
|
|
23372
|
+
A[y] = m[E], T.push(A);
|
|
23373
23373
|
}
|
|
23374
23374
|
return [T, v];
|
|
23375
23375
|
}
|
|
@@ -23383,18 +23383,18 @@ ${a}`);
|
|
|
23383
23383
|
static calcReduce(g, y, m, S, T) {
|
|
23384
23384
|
const v = g.dims.slice(0);
|
|
23385
23385
|
y.length === 0 && v.forEach(((M, P) => y.push(P)));
|
|
23386
|
-
const
|
|
23386
|
+
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
23387
|
for (let M = 0; M < A; M++) {
|
|
23388
23388
|
const P = e.offsetToIndices(M, x);
|
|
23389
|
-
p.fillIndex(P, v, D),
|
|
23389
|
+
p.fillIndex(P, v, D), w.set(P, o.calcReduceByAxis(g.numberData, y, v, 0, e.indicesToOffset(D, N), S, T));
|
|
23390
23390
|
}
|
|
23391
|
-
return m ?
|
|
23391
|
+
return m ? w : new d.Tensor(o.calcReduceShape(v, y, m), w.type, void 0, void 0, w.data, w.dataId);
|
|
23392
23392
|
}
|
|
23393
|
-
static calcReduceByAxis(g, y, m, S, T, v,
|
|
23393
|
+
static calcReduceByAxis(g, y, m, S, T, v, E) {
|
|
23394
23394
|
let A = 0;
|
|
23395
23395
|
if (S >= y.length) return v(g[T]);
|
|
23396
|
-
const
|
|
23397
|
-
for (let N = 0; N < m[
|
|
23396
|
+
const w = y[S], x = w >= m.length ? 1 : e.size(m.slice(w + 1));
|
|
23397
|
+
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
23398
|
return A;
|
|
23399
23399
|
}
|
|
23400
23400
|
static calcReduceShape(g, y, m) {
|
|
@@ -23407,19 +23407,19 @@ ${a}`);
|
|
|
23407
23407
|
class h {
|
|
23408
23408
|
static adjustPoolAttributes(g, y, m, S, T, v) {
|
|
23409
23409
|
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[
|
|
23410
|
+
if (g) for (let E = 0; E < y.length - 2; E++) E >= m.length ? m.push(y[E + 2]) : m[E] = y[E + 2];
|
|
23411
|
+
for (let E = 0; E < m.length; E++) if (E < S.length) {
|
|
23412
|
+
if (S[E] < 0) throw new Error("strides should be greater than or equal to 1");
|
|
23413
23413
|
} else S.push(1);
|
|
23414
|
-
for (let
|
|
23415
|
-
if (T[
|
|
23414
|
+
for (let E = 0; E < m.length; E++) if (E < T.length) {
|
|
23415
|
+
if (T[E] < 0) throw new Error("dilations should be greater than or equal to 1");
|
|
23416
23416
|
} else T.push(1);
|
|
23417
|
-
for (let
|
|
23418
|
-
if (v[
|
|
23417
|
+
for (let E = 0; E < 2 * m.length; E++) if (E < v.length) {
|
|
23418
|
+
if (v[E] < 0) throw new Error("pad should be greater than or equal to 1");
|
|
23419
23419
|
} else v.push(0);
|
|
23420
|
-
for (let
|
|
23421
|
-
if (m[
|
|
23422
|
-
if (v[
|
|
23420
|
+
for (let E = 0; E < m.length; E++) {
|
|
23421
|
+
if (m[E] <= 0) throw new Error("kernel shapes need to be greater than 0");
|
|
23422
|
+
if (v[E] >= m[E] || v[E + m.length] >= m[E]) throw new Error("pads should be smaller than kernel");
|
|
23423
23423
|
}
|
|
23424
23424
|
}
|
|
23425
23425
|
static adjustPadsBasedOnAutoPad(g, y, m, S, T, v) {
|
|
@@ -23427,35 +23427,35 @@ ${a}`);
|
|
|
23427
23427
|
if (T.length !== 2 * (g.length - 2)) throw new Error("length of pads should be twice the length of data dimensions");
|
|
23428
23428
|
if (y.length !== g.length - 2) throw new Error("length of strides should be the length of data dimensions");
|
|
23429
23429
|
if (S.length !== g.length - 2) throw new Error("length of kernel shapes should be the length of data dimensions");
|
|
23430
|
-
for (let
|
|
23430
|
+
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
23431
|
}
|
|
23432
23432
|
}
|
|
23433
|
-
static computePoolOutputShape(g, y, m, S, T, v,
|
|
23433
|
+
static computePoolOutputShape(g, y, m, S, T, v, E) {
|
|
23434
23434
|
if (y.length <= 0) throw new Error("input shape must be of size greater than 0");
|
|
23435
23435
|
const A = [y[0], y[1]];
|
|
23436
|
-
return h.computeShapeHelper(g, y, A, m, S, T, v,
|
|
23436
|
+
return h.computeShapeHelper(g, y, A, m, S, T, v, E), A;
|
|
23437
23437
|
}
|
|
23438
|
-
static computeConvOutputShape(g, y, m, S, T, v,
|
|
23438
|
+
static computeConvOutputShape(g, y, m, S, T, v, E) {
|
|
23439
23439
|
if (g.length <= 0 || y.length <= 0) throw new Error("invalid input tensor dims or invalid filter tensor dims");
|
|
23440
23440
|
const A = [g[0], y[0]];
|
|
23441
|
-
return h.computeShapeHelper(!1, g, A, m, S, T, v,
|
|
23441
|
+
return h.computeShapeHelper(!1, g, A, m, S, T, v, E), A;
|
|
23442
23442
|
}
|
|
23443
|
-
static computeShapeHelper(g, y, m, S, T, v,
|
|
23444
|
-
if (g) for (let
|
|
23445
|
-
else for (let
|
|
23443
|
+
static computeShapeHelper(g, y, m, S, T, v, E, A) {
|
|
23444
|
+
if (g) for (let w = 0; w < y.length - 2; w++) m.push(1);
|
|
23445
|
+
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
23446
|
}
|
|
23447
|
-
static adjustPadAndReturnShape(g, y, m, S, T, v,
|
|
23448
|
-
const
|
|
23449
|
-
if (!A || A === "NOTSET") return Math.floor((g + T[v] + T[
|
|
23447
|
+
static adjustPadAndReturnShape(g, y, m, S, T, v, E, A) {
|
|
23448
|
+
const w = m * (S - 1) + 1;
|
|
23449
|
+
if (!A || A === "NOTSET") return Math.floor((g + T[v] + T[E] - w) / y + 1);
|
|
23450
23450
|
switch (A) {
|
|
23451
23451
|
case "VALID":
|
|
23452
|
-
return T[v] = 0, T[
|
|
23452
|
+
return T[v] = 0, T[E] = 0, Math.floor((g - w) / y + 1);
|
|
23453
23453
|
case "SAME_LOWER":
|
|
23454
23454
|
case "SAME_UPPER":
|
|
23455
23455
|
if (m !== 1) throw new Error("Dilation not supported for SAME_UPPER or SAME_LOWER");
|
|
23456
23456
|
{
|
|
23457
23457
|
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[
|
|
23458
|
+
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
23459
|
}
|
|
23460
23460
|
default:
|
|
23461
23461
|
throw new Error("Unsupported AutoPad type");
|
|
@@ -23503,7 +23503,7 @@ ${a}`);
|
|
|
23503
23503
|
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
23504
|
const d = i(1670), _ = u(i(349)), p = i(6361), a = () => !!d.env.wasm.proxy && typeof document < "u";
|
|
23505
23505
|
let t, e, r, o = !1, h = !1, b = !1;
|
|
23506
|
-
const g = [], y = [], m = [], S = [], T = [], v = [],
|
|
23506
|
+
const g = [], y = [], m = [], S = [], T = [], v = [], E = () => {
|
|
23507
23507
|
if (o || !h || b || !t) throw new Error("worker not ready");
|
|
23508
23508
|
}, A = (x) => {
|
|
23509
23509
|
switch (x.data.type) {
|
|
@@ -23531,13 +23531,13 @@ ${a}`);
|
|
|
23531
23531
|
case "end-profiling":
|
|
23532
23532
|
x.data.err ? v.shift()[1](x.data.err) : v.shift()[0]();
|
|
23533
23533
|
}
|
|
23534
|
-
},
|
|
23534
|
+
}, w = typeof document < "u" ? (c = document?.currentScript) === null || c === void 0 ? void 0 : c.src : void 0;
|
|
23535
23535
|
n.initWasm = async () => {
|
|
23536
23536
|
if (a()) {
|
|
23537
23537
|
if (h) return;
|
|
23538
23538
|
if (o) throw new Error("multiple calls to 'initWasm()' detected.");
|
|
23539
23539
|
if (b) throw new Error("previous call to 'initWasm()' failed.");
|
|
23540
|
-
return o = !0, d.env.wasm.wasmPaths === void 0 &&
|
|
23540
|
+
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
23541
|
t?.terminate(), t = i(9710).Z(), t.onmessage = A, e = [x, N];
|
|
23542
23542
|
const D = { type: "init-wasm", in: d.env.wasm };
|
|
23543
23543
|
t.postMessage(D);
|
|
@@ -23545,37 +23545,37 @@ ${a}`);
|
|
|
23545
23545
|
}
|
|
23546
23546
|
return (0, p.initializeWebAssembly)(d.env.wasm);
|
|
23547
23547
|
}, n.initOrt = async (x, N) => {
|
|
23548
|
-
if (a()) return
|
|
23548
|
+
if (a()) return E(), new Promise(((D, M) => {
|
|
23549
23549
|
r = [D, M];
|
|
23550
23550
|
const P = { type: "init-ort", in: { numThreads: x, loggingLevel: N } };
|
|
23551
23551
|
t.postMessage(P);
|
|
23552
23552
|
}));
|
|
23553
23553
|
_.initOrt(x, N);
|
|
23554
|
-
}, n.createSessionAllocate = async (x) => a() ? (
|
|
23554
|
+
}, n.createSessionAllocate = async (x) => a() ? (E(), new Promise(((N, D) => {
|
|
23555
23555
|
g.push([N, D]);
|
|
23556
23556
|
const M = { type: "create_allocate", in: { model: x } };
|
|
23557
23557
|
t.postMessage(M, [x.buffer]);
|
|
23558
|
-
}))) : _.createSessionAllocate(x), n.createSessionFinalize = async (x, N) => a() ? (
|
|
23558
|
+
}))) : _.createSessionAllocate(x), n.createSessionFinalize = async (x, N) => a() ? (E(), new Promise(((D, M) => {
|
|
23559
23559
|
y.push([D, M]);
|
|
23560
23560
|
const P = { type: "create_finalize", in: { modeldata: x, options: N } };
|
|
23561
23561
|
t.postMessage(P);
|
|
23562
|
-
}))) : _.createSessionFinalize(x, N), n.createSession = async (x, N) => a() ? (
|
|
23562
|
+
}))) : _.createSessionFinalize(x, N), n.createSession = async (x, N) => a() ? (E(), new Promise(((D, M) => {
|
|
23563
23563
|
m.push([D, M]);
|
|
23564
23564
|
const P = { type: "create", in: { model: x, options: N } };
|
|
23565
23565
|
t.postMessage(P, [x.buffer]);
|
|
23566
23566
|
}))) : _.createSession(x, N), n.releaseSession = async (x) => {
|
|
23567
|
-
if (a()) return
|
|
23567
|
+
if (a()) return E(), new Promise(((N, D) => {
|
|
23568
23568
|
S.push([N, D]);
|
|
23569
23569
|
const M = { type: "release", in: x };
|
|
23570
23570
|
t.postMessage(M);
|
|
23571
23571
|
}));
|
|
23572
23572
|
_.releaseSession(x);
|
|
23573
|
-
}, n.run = async (x, N, D, M, P) => a() ? (
|
|
23573
|
+
}, n.run = async (x, N, D, M, P) => a() ? (E(), new Promise(((L, B) => {
|
|
23574
23574
|
T.push([L, B]);
|
|
23575
23575
|
const V = { type: "run", in: { sessionId: x, inputIndices: N, inputs: D, outputIndices: M, options: P } };
|
|
23576
23576
|
t.postMessage(V, _.extractTransferableBuffers(D));
|
|
23577
23577
|
}))) : _.run(x, N, D, M, P), n.endProfiling = async (x) => {
|
|
23578
|
-
if (a()) return
|
|
23578
|
+
if (a()) return E(), new Promise(((N, D) => {
|
|
23579
23579
|
v.push([N, D]);
|
|
23580
23580
|
const M = { type: "end-profiling", in: x };
|
|
23581
23581
|
t.postMessage(M);
|
|
@@ -23761,13 +23761,13 @@ ${a}`);
|
|
|
23761
23761
|
r._free(t[0]), r._OrtReleaseSessionOptions(h), b.forEach(r._free);
|
|
23762
23762
|
}
|
|
23763
23763
|
const g = r._OrtGetInputCount(o), y = r._OrtGetOutputCount(o), m = [], S = [], T = [], v = [];
|
|
23764
|
-
for (let
|
|
23765
|
-
const A = r._OrtGetInputName(o,
|
|
23764
|
+
for (let E = 0; E < g; E++) {
|
|
23765
|
+
const A = r._OrtGetInputName(o, E);
|
|
23766
23766
|
if (A === 0) throw new Error("Can't get an input name");
|
|
23767
23767
|
S.push(A), m.push(r.UTF8ToString(A));
|
|
23768
23768
|
}
|
|
23769
|
-
for (let
|
|
23770
|
-
const A = r._OrtGetOutputName(o,
|
|
23769
|
+
for (let E = 0; E < y; E++) {
|
|
23770
|
+
const A = r._OrtGetOutputName(o, E);
|
|
23771
23771
|
if (A === 0) throw new Error("Can't get an output name");
|
|
23772
23772
|
v.push(A), T.push(r.UTF8ToString(A));
|
|
23773
23773
|
}
|
|
@@ -23870,10 +23870,10 @@ ${a}`);
|
|
|
23870
23870
|
const b = (0, u.getInstance)(), g = d.get(t);
|
|
23871
23871
|
if (!g) throw new Error("invalid session id");
|
|
23872
23872
|
const y = g[0], m = g[1], S = g[2], T = e.length, v = o.length;
|
|
23873
|
-
let
|
|
23874
|
-
const
|
|
23873
|
+
let E = 0, A = [];
|
|
23874
|
+
const w = [], x = [];
|
|
23875
23875
|
try {
|
|
23876
|
-
[
|
|
23876
|
+
[E, A] = (0, c.setRunOptions)(h);
|
|
23877
23877
|
for (let B = 0; B < T; B++) {
|
|
23878
23878
|
const V = r[B][0], X = r[B][1], Z = r[B][2];
|
|
23879
23879
|
let q, k;
|
|
@@ -23891,7 +23891,7 @@ ${a}`);
|
|
|
23891
23891
|
X.forEach(((he) => b.HEAP32[F++] = he));
|
|
23892
23892
|
const j = b._OrtCreateTensor(_(V), q, k, O, X.length);
|
|
23893
23893
|
if (j === 0) throw new Error("Can't create a tensor");
|
|
23894
|
-
|
|
23894
|
+
w.push(j);
|
|
23895
23895
|
} finally {
|
|
23896
23896
|
b.stackRestore(I);
|
|
23897
23897
|
}
|
|
@@ -23899,9 +23899,9 @@ ${a}`);
|
|
|
23899
23899
|
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
23900
|
try {
|
|
23901
23901
|
let B = D / 4, V = M / 4, X = P / 4, Z = L / 4;
|
|
23902
|
-
for (let I = 0; I < T; I++) b.HEAPU32[B++] =
|
|
23902
|
+
for (let I = 0; I < T; I++) b.HEAPU32[B++] = w[I], b.HEAPU32[V++] = m[e[I]];
|
|
23903
23903
|
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,
|
|
23904
|
+
let q = b._OrtRun(y, M, D, T, L, v, P, E);
|
|
23905
23905
|
const k = [];
|
|
23906
23906
|
if (q === 0) for (let I = 0; I < v; I++) {
|
|
23907
23907
|
const O = b.HEAPU32[P / 4 + I], F = b.stackSave(), j = b.stackAlloc(16);
|
|
@@ -23914,12 +23914,12 @@ ${a}`);
|
|
|
23914
23914
|
const rt = b.HEAPU32[Q++], ct = b.HEAPU32[Q++], yt = [];
|
|
23915
23915
|
for (let ht = 0; ht < ct; ht++) yt.push(b.HEAPU32[rt / 4 + ht]);
|
|
23916
23916
|
b._OrtFree(rt);
|
|
23917
|
-
const mt = yt.length === 0 ? 1 : yt.reduce(((ht,
|
|
23917
|
+
const mt = yt.length === 0 ? 1 : yt.reduce(((ht, Et) => ht * Et));
|
|
23918
23918
|
if (he = p(Ce), he === "string") {
|
|
23919
23919
|
const ht = [];
|
|
23920
|
-
let
|
|
23920
|
+
let Et = Xe / 4;
|
|
23921
23921
|
for (let Ot = 0; Ot < mt; Ot++) {
|
|
23922
|
-
const Ht = b.HEAPU32[
|
|
23922
|
+
const Ht = b.HEAPU32[Et++], nn = Ot === mt - 1 ? void 0 : b.HEAPU32[Et] - Ht;
|
|
23923
23923
|
ht.push(b.UTF8ToString(Ht, nn));
|
|
23924
23924
|
}
|
|
23925
23925
|
k.push([he, yt, ht]);
|
|
@@ -23937,7 +23937,7 @@ ${a}`);
|
|
|
23937
23937
|
b.stackRestore(N);
|
|
23938
23938
|
}
|
|
23939
23939
|
} finally {
|
|
23940
|
-
|
|
23940
|
+
w.forEach(b._OrtReleaseTensor), x.forEach(b._free), b._OrtReleaseRunOptions(E), A.forEach(b._free);
|
|
23941
23941
|
}
|
|
23942
23942
|
}, n.endProfiling = (t) => {
|
|
23943
23943
|
const e = (0, u.getInstance)(), r = d.get(t);
|
|
@@ -23995,15 +23995,15 @@ ${a}`);
|
|
|
23995
23995
|
} catch {
|
|
23996
23996
|
return !1;
|
|
23997
23997
|
}
|
|
23998
|
-
})(), T = typeof h.wasmPaths == "string" ? h.wasmPaths : void 0, v = o(!1, m),
|
|
23999
|
-
let
|
|
23998
|
+
})(), 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;
|
|
23999
|
+
let w = !1;
|
|
24000
24000
|
const x = [];
|
|
24001
24001
|
if (b > 0 && x.push(new Promise(((N) => {
|
|
24002
24002
|
setTimeout((() => {
|
|
24003
|
-
|
|
24003
|
+
w = !0, N();
|
|
24004
24004
|
}), b);
|
|
24005
24005
|
}))), 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) +
|
|
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) + E : B + L };
|
|
24007
24007
|
if (m) if (typeof Blob > "u") P.mainScriptUrlOrBlob = d.join("/", "ort-wasm-threaded.js");
|
|
24008
24008
|
else {
|
|
24009
24009
|
const L = `var ortWasmThreaded=(function(){var _scriptDir;return ${M.toString()}})();`;
|
|
@@ -24014,7 +24014,7 @@ ${a}`);
|
|
|
24014
24014
|
}), ((L) => {
|
|
24015
24015
|
e = !1, r = !0, D(L);
|
|
24016
24016
|
}));
|
|
24017
|
-
}))), await Promise.race(x),
|
|
24017
|
+
}))), await Promise.race(x), w) throw new Error(`WebAssembly backend initializing failed due to timeout: ${b}ms`);
|
|
24018
24018
|
}, n.getInstance = () => {
|
|
24019
24019
|
if (t && a) return a;
|
|
24020
24020
|
throw new Error("WebAssembly is not initialized yet.");
|
|
@@ -24772,11 +24772,11 @@ function requireRealTimeVad() {
|
|
|
24772
24772
|
}) : S = m.stream;
|
|
24773
24773
|
const T = new AudioContext(), v = new MediaStreamAudioSourceNode(T, {
|
|
24774
24774
|
mediaStream: S
|
|
24775
|
-
}),
|
|
24776
|
-
return
|
|
24775
|
+
}), E = await b.new(T, m);
|
|
24776
|
+
return E.receive(v), new h(m, T, S, E, v);
|
|
24777
24777
|
}
|
|
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 =
|
|
24778
|
+
constructor(y, m, S, T, v, E = !1) {
|
|
24779
|
+
this.options = y, this.audioContext = m, this.stream = S, this.audioNodeVAD = T, this.sourceNode = v, this.listening = E, this.pause = () => {
|
|
24780
24780
|
this.audioNodeVAD.pause(), this.listening = !1;
|
|
24781
24781
|
}, this.start = () => {
|
|
24782
24782
|
this.audioNodeVAD.start(), this.listening = !0;
|
|
@@ -24793,14 +24793,14 @@ function requireRealTimeVad() {
|
|
|
24793
24793
|
...m
|
|
24794
24794
|
};
|
|
24795
24795
|
(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,
|
|
24796
|
+
const T = S.model === "v5" ? e : r, v = S.baseAssetPath + T, E = S.model === "v5" ? p.SileroV5.new : p.SileroLegacy.new;
|
|
24797
24797
|
let A;
|
|
24798
24798
|
try {
|
|
24799
|
-
A = await
|
|
24799
|
+
A = await E(s.ort, () => (0, f.defaultModelFetcher)(v));
|
|
24800
24800
|
} catch (N) {
|
|
24801
24801
|
throw console.error(`Encountered an error while loading model file ${v}`), N;
|
|
24802
24802
|
}
|
|
24803
|
-
const
|
|
24803
|
+
const w = new u.FrameProcessor(A.process, A.reset_state, {
|
|
24804
24804
|
frameSamples: S.frameSamples,
|
|
24805
24805
|
positiveSpeechThreshold: S.positiveSpeechThreshold,
|
|
24806
24806
|
negativeSpeechThreshold: S.negativeSpeechThreshold,
|
|
@@ -24808,7 +24808,7 @@ function requireRealTimeVad() {
|
|
|
24808
24808
|
preSpeechPadFrames: S.preSpeechPadFrames,
|
|
24809
24809
|
minSpeechFrames: S.minSpeechFrames,
|
|
24810
24810
|
submitUserSpeechOnPause: S.submitUserSpeechOnPause
|
|
24811
|
-
}), x = new b(y, S,
|
|
24811
|
+
}), x = new b(y, S, w);
|
|
24812
24812
|
return await x.setupAudioNode(), x;
|
|
24813
24813
|
}
|
|
24814
24814
|
constructor(y, m, S) {
|
|
@@ -24849,13 +24849,13 @@ function requireRealTimeVad() {
|
|
|
24849
24849
|
v.processorOptions = {
|
|
24850
24850
|
...v.processorOptions ?? {},
|
|
24851
24851
|
frameSamples: this.options.frameSamples
|
|
24852
|
-
}, this.audioNode = new AudioWorkletNode(this.ctx, "vad-helper-worklet", v), this.audioNode.port.onmessage = async (
|
|
24853
|
-
switch (
|
|
24852
|
+
}, this.audioNode = new AudioWorkletNode(this.ctx, "vad-helper-worklet", v), this.audioNode.port.onmessage = async (E) => {
|
|
24853
|
+
switch (E.data?.message) {
|
|
24854
24854
|
case _.Message.AudioFrame:
|
|
24855
|
-
let A =
|
|
24856
|
-
A instanceof ArrayBuffer || (A = new ArrayBuffer(
|
|
24857
|
-
const
|
|
24858
|
-
await this.processFrame(
|
|
24855
|
+
let A = E.data.data;
|
|
24856
|
+
A instanceof ArrayBuffer || (A = new ArrayBuffer(E.data.data.byteLength), new Uint8Array(A).set(new Uint8Array(E.data.data)));
|
|
24857
|
+
const w = new Float32Array(A);
|
|
24858
|
+
await this.processFrame(w);
|
|
24859
24859
|
break;
|
|
24860
24860
|
}
|
|
24861
24861
|
};
|
|
@@ -24878,8 +24878,8 @@ function requireRealTimeVad() {
|
|
|
24878
24878
|
const v = T.inputBuffer.getChannelData(0);
|
|
24879
24879
|
if (T.outputBuffer.getChannelData(0).fill(0), this.resampler) {
|
|
24880
24880
|
const A = this.resampler.process(v);
|
|
24881
|
-
for (const
|
|
24882
|
-
await this.processFrame(
|
|
24881
|
+
for (const w of A)
|
|
24882
|
+
await this.processFrame(w);
|
|
24883
24883
|
}
|
|
24884
24884
|
} catch (v) {
|
|
24885
24885
|
console.error("Error processing audio:", v);
|
|
@@ -30171,27 +30171,28 @@ const initialiseTransaction = async (s) => {
|
|
|
30171
30171
|
};
|
|
30172
30172
|
}
|
|
30173
30173
|
}, getTransactionHistory = async ({
|
|
30174
|
-
txn_count: s
|
|
30174
|
+
txn_count: s,
|
|
30175
|
+
oid: n
|
|
30175
30176
|
}) => {
|
|
30176
30177
|
try {
|
|
30177
|
-
const
|
|
30178
|
-
|
|
30179
|
-
const
|
|
30178
|
+
const i = new Headers();
|
|
30179
|
+
i.append("Content-Type", "application/json");
|
|
30180
|
+
const c = {
|
|
30180
30181
|
method: "GET",
|
|
30181
|
-
headers:
|
|
30182
|
-
},
|
|
30183
|
-
`${GET_EKA_VOICE_HOST_V2()}/transaction/history?count=${s}`,
|
|
30184
|
-
|
|
30182
|
+
headers: i
|
|
30183
|
+
}, l = await fetchWrapper(
|
|
30184
|
+
`${GET_EKA_VOICE_HOST_V2()}/transaction/history?count=${s}${n ? `&oid=${n}` : ""}`,
|
|
30185
|
+
c
|
|
30185
30186
|
);
|
|
30186
30187
|
return {
|
|
30187
|
-
data: (await
|
|
30188
|
-
status_code:
|
|
30188
|
+
data: (await l.json()).data,
|
|
30189
|
+
status_code: l.status,
|
|
30189
30190
|
message: `Past ${s} transactions fetched successfully.`
|
|
30190
30191
|
};
|
|
30191
|
-
} catch (
|
|
30192
|
+
} catch (i) {
|
|
30192
30193
|
return {
|
|
30193
30194
|
status_code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
30194
|
-
message: `Something went wrong in fetching transactions. ${
|
|
30195
|
+
message: `Something went wrong in fetching transactions. ${i}`
|
|
30195
30196
|
};
|
|
30196
30197
|
}
|
|
30197
30198
|
}, deleteTransaction = async ({
|
|
@@ -31560,28 +31561,30 @@ async function getV1SessionSuggestedMedications(s) {
|
|
|
31560
31561
|
}
|
|
31561
31562
|
async function postV1Document({
|
|
31562
31563
|
session_id: s,
|
|
31563
|
-
document_name: n
|
|
31564
|
+
document_name: n,
|
|
31565
|
+
type: i
|
|
31564
31566
|
}) {
|
|
31565
31567
|
try {
|
|
31566
|
-
const
|
|
31567
|
-
|
|
31568
|
-
const
|
|
31568
|
+
const c = new Headers();
|
|
31569
|
+
c.append("Content-Type", "application/json");
|
|
31570
|
+
const f = {
|
|
31569
31571
|
method: "POST",
|
|
31570
|
-
headers:
|
|
31572
|
+
headers: c,
|
|
31571
31573
|
body: JSON.stringify({
|
|
31572
31574
|
session_id: s,
|
|
31573
|
-
document_name: n
|
|
31575
|
+
document_name: n,
|
|
31576
|
+
type: i
|
|
31574
31577
|
})
|
|
31575
|
-
},
|
|
31576
|
-
let
|
|
31577
|
-
return
|
|
31578
|
-
...
|
|
31579
|
-
code:
|
|
31580
|
-
},
|
|
31581
|
-
} catch (
|
|
31582
|
-
return console.error("%c postV1Document -> error", "color:#f5ce50",
|
|
31578
|
+
}, u = await fetchWrapper(`${GET_EKA_VOICE_HOST_V1()}/documents`, f);
|
|
31579
|
+
let d = await u.json();
|
|
31580
|
+
return d = {
|
|
31581
|
+
...d,
|
|
31582
|
+
code: u.status
|
|
31583
|
+
}, d;
|
|
31584
|
+
} catch (c) {
|
|
31585
|
+
return console.error("%c postV1Document -> error", "color:#f5ce50", c), {
|
|
31583
31586
|
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31584
|
-
message: `Something went wrong! ${
|
|
31587
|
+
message: `Something went wrong! ${c}`
|
|
31585
31588
|
};
|
|
31586
31589
|
}
|
|
31587
31590
|
}
|
|
@@ -31618,7 +31621,56 @@ const REQUEST_TIMEOUT_MS = 1e4, fetchChunkTranscript = async (s, n) => {
|
|
|
31618
31621
|
} catch {
|
|
31619
31622
|
return { success: !1, error: "network_error" };
|
|
31620
31623
|
}
|
|
31621
|
-
}
|
|
31624
|
+
};
|
|
31625
|
+
async function patchSessionContext(s, n) {
|
|
31626
|
+
try {
|
|
31627
|
+
const i = new Headers();
|
|
31628
|
+
i.append("Content-Type", "application/json");
|
|
31629
|
+
const c = {
|
|
31630
|
+
method: "PATCH",
|
|
31631
|
+
headers: i,
|
|
31632
|
+
body: JSON.stringify({ context: n })
|
|
31633
|
+
}, l = await fetchWrapper(
|
|
31634
|
+
`${GET_EKA_VOICE_HOST_V1()}/sessions/${s}/context`,
|
|
31635
|
+
c
|
|
31636
|
+
);
|
|
31637
|
+
let f = await l.json();
|
|
31638
|
+
return f = {
|
|
31639
|
+
...f,
|
|
31640
|
+
code: l.status
|
|
31641
|
+
}, f;
|
|
31642
|
+
} catch (i) {
|
|
31643
|
+
return console.error("%c patchSessionContext -> error", "color:#f5ce50", i), {
|
|
31644
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31645
|
+
message: `Something went wrong! ${i}`
|
|
31646
|
+
};
|
|
31647
|
+
}
|
|
31648
|
+
}
|
|
31649
|
+
async function deleteSessionContext(s, n) {
|
|
31650
|
+
try {
|
|
31651
|
+
const i = new Headers();
|
|
31652
|
+
i.append("Content-Type", "application/json");
|
|
31653
|
+
const c = {
|
|
31654
|
+
method: "DELETE",
|
|
31655
|
+
headers: i,
|
|
31656
|
+
body: JSON.stringify({ context: n })
|
|
31657
|
+
}, l = await fetchWrapper(
|
|
31658
|
+
`${GET_EKA_VOICE_HOST_V1()}/sessions/${s}/context`,
|
|
31659
|
+
c
|
|
31660
|
+
);
|
|
31661
|
+
let f = await l.json();
|
|
31662
|
+
return f = {
|
|
31663
|
+
...f,
|
|
31664
|
+
code: l.status
|
|
31665
|
+
}, f;
|
|
31666
|
+
} catch (i) {
|
|
31667
|
+
return console.error("%c deleteSessionContext -> error", "color:#f5ce50", i), {
|
|
31668
|
+
code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31669
|
+
message: `Something went wrong! ${i}`
|
|
31670
|
+
};
|
|
31671
|
+
}
|
|
31672
|
+
}
|
|
31673
|
+
const _n = class _n {
|
|
31622
31674
|
// SystemCompatibilityManager Instance
|
|
31623
31675
|
// Private constructor to prevent direct instantiation
|
|
31624
31676
|
constructor() {
|
|
@@ -31831,15 +31883,16 @@ const REQUEST_TIMEOUT_MS = 1e4, fetchChunkTranscript = async (s, n) => {
|
|
|
31831
31883
|
async pollSessionOutput(n) {
|
|
31832
31884
|
return await pollOutputSummary(n);
|
|
31833
31885
|
}
|
|
31834
|
-
async getSessionHistory({ txn_count: n }) {
|
|
31886
|
+
async getSessionHistory({ txn_count: n, oid: i }) {
|
|
31835
31887
|
try {
|
|
31836
31888
|
return await getTransactionHistory({
|
|
31837
|
-
txn_count: n
|
|
31889
|
+
txn_count: n,
|
|
31890
|
+
oid: i
|
|
31838
31891
|
});
|
|
31839
|
-
} catch (
|
|
31892
|
+
} catch (c) {
|
|
31840
31893
|
return {
|
|
31841
31894
|
status_code: SDK_STATUS_CODE.INTERNAL_SERVER_ERROR,
|
|
31842
|
-
message: `Failed to fetch previous transactions, ${
|
|
31895
|
+
message: `Failed to fetch previous transactions, ${c}`
|
|
31843
31896
|
};
|
|
31844
31897
|
}
|
|
31845
31898
|
}
|
|
@@ -31985,6 +32038,12 @@ const REQUEST_TIMEOUT_MS = 1e4, fetchChunkTranscript = async (s, n) => {
|
|
|
31985
32038
|
async getChunkTranscript(n, i) {
|
|
31986
32039
|
return fetchChunkTranscript(n, i);
|
|
31987
32040
|
}
|
|
32041
|
+
async addSessionContext({ txn_id: n, context: i }) {
|
|
32042
|
+
return await patchSessionContext(n, i);
|
|
32043
|
+
}
|
|
32044
|
+
async removeSessionContext({ txn_id: n, context: i }) {
|
|
32045
|
+
return await deleteSessionContext(n, i);
|
|
32046
|
+
}
|
|
31988
32047
|
};
|
|
31989
32048
|
_n.instance = null;
|
|
31990
32049
|
let EkaScribe = _n;
|