Skip to content

Let a VF reference the Atmos track of an existing DCP - #9

Merged
JaumeAP merged 2 commits into
mainfrom
reference-atmos-rebased
Oct 23, 2026
Merged

JaumeAP merged 2 commits into
mainfrom
reference-atmos-rebased

Conversation

@JaumeAP

@JaumeAP JaumeAP commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

When a VF is made from a DCP that has an Atmos track, the Atmos is always written again, as a new MXF with a new ID. This adds the option to reference it instead, like video and sound: an extra tick, "Atmos", in the DCP referencing dialog. When it is on, the VF's CPL points at the original Atmos asset, with the trim as the entry point and duration as for sound, and the original's Atmos frames are not read again.

The change is in DCPContent (a reference_atmos flag, saved in the metadata as ReferenceAtmos, and can_reference_atmos()), ReelWriter and get_referenced_reel_assets() (use the original ReelAtmosAsset), DCPDecoder (does not read a referenced Atmos track), Film (switches the flag off when it can no longer be referenced) and the referencing dialog.

The flag is not part of DCPContent::identifier(). The identifier is part of the path of the encoded video, so referencing the Atmos track must not change it: that would make the video be encoded again for no reason.

Tests: test/atmos_reference_asset_test.cc (8 cases, using test/data/atmos_0.mxf and atmos_1.mxf from the public test data). With the change in place the 63 tests in atmos_*, vf_*, reels_*, reel_*, dcp_* and film_* pass on macOS (arm64). Each new test fails with the part of the change it covers taken out:

  • the VF's CPL pointing at the original Atmos asset, and the trim: fails without the decoder condition and without the entry-point offset;

  • the flag in the metadata, and the identifier staying the same when it is set. With the earlier version, which added "a" to the identifier when the flag was set:

    $ build/test/unit-tests --run_test='atmos_reference_*'
    Running 8 test cases...
    ../test/atmos_reference_asset_test.cc:163: error: in "atmos_reference_identifier_test": check content->identifier() == not_referenced has failed
    *** 1 failure is detected in the test module "dcpomatic_test"
    

    and with this change:

    $ build/test/unit-tests --run_test='atmos_reference_*'
    Running 8 test cases...
    *** No errors detected
    
  • when it is not available (no Atmos track, overlapping Atmos content) and when the film switches it off;

  • is_vf();

  • a referenced Atmos track not being read;

  • sound and Atmos being referenced independently of each other, set in either order.

Not covered or not checked:

  • The new column in the referencing dialog: it builds, but I did not use it.
  • An encrypted Atmos track.
  • Channel 14. libdcp writes the sync signal into the main sound when the film contains Atmos content. If the Atmos is referenced but the sound is written again, the new sound has a new asset ID and the signal's frame count starts at 0, while the Atmos is the original's. I have not been able to check what a Dolby processor does with that. Referencing both leaves channel 14 as in the original.

Two commits on top of upstream/main (9fb642020): the change and its tests. A test for Atmos frames landing in the wrong reel when a reel has no Atmos was on this branch before; it now lives with its fix in #10. To build it with --warnings-are-errors on Xcode 26 I used -Wno-error=implicit-const-int-float-conversion -Wno-error=unnecessary-virtual-specifier locally, because upstream does not build the tests there otherwise (not part of this change).

🤖 Generated with Claude Code

https://claude.ai/code/session_011HCUWvPpbN7e6hcwuWBJjs

@JaumeAP
JaumeAP force-pushed the reference-atmos-rebased branch from dc9edff to fa1ea15 Compare October 22, 2026 21:17
Jaume Puig added 2 commits October 23, 2026 17:44
DCPContent has a reference_atmos flag, like reference_video and
reference_audio, with an Atmos column in the DCP referencing dialog.
When it is set the VF's CPL points at the original Atmos asset, with the
trim as the entry point and duration as for sound, and the Atmos frames
of the original are not read again.

Claude-Session: https://claude.ai/code/session_011HCUWvPpbN7e6hcwuWBJjs
atmos_reference_asset_test.cc has the tests of reference_atmos, using
test/data/atmos_0.mxf and atmos_1.mxf: the VF's CPL pointing at the
original Atmos asset, with and without trims; the flag in the metadata,
and the content identifier not changing when it is set; when it is not
available and when the film switches it off; is_vf(); the Atmos of a
referenced DCP not being read; and referencing the sound and the Atmos
independently of each other.  Each of them fails with the part of the
change it covers taken out.

Claude-Session: https://claude.ai/code/session_011HCUWvPpbN7e6hcwuWBJjs
@JaumeAP
JaumeAP force-pushed the reference-atmos-rebased branch from 810b1b2 to 9e42692 Compare October 23, 2026 15:44
@JaumeAP
JaumeAP merged commit 715a19d into main Oct 23, 2026
1 check passed
@JaumeAP
JaumeAP deleted the reference-atmos-rebased branch October 23, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant