conformtools 0.6.6 → 0.6.7
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/README.md +15 -10
- package/dist/{account-HDXVTS5T.js → account-DJTD3KYK.js} +1 -1
- package/dist/{bridge-D5KPIUSY.js → bridge-JQF4V3V2.js} +1 -1
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/chunk-2BPR6LK6.js +3 -0
- package/dist/{chunk-VS3MKKJ5.js → chunk-3D3Z4TBR.js} +1 -1
- package/dist/{chunk-OJWIBQK4.js → chunk-55BKURYP.js} +167 -165
- package/dist/chunk-5WEZRGXG.js +39 -0
- package/dist/{chunk-P7OVDUA5.js → chunk-6V4OEOOX.js} +1 -1
- package/dist/{chunk-6ML26TIK.js → chunk-A7FNR3T5.js} +1 -1
- package/dist/chunk-AMRJXYL4.js +3 -0
- package/dist/{chunk-5SUGU2YR.js → chunk-D4WPRRBT.js} +1 -1
- package/dist/{chunk-UKKRZ574.js → chunk-EUBXH67N.js} +2 -2
- package/dist/{chunk-AS7IXHYM.js → chunk-GK4YYKJ6.js} +1 -1
- package/dist/{chunk-LFJLRLEP.js → chunk-GM6QKY7W.js} +1 -1
- package/dist/{chunk-HGDO3OED.js → chunk-J2JXLEAI.js} +1 -1
- package/dist/{chunk-5RSNFPED.js → chunk-NAFLOZER.js} +6 -5
- package/dist/{chunk-5JBUCVRI.js → chunk-P2LL3JMC.js} +1 -1
- package/dist/{chunk-3OCQA33E.js → chunk-PHAMF4JF.js} +2 -1
- package/dist/chunk-RGMTLNMF.js +3 -0
- package/dist/chunk-RJ6JA2LZ.js +3 -0
- package/dist/{chunk-RFIPLBQ4.js → chunk-S5JDS5PQ.js} +1 -1
- package/dist/{chunk-X53BNWNV.js → chunk-SGLQY53R.js} +1 -1
- package/dist/{chunk-EJGVNQ3E.js → chunk-SKFMOLUO.js} +1 -1
- package/dist/{chunk-SZD4C5MB.js → chunk-SNTAZJ5A.js} +1 -1
- package/dist/{chunk-3XD6NC4G.js → chunk-VIBEEWPC.js} +1 -1
- package/dist/{chunk-NQHQKEP5.js → chunk-WN53ARHJ.js} +1 -1
- package/dist/{chunk-OVUCL3YY.js → chunk-XLEINKFL.js} +1 -1
- package/dist/cli.js +3 -3
- package/dist/conformtools-analyze +0 -0
- package/dist/conformtools-decode +0 -0
- package/dist/{cr3-wasm-L2LFY3LM.js → cr3-wasm-HLJWEV2S.js} +1 -1
- package/dist/{dng-wasm-U6NC3MDK.js → dng-wasm-CQDLPM5V.js} +1 -1
- package/dist/{dpx-wasm-RMKEUKED.js → dpx-wasm-TLGMM7BO.js} +1 -1
- package/dist/{exr-wasm-LBAOMOZD.js → exr-wasm-2NPKPTVB.js} +1 -1
- package/dist/framing-SWOD4CWB.js +3 -0
- package/dist/gfx-worker.js +1 -1
- package/dist/{h264-3ESGVT6G.js → h264-JJMZSUWW.js} +1 -1
- package/dist/{h264-mxf-NPFS7NGH.js → h264-mxf-DCUOGLDU.js} +1 -1
- package/dist/{host-relink-D6CB2VOQ.js → host-relink-TWAF6WIG.js} +1 -1
- package/dist/hosts-Z666EF7V.js +3 -0
- package/dist/http.js +2 -2
- package/dist/{inspect-7ASUPU73.js → inspect-FJKYPEXL.js} +15 -15
- package/dist/{isobmff-SIOE67WL.js → isobmff-VJOWP4MH.js} +1 -1
- package/dist/mc-video-5MGGOQN4.js +3 -0
- package/dist/mcp.js +1 -1
- package/dist/{media-7AUNRKHF.js → media-NZYVREUF.js} +1 -1
- package/dist/media_core-YZ3PABEG.js +9 -0
- package/dist/{mxf-74TTDICM.js → mxf-FJSRFLJC.js} +1 -1
- package/dist/{ops-FSOOBXMV.js → ops-X7NAREC4.js} +1 -1
- package/dist/premiere-uxp/lib/probe.js +212 -1
- package/dist/{r3d-ZDJ3WURS.js → r3d-CXUNG6VS.js} +1 -1
- package/dist/{r3d-YTLOMC7C.js → r3d-T5O6IIZZ.js} +1 -1
- package/dist/{source-BDJAUQVR.js → source-QGWWLMME.js} +1 -1
- package/dist/still-P4JJNTEO.js +3 -0
- package/dist/still-wasm-DN5LPASS.js +3 -0
- package/dist/{store-ZHXLQCGN.js → store-7IOEBOZY.js} +1 -1
- package/dist/{tiff-wasm-D2FJ3L56.js → tiff-wasm-BPRDR6EB.js} +1 -1
- package/dist/{timeline-6DYFDVEH.js → timeline-DQG6TVPF.js} +1 -1
- package/dist/wasm/media_core_bg.wasm +0 -0
- package/dist/wasm-threads/media_core_bg.wasm +0 -0
- package/dist/{wav-OWMUGQMM.js → wav-64SC6P7U.js} +1 -1
- package/package.json +1 -1
- package/dist/chunk-7MC7M2Y5.js +0 -3
- package/dist/chunk-BL6L5ZBP.js +0 -39
- package/dist/chunk-C5IX63YF.js +0 -3
- package/dist/chunk-UCMNH6Q6.js +0 -3
- package/dist/chunk-XNR7M4VX.js +0 -3
- package/dist/framing-SRCJKAYO.js +0 -3
- package/dist/hosts-W4AD2MYH.js +0 -3
- package/dist/media_core-Q2PIEV7D.js +0 -9
- package/dist/still-ZG2RUQAL.js +0 -3
|
@@ -5,6 +5,217 @@
|
|
|
5
5
|
const { P, g, activeProject } = require("./ctx");
|
|
6
6
|
|
|
7
7
|
const verbs = {
|
|
8
|
+
// Premiere's OWN re-save of a project file: open `path`, saveAs `out`, close it. The title law rig
|
|
9
|
+
// (oracle/titles) writes a text document in the JSON form and reads back the binary form Premiere
|
|
10
|
+
// converts it to, so every binary field is placed by Premiere itself. The project open before stays
|
|
11
|
+
// open and untouched.
|
|
12
|
+
// A .mogrt placed by Premiere itself (SequenceEditor.insertMogrtFromPath) into a NEW scratch project, saved to
|
|
13
|
+
// `out`: the graphic as Premiere instantiates it, which is the form an artist's project carries.
|
|
14
|
+
"debug.mogrt_resave": async ({ mogrts, out }) => {
|
|
15
|
+
const ppro = P.api();
|
|
16
|
+
const proj = await ppro.Project.createProject(String(out));
|
|
17
|
+
if (!proj) throw new Error(`createProject(${out}) returned nothing`);
|
|
18
|
+
const seq = await proj.createSequence("titles");
|
|
19
|
+
const editor = await ppro.SequenceEditor.getEditor(seq);
|
|
20
|
+
const placed = [];
|
|
21
|
+
let t = 0;
|
|
22
|
+
for (const m of mogrts || []) {
|
|
23
|
+
try {
|
|
24
|
+
const at = ppro.TickTime.createWithSeconds(t);
|
|
25
|
+
let items;
|
|
26
|
+
proj.lockedAccess(() => { items = editor.insertMogrtFromPath(String(m), at, 0, 0); });
|
|
27
|
+
placed.push({ mogrt: String(m), ok: !!items, n: items && items.length });
|
|
28
|
+
} catch (e) { placed.push({ mogrt: String(m), err: String(e.message || e) }); }
|
|
29
|
+
t += 30;
|
|
30
|
+
await new Promise((r) => setTimeout(r, 300));
|
|
31
|
+
}
|
|
32
|
+
let count = 0;
|
|
33
|
+
for (let i = 0; i < (await seq.getVideoTrackCount()); i += 1) count += ((await (await seq.getVideoTrack(i)).getTrackItems(1, false)) || []).length;
|
|
34
|
+
const ok = await proj.save();
|
|
35
|
+
const closed = await proj.close();
|
|
36
|
+
return { saved: ok !== false, closed: closed !== false, placed, track_items: count };
|
|
37
|
+
},
|
|
38
|
+
// Premiere's OWN import of interchange files (FCP7 XML, AAF, EDL…) into a NEW scratch project saved to `out`:
|
|
39
|
+
// the sequence as Premiere builds it, which our .prproj reader then reads (e.g. how it sets a clip's source
|
|
40
|
+
// in-point from an XML <in> on a different-rate file). The project open before is untouched. Needs ONLINE media:
|
|
41
|
+
// with the media offline Premiere 26.5.2 never returns from importFiles (2026-10-27).
|
|
42
|
+
"debug.import_save": async ({ files, out }) => {
|
|
43
|
+
const ppro = P.api();
|
|
44
|
+
const proj = await ppro.Project.createProject(String(out));
|
|
45
|
+
if (!proj) throw new Error(`createProject(${out}) returned nothing`);
|
|
46
|
+
const root = await proj.getRootItem();
|
|
47
|
+
const ok = await proj.importFiles((files || []).map(String), true, root, false);
|
|
48
|
+
const seqs = ((await proj.getSequences()) || []).map((s) => s.name);
|
|
49
|
+
const saved = await proj.save();
|
|
50
|
+
const closed = await proj.close();
|
|
51
|
+
return { imported: ok !== false, sequences: seqs, saved: saved !== false, closed: closed !== false };
|
|
52
|
+
},
|
|
53
|
+
// Every component and param of every track item of a project file (display / match names, value at 0), read-only:
|
|
54
|
+
// where a setting lives before a rig authors it.
|
|
55
|
+
"debug.params_dump": async ({ path }) => {
|
|
56
|
+
const ppro = P.api();
|
|
57
|
+
const proj = await ppro.Project.open(String(path));
|
|
58
|
+
if (!proj) throw new Error(`Project.open(${path}) returned nothing`);
|
|
59
|
+
const out = [];
|
|
60
|
+
try {
|
|
61
|
+
for (const seq of (await proj.getSequences()) || []) {
|
|
62
|
+
const nv = await seq.getVideoTrackCount();
|
|
63
|
+
for (let t = 0; t < nv; t += 1) {
|
|
64
|
+
const track = await seq.getVideoTrack(t);
|
|
65
|
+
for (const it of (await track.getTrackItems(1, false)) || []) {
|
|
66
|
+
const item = { name: await it.getName(), members: P.members(it), components: [] };
|
|
67
|
+
const chain = await it.getComponentChain();
|
|
68
|
+
const n = await chain.getComponentCount();
|
|
69
|
+
for (let i = 0; i < n; i += 1) {
|
|
70
|
+
const c = await chain.getComponentAtIndex(i);
|
|
71
|
+
const comp = { display: await c.getDisplayName(), match: await c.getMatchName(), params: [] };
|
|
72
|
+
const pn = await c.getParamCount();
|
|
73
|
+
for (let j = 0; j < pn; j += 1) {
|
|
74
|
+
const prm = await c.getParam(j);
|
|
75
|
+
let v = null;
|
|
76
|
+
try { const k = await prm.getStartValue(); v = k && k.value !== undefined ? String(k.value).slice(0, 120) : String(k).slice(0, 120); } catch (e) { v = "ERR " + (e.message || e); }
|
|
77
|
+
comp.params.push({ name: prm.displayName, v });
|
|
78
|
+
}
|
|
79
|
+
item.components.push(comp);
|
|
80
|
+
}
|
|
81
|
+
out.push(item);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
} finally {
|
|
86
|
+
await proj.close();
|
|
87
|
+
}
|
|
88
|
+
return out;
|
|
89
|
+
},
|
|
90
|
+
// Premiere's own render of a project file: open `path`, export its sequence (the one named `sequence`, else
|
|
91
|
+
// the first) with the .epr `preset` to `out` (EXPORT_IMMEDIATELY: returns when the file is written), close it.
|
|
92
|
+
// The title law rig renders a PNG-with-alpha sequence of its cells this way.
|
|
93
|
+
"debug.project_render": async ({ path, out, preset, sequence }) => {
|
|
94
|
+
const ppro = P.api();
|
|
95
|
+
const proj = await ppro.Project.open(String(path));
|
|
96
|
+
if (!proj) throw new Error(`Project.open(${path}) returned nothing`);
|
|
97
|
+
try {
|
|
98
|
+
const seqs = (await proj.getSequences()) || [];
|
|
99
|
+
const seq = seqs.find((s) => s.name === sequence) || seqs[0];
|
|
100
|
+
if (!seq) throw new Error("no sequence in the project");
|
|
101
|
+
const EM = ppro.EncoderManager;
|
|
102
|
+
const m = await EM.getManager();
|
|
103
|
+
const ok = await m.exportSequence(seq, EM.EXPORT_IMMEDIATELY, String(out), String(preset));
|
|
104
|
+
return { ok: ok !== false, sequence: seq.name };
|
|
105
|
+
} finally {
|
|
106
|
+
await proj.close();
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"debug.project_resave": async ({ path, out }) => {
|
|
110
|
+
const ppro = P.api();
|
|
111
|
+
const proj = await ppro.Project.open(String(path));
|
|
112
|
+
if (!proj) throw new Error(`Project.open(${path}) returned nothing`);
|
|
113
|
+
// Premiere keeps a text document in the form it was read until the graphic is changed: set every Source Text
|
|
114
|
+
// back to its own value so it re-encodes, as an artist's edit does.
|
|
115
|
+
const touched = [];
|
|
116
|
+
for (const seq of (await proj.getSequences()) || []) {
|
|
117
|
+
const nv = await seq.getVideoTrackCount();
|
|
118
|
+
for (let t = 0; t < nv; t += 1) {
|
|
119
|
+
const track = await seq.getVideoTrack(t);
|
|
120
|
+
for (const it of (await track.getTrackItems(1, false)) || []) {
|
|
121
|
+
const chain = await it.getComponentChain();
|
|
122
|
+
const n = await chain.getComponentCount();
|
|
123
|
+
for (let i = 0; i < n; i += 1) {
|
|
124
|
+
const c = await chain.getComponentAtIndex(i);
|
|
125
|
+
const pn = await c.getParamCount();
|
|
126
|
+
for (let j = 0; j < pn; j += 1) {
|
|
127
|
+
const prm = await c.getParam(j);
|
|
128
|
+
if (prm.displayName !== "Source Text") continue;
|
|
129
|
+
const kf = await prm.getStartValue();
|
|
130
|
+
const row = { name: await it.getName(), members: P.members(prm), kf: kf === null ? "null" : typeof kf, kfv: kf && kf.value !== undefined ? String(kf.value).slice(0, 300) : null };
|
|
131
|
+
try { row.varying = await prm.isTimeVarying(); } catch (e) { row.varying = "ERR " + e.message; }
|
|
132
|
+
try { const vt = await prm.getValueAtTime(P.api().TickTime.createWithTicks("0")); row.at0 = vt === null ? "null" : String(vt && vt.value !== undefined ? vt.value : vt).slice(0, 300); } catch (e) { row.at0 = "ERR " + e.message; }
|
|
133
|
+
try {
|
|
134
|
+
const v = kf.value;
|
|
135
|
+
const key = prm.createKeyframe(v);
|
|
136
|
+
proj.lockedAccess(() => proj.executeTransaction((ca) => ca.addAction(prm.createSetValueAction(key, true)), "resave"));
|
|
137
|
+
row.set = "ok";
|
|
138
|
+
} catch (e) { row.set = "ERR " + (e.message || e); }
|
|
139
|
+
touched.push(row);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
const ok = await proj.saveAs(String(out));
|
|
146
|
+
const closed = await proj.close();
|
|
147
|
+
return { saved: ok !== false, closed: closed !== false, out: String(out), touched };
|
|
148
|
+
},
|
|
149
|
+
// Premiere authors the keyframes: open `path`, and on each track item named in `keys` give the param
|
|
150
|
+
// (`component` display/match name, `param` display name) Premiere's own keyframes — `keys: [[seconds, value]]`,
|
|
151
|
+
// value a number, [x, y] (PointF), a boolean or a string (Source Text JSON) — with interpolation `interp`
|
|
152
|
+
// (KeyframeInterpolationMode name, e.g. "LINEAR", "HOLD", "BEZIER"); then save as `out`. The title rig diffs the
|
|
153
|
+
// saved file to place how Premiere stores an animated text layer.
|
|
154
|
+
"debug.keyframe_resave": async ({ path, out, keys }) => {
|
|
155
|
+
const ppro = P.api();
|
|
156
|
+
const proj = await ppro.Project.open(String(path));
|
|
157
|
+
if (!proj) throw new Error(`Project.open(${path}) returned nothing`);
|
|
158
|
+
const report = [];
|
|
159
|
+
const items = [];
|
|
160
|
+
for (const seq of (await proj.getSequences()) || []) {
|
|
161
|
+
for (let t = 0; t < (await seq.getVideoTrackCount()); t += 1) {
|
|
162
|
+
for (const it of (await (await seq.getVideoTrack(t)).getTrackItems(1, false)) || []) items.push(it);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
for (const k of keys || []) {
|
|
166
|
+
const row = { ...k, keys: undefined };
|
|
167
|
+
try {
|
|
168
|
+
let it = null;
|
|
169
|
+
for (const x of items) if ((await x.getName()) === k.item) it = x;
|
|
170
|
+
if (!it) throw new Error(`no track item ${k.item}`);
|
|
171
|
+
const t0 = Number((await it.getInPoint()).seconds || 0);
|
|
172
|
+
const start = Number((await it.getStartTime()).seconds || 0);
|
|
173
|
+
const chain = await it.getComponentChain();
|
|
174
|
+
let prm = null;
|
|
175
|
+
for (let i = 0; i < (await chain.getComponentCount()) && !prm; i += 1) {
|
|
176
|
+
const c = await chain.getComponentAtIndex(i);
|
|
177
|
+
const names = [await c.getDisplayName(), await c.getMatchName()];
|
|
178
|
+
if (k.component && !names.includes(k.component)) continue;
|
|
179
|
+
for (let j = 0; j < (await c.getParamCount()); j += 1) {
|
|
180
|
+
const p = await c.getParam(j);
|
|
181
|
+
if (p.displayName === k.param) { prm = p; break; }
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
if (!prm) throw new Error(`no param ${k.component}/${k.param}`);
|
|
185
|
+
const val = (v) => (Array.isArray(v) ? new ppro.PointF(v[0], v[1]) : v);
|
|
186
|
+
const mode = ppro.Constants && ppro.Constants.InterpolationMode
|
|
187
|
+
? ppro.Constants.InterpolationMode[k.interp || "LINEAR"] : undefined;
|
|
188
|
+
row.mode = mode;
|
|
189
|
+
let err = null;
|
|
190
|
+
proj.lockedAccess(() => {
|
|
191
|
+
try {
|
|
192
|
+
proj.executeTransaction((ca) => {
|
|
193
|
+
ca.addAction(prm.createSetTimeVaryingAction(true));
|
|
194
|
+
for (const [s, v] of k.keys) {
|
|
195
|
+
const key = prm.createKeyframe(val(v));
|
|
196
|
+
// a track item's param time is clip time: the item's in point plus the offset into the item
|
|
197
|
+
key.position = ppro.TickTime.createWithSeconds(t0 + Number(s));
|
|
198
|
+
ca.addAction(prm.createAddKeyframeAction(key));
|
|
199
|
+
}
|
|
200
|
+
}, "keys");
|
|
201
|
+
if (mode !== undefined) {
|
|
202
|
+
proj.executeTransaction((ca) => {
|
|
203
|
+
for (const [s] of k.keys) ca.addAction(prm.createSetInterpolationAtKeyframeAction(ppro.TickTime.createWithSeconds(t0 + Number(s)), mode, false));
|
|
204
|
+
}, "interp");
|
|
205
|
+
}
|
|
206
|
+
} catch (e) { err = e; }
|
|
207
|
+
});
|
|
208
|
+
if (err) throw err;
|
|
209
|
+
row.ok = true;
|
|
210
|
+
row.start = start;
|
|
211
|
+
row.in = t0;
|
|
212
|
+
} catch (e) { row.err = String(e.message || e); }
|
|
213
|
+
report.push(row);
|
|
214
|
+
}
|
|
215
|
+
const ok = await proj.saveAs(String(out));
|
|
216
|
+
await proj.close();
|
|
217
|
+
return { saved: ok !== false, out: String(out), report };
|
|
218
|
+
},
|
|
8
219
|
// Which add / commit / lock arrangement lands a sequence marker on THIS Premiere (26.5.2 answered "Requires
|
|
9
220
|
// locked access" with the action made inside lockedAccess). Each variant adds one marker at its own frame
|
|
10
221
|
// (`frame` + i), reports the step that threw, then every marker it landed is removed again.
|
|
@@ -170,7 +381,7 @@ const verbs = {
|
|
|
170
381
|
"debug.probe": async () => {
|
|
171
382
|
const ppro = P.api();
|
|
172
383
|
const out = { host_version: P.hostVersion(), platform: P.platform(), top: Object.keys(ppro).sort(), classes: {}, constants: {} };
|
|
173
|
-
for (const k of ["Project", "Sequence", "VideoTrack", "VideoClipTrackItem", "TrackItem", "Markers", "Marker", "Metadata", "ClipProjectItem", "FolderItem", "ProjectItem", "ComponentChain", "Component", "ComponentParam", "Keyframe", "TickTime", "SequenceEditor", "EncoderManager", "ProjectConverter", "VideoFilterFactory", "PointF", "Media"]) {
|
|
384
|
+
for (const k of ["TextSegments", "Properties", "Component", "VideoComponentChain", "VideoFilterFactory", "Utils", "Project", "Sequence", "VideoTrack", "VideoClipTrackItem", "TrackItem", "Markers", "Marker", "Metadata", "ClipProjectItem", "FolderItem", "ProjectItem", "ComponentChain", "Component", "ComponentParam", "Keyframe", "TickTime", "SequenceEditor", "EncoderManager", "ProjectConverter", "VideoFilterFactory", "PointF", "Media"]) {
|
|
174
385
|
if (ppro[k]) out.classes[k] = { static: P.members(ppro[k]).filter((n) => !["length", "name", "prototype"].includes(n)), proto: ppro[k].prototype ? P.members(ppro[k].prototype) : [] };
|
|
175
386
|
}
|
|
176
387
|
if (ppro.Constants) for (const k of Object.keys(ppro.Constants)) { try { out.constants[k] = ppro.Constants[k]; } catch (_) { /* skip */ } }
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a as e1}from"./chunk-7D7H6VFW.js";import{Ga as r1,xa as n1}from"./chunk-C5IX63YF.js";import"./chunk-PSANHDZM.js";var t1=new Uint32Array([327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,458759,458759,458759,458759,458759,458759,458759,458759,524296,524296,524296,524296,589839,589839,655376,655377,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,458764,458764,458764,458764,458764,458764,458764,458764,458766,458766,458766,458766,458766,458766,458766,458766,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154]),a1=new Uint32Array([393223,393224,327686,327686,262149,262149,262149,262149,196609,196609,196609,196609,196609,196609,196609,196609,262146,262146,262146,262146,262147,262147,262147,262147,196612,196612,196612,196612,196612,196612,196612,196612,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536]),i1=new Uint32Array([131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,196610,196610,196610,196610,196610,196610,196610,196610,196611,196611,196611,196611,196611,196611,196611,196611,196612,196612,196612,196612,196612,196612,196612,196612,262149,262149,262149,262149,262150,262150,262150,262150,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073]),u1=new Uint32Array([0,1,5,6,14,15,27,28,44,45,65,66,90,91,119,120,2,4,7,13,16,26,29,43,46,64,67,89,92,118,121,150,3,8,12,17,25,30,42,47,63,68,88,93,117,122,149,151,9,11,18,24,31,41,48,62,69,87,94,116,123,148,152,177,10,19,23,32,40,49,61,70,86,95,115,124,147,153,176,178,20,22,33,39,50,60,71,85,96,114,125,146,154,175,179,200,21,34,38,51,59,72,84,97,113,126,145,155,174,180,199,201,35,37,52,58,73,83,98,112,127,144,156,173,181,198,202,219,36,53,57,74,82,99,111,128,143,157,172,182,197,203,218,220,54,56,75,81,100,110,129,142,158,171,183,196,204,217,221,234,55,76,80,101,109,130,141,159,170,184,195,205,216,222,233,235,77,79,102,108,131,140,160,169,185,194,206,215,223,232,236,245,78,103,107,132,139,161,168,186,193,207,214,224,231,237,244,246,104,106,133,138,162,167,187,192,208,213,225,230,238,243,247,252,105,134,137,163,166,188,191,209,212,226,229,239,242,248,251,253,135,136,164,165,189,190,210,211,227,228,240,241,249,250,254,255]),z=new Int32Array([2048,2882,2841,2772,2676,2554,2408,2239,2048,1837,1609,1365,1108,841,565,284,2048,2772,2408,1837,1108,284,-565,-1365,-2048,-2554,-2841,-2882,-2676,-2239,-1609,-841,2048,2554,1609,284,-1108,-2239,-2841,-2772,-2048,-841,565,1837,2676,2882,2408,1365,2048,2239,565,-1365,-2676,-2772,-1609,284,2048,2882,2408,841,-1108,-2554,-2841,-1837,2048,1837,-565,-2554,-2676,-841,1609,2882,2048,-284,-2408,-2772,-1108,1365,2841,2239,2048,1365,-1609,-2882,-1108,1837,2841,841,-2048,-2772,-565,2239,2676,284,-2408,-2554,2048,841,-2408,-2239,1108,2882,565,-2554,-2048,1365,2841,284,-2676,-1837,1609,2772,2048,284,-2841,-841,2676,1365,-2408,-1837,2048,2239,-1609,-2554,1108,2772,-565,-2882,2048,-284,-2841,841,2676,-1365,-2408,1837,2048,-2239,-1609,2554,1108,-2772,-565,2882,2048,-841,-2408,2239,1108,-2882,565,2554,-2048,-1365,2841,-284,-2676,1837,1609,-2772,2048,-1365,-1609,2882,-1108,-1837,2841,-841,-2048,2772,-565,-2239,2676,-284,-2408,2554,2048,-1837,-565,2554,-2676,841,1609,-2882,2048,284,-2408,2772,-1108,-1365,2841,-2239,2048,-2239,565,1365,-2676,2772,-1609,-284,2048,-2882,2408,-841,-1108,2554,-2841,1837,2048,-2554,1609,-284,-1108,2239,-2841,2772,-2048,841,565,-1837,2676,-2882,2408,-1365,2048,-2772,2408,-1837,1108,-284,-565,1365,-2048,2554,-2841,2882,-2676,2239,-1609,841,2048,-2882,2841,-2772,2676,-2554,2408,-2239,2048,-1837,1609,-1365,1108,-841,565,-284]),s1={m16:931135616,lg_a:1098061119,lg_b:1125906863,lg_c:1046850094,lg_pa:1008981770,gc_k:1064554302,gc_p:1101529087,gc_t:1028443341,sd_eps:953267991,inv273:997199617,rr_c13:956301440,rr_c16:931135616,rr_c18:914358400,bil_sg:973078528,bil_srb:975874731,sobel_sc:931135616,bil_t7_0:1032826803,bil_t7_1:1040595071,bil_t7_2:1044597305,bil_t7_3:1046301409,bil_t7_4:1044597305,bil_t7_5:1040595071,bil_t7_6:1032826803,bil_t9_0:1031861895,bil_t9_1:1035879338,bil_t9_2:1039871874,bil_t9_3:1041522383,bil_t9_4:1042077871,bil_t9_5:1041522383,bil_t9_6:1039871874,bil_t9_7:1035879338,bil_t9_8:1031861895,gauss55_00:1065353216,gauss55_01:1082130432,gauss55_02:1088421888,gauss55_03:1082130432,gauss55_04:1065353216,gauss55_10:1082130432,gauss55_11:1098907648,gauss55_12:1104150528,gauss55_13:1098907648,gauss55_14:1082130432,gauss55_20:1088421888,gauss55_21:1104150528,gauss55_22:1109655552,gauss55_23:1104150528,gauss55_24:1088421888,gauss55_30:1082130432,gauss55_31:1098907648,gauss55_32:1104150528,gauss55_33:1098907648,gauss55_34:1082130432,gauss55_40:1065353216,gauss55_41:1082130432,gauss55_42:1088421888,gauss55_43:1082130432,gauss55_44:1065353216};function E(n,r){return(n[r]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3])>>>0}function w(n,r){return n[r]<<8|n[r+1]}function q(n){let r=Math.min(n.length,65536),e=-1;for(let u=16;u+6<=r;u+=2){if(w(n,u)!==259)continue;let g=w(n,u+2),p=w(n,u+4);if(g<256||g>8192||p<128||p>8192)continue;let y=u-16;if(E(n,y+4)!==0||E(n,y+8)!==0)continue;let P=E(n,y);if(!(P<65536||y+P>n.length+8192)){e=y;break}}if(e<0)throw new Error("RED codestream container not found");let i=e,t=i+12,a=[];for(let u=0;u<8;u++)a.push(w(n,t+4+2*u));let o=i+28;if(o+512>n.length)throw new Error("R3D container table truncated");let b=a[1],m=a[2],f=i+540,v=v1(n,f,a[4],b);if(b%2!==0)throw new Error(`odd R3D canvas width ${b}`);return{canvasW:b,canvasH:m,rawFields:a,table512:n.subarray(o,o+512),streamOff:f,segments:v}}function v1(n,r,e,i){let t=Math.ceil(i/128),a=r;for(;(w(n,a)&4095)<256;)if(a+=2,a+2>n.length)throw new Error("R3D segment stream truncated");a+=1;let o=a,b=n[a-1],m=[];for(let f=0;f<e;f++){if(o+8>n.length)throw new Error("R3D segment header past essence end");let v=[w(n,o),w(n,o+2),w(n,o+4),w(n,o+6)],u=v.map(h=>h+7>>3),g=o+8,p=u[0]+u[1]+u[2]+u[3];if(g+p>n.length)throw new Error("R3D segment body past essence end");let y=g,P=v.map((h,x)=>{let C={off:y,bitLength:h,byteLength:u[x]};return y+=u[x],C});m.push({x:f%t*128,y:Math.floor(f/t)*16,quant:b,subbands:P}),b=n[g+p]??0,o=g+p+1}return m}function o1(n){let r=new Uint32Array(n.segments.length*4*8),e=0;for(let i of n.segments)for(let t=0;t<4;t++){let a=i.subbands[t];r[e]=a.off,r[e+1]=a.bitLength,r[e+2]=a.byteLength,r[e+3]=i.x,r[e+4]=i.y,r[e+5]=i.quant,r[e+6]=t,r[e+7]=0,e+=8}return r}function k(n){return x1[0]=n>>>0,h1[0]}var c1=new ArrayBuffer(4),x1=new Uint32Array(c1),h1=new Float32Array(c1),w1=1112556626;function B1(n){if(n.length<140)return null;let r=new DataView(n.buffer,n.byteOffset,n.byteLength);if(r.getUint32(0,!0)!==w1||r.getUint32(4,!0)!==1)return null;let e=r.getUint32(8,!0),i=12,t=[];for(let f=0;f<4;f++,i+=4)t.push(r.getUint32(i,!0));let a=[];for(let f=0;f<26;f++,i+=4)a.push(r.getUint32(i,!0));let o=r.getUint32(i,!0);i+=4;let b=r.getUint32(i,!0);if(i+=4,i+b>n.length)return null;let m=new TextDecoder().decode(n.subarray(i,i+b));return{wbBits:t,smatrixBits:a,exposureBits:o,fixFlashers:(e&2)!==0,model:m}}async function M(n){try{return await r1(),B1(n1(n??new Uint8Array(0)))}catch{return null}}var l1=`// R3D KOMODO entropy decode (kernel 1 of 2). One invocation per (segment, subband) job.
|
|
3
|
+
import{a as e1}from"./chunk-7D7H6VFW.js";import{Ha as r1,xa as n1}from"./chunk-RJ6JA2LZ.js";import"./chunk-PSANHDZM.js";var t1=new Uint32Array([327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,327683,458759,458759,458759,458759,458759,458759,458759,458759,524296,524296,524296,524296,589839,589839,655376,655377,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,393227,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262148,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,262146,458764,458764,458764,458764,458764,458764,458764,458764,458766,458766,458766,458766,458766,458766,458766,458766,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,393229,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,327686,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,131081,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,196609,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262149,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154,262154]),a1=new Uint32Array([393223,393224,327686,327686,262149,262149,262149,262149,196609,196609,196609,196609,196609,196609,196609,196609,262146,262146,262146,262146,262147,262147,262147,262147,196612,196612,196612,196612,196612,196612,196612,196612,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536,65536]),i1=new Uint32Array([131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,131072,196610,196610,196610,196610,196610,196610,196610,196610,196611,196611,196611,196611,196611,196611,196611,196611,196612,196612,196612,196612,196612,196612,196612,196612,262149,262149,262149,262149,262150,262150,262150,262150,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073,131073]),u1=new Uint32Array([0,1,5,6,14,15,27,28,44,45,65,66,90,91,119,120,2,4,7,13,16,26,29,43,46,64,67,89,92,118,121,150,3,8,12,17,25,30,42,47,63,68,88,93,117,122,149,151,9,11,18,24,31,41,48,62,69,87,94,116,123,148,152,177,10,19,23,32,40,49,61,70,86,95,115,124,147,153,176,178,20,22,33,39,50,60,71,85,96,114,125,146,154,175,179,200,21,34,38,51,59,72,84,97,113,126,145,155,174,180,199,201,35,37,52,58,73,83,98,112,127,144,156,173,181,198,202,219,36,53,57,74,82,99,111,128,143,157,172,182,197,203,218,220,54,56,75,81,100,110,129,142,158,171,183,196,204,217,221,234,55,76,80,101,109,130,141,159,170,184,195,205,216,222,233,235,77,79,102,108,131,140,160,169,185,194,206,215,223,232,236,245,78,103,107,132,139,161,168,186,193,207,214,224,231,237,244,246,104,106,133,138,162,167,187,192,208,213,225,230,238,243,247,252,105,134,137,163,166,188,191,209,212,226,229,239,242,248,251,253,135,136,164,165,189,190,210,211,227,228,240,241,249,250,254,255]),z=new Int32Array([2048,2882,2841,2772,2676,2554,2408,2239,2048,1837,1609,1365,1108,841,565,284,2048,2772,2408,1837,1108,284,-565,-1365,-2048,-2554,-2841,-2882,-2676,-2239,-1609,-841,2048,2554,1609,284,-1108,-2239,-2841,-2772,-2048,-841,565,1837,2676,2882,2408,1365,2048,2239,565,-1365,-2676,-2772,-1609,284,2048,2882,2408,841,-1108,-2554,-2841,-1837,2048,1837,-565,-2554,-2676,-841,1609,2882,2048,-284,-2408,-2772,-1108,1365,2841,2239,2048,1365,-1609,-2882,-1108,1837,2841,841,-2048,-2772,-565,2239,2676,284,-2408,-2554,2048,841,-2408,-2239,1108,2882,565,-2554,-2048,1365,2841,284,-2676,-1837,1609,2772,2048,284,-2841,-841,2676,1365,-2408,-1837,2048,2239,-1609,-2554,1108,2772,-565,-2882,2048,-284,-2841,841,2676,-1365,-2408,1837,2048,-2239,-1609,2554,1108,-2772,-565,2882,2048,-841,-2408,2239,1108,-2882,565,2554,-2048,-1365,2841,-284,-2676,1837,1609,-2772,2048,-1365,-1609,2882,-1108,-1837,2841,-841,-2048,2772,-565,-2239,2676,-284,-2408,2554,2048,-1837,-565,2554,-2676,841,1609,-2882,2048,284,-2408,2772,-1108,-1365,2841,-2239,2048,-2239,565,1365,-2676,2772,-1609,-284,2048,-2882,2408,-841,-1108,2554,-2841,1837,2048,-2554,1609,-284,-1108,2239,-2841,2772,-2048,841,565,-1837,2676,-2882,2408,-1365,2048,-2772,2408,-1837,1108,-284,-565,1365,-2048,2554,-2841,2882,-2676,2239,-1609,841,2048,-2882,2841,-2772,2676,-2554,2408,-2239,2048,-1837,1609,-1365,1108,-841,565,-284]),s1={m16:931135616,lg_a:1098061119,lg_b:1125906863,lg_c:1046850094,lg_pa:1008981770,gc_k:1064554302,gc_p:1101529087,gc_t:1028443341,sd_eps:953267991,inv273:997199617,rr_c13:956301440,rr_c16:931135616,rr_c18:914358400,bil_sg:973078528,bil_srb:975874731,sobel_sc:931135616,bil_t7_0:1032826803,bil_t7_1:1040595071,bil_t7_2:1044597305,bil_t7_3:1046301409,bil_t7_4:1044597305,bil_t7_5:1040595071,bil_t7_6:1032826803,bil_t9_0:1031861895,bil_t9_1:1035879338,bil_t9_2:1039871874,bil_t9_3:1041522383,bil_t9_4:1042077871,bil_t9_5:1041522383,bil_t9_6:1039871874,bil_t9_7:1035879338,bil_t9_8:1031861895,gauss55_00:1065353216,gauss55_01:1082130432,gauss55_02:1088421888,gauss55_03:1082130432,gauss55_04:1065353216,gauss55_10:1082130432,gauss55_11:1098907648,gauss55_12:1104150528,gauss55_13:1098907648,gauss55_14:1082130432,gauss55_20:1088421888,gauss55_21:1104150528,gauss55_22:1109655552,gauss55_23:1104150528,gauss55_24:1088421888,gauss55_30:1082130432,gauss55_31:1098907648,gauss55_32:1104150528,gauss55_33:1098907648,gauss55_34:1082130432,gauss55_40:1065353216,gauss55_41:1082130432,gauss55_42:1088421888,gauss55_43:1082130432,gauss55_44:1065353216};function E(n,r){return(n[r]<<24|n[r+1]<<16|n[r+2]<<8|n[r+3])>>>0}function w(n,r){return n[r]<<8|n[r+1]}function q(n){let r=Math.min(n.length,65536),e=-1;for(let u=16;u+6<=r;u+=2){if(w(n,u)!==259)continue;let g=w(n,u+2),p=w(n,u+4);if(g<256||g>8192||p<128||p>8192)continue;let y=u-16;if(E(n,y+4)!==0||E(n,y+8)!==0)continue;let P=E(n,y);if(!(P<65536||y+P>n.length+8192)){e=y;break}}if(e<0)throw new Error("RED codestream container not found");let i=e,t=i+12,a=[];for(let u=0;u<8;u++)a.push(w(n,t+4+2*u));let o=i+28;if(o+512>n.length)throw new Error("R3D container table truncated");let b=a[1],m=a[2],f=i+540,v=v1(n,f,a[4],b);if(b%2!==0)throw new Error(`odd R3D canvas width ${b}`);return{canvasW:b,canvasH:m,rawFields:a,table512:n.subarray(o,o+512),streamOff:f,segments:v}}function v1(n,r,e,i){let t=Math.ceil(i/128),a=r;for(;(w(n,a)&4095)<256;)if(a+=2,a+2>n.length)throw new Error("R3D segment stream truncated");a+=1;let o=a,b=n[a-1],m=[];for(let f=0;f<e;f++){if(o+8>n.length)throw new Error("R3D segment header past essence end");let v=[w(n,o),w(n,o+2),w(n,o+4),w(n,o+6)],u=v.map(h=>h+7>>3),g=o+8,p=u[0]+u[1]+u[2]+u[3];if(g+p>n.length)throw new Error("R3D segment body past essence end");let y=g,P=v.map((h,x)=>{let C={off:y,bitLength:h,byteLength:u[x]};return y+=u[x],C});m.push({x:f%t*128,y:Math.floor(f/t)*16,quant:b,subbands:P}),b=n[g+p]??0,o=g+p+1}return m}function o1(n){let r=new Uint32Array(n.segments.length*4*8),e=0;for(let i of n.segments)for(let t=0;t<4;t++){let a=i.subbands[t];r[e]=a.off,r[e+1]=a.bitLength,r[e+2]=a.byteLength,r[e+3]=i.x,r[e+4]=i.y,r[e+5]=i.quant,r[e+6]=t,r[e+7]=0,e+=8}return r}function k(n){return x1[0]=n>>>0,h1[0]}var c1=new ArrayBuffer(4),x1=new Uint32Array(c1),h1=new Float32Array(c1),w1=1112556626;function B1(n){if(n.length<140)return null;let r=new DataView(n.buffer,n.byteOffset,n.byteLength);if(r.getUint32(0,!0)!==w1||r.getUint32(4,!0)!==1)return null;let e=r.getUint32(8,!0),i=12,t=[];for(let f=0;f<4;f++,i+=4)t.push(r.getUint32(i,!0));let a=[];for(let f=0;f<26;f++,i+=4)a.push(r.getUint32(i,!0));let o=r.getUint32(i,!0);i+=4;let b=r.getUint32(i,!0);if(i+=4,i+b>n.length)return null;let m=new TextDecoder().decode(n.subarray(i,i+b));return{wbBits:t,smatrixBits:a,exposureBits:o,fixFlashers:(e&2)!==0,model:m}}async function M(n){try{return await r1(),B1(n1(n??new Uint8Array(0)))}catch{return null}}var l1=`// R3D KOMODO entropy decode (kernel 1 of 2). One invocation per (segment, subband) job.
|
|
4
4
|
// Faithful port of decode_subband_raw in rust/media-core/src/r3d/entropy.rs.
|
|
5
5
|
// Writes RAW coefficients (scan order) straight into coeff[job*2048 ..] \u2014 the buffer must be
|
|
6
6
|
// zero-initialized; only nonzero decoded positions are written (deterministic across reruns).
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{c as l}from"./chunk-
|
|
3
|
+
import{c as l}from"./chunk-2BPR6LK6.js";import{Aa as F,G as _,Ga as O,H as S,Ha as f,I as P,ia as b,ja as R,wa as w,za as v}from"./chunk-RJ6JA2LZ.js";import"./chunk-PSANHDZM.js";var g=class{constructor(e=[]){this.ranges=[];for(let[r,n]of e)this.add(r,n)}add(e,r){if(r<=e)return;let n=[],[s,o]=[e,r];for(let[i,a]of this.ranges)a<s||i>o?n.push([i,a]):(s=Math.min(s,i),o=Math.max(o,a));n.push([s,o]),n.sort((i,a)=>i[0]-a[0]),this.ranges=n}has(e,r){return r<=e?!0:this.ranges.some(([n,s])=>n<=e&&s>=r)}missing(e,r){if(r<=e)return[];let n=[],s=e;for(let[o,i]of this.ranges)if(!(i<=s)&&(o>=r||(o>s&&n.push([s,Math.min(o,r)]),s=Math.max(s,i),s>=r)))break;return s<r&&n.push([s,r]),n}count(){return this.ranges.reduce((e,[r,n])=>e+(n-r),0)}toJSON(){return this.ranges.map(([e,r])=>[e,r])}};function U(t,e){let r=new g;for(let n of t){if(n.kind!=="clip"||!n.source_range)continue;let s=n.source_range.start.value,o=n.source_range.duration.value,i=Math.max(0,Math.max(0,Math.floor(s))-e),a=Math.floor(s+o)+e;a>i&&r.add(i,a)}return r.toJSON()}function J(t,e,r){let n=U(e,r),s=a=>n.some(([c,u])=>a>=c&&a<u),o=new Map,i=a=>{let c=o.get(a);return c||(c={part:a,structuralRanges:[],essenceRanges:[]},o.set(a,c)),c};for(let a of t.segments){let c=a.part??0;a.kind==="structural"?i(c).structuralRanges.push({offset:a.offset,length:a.length}):(a.kind==="frame"||a.kind==="gop")&&a.frame_in!=null&&s(a.frame_in)&&i(c).essenceRanges.push({offset:a.offset,length:a.length})}return[...o.values()].sort((a,c)=>a.part-c.part)}async function A(t,e){if(!O)return null;try{let n=await(await import("./r3d-CXUNG6VS.js")).decodeR3dRgbaGpu(t,e);return n?{width:n.width,height:n.height,rgba:n.rgba}:null}catch{return null}}function p(t){return(e,r,n)=>t.parts[e].read(r,n)}function d(t){return JSON.stringify(t.parts.map(e=>({name:e.filename,size:e.fileSize})))}function L(t,e){let r=[];for(let n of t){if(n.kind!=="clip"||!n.source_range)continue;let s=n.source_range.start.value,o=n.source_range.duration.value;r.push({frame_in:Math.max(0,Math.floor(s)),frame_out:Math.floor(s+o),handles:e})}return JSON.stringify(r)}var k=16,h=new WeakMap,D=new WeakMap;function x(t){let e=D.get(t);return e||(e=t.parts[0].read(0,Math.min(16*1024,t.parts[0].fileSize)),D.set(t,e)),e}async function N(t){let e=h.get(t);return e||(await f(),e=JSON.parse(await b(p(t),d(t))),h.set(t,e)),e}async function G(t){await f();let e=await b(p(t),d(t));return h.set(t,JSON.parse(e)),e}function B(t,e){h.set(t,JSON.parse(e))}async function C(t,e){let r=JSON.parse(await R(p(t),d(t)));return{v:1,container:"r3d",codec:"redcode",frame_count:e.frame_count,granularity:"frame",...t.parts.length>1?{part_names:t.parts.map(n=>n.filename.split(/[/\\]/).pop()??n.filename)}:{},segments:r}}var V={async inspect(t){await f();let e=await w(p(t),d(t)),r=JSON.parse(e);if(!r||r.frame_count===0)return null;let n=t.parts[0],s=r.timecode??null,o=s&&s.fps_denominator>0?s.fps_numerator/s.fps_denominator:null,i=r.width??null,a=r.height??null;return{id:n.filename,kind:"external",target_url:n.filename,available_range:o&&r.frame_count?{start:{value:0,rate:o},duration:{value:r.frame_count,rate:o}}:null,reel_name:r.reel??null,source_timecode:s?.display??null,source_fps:o,source_resolution_w:i,source_resolution_h:a,container:"r3d",codec:"redcode",size_bytes:r.file_size,streams:[{kind:"video",codec:"redcode",width:i??void 0,height:a??void 0,rate:o??void 0,bit_depth:k,codec_specific:{fourcc:r.codec_fourcc??"REDCODE"}}],decode_provenance:r.decode_provenance??null,vendor_metadata:{frame_count:r.frame_count,...s?{drop_frame:s.drop_frame}:{}},binding_state:"unbound",raw_extraction:{r3d_probe:r},metadata:{}}},async extract(t){await f();let e=JSON.parse(await w(p(t),d(t)));return!e||e.frame_count===0?null:C(t,e)},async sparsify(t,e){await f();let r=JSON.parse(await R(p(t),d(t))),n={v:1,container:"r3d",codec:"redcode",frame_count:r.filter(o=>o.kind==="frame").length,granularity:"frame",segments:r},s=new Map;for(let o of r)o.kind==="frame"&&s.set(o.part??0,(s.get(o.part??0)??0)+1);return J(n,e.items,e.handles).map(o=>({filename:t.parts[o.part].filename,fileSize:t.parts[o.part].fileSize,structuralRanges:o.structuralRanges,essenceRanges:o.essenceRanges,frameCount:s.get(o.part)??0,keptFrames:o.essenceRanges.length}))},async trim(t,e){await f();let r=t.parts.some(a=>a.dataRanges!==void 0),n=r?JSON.stringify(t.parts.map(a=>a.dataRanges??[])):"[]",s=r?"[]":L(e.items,e.handles),o=await F(p(t),d(t),s,n);return JSON.parse(o).parts.map(a=>a.trim_plan)},async decode(t,e,r){await f();let n=await N(t);if(e<0||e>=n.length)throw new l(e,n.length);let s=n[e],o=s.part??0,i=t.parts[o];if(!i)throw new l(e,n.length);let a=await i.read(s.essenceOffset,s.essenceLength),c=2,u=await x(t),m;if(r.detail==="coarse")m=_(a,u,0);else if(v(a))m=_(a,u,c);else{let y=await A(a,u);if(y)return y;m=P(a,u)}let M=new DataView(m.buffer,m.byteOffset,8);return{width:M.getUint32(0,!0),height:M.getUint32(4,!0),rgba:m.slice(8)}},async decode16(t,e){await f();let r=await N(t);if(e<0||e>=r.length)throw new l(e,r.length);let n=r[e],s=t.parts[n.part??0];if(!s)throw new l(e,r.length);let o=await s.read(n.essenceOffset,n.essenceLength),i=S(o),a=new DataView(i.buffer,i.byteOffset,8),c=a.getUint32(0,!0),u=a.getUint32(4,!0),m=i.slice(8);return{width:c,height:u,rgb16:new Uint16Array(m.buffer,m.byteOffset,c*u*3)}}};export{G as listR3dFramesJson,V as r3dFormat,B as seedR3dFramesJson};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a,b,c,d,e,f}from"./chunk-
|
|
3
|
+
import{a,b,c,d,e,f}from"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-PSANHDZM.js";export{c as formatForFile,b as partFromByteSource,a as partFromFile,d as sourceFromFile,e as sourceFromFiles,f as sourceFromParts};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{a as l,f as o,g as m}from"./chunk-JV7TZDKJ.js";import{a as s}from"./chunk-RGMTLNMF.js";import"./chunk-PSANHDZM.js";var h=e=>{let t=e.split(/[/\\]/).pop()??"",i=t.lastIndexOf(".");return i>0?t.slice(i+1).toLowerCase():""};async function f(e,t){try{if(e==="dpx"){let r=await(await import("./dpx-wasm-TLGMM7BO.js")).inspectDpxWasm(t);return r?{width:r.width,height:r.height}:null}if(e==="exr"){let r=await(await import("./exr-wasm-2NPKPTVB.js")).inspectExrWasm(t);return r?{width:r.width,height:r.height}:null}if(e==="dng"){let r=await(await import("./dng-wasm-CQDLPM5V.js")).inspectDngWasm(t);return r?{width:r.width,height:r.height}:null}if(e==="cr3"){let r=await(await import("./cr3-wasm-HLJWEV2S.js")).inspectCr3Wasm(t);return r?{width:r.width,height:r.height}:null}if(e==="tif"||e==="tiff"){let r=await(await import("./tiff-wasm-BPRDR6EB.js")).inspectTiffWasm(t);return r?{width:r.width,height:r.height}:null}let i=await import("./still-wasm-DN5LPASS.js"),n=await i.inspectPhotoRawWasm(e,t);if(n)return{width:n.width,height:n.height};let a=await i.decodeStillWasm(e,t);return a?{width:a.width,height:a.height}:null}catch{}return null}async function p(e){if(typeof createImageBitmap!="function"||typeof Blob>"u")return null;try{let t=await createImageBitmap(new Blob([e])),i={width:t.width,height:t.height};return t.close?.(),i.width>0&&i.height>0?i:null}catch{return null}}async function c(e){let t=h(e.filename),i=await m(t,o(e));if(i)return i;let n=s(t);if(n===null||n==="none")return null;let a;try{a=await e.read(0,e.fileSize)}catch{return null}return n==="wasm-decoder"?await f(t,a):await p(a)}function u(e){let t=l(e);return t==="jpg"?"jpeg":t==="tif"?"tiff":t||"still"}var R={async inspect(e){let t=e.parts[0],i=await c(t);return{id:t.filename,kind:"external",content_kind:"still",target_url:t.filename,available_range:null,reel_name:null,source_timecode:null,container:l(t.filename)||"still",codec:u(t.filename),size_bytes:t.fileSize,bitrate_bps:null,source_resolution_w:i?.width??null,source_resolution_h:i?.height??null,source_pixel_aspect:i?1:null,streams:[],vendor_metadata:{},binding_state:"unbound",raw_extraction:{},metadata:{}}},async extract(e){let t=e.parts.map((i,n)=>({kind:"frame",part:n,offset:0,length:i.fileSize,frame_in:n,frame_out:n}));return t.length===0?null:{v:1,container:l(e.parts[0].filename)||"still",codec:u(e.parts[0].filename),frame_count:t.length,granularity:"frame",segments:t,...e.parts.length>1?{part_names:e.parts.map(i=>i.filename)}:{}}},async sparsify(){throw new Error("stillFormat.sparsify: stills ship whole \u2014 no sparse plan exists")},async trim(){throw new Error("stillFormat.trim: stills ship whole \u2014 no trim plan exists")}};export{R as stillFormat};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
+
import{a as s}from"./chunk-DKGGJM6Z.js";import{Fa as i,Ha as a}from"./chunk-RJ6JA2LZ.js";import"./chunk-PSANHDZM.js";var u={dpx:"dpx",tif:"tiff",tiff:"tiff",exr:"exr",j2c:"j2k",j2k:"j2k",jp2:"j2k",jph:"j2k",dng:"dng",cr3:"cr3",cr2:"cr2",arw:"arw",psd:"psd",tga:"tga",heic:"heic",heif:"heic",png:"png",jpg:"jpeg",jpeg:"jpeg",gif:"gif",bmp:"bmp",webp:"webp"};function l(e){return Object.prototype.hasOwnProperty.call(u,(e??"").toLowerCase())}var d=e=>{let n=i[e];return typeof n=="function"?n:void 0};async function g(e,n){let r=e.toLowerCase();if(r!=="arw"&&r!=="cr2")return null;await a();let t=i[`inspect_${r}`];if(typeof t!="function")return null;let o=t(n);return o==="null"?null:JSON.parse(o)}async function m(e,n,r=1){let t=u[e.toLowerCase()];if(!t)return null;await a();try{let o=r>1?d(`decode_${t}_preview`):void 0;if(o)return s(o(n,r));let c=d(`decode_${t}_rgba`);return c?s(c(n)):null}catch{return null}}export{u as STILL_WASM_BASE,m as decodeStillWasm,l as hasStillWasm,g as inspectPhotoRawWasm};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{A as a,B as b,C as c,D as d,E as e,F as f}from"./chunk-
|
|
3
|
+
import{A as a,B as b,C as c,D as d,E as e,F as f}from"./chunk-SKFMOLUO.js";import"./chunk-NAFLOZER.js";import"./chunk-PHAMF4JF.js";import"./chunk-PLRB2YXJ.js";import"./chunk-PSANHDZM.js";export{a as createSession,f as getExtra,b as getSession,d as listSessions,e as saveExtra,c as updateSession};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a,b,c}from"./chunk-
|
|
3
|
+
import{a,b,c}from"./chunk-SGLQY53R.js";import"./chunk-DKGGJM6Z.js";import"./chunk-RJ6JA2LZ.js";import"./chunk-PSANHDZM.js";export{c as decodeTiffPreviewWasm,b as decodeTiffWasm,a as inspectTiffWasm};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{$ as p,M as a,N as b,O as c,P as d,Q as e,R as f,S as g,T as h,U as i,V as j,W as k,X as l,Y as m,Z as n,_ as o,aa as q,ba as r}from"./chunk-
|
|
3
|
+
import{$ as p,M as a,N as b,O as c,P as d,Q as e,R as f,S as g,T as h,U as i,V as j,W as k,X as l,Y as m,Z as n,_ as o,aa as q,ba as r}from"./chunk-5WEZRGXG.js";import"./chunk-PFISREY4.js";import"./chunk-JV7TZDKJ.js";import"./chunk-VIBEEWPC.js";import"./chunk-PFZVET7S.js";import"./chunk-6V4OEOOX.js";import"./chunk-RGMTLNMF.js";import"./chunk-D4WPRRBT.js";import"./chunk-WN53ARHJ.js";import"./chunk-A7FNR3T5.js";import"./chunk-J2JXLEAI.js";import"./chunk-SGLQY53R.js";import"./chunk-DKGGJM6Z.js";import"./chunk-AMRJXYL4.js";import"./chunk-3D3Z4TBR.js";import"./chunk-2BPR6LK6.js";import"./chunk-NU3X7P4N.js";import"./chunk-RJ6JA2LZ.js";import"./chunk-NAFLOZER.js";import"./chunk-PHAMF4JF.js";import"./chunk-PLRB2YXJ.js";import"./chunk-C2ESM27Z.js";import"./chunk-PSANHDZM.js";export{i as OPERATION_KINDS,a as READ_FORMATS,j as applyOperation,k as applyOperationWithSources,q as consolidate,g as countFlags,b as detectFormat,r as judge,p as linkText,e as listClips,h as listFlags,f as listMedia,c as readTimeline,l as resolveTarget,o as routesText,d as summarize,n as writeDestination,m as writeTimeline};
|
|
Binary file
|
|
Binary file
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{a as b}from"./chunk-AACY2V3L.js";import{
|
|
3
|
+
import{a as b}from"./chunk-AACY2V3L.js";import{Ha as u,aa as _,ka as f,ra as d,ua as g}from"./chunk-RJ6JA2LZ.js";import"./chunk-PSANHDZM.js";function p(s){return(r,t)=>s.read(r,t)}function S(s){let r=[];for(let t of s)t.kind!=="clip"||!t.source_range||r.push({start_frame:t.source_range.start.value,dur_frames:t.source_range.duration.value,fps:t.source_range.start.rate??1});return r}var w={async inspect(s){await u();let r=s.parts[0],t=await _(p(r),r.fileSize),e=JSON.parse(t);if(!e||!e.sample_rate)return null;let a=e.byte_rate>0?e.data_length/e.byte_rate:null,m=a?Math.round(a*e.sample_rate):0,n=[{kind:"audio",codec:"pcm",rate:e.sample_rate,channels:e.channels,bit_depth:e.bits_per_sample,codec_specific:{bits_per_sample:e.bits_per_sample}}];return{id:r.filename,kind:"external",content_kind:"audio",target_url:r.filename,available_range:a?{start:{value:0,rate:e.sample_rate},duration:{value:m,rate:e.sample_rate}}:null,reel_name:null,source_timecode:e.source_timecode??null,container:"wav",codec:"pcm",size_bytes:r.fileSize,bitrate_bps:e.byte_rate*8,streams:n,vendor_metadata:e.bext?{bext:e.bext}:{},binding_state:"unbound",raw_extraction:{wav_meta:e},metadata:{}}},async extract(s){await u();let r=s.parts[0],t=JSON.parse(await f(p(r),r.fileSize));return t.length===0?null:{v:1,container:"wav",codec:"pcm",frame_count:b(t),granularity:"second",segments:t}},async sparsify(s,r){await u();let t=s.parts[0],e=await g(p(t),t.fileSize,JSON.stringify(S(r.items)),r.handles),a=JSON.parse(e);return[{filename:t.filename,fileSize:a.fileSize,structuralRanges:a.structuralRanges,essenceRanges:a.essenceRanges,trimInputs:a.trimInputs}]},async trim(s,r){await u();let t=s.parts[0],e=[];for(let n of r.items){if(n.kind!=="clip"||!n.source_range)continue;let i=n.source_range.start.rate??1,o=Math.max(0,(n.source_range.start.value-r.handles)/i),c=(n.source_range.start.value+n.source_range.duration.value+r.handles)/i;c>o&&e.push([o,c])}if(e.length===0)throw new Error("wav trim: no usable trim ranges in items");e.sort((n,i)=>n[0]-i[0]);let a=[];for(let[n,i]of e){let o=a[a.length-1];o&&n<=o[1]?o[1]=Math.max(o[1],i):a.push([n,i])}let m=[];for(let[n,[i,o]]of a.entries()){let c=await d(p(t),t.fileSize,i,o,1),l=JSON.parse(c);a.length>1&&(l.output_clip_number=n+1,l.output_clip_count=a.length,l.output_part_number=1),m.push(l)}return m}};export{w as wavFormat};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conformtools",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.7",
|
|
4
4
|
"description": "conform.tools on your machine: timeline exchange, relink, media trim, delivery and auto conform, as MCP tools for Claude and other AI apps, a CLI and a local HTTP API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
package/dist/chunk-7MC7M2Y5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
|
|
3
|
-
import{Ba as l,Ga as d}from"./chunk-C5IX63YF.js";var u=[{codec:"prores",label:"Apple ProRes",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview tier is DC-only 1/8 COLOR (2026-08-05 \u2014 was gray luma; Y+Cb+Cr DC walks, no AC/IDCT) \u2014 the realtime tier for BOTH playback and scrub: full 4K XQ decode is ~170ms/frame + a 35MB RGBA hand-off, which can hold neither 24fps nor a smooth scrub; the parked frame upgrades to full via the standard 160ms park timer (scrubPreview flipped true 2026-08-05 with the colour preview \u2014 the old 'full decode is scrub-fast' held for 2K 422, not 4K XQ). Both wrappers: .mov (sample table) and MXF OP1a (RDD 44, 2026-07-28 \u2014 is_prores_mxf routes the identical icpf bitstream through the walker via decode_prores_mxf; Suite ap4h fixture gated byte-exact vs ffmpeg 10-bit, rust tests/prores_mxf_gate.rs)"},{codec:"prores_raw",label:"Apple ProRes RAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview tier is a TRUE DC-only Bayer decode: the DC-DPCM segment is a strict prefix of each tile component's bitstream, so the preview reads just those prefixes (no AC walk, no IDCT), lands the exact closed-form value the full IDCT produces, and runs the SAME develop on the 1/8 grid (tier_parity gate). Decode = Apple's own reconstruction (RE'd from AppleProResRAWCodec.bundle 2026-10-22): bit-exact vs VideoToolbox's software decode on iPhone 17 Pro / Sony a7S III / Panasonic; the ffmpeg 8.0 byte-exact path remains as decode_bayer. Develop = the ProRes RAW SDK as DaVinci Resolve runs it (kernels transcribed from its Metal AIR, parameters RE'd from Resolve and captured live): noise-gated edge-directed demosaic, mired-interpolated per-CCT WB + forward matrix from the moov (iPhone; header colour otherwise), Apple Log / Apple Wide Gamut output matching a Resolve 21 render to f32 rounding (97.9% of 10-bit codes identical end to end; the rest is Resolve's hardware-decode LSB noise). Viewer tiers render ACEScct log (2026-07-26 \u2014 no baked Rec.709/sRGB; the transcode-grade log form); decode_prores_raw_tier takes the clip's container colour."},{codec:"h264",label:"H.264 / AVC",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"scrub = nearest-keyframe snap (1 decode); exact frame on park"},{codec:"hevc",label:"HEVC / H.265",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"scrub = nearest-keyframe snap (1 decode); exact frame on park"},{codec:"xavc",label:"Sony XAVC-Intra",full:!0,preview:!1,luma:!1,scrubPreview:!1,backend:"webcodecs",notes:"all-intra; already scrub-fast"},{codec:"h264_mxf",label:"H.264 long-GOP (MXF)",full:!0,preview:!0,luma:!1,scrubPreview:!0,backend:"webcodecs",notes:"Camera proxies (Sony CTAPA and kin): H.264 High long-GOP in MXF OP1a. SEPARATE from 'xavc' because XAVC-Intra is all-intra and this is not \u2014 measured on a 1224-frame CTAPA proxy: IBBP, I every 12, but a true RAP (index flag 0x80) only every 48; the intervening I-frames are open-GOP (flag 0x40) and are NOT legal entry points. Decoded by LongGopPlayer: walk the GOP from its RAP, first AU 'key' and the rest 'delta', outputs taken in EMISSION order (WebCodecs owns the B-frame reorder, so the index's temporal_offset is never interpreted). Whole GOP is cached, so any scrub inside those 2s is free. Until 2026-08-10 these files were misidentified as xavc and decoded one isolated AU at a time (submit + flush), so every P/B frame hit a decoder with no reference state, only the leading IDR ever decoded, and the viewer showed frame 0 forever. Gated by oracle/i2o/e2e/mxf-longgop-playback.spec.ts against ffmpeg"},{codec:"r3d",label:"RED R3D",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"Full + preview render NATIVE RWG/Log3G10 (2026-07-26 \u2014 IPP2 output LUT removed from decoders; display transforms are downstream)"},{codec:"arriraw",label:"ARRIRAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"EVERY STAGE BYTE-EXACT vs the ARRI SDK (2026-07-27): prep, the ADA-7 demosaic (0 of 15,690,240), the LuMaTaLu colour kernel (0 of 31,457,280 \u2014 closed by transcribing the SDK's own f32 op order: the LUT index is fmul-then-fadd not a fused mul_add, the B-spline weights are evaluated expanded with the sixth applied last, and the bicubic accumulates columns before rows), the 1:1 resample (identity) and AfaScaler+BufferScaler (0 of 43,739,136). The shipped master still omits AfaScaler's Rec.709 YCbCr detail and its Jenkins-hash grain \u2014 added looks, not native signal \u2014 so the end-to-end floor gate vs the SDK's DEFAULT output reads 0.16/255; colour is no part of that number. exact AWG4/LogC4 develop (2026-07-21, vs ARRI SDK); preview is colour via the same per-clip develop plan (tier gate corr \u22650.997). Pre-A35 12-bit ALEV-III (Mini/Mini LF) fully wired 2026-07-26: Gen2 develop to native AWG3/LogC3, SDK-gated MAE<0.8/255, probe inner_codec 'arriraw-alev3' \u2192 decode_arriraw12_mxf; other ALEV3 bodies decode flagged calib:parametric-alev3-family-unvalidated"},{codec:"dnxhr",label:"Avid DNxHR / DNxHD",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"DC-only 1/8 preview tier is COLOR (2026-08-05 \u2014 was gray luma) \u2014 playback + scrub ride it (4K/UHD DNxHR full decodes aren't scrub-fast); park upgrades to full"},{codec:"crm",label:"Canon Cinema RAW Light",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"preview LL tier develops through the SAME tone-exact Canon Log 2 path as Full (2026-07-26 \u2014 replaced the placeholder tone map that drifted -46/255)"},{codec:"braw",label:"Blackmagic RAW",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"per-clip WB develop (bmdf wkel/wtin \u2192 wb_grid tables; Pocket-6K-family sweep-validated); preview is COLOUR-accurate native Gen5 log (gate corr \u22650.996 vs downsampled full). ENTROPY-PROFILE GATED PER FRAME (rust braw::PROFILES): the frame-header ladder selects one of four separately-compiled SDK decoder families AND its dequant table, and it is per-frame rate-control output \u2014 NOT a per-clip constant (the old 'compression base' model was wrong; two encodes off the same PYXIS body carry different ladders). A frame whose exact ladder we have not captured tables for is refused with calib:unsupported-entropy-profile rather than decoded on a neighbouring quantiser. Captured profiles: (0,0,0,1) C013/C060 8\xD78 byte-exact; and the 12\xD712 family (SHIPPED 2026-07-26) \u2014 (1,2,3,4) URSA 12K, plus BOTH PYXIS encodes (0,1,2,4) and (0,0,1,2), which are the same camera at the same raster with quantisers half a step apart. That family is 12\xD712 luma / 12\xD76 chroma, 2 luma + Cb + Cr per unit off one threaded bit-reader; all four walks (full, multithreaded, DC preview, colour preview) are parametric over it. GRAIN + EDGE FILTER MODELLED 2026-07-26 \u2014 the decode is now essentially the SDK's literal output: the synthesized high-frequency PRNG grain is reproduced (scatter map verified 0 mismatches over 76,896 observations across two clips), its per-frame seed turns out to be carried IN the bitstream (16 BE bytes before the first tile) and re-seeded per tile as s1 ^= broadcast16(region<<5|vtile), and the post-IDCT block-edge filter (A*b + B*(a+c) >> 4) is applied. The filter's per-block STRENGTH byte is solved too (2026-07-26): it is transmitted, not derived - each unit ends with a [ctx+0x68]-bit field on its own reader (the skip the walk used to call 'hf_bias' and discard), packing four 2-bit weight selectors per block (bits 7:6/5:4 = the horizontal cut's two 6-px column spans, 3:2/1:0 = the vertical cut's two 6-px row spans); and the four weights are master[ladder[k]] with master[i] = (16-2i, i), so the header ladder IS the deblock strength ramp and no future profile needs a capture for it. BRAW IS BYTE-EXACT (2026-07-26). Frame-gated vs the SDK's own decoded.bin, through BOTH the oracle bitstream and the real .braw container path: all four captures \u2014 C060 (8x8), URSA 12K, and both PYXIS encodes \u2014 now differ from the SDK in ZERO samples, luma and chroma alike, across 208,099,712 luma samples; the gates assert max == 0 rather than a mean bound, because a tolerance cannot tell 'clean' from 'one wrong block in 400,000'. The last drift (11,248 URSA pixels off by one, ~0.014%) was never a modelling gap: the SDK computes an Arai-Agui-Nakajima SCALED DCT \u2014 coefficients premultiplied by s[u]*s[v] = c(k)/(2*cos(k*pi/2N)), then a unit-scale radix-3 x radix-4 butterfly \u2014 so a dense basis multiply is the same function through a DIFFERENT operation graph and rounds differently in f32, which is why f32, f32+FMA and f64 all missed. Both transforms (luma 12x12 @0x6e9c8, chroma 12x6 @0x6fc68) are now the SDK's literal dataflow, machine-transcribed by oracle/media/braw/t12_transcribe.py \u2014 a symbolic byte-slot emulator of the unrolled NEON \u2014 into the generated rust/media-core/src/codecs/braw_t12_idct.rs. The 8x8 family gains the same seed fix (whole-frame grain, no captured constant) AND the same edge filter: it was never a different algorithm, only a different compiled copy (@0x6b6a4) whose ladder (0,0,0,1) resolves to three identities plus one weak tap - C060 Y 1.76 -> 0.003. Also solved by censusing where the residual sat: the SDK runs horizontal before vertical; a vertical cut is governed by the block to its LEFT; the frame's final vertical cut is not filtered (the SDK handles cuts in pairs and drops the pair whose second cut leaves the frame); and the 8x8 byte is a nibble per block (7:6 h / 5:4 v for block 0, 3:2 h / 1:0 v for block 1). Both PYXIS profiles now carry captured grain quantisers (the PARIS original's were read once its volume was remounted). Also gated: the multithreaded walk is byte-identical to single-threaded, and both preview tiers are exact block means of the full decode (corr 1.0000). Still refused: Pocket 6K C040 (2,3,4,4) = a fourth algorithm. See oracle/media/braw/ENTROPY_PROFILE_RE.md"},{codec:"xocn",label:"Sony X-OCN",full:!0,preview:!0,luma:!0,scrubPreview:!0,backend:"wasm",notes:"Full + preview render NATIVE S-Gamut3/S-Log3 (2026-07-26 \u2014 replaced the adaptive display transform); preview = LL-band-only decode (~1/8 per axis, ~90x faster), colour-consistent with Full by construction. Fitted sensors: Burano LT/8K (SBRg), Venice ST (SBRe), VENICE 2 8.6K (SBRf, 2026-07-26 \u2014 decodes via the same parametric geometry, own C0_VENICE2 matrix R\xB2\u22650.9994). X-OCN IS BYTE-EXACT ACROSS MODES (2026-07-27): LT 6K, Venice ST and Burano 8K all decode to ZERO differing samples vs libSonyRawDev's own decoder output \u2014 86,293,760 samples over the three, gated in tests/xocn_variant_gate.rs against hashes of the SDK's planes. Venice ST and 8K previously lost their top and bottom rows (28 and 12 rows; the interiors were already exact) because the band row ranges were formulas in the LL strip count n, read off the LT capture (y0=10, y1=8n-2 and friends) \u2014 those hold only when 8n == h + 12, which is an LT coincidence. The real rule (xocn::phase_chain): the standalone band carries the frame's h rows CENTRED in its 8n coded rows, and every coarser level is the even subset of the level below, so lo = a[k] and y14 = a[k] + n[k] fall out per level and reproduce LT's captured constants exactly. Settled by MEASURING the bitstream \u2014 strips are byte-aligned, so the row count of a strip is the count whose decode consumes its byte size (harness xocnstrip) \u2014 not by sweeping constants. The write-side dy row shift that used to paper over the phase is gone. SBRf/VENICE 2 decodes through the same path but is not yet re-gated byte-exact (fixture on PARIS)"}],f=new Map(u.map(t=>[t.codec,t]));function a(t){let e=(t??"").toLowerCase().trim();return e?e==="aprn"||e==="aprh"?"prores_raw":e==="prores_mxf"||e.startsWith("ap")?"prores":e==="arriraw-alev3"?"arriraw":e==="avc1"||e==="avc3"||e==="h264"?"h264":e.startsWith("hvc")||e.startsWith("hev")||e==="h265"?"hevc":e.startsWith("avd")||e==="dnxh"||e==="dnxhd"?"dnxhr":e==="redcode"?"r3d":f.has(e)?e:null:null}function m(t){let e=(t??"").toLowerCase().trim();if(!e)return null;if(e==="aprn"||e==="aprh"||a(e)==="prores_raw"||e==="ap4h"||e==="ap4x")return 12;if(e.startsWith("ap"))return 10;let r=a(e);return r==="r3d"?16:r==="arriraw"||r==="braw"?12:r==="xocn"?16:r==="crm"?12:/dnxhr.?(hqx|444)/.test(e)?10:null}function b(t,e){if(typeof e!="number")return null;let r=a(t);return r==="h264"?[66,77,88,100].includes(e)?8:e===110?10:null:r==="hevc"?e===1?8:e===2?10:null:null}function w(t){let e=(t??"").toLowerCase().trim();if(!e)return null;if(e==="ap4h"||e==="ap4x")return"4:4:4";let r=a(e);return r==="prores_raw"||r==="r3d"||r==="arriraw"||r==="braw"||r==="xocn"||r==="crm"?"bayer":r==="prores"?"4:2:2":/dnxhr.?444/.test(e)?"4:4:4":/dnxhr.?(hqx|hq|sq|lb)/.test(e)?"4:2:2":null}function v(t){let e=t.toLowerCase().replace(/[^0-9a-z]/g,"");return e==="bayer"||e==="raw"?"bayer":e.length>=3&&/^\d+$/.test(e)?e.split("").join(":"):e}function c(t){let e=a(t);return e==="prores"||e==="h264"||e==="hevc"?e:"other"}var h={prores:"ProRes",h264:"H.264",hevc:"HEVC",r3d:"R3D",arriraw:"ARRIRAW",xocn:"X-OCN",vc3:"DNxHR",braw:"BRAW",proresraw:"ProRes RAW",other:"unsupported"};function y(t){return h[t]??"unsupported"}function p(t){let e=JSON.parse(t),r=e.frames??[],o=r.length>>1,s=new Array(o);for(let n=0,i=0;i<o;n+=2,i++)s[i]={offset:r[n],size:r[n+1]};return{offs:s,codec:e.codec,kind:c(e.codec),w:e.width,h:e.height,fps:e.fps??null,startFrame:e.start_frame??0,dropFrame:e.drop_frame??!1}}async function E(t){await d();let r=await l((o,s)=>t.slice(o,o+s).arrayBuffer().then(n=>new Uint8Array(n)),t.size,"mov");return p(r)}export{a,m as b,b as c,w as d,v as e,y as f,p as g,E as h};
|