forge
Explore
Log in

Don't you dare go Hollow

Name the dropped display height as a design gap, not an oversight

Browse files at this commit

25cd3de2e6c3628abb8ab1c3d70f67f82d9bb8d0Ahmet Kaan GümüşParent: 8773473
  • docs
    • name the dropped display height as a design gap, not an oversight
Show full message
docs(demux): name the dropped display height as a design gap, not an oversight

`PixelAspect::stated_size` reads a unit-0 pair's display height, checks it for
the degenerate claim, and then does not use it -- a 1920x803 scope is drawn
1920x1080, because this engine's model moves the width only.

That is correct today and I want it written down rather than left looking like
a bug, because it stops being correct the moment any path starts honouring a
stated display height: the height half is being discarded deliberately, and the
reason it is safe to discard (`VideoMeta::height` is the coded height
everywhere, and every consumer reads the aspect as width-only) is exactly what
such a change would remove.

Documentation only; no behaviour change.
crates/engine/src/demux.rsmodified+18 -0
@@ -461,6 +461,24 @@ impl PixelAspect {
461461 /// What needs bounding is the raster, and [`Self::width_factor`] bounds
462462 /// that with [`Self::MAX_DISPLAY_WIDTH`] on every path. So this has only
463463 /// to refuse the degenerate claims: a zero half.
464+ ///
465+ /// # A named design gap, not an oversight
466+ ///
467+ /// The stated display *height* is read, checked, and then dropped. That is
468+ /// correct against this engine's model today -- `VideoMeta::height` is the
469+ /// coded height for every file, every door builds the display pair as
470+ /// `width_factor(coded_width)` against the coded height, and every consumer
471+ /// (`decode.rs`, `export.rs`, `hw.rs`'s `pixel_aspect_h`/`_v` beside
472+ /// `coded_width`/`coded_height`) reads the aspect as width-only.
473+ ///
474+ /// It becomes a real defect the moment any path starts honouring a stated
475+ /// display height: a 1920x803 pair would then have to drive
476+ /// `VideoMeta::height`, and this function would be silently feeding it
477+ /// `coded.0` instead. So the drop is recorded here rather than left as a
478+ /// line that looks like an oversight, and whoever makes that change should
479+ /// start by reading this paragraph -- the height half is being discarded
480+ /// deliberately, and the reason it was safe to discard is exactly the thing
481+ /// that change would remove.
464482 pub fn stated_size(display_width: u64, display_height: u64, coded: (u32, u32)) -> Option<Self> {
465483 // The height is checked for the degenerate claim and then goes unused:
466484 // a zero-height pair is a header that lies, and one this engine reads