Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define presentation compositor #61

Merged
merged 4 commits into from
Feb 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions spec/imsc-hrm.html
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ <h2>Architecture</h2>
<a>Intermediate Synchronic Documents</a> E<sub>i</sub>:</p>
<ul>
<li><a>non-empty ISDs</a> are processed using a simple double buffering model: while a <a>non-empty ISD</a>
E<sub>n</sub> is being painted into a Back Buffer, the previous <a>non-empty ISD</a> E<sub>m</sub> is available
for display in a Front Buffer; and</li>
E<sub>n</sub> is being painted into a Back Buffer by the <dfn>Presentation Compositor</dfn>, the previous <a>non-empty
ISD</a> E<sub>m</sub> is available for display in a Front Buffer; and</li>
nigelmegitt marked this conversation as resolved.
Show resolved Hide resolved
<li><a>empty ISDs</a> merely disconnect the Front Buffer from the display when presented,
i.e., presenting an <a>empty ISD</a> is equivalent to presenting nothing.</li>
</ul>
Expand Down Expand Up @@ -462,14 +462,17 @@ <h2>Architecture</h2>
<p>Similarly, Decoded Image Buffers D<sub>n</sub> and D<sub>n-1</sub> store decoded images across <a data-lt=
"Intermediate Synchronic Document">Intermediate Synchronic Documents</a>, allowing images to be copied into the Presentation
Buffer instead of decoded.</p>

<p>Each of the terms <a>Presentation Compositor</a>, Glyph Renderer, Glyph Copier, Image Decoder, and Image Copier
is defined by the algorithmic requirements defined for it in this specification.</p>
</section>

<section id='hypothetical-render-model-general'>
<h2>Algorithm</h2>

<p>The HRM algorithm processes a sequence of <a>Intermediate Synchronic Documents</a> E<sub>n</sub>.</p>

<p>Each successive <a>non-empty ISD</a> E<sub>n</sub> is rendered by the Presentation Compositor using the
<p>Each successive <a>non-empty ISD</a> E<sub>n</sub> is rendered by the <a>Presentation Compositor</a> using the
following steps in order:</p>

<ol>
Expand All @@ -482,7 +485,7 @@ <h2>Algorithm</h2>
<li>paint the text or image subtitle content.</li>
</ol>

<p>The Presentation Compositor begins rendering E<sub>n</sub>:</p>
<p>The <a>Presentation Compositor</a> begins rendering E<sub>n</sub>:</p>

<ul>
<li>at the presentation time of E<sub>m</sub>, where m is the largest non-zero value that is both less than
Expand All @@ -491,7 +494,7 @@ <h2>Algorithm</h2>
<li>at the presentation time of E<sub>n</sub> minus <a>IPD</a>, otherwise.</li>
</ul>

<p class="note">The Presentation Compositor never begins rendering an ISD more than <a>IPD</a> ahead of its
<p class="note">The <a>Presentation Compositor</a> never begins rendering an ISD more than <a>IPD</a> ahead of its
presentation time.</p>

<figure id='fig-rendering-presentation-time'>
Expand All @@ -500,13 +503,13 @@ <h2>Algorithm</h2>
<figcaption>
illustrates the rendering and presentation of <a>Intermediate Synchronic Documents</a>, where the hatched
areas indicate time spent drawing the associated <a>Intermediate Synchronic Document</a>. For example, the
Presentation Compositor begins rendering E<sub>1</sub> at the presentation time of E<sub>0</sub> since
E<sub>1</sub> is not an <a>empty ISD</a>. In contrast, the Presentation Compositor begins rendering
<a>Presentation Compositor</a> begins rendering E<sub>1</sub> at the presentation time of E<sub>0</sub> since
E<sub>1</sub> is not an <a>empty ISD</a>. In contrast, the <a>Presentation Compositor</a> begins rendering
E<sub>5</sub> at the presentation time of E<sub>5</sub> minus IPD since (i) both E<sub>3</sub> and
E<sub>4</sub> are <a>empty ISDs</a> and the presentation time of E<sub>5</sub> minus that of E<sub>2</sub> is
greater than IPD. Furthermore, E<sub>2</sub> remains in the Front Buffer until the presentation time of
E<sub>5</sub> but is not presented while E<sub>3</sub> and E<sub>4</sub> are presented, during which time the
Front Buffer is not available for display. Finally, the Presentation Compositor begins rendering E<sub>0</sub>
Front Buffer is not available for display. Finally, the <a>Presentation Compositor</a> begins rendering E<sub>0</sub>
at the presentation time of E<sub>0</sub> minus IPD since E<sub>0</sub> is the first <a>Intermediate
Synchronic Document</a>.
</figcaption>
Expand Down Expand Up @@ -549,7 +552,7 @@ <h2>Algorithm</h2>
example, if the Back Buffer is copied twice to Front Buffer between two consecutive video frame boundaries of the
<a>Related Video Object</a>.</p>

<p>It SHALL be an <a>error</a> for the Presentation Compositor to fail to complete painting pixels for
<p>It SHALL be an <a>error</a> for the <a>Presentation Compositor</a> to fail to complete painting pixels for
<a>non-empty ISD</a> E<sub>n</sub> before its presentation time.</p>

<p>The following table specifies the values of <a>IPD</a> and BDraw.</p>
Expand Down Expand Up @@ -639,10 +642,10 @@ <h2>Paint Regions</h2>
<section id='paint-images'>
<h2>Paint Images</h2>

<p>The Presentation Compositor paints into the Back Buffer all visible pixels of <a>presented
<p>The <a>Presentation Compositor</a> paints into the Back Buffer all visible pixels of <a>presented
images</a> of <a>Intermediate Synchronic Document</a> E<sub>n</sub>.</p>

<p>For each <dfn data-cite="IMSC#dfn-presented-image">presented image</dfn>, the Presentation Compositor either:</p>
<p>For each <dfn data-cite="IMSC#dfn-presented-image">presented image</dfn>, the <a>Presentation Compositor</a> either:</p>

<ul>
<li>if an identical image is present in Decoded Image Buffer D<sub>n</sub>, copies the image from Decoded Image Buffer
Expand Down Expand Up @@ -769,7 +772,7 @@ <h2>Paint Text</h2>
</p>

<p>For each <a>glyph</a> associated with a <a>character</a> in a <a>presented region</a> of <a>Intermediate Synchronic Document</a>
E<sub>n</sub>, the Presentation Compositor:</p>
E<sub>n</sub>, the <a>Presentation Compositor</a>:</p>

<ul>
<li>if an identical <a>glyph</a> is present in Glyph Buffer G<sub>n</sub>, copies the <a>glyph</a> from Glyph Buffer
Expand All @@ -787,10 +790,10 @@ <h2>Paint Text</h2>
</ul>

<figure>
<img src="figures/text-render-example-figure-2.png" alt="Example of Presentation Compositor Behavior for Text Rendering">
<img src="figures/text-render-example-figure-2.png" alt="Example of <a>Presentation Compositor</a> Behavior for Text Rendering">

<figcaption>
Example of Presentation Compositor Behavior for Text Rendering
Example of <a>Presentation Compositor</a> Behavior for Text Rendering
</figcaption>
</figure>

Expand Down