@blockcast/mmt-container 0.4.0 → 0.4.1-main.2e0aa69d293d
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 +37 -21
- package/dist/align.d.ts +24 -18
- package/dist/align.d.ts.map +1 -1
- package/dist/align.js +23 -4
- package/dist/align.js.map +2 -2
- package/dist/browser-runtime.js +5070 -908
- package/dist/browser-runtime.js.map +4 -4
- package/dist/carp-catalog.d.ts +76 -39
- package/dist/carp-catalog.d.ts.map +1 -1
- package/dist/carp-catalog.js +321 -205
- package/dist/carp-catalog.js.map +3 -3
- package/dist/catalog-fec-params.d.ts +12 -4
- package/dist/catalog-fec-params.d.ts.map +1 -1
- package/dist/catalog-fec-params.js +40 -17
- package/dist/catalog-fec-params.js.map +3 -3
- package/dist/catalog-network-source.d.ts +28 -7
- package/dist/catalog-network-source.d.ts.map +1 -1
- package/dist/catalog-network-source.js +21 -1
- package/dist/catalog-network-source.js.map +2 -2
- package/dist/catalog-validator.d.ts +4 -3
- package/dist/catalog-validator.d.ts.map +1 -1
- package/dist/catalog-validator.js +0 -29
- package/dist/catalog-validator.js.map +3 -3
- package/dist/cmcd-producer.d.ts +13 -1
- package/dist/cmcd-producer.d.ts.map +1 -1
- package/dist/cmcd-producer.js +14 -0
- package/dist/cmcd-producer.js.map +2 -2
- package/dist/delivery-catalog.js +115 -235
- package/dist/delivery-catalog.js.map +4 -4
- package/dist/fec-manager.d.ts +113 -1
- package/dist/fec-manager.d.ts.map +1 -1
- package/dist/fec-manager.js +464 -66
- package/dist/fec-manager.js.map +4 -4
- package/dist/fec-state.d.ts +2 -1
- package/dist/fec-state.d.ts.map +1 -1
- package/dist/fec-state.js +18 -3
- package/dist/fec-state.js.map +3 -3
- package/dist/fec-worker-setup.d.ts +10 -0
- package/dist/fec-worker-setup.d.ts.map +1 -1
- package/dist/fec-worker-setup.js +15 -4
- package/dist/fec-worker-setup.js.map +2 -2
- package/dist/held-layer-admission.d.ts +58 -0
- package/dist/held-layer-admission.d.ts.map +1 -0
- package/dist/held-layer-admission.js +105 -0
- package/dist/held-layer-admission.js.map +7 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +2 -2
- package/dist/iso-block-locator.d.ts +39 -1
- package/dist/iso-block-locator.d.ts.map +1 -1
- package/dist/iso-block-locator.js +109 -17
- package/dist/iso-block-locator.js.map +3 -3
- package/dist/mfu-reassembler.js +21 -13
- package/dist/mfu-reassembler.js.map +2 -2
- package/dist/mmtp-container-parser.d.ts.map +1 -1
- package/dist/mmtp-container-parser.js +93 -22
- package/dist/mmtp-container-parser.js.map +2 -2
- package/dist/mmtp-container-parser.no-modules.js +3692 -1213
- package/dist/mmtp-container-parser.no-modules.js.map +4 -4
- package/dist/mmtp-decode-pipeline.js +93 -22
- package/dist/mmtp-decode-pipeline.js.map +2 -2
- package/dist/mmtp-fec-session.d.ts +192 -0
- package/dist/mmtp-fec-session.d.ts.map +1 -0
- package/dist/mmtp-fec-session.js +640 -0
- package/dist/mmtp-fec-session.js.map +7 -0
- package/dist/mmtp-router.d.ts +101 -32
- package/dist/mmtp-router.d.ts.map +1 -1
- package/dist/mmtp-router.js +422 -189
- package/dist/mmtp-router.js.map +2 -2
- package/dist/multicast-auth-catalog.d.ts +94 -92
- package/dist/multicast-auth-catalog.d.ts.map +1 -1
- package/dist/multicast-auth-catalog.js +746 -131
- package/dist/multicast-auth-catalog.js.map +4 -4
- package/dist/multicast-input.d.ts +31 -8
- package/dist/multicast-input.d.ts.map +1 -1
- package/dist/multicast-input.js +299 -35
- package/dist/multicast-input.js.map +3 -3
- package/dist/multicast-manager.d.ts +140 -12
- package/dist/multicast-manager.d.ts.map +1 -1
- package/dist/multicast-manager.js +4104 -605
- package/dist/multicast-manager.js.map +4 -4
- package/dist/multicast-transport.d.ts +16 -3
- package/dist/multicast-transport.d.ts.map +1 -1
- package/dist/multicast-transport.js +127 -240
- package/dist/multicast-transport.js.map +4 -4
- package/dist/multicast-unwrap.js +21 -13
- package/dist/multicast-unwrap.js.map +2 -2
- package/dist/no-modules.d.ts +5 -3
- package/dist/no-modules.d.ts.map +1 -1
- package/dist/no-modules.js +3643 -1197
- package/dist/no-modules.js.map +4 -4
- package/dist/phase14-catalog-override.d.ts +1 -1
- package/dist/phase14-catalog-override.d.ts.map +1 -1
- package/dist/phase14-catalog-override.js +2 -2
- package/dist/phase14-catalog-override.js.map +2 -2
- package/dist/repair-fetch.d.ts +90 -6
- package/dist/repair-fetch.d.ts.map +1 -1
- package/dist/repair-fetch.js +160 -32
- package/dist/repair-fetch.js.map +3 -3
- package/dist/repair-layers.d.ts +2 -0
- package/dist/repair-layers.d.ts.map +1 -1
- package/dist/repair-layers.js +19 -2
- package/dist/repair-layers.js.map +2 -2
- package/dist/sample-combiner.d.ts +7 -1
- package/dist/sample-combiner.d.ts.map +1 -1
- package/dist/sample-combiner.js +14 -2
- package/dist/sample-combiner.js.map +2 -2
- package/dist/signaling.d.ts +2 -2
- package/dist/signaling.d.ts.map +1 -1
- package/dist/signaling.js +3 -3
- package/dist/signaling.js.map +2 -2
- package/dist/switching-set-alignment.d.ts +1 -1
- package/dist/switching-set-alignment.js.map +1 -1
- package/dist/timestamp-codec.js +21 -13
- package/dist/timestamp-codec.js.map +2 -2
- package/dist/wasm-mfu-reassembler.js.map +1 -1
- package/dist/wasm-mmtp-container-parser.js +93 -22
- package/dist/wasm-mmtp-container-parser.js.map +2 -2
- package/package.json +6 -18
- package/schemas/catalog.schema.json +133 -38
- package/src/align.ts +52 -21
- package/src/carp-catalog.ts +188 -68
- package/src/catalog-fec-params.ts +28 -3
- package/src/catalog-network-source.ts +49 -7
- package/src/catalog-validator.ts +4 -11
- package/src/cmcd-producer.ts +23 -1
- package/src/fec-manager.ts +378 -63
- package/src/fec-state.ts +11 -4
- package/src/fec-worker-setup.ts +30 -2
- package/src/held-layer-admission.ts +161 -0
- package/src/index.ts +32 -19
- package/src/iso-block-locator.ts +110 -7
- package/src/mmtp-container-parser.ts +75 -7
- package/src/mmtp-fec-session.ts +606 -0
- package/src/mmtp-router.ts +453 -236
- package/src/multicast-auth-catalog.ts +196 -231
- package/src/multicast-input.ts +148 -124
- package/src/multicast-manager.ts +447 -53
- package/src/multicast-transport.ts +23 -5
- package/src/no-modules.ts +8 -7
- package/src/phase14-catalog-override.ts +3 -3
- package/src/repair-fetch.ts +306 -42
- package/src/repair-layers.ts +22 -2
- package/src/sample-combiner.ts +15 -2
- package/src/signaling.ts +2 -2
- package/src/switching-set-alignment.ts +1 -1
- package/test-vectors/align.json +108 -32
- package/test-vectors/bc-provenance-v2.json +1526 -0
- package/test-vectors/catalog/README.md +71 -4
- package/test-vectors/catalog/negative/fec-block-profile-missing.json +1 -1
- package/test-vectors/catalog/negative/fec-block-profile-retired.json +1 -1
- package/test-vectors/catalog/negative/fec-block-profile-unknown.json +1 -1
- package/test-vectors/catalog/negative/fec-iso-symbol-size-below-floor.json +28 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-iso-symbol-size-13.json +28 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-k-plus-p-over-255.json +39 -0
- package/test-vectors/catalog/negative/fec-reed-solomon-overlay-over-255.json +40 -0
- package/test-vectors/catalog/negative/fec-repair-overlay-source-symbols-zero.json +43 -0
- package/test-vectors/catalog/negative/fec-repair-symbols-zero.json +28 -0
- package/test-vectors/catalog/negative/fec-source-symbols-zero.json +28 -0
- package/test-vectors/catalog/negative/fec-symbol-size-zero.json +28 -0
- package/test-vectors/catalog/negative/init-data-inline-without-data.json +22 -0
- package/test-vectors/catalog/negative/mmtp-mode-mpu.json +15 -0
- package/test-vectors/catalog/negative/multicast-amt-dns-without-relay.json +37 -0
- package/test-vectors/catalog/negative/multicast-amt-driad-with-relay.json +38 -0
- package/test-vectors/catalog/negative/multicast-auth-asm-missing-sender-address.json +77 -0
- package/test-vectors/catalog/negative/multicast-auth-duplicate-first-epoch.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-duplicate-kid.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-auth-without-object-auth.json +38 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-auth.json +49 -0
- package/test-vectors/catalog/negative/multicast-auth-endpoint-missing-bandwidth.json +55 -0
- package/test-vectors/catalog/negative/multicast-auth-manifest-port-equals-port.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-manifest-timer-out-of-range.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-above-max.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-max-auth-delay-below-min.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-root-dotted-key.json +55 -0
- package/test-vectors/catalog/negative/multicast-auth-sender-address-on-ssm.json +57 -0
- package/test-vectors/catalog/negative/multicast-auth-version-1.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-version-3.json +56 -0
- package/test-vectors/catalog/negative/multicast-auth-version-missing.json +55 -0
- package/test-vectors/catalog/negative/multicast-endpoint-foreign-namespace-track.json +44 -0
- package/test-vectors/catalog/negative/multicast-endpoint-protocol-amt.json +38 -0
- package/test-vectors/catalog/negative/multicast-endpoint-protocol-atsc3.json +38 -0
- package/test-vectors/catalog/negative/presentation-anchor-unsafe.json +16 -0
- package/test-vectors/catalog/positive/fec-algorithm-unimplemented.json +29 -0
- package/test-vectors/catalog/positive/fec-iso-ssbg1.json +1 -1
- package/test-vectors/catalog/positive/fec-multicast.json +1 -1
- package/test-vectors/catalog/positive/fec-reed-solomon-layered.json +50 -0
- package/test-vectors/catalog/positive/mmt01-12-1-init-ref-anchor.json +29 -0
- package/test-vectors/catalog/positive/multicast-amt-discovery-omitted.json +37 -0
- package/test-vectors/catalog/positive/multicast-amt-dns-relay.json +38 -0
- package/test-vectors/catalog/positive/multicast-amt-manual-relay.json +3 -3
- package/test-vectors/catalog/{negative/multicast-endpoint-missing-protocol-and-source.json → positive/multicast-asm-unprotected.json} +10 -5
- package/test-vectors/catalog/positive/multicast-auth-asm-sender.json +78 -0
- package/test-vectors/catalog/positive/multicast-auth-rotation.json +39 -38
- package/test-vectors/catalog/positive/multicast-draft01-4-1-example.json +81 -0
- package/test-vectors/catalog/positive/multicast-draft01-7-2-6-example.json +70 -0
- package/test-vectors/catalog/positive/presentation-anchor-negative.json +27 -0
- package/test-vectors/catalog/section-codes.json +31 -1
- package/test-vectors/catalog-multicast-auth-v1.json +38 -20
- package/test-vectors/catalog-validation.json +101 -5
- package/test-vectors/catalog-validator-public-api.mjs +14 -9
- package/test-vectors/generate-bc-provenance-v2.mjs +252 -0
- package/dist/fec-codec.d.ts +0 -32
- package/dist/fec-codec.d.ts.map +0 -1
- package/dist/fec-codec.js +0 -47
- package/dist/fec-codec.js.map +0 -7
- package/dist/manifest-auth-plan.d.ts +0 -30
- package/dist/manifest-auth-plan.d.ts.map +0 -1
- package/dist/manifest-auth-plan.js +0 -1266
- package/dist/manifest-auth-plan.js.map +0 -7
- package/dist/source-auth.d.ts +0 -2
- package/dist/source-auth.d.ts.map +0 -1
- package/dist/source-auth.js +0 -1209
- package/dist/source-auth.js.map +0 -7
- package/src/fec-codec.ts +0 -61
- package/src/manifest-auth-plan.ts +0 -107
- package/src/source-auth.ts +0 -1
- package/test-vectors/generate-source-auth-fixture.mjs +0 -114
- package/test-vectors/source-auth-v1.json +0 -61
package/src/repair-layers.ts
CHANGED
|
@@ -34,6 +34,8 @@ export const MAX_RAPTORQ_SOURCE_SYMBOLS = 56403;
|
|
|
34
34
|
export const MAX_REPAIR_SYMBOLS = 0xffffff;
|
|
35
35
|
/** The 24-bit ESI bounds K + totalP - 1 for one FEC instance. */
|
|
36
36
|
export const MAX_ENCODING_SYMBOL_ID = 0xffffff;
|
|
37
|
+
/** Reed-Solomon block bound: K + P <= 255 (draft-ramadan-moq-fec-01 4.5, 6.3.4 rule 12). */
|
|
38
|
+
export const MAX_REED_SOLOMON_BLOCK_SYMBOLS = 255;
|
|
37
39
|
|
|
38
40
|
export type RepairContractCode =
|
|
39
41
|
| "track_fec"
|
|
@@ -429,11 +431,14 @@ export function assembleRepairLayers(
|
|
|
429
431
|
if (layered && !positiveInteger(source.sourceSymbols)) {
|
|
430
432
|
fail("track_fec", `${source.path}.sourceSymbols`, "layered or overlay repair needs a positive integer sourceSymbols on the source");
|
|
431
433
|
}
|
|
432
|
-
|
|
434
|
+
// Rule 7: the two specified schemes. Reed-Solomon layers decode because its
|
|
435
|
+
// Cauchy matrix row for RS_ID is the same whatever the block's total P (fec-01 4.4).
|
|
436
|
+
const reedSolomon = source.algorithm === "reed-solomon";
|
|
437
|
+
if (layered && source.algorithm !== "raptorq" && !reedSolomon) {
|
|
433
438
|
fail(
|
|
434
439
|
"track_fec",
|
|
435
440
|
`${source.path}.algorithm`,
|
|
436
|
-
"repair layers and overlays are defined only for raptorq
|
|
441
|
+
"repair layers and overlays are defined only for raptorq and reed-solomon (draft-ramadan-moq-fec-01 6.3.4 rule 7)",
|
|
437
442
|
);
|
|
438
443
|
}
|
|
439
444
|
|
|
@@ -500,6 +505,13 @@ export function assembleRepairLayers(
|
|
|
500
505
|
`overlay sourceSymbols + repairSymbols - 1 exceeds the 24-bit ESI space (${MAX_ENCODING_SYMBOL_ID})`,
|
|
501
506
|
);
|
|
502
507
|
}
|
|
508
|
+
if (reedSolomon && sourceSymbols + repairSymbols > MAX_REED_SOLOMON_BLOCK_SYMBOLS) {
|
|
509
|
+
fail(
|
|
510
|
+
"track_fec_bounds",
|
|
511
|
+
`${d.path}.repairSymbols`,
|
|
512
|
+
`reed-solomon overlay sourceSymbols + repairSymbols exceeds ${MAX_REED_SOLOMON_BLOCK_SYMBOLS} (draft-ramadan-moq-fec-01 6.3.4 rule 12)`,
|
|
513
|
+
);
|
|
514
|
+
}
|
|
503
515
|
overlays.push({ repairTrackName: d.name, scope: "keyframe", sourceSymbols, repairSymbols, priority: d.priority as number });
|
|
504
516
|
}
|
|
505
517
|
|
|
@@ -549,5 +561,13 @@ export function assembleRepairLayers(
|
|
|
549
561
|
);
|
|
550
562
|
}
|
|
551
563
|
|
|
564
|
+
if (reedSolomon && k + totalBaseRepairSymbols > MAX_REED_SOLOMON_BLOCK_SYMBOLS) {
|
|
565
|
+
fail(
|
|
566
|
+
"track_fec_bounds",
|
|
567
|
+
`${source.path}.sourceSymbols`,
|
|
568
|
+
`reed-solomon sourceSymbols + total base repair symbols exceeds ${MAX_REED_SOLOMON_BLOCK_SYMBOLS} (draft-ramadan-moq-fec-01 6.3.4 rule 12)`,
|
|
569
|
+
);
|
|
570
|
+
}
|
|
571
|
+
|
|
552
572
|
return { sourceTrackName: source.name, baseLayers, overlays, totalBaseRepairSymbols };
|
|
553
573
|
}
|
package/src/sample-combiner.ts
CHANGED
|
@@ -286,8 +286,14 @@ export class SampleCombiner {
|
|
|
286
286
|
/**
|
|
287
287
|
* Add one reassembled data unit. Returns the combined sample once every
|
|
288
288
|
* constituent data unit has arrived and totals the authored size.
|
|
289
|
+
*
|
|
290
|
+
* `sampleSize` is the authored size the host resolves for the sample as the
|
|
291
|
+
* data unit completes. It stands in only when no size was registered, which
|
|
292
|
+
* happens when the data unit's FI=0/FI=1 reached the reassembler without the
|
|
293
|
+
* host's own FT=2 parse: an FEC-recovered first fragment completed by source
|
|
294
|
+
* fragments, or one decoded before its source copy arrived.
|
|
289
295
|
*/
|
|
290
|
-
addMfu(mfu: ReassembledMFU): CombinedSample | null {
|
|
296
|
+
addMfu(mfu: ReassembledMFU, sampleSize?: number): CombinedSample | null {
|
|
291
297
|
if (mfu.movieFragmentSequenceNumber === undefined || mfu.sampleNumber === undefined) {
|
|
292
298
|
// Non-timed (Item) MFU: sample combining does not apply.
|
|
293
299
|
this.#stats.passthroughSamples++
|
|
@@ -311,7 +317,7 @@ export class SampleCombiner {
|
|
|
311
317
|
}
|
|
312
318
|
|
|
313
319
|
const dataLen = mfu.data.byteLength
|
|
314
|
-
const authoredSize = this.#authoredSizes.get(key)
|
|
320
|
+
const authoredSize = this.#authoredSizes.get(key) ?? sampleSize
|
|
315
321
|
|
|
316
322
|
if (offset === 0 && !this.#pending.has(key)) {
|
|
317
323
|
const passesThrough = authoredSize === undefined
|
|
@@ -678,6 +684,13 @@ if (import.meta.vitest) {
|
|
|
678
684
|
expect(out?.data).toEqual(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]))
|
|
679
685
|
})
|
|
680
686
|
|
|
687
|
+
test('a size handed with the data unit completes a sample no head registered', () => {
|
|
688
|
+
const c = combiner({ requireAuthoredSize: true })
|
|
689
|
+
const out = c.addMfu(mfu(1, 9, 17, 0, [1, 2, 3, 4, 5], 1000n, true), 5)
|
|
690
|
+
expect(out?.data).toEqual(new Uint8Array([1, 2, 3, 4, 5]))
|
|
691
|
+
expect(c.addMfu(mfu(1, 9, 17, 0, [1, 2, 3, 4, 5], 1000n, true), 5)).toBeNull()
|
|
692
|
+
})
|
|
693
|
+
|
|
681
694
|
test('duplicate offset is rejected', () => {
|
|
682
695
|
const c = combiner()
|
|
683
696
|
c.registerAuthoredSize(undefined, 1, 9, 17, 10)
|
package/src/signaling.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import {
|
|
13
13
|
ALFEC_MESSAGE_ID,
|
|
14
14
|
FEC_CODE_RAPTORQ,
|
|
15
|
-
|
|
15
|
+
FEC_CODE_REED_SOLOMON,
|
|
16
16
|
PACKET_TYPE_MPU,
|
|
17
17
|
PACKET_TYPE_REPAIR,
|
|
18
18
|
PACKET_TYPE_SIGNALING,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
export {
|
|
23
23
|
ALFEC_MESSAGE_ID,
|
|
24
24
|
FEC_CODE_RAPTORQ,
|
|
25
|
-
|
|
25
|
+
FEC_CODE_REED_SOLOMON,
|
|
26
26
|
PACKET_TYPE_MPU,
|
|
27
27
|
PACKET_TYPE_REPAIR,
|
|
28
28
|
PACKET_TYPE_SIGNALING,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Phase 14 D-15: log-only on drift (does NOT reject stream, does NOT throw).
|
|
6
6
|
* Phase 14 D-16: tolerance = Math.floor(1_000_000 / framerate / 2) microseconds.
|
|
7
7
|
* Hardcoded tolerance is FORBIDDEN — derives from framerate only.
|
|
8
|
-
* Phase 14 D-17:
|
|
8
|
+
* Phase 14 D-17: tracks with equal altGroup form one switching set; repair legs are in none.
|
|
9
9
|
* Phase 14 T-14-03 mitigation: at most ONE misalignment emit per groupId pair.
|
|
10
10
|
*/
|
|
11
11
|
|
package/test-vectors/align.json
CHANGED
|
@@ -2,113 +2,189 @@
|
|
|
2
2
|
"$comment": [
|
|
3
3
|
"Cross-language test vectors for group alignment and MMTP subgroup keys.",
|
|
4
4
|
"",
|
|
5
|
-
"Every sibling implementation (
|
|
6
|
-
"Rust
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
5
|
+
"Every sibling implementation (TS packages/container/src/align.ts,",
|
|
6
|
+
"Rust mmt-core/src/align.rs, and their downstream consumers) loads this",
|
|
7
|
+
"file and asserts its own groupId/driftCheck output matches. Any formula",
|
|
8
|
+
"change in any language that drifts from this fixture must fail CI.",
|
|
9
|
+
"",
|
|
10
|
+
"Version 2 (draft-ramadan-moq-mmt-01 Section 4.4.1): every group_id",
|
|
11
|
+
"vector carries presentation_anchor_ticks and the formula is",
|
|
12
|
+
"floor((ticks - presentation_anchor_ticks) / group_duration_ticks).",
|
|
13
|
+
"There is no clamp; group_id_reject lists inputs with ticks earlier",
|
|
14
|
+
"than the anchor, which every implementation MUST refuse.",
|
|
10
15
|
"",
|
|
11
16
|
"When adding a vector, prefer values that exercise a boundary (exact",
|
|
12
17
|
"tick, 1-off, negative, large-int near 2^53, prime divisor) rather",
|
|
13
18
|
"than arbitrary numbers."
|
|
14
19
|
],
|
|
15
|
-
"version":
|
|
20
|
+
"version": 2,
|
|
16
21
|
"group_id": [
|
|
17
22
|
{
|
|
18
23
|
"name": "t=0 → 0",
|
|
19
24
|
"ticks": 0,
|
|
20
25
|
"group_duration_ticks": 360000,
|
|
21
|
-
"expected_group_id": 0
|
|
26
|
+
"expected_group_id": 0,
|
|
27
|
+
"presentation_anchor_ticks": 0
|
|
22
28
|
},
|
|
23
29
|
{
|
|
24
30
|
"name": "90kHz, dur=4s: 3.9s before boundary → 0",
|
|
25
31
|
"ticks": 351000,
|
|
26
32
|
"group_duration_ticks": 360000,
|
|
27
|
-
"expected_group_id": 0
|
|
33
|
+
"expected_group_id": 0,
|
|
34
|
+
"presentation_anchor_ticks": 0
|
|
28
35
|
},
|
|
29
36
|
{
|
|
30
37
|
"name": "90kHz, dur=4s: exact boundary at 4s → 1",
|
|
31
38
|
"ticks": 360000,
|
|
32
39
|
"group_duration_ticks": 360000,
|
|
33
|
-
"expected_group_id": 1
|
|
40
|
+
"expected_group_id": 1,
|
|
41
|
+
"presentation_anchor_ticks": 0
|
|
34
42
|
},
|
|
35
43
|
{
|
|
36
44
|
"name": "90kHz, dur=4s: 4s + 1 tick → 1",
|
|
37
45
|
"ticks": 360001,
|
|
38
46
|
"group_duration_ticks": 360000,
|
|
39
|
-
"expected_group_id": 1
|
|
47
|
+
"expected_group_id": 1,
|
|
48
|
+
"presentation_anchor_ticks": 0
|
|
40
49
|
},
|
|
41
50
|
{
|
|
42
51
|
"name": "90kHz, dur=4s: second boundary at 8s → 2",
|
|
43
52
|
"ticks": 720000,
|
|
44
53
|
"group_duration_ticks": 360000,
|
|
45
|
-
"expected_group_id": 2
|
|
54
|
+
"expected_group_id": 2,
|
|
55
|
+
"presentation_anchor_ticks": 0
|
|
46
56
|
},
|
|
47
57
|
{
|
|
48
58
|
"name": "48kHz audio, dur=4s: aligned at 192000 ticks → 1",
|
|
49
59
|
"ticks": 192000,
|
|
50
60
|
"group_duration_ticks": 192000,
|
|
51
|
-
"expected_group_id": 1
|
|
52
|
-
|
|
53
|
-
{
|
|
54
|
-
"name": "negative clamps to 0 (base-clamp)",
|
|
55
|
-
"ticks": -1,
|
|
56
|
-
"group_duration_ticks": 360000,
|
|
57
|
-
"expected_group_id": 0
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"name": "large negative clamps to 0 (epoch skew)",
|
|
61
|
-
"ticks": -9000000,
|
|
62
|
-
"group_duration_ticks": 360000,
|
|
63
|
-
"expected_group_id": 0
|
|
61
|
+
"expected_group_id": 1,
|
|
62
|
+
"presentation_anchor_ticks": 0
|
|
64
63
|
},
|
|
65
64
|
{
|
|
66
65
|
"name": "1kHz, dur=2s: 10s → 5",
|
|
67
66
|
"ticks": 10000,
|
|
68
67
|
"group_duration_ticks": 2000,
|
|
69
|
-
"expected_group_id": 5
|
|
68
|
+
"expected_group_id": 5,
|
|
69
|
+
"presentation_anchor_ticks": 0
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
"name": "1kHz, dur=2s: 10s + 1 tick → 5 (still in bucket 5)",
|
|
73
73
|
"ticks": 10001,
|
|
74
74
|
"group_duration_ticks": 2000,
|
|
75
|
-
"expected_group_id": 5
|
|
75
|
+
"expected_group_id": 5,
|
|
76
|
+
"presentation_anchor_ticks": 0
|
|
76
77
|
},
|
|
77
78
|
{
|
|
78
79
|
"name": "1kHz, dur=2s: 12s → 6",
|
|
79
80
|
"ticks": 12000,
|
|
80
81
|
"group_duration_ticks": 2000,
|
|
81
|
-
"expected_group_id": 6
|
|
82
|
+
"expected_group_id": 6,
|
|
83
|
+
"presentation_anchor_ticks": 0
|
|
82
84
|
},
|
|
83
85
|
{
|
|
84
86
|
"name": "prime divisor (dur=7): ticks=13 → 1",
|
|
85
87
|
"ticks": 13,
|
|
86
88
|
"group_duration_ticks": 7,
|
|
87
|
-
"expected_group_id": 1
|
|
89
|
+
"expected_group_id": 1,
|
|
90
|
+
"presentation_anchor_ticks": 0
|
|
88
91
|
},
|
|
89
92
|
{
|
|
90
93
|
"name": "prime divisor (dur=7): ticks=14 → 2 (exact boundary)",
|
|
91
94
|
"ticks": 14,
|
|
92
95
|
"group_duration_ticks": 7,
|
|
93
|
-
"expected_group_id": 2
|
|
96
|
+
"expected_group_id": 2,
|
|
97
|
+
"presentation_anchor_ticks": 0
|
|
94
98
|
},
|
|
95
99
|
{
|
|
96
100
|
"name": "prime divisor (dur=7): ticks=15 → 2",
|
|
97
101
|
"ticks": 15,
|
|
98
102
|
"group_duration_ticks": 7,
|
|
99
|
-
"expected_group_id": 2
|
|
103
|
+
"expected_group_id": 2,
|
|
104
|
+
"presentation_anchor_ticks": 0
|
|
100
105
|
},
|
|
101
106
|
{
|
|
102
107
|
"name": "large-int (24h @ 90kHz): 7_776_000_000 ticks, dur=4s → 21600",
|
|
103
108
|
"ticks": 7776000000,
|
|
104
109
|
"group_duration_ticks": 360000,
|
|
105
|
-
"expected_group_id": 21600
|
|
110
|
+
"expected_group_id": 21600,
|
|
111
|
+
"presentation_anchor_ticks": 0
|
|
106
112
|
},
|
|
107
113
|
{
|
|
108
114
|
"name": "near MAX_SAFE_INTEGER (TS=2^52, dur=2): ticks=2^52 → 2^51",
|
|
109
115
|
"ticks": 4503599627370496,
|
|
110
116
|
"group_duration_ticks": 2,
|
|
111
|
-
"expected_group_id": 2251799813685248
|
|
117
|
+
"expected_group_id": 2251799813685248,
|
|
118
|
+
"presentation_anchor_ticks": 0
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "mmt-01 4.4.1 worked example A: 90kHz, 10.5s → 5",
|
|
122
|
+
"ticks": 945000,
|
|
123
|
+
"group_duration_ticks": 180000,
|
|
124
|
+
"presentation_anchor_ticks": 0,
|
|
125
|
+
"expected_group_id": 5
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"name": "mmt-01 4.4.1 worked example B: 44.1kHz, 10.5s → 5",
|
|
129
|
+
"ticks": 463050,
|
|
130
|
+
"group_duration_ticks": 88200,
|
|
131
|
+
"presentation_anchor_ticks": 0,
|
|
132
|
+
"expected_group_id": 5
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "mmt-01 4.4.1 negative anchor: MPU 0 ticks=-90000 → 0",
|
|
136
|
+
"ticks": -90000,
|
|
137
|
+
"group_duration_ticks": 180000,
|
|
138
|
+
"presentation_anchor_ticks": -180000,
|
|
139
|
+
"expected_group_id": 0
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"name": "mmt-01 4.4.1 negative anchor: MPU 1 ticks=90000 → 1",
|
|
143
|
+
"ticks": 90000,
|
|
144
|
+
"group_duration_ticks": 180000,
|
|
145
|
+
"presentation_anchor_ticks": -180000,
|
|
146
|
+
"expected_group_id": 1
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"name": "ticks equal to anchor → 0",
|
|
150
|
+
"ticks": -180000,
|
|
151
|
+
"group_duration_ticks": 180000,
|
|
152
|
+
"presentation_anchor_ticks": -180000,
|
|
153
|
+
"expected_group_id": 0
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"name": "positive anchor shifts the origin: ticks=360000, anchor=90000 → 1",
|
|
157
|
+
"ticks": 360000,
|
|
158
|
+
"group_duration_ticks": 180000,
|
|
159
|
+
"presentation_anchor_ticks": 90000,
|
|
160
|
+
"expected_group_id": 1
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"name": "positive anchor: one tick before the shifted boundary → 0",
|
|
164
|
+
"ticks": 269999,
|
|
165
|
+
"group_duration_ticks": 180000,
|
|
166
|
+
"presentation_anchor_ticks": 90000,
|
|
167
|
+
"expected_group_id": 0
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"group_id_reject": [
|
|
171
|
+
{
|
|
172
|
+
"name": "reject: ticks=-1 before anchor 0 (no clamp)",
|
|
173
|
+
"ticks": -1,
|
|
174
|
+
"group_duration_ticks": 360000,
|
|
175
|
+
"presentation_anchor_ticks": 0
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
"name": "reject: mmt-01 4.4.1 negative PTS with anchor 0",
|
|
179
|
+
"ticks": -90000,
|
|
180
|
+
"group_duration_ticks": 180000,
|
|
181
|
+
"presentation_anchor_ticks": 0
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"name": "reject: one tick before a positive anchor",
|
|
185
|
+
"ticks": 89999,
|
|
186
|
+
"group_duration_ticks": 180000,
|
|
187
|
+
"presentation_anchor_ticks": 90000
|
|
112
188
|
}
|
|
113
189
|
],
|
|
114
190
|
"drift": [
|