-
Notifications
You must be signed in to change notification settings - Fork 6
/
imsc-hrm.html
761 lines (602 loc) · 34.4 KB
/
imsc-hrm.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<title>IMSC Hypothetical Render Model</title>
<style>
figure img {
height: auto;
}
</style>
<script src="https://www.w3.org/Tools/respec/respec-w3c" class="remove" defer></script>
</script>
<script class='remove'>
var respecConfig = {
specStatus: "WD"
//, processVersion: "2018"
//, previousMaturity: "PR"
, publishDate: "2021-11-09"
//, modificationDate: "2020-04-27"
//, errata: ""
//, implementationReportURI: ""
, sotdAfterWGinfo: "true"
//, previousPublishDate: "2018-10-04"
, shortName: "imsc-hrm"
, editors: [{
name: "Pierre Lemieux",
w3cid: "57073",
mailto: "pal@sandflow.com"
}]
, group: "wg/timed-text"
, subjectPrefix: "[imsc-hrm]"
, edDraftURI: "https://w3c.github.io/imsc-hrm/spec/imsc-hrm.html"
, github: {
repoURL : "https://github.com/w3c/imsc-hrm/",
branch : "main"
}
, license: "w3c-software-doc"
, localBiblio: {
"SUBM": {
publisher: "World Wide Web Consortium (W3C)",
href:"https://www.w3.org/Submission/2013/SUBM-ttml-ww-profiles-20130607/",
title: "TTML Text and Image Profiles for Internet Media Subtitles and Captions (Member Submission, 07 June 2013)"
},
"CEA-608": {
publisher: "Consumer Technology Association",
href : "https://www.techstreet.com/standards/cta-608-e-r2014?product_id=1815447",
title:"CTA 608-E, Line-21 Data Services"
},
"CEA-708": {
publisher: "Consumer Technology Association",
href : "https://www.techstreet.com/standards/cta-708-d?product_id=1815448",
title: "CTA 708-D, Digital Television (DTV) Closed Captioning"
},
"CFF": {
publisher: "Digital Entertainment Content Ecosystem (DECE)",
href: "https://www.uvcentral.com/specs",
title:"Common File Format & Media Formats Specification (CFF) Version 2.2"
},
"EBU-TT-D": {
publisher: "European Broadcasting Union (EBU)",
href: "https://tech.ebu.ch/files/live/sites/tech/files/shared/tech/tech2380v1_0_1.pdf",
title: "Tech 3380, EBU-TT-D Subtitling Distribution Format Version 1.0.1"
},
"EBU-TT-M": {
publisher: "European Broadcasting Union (EBU)",
href :"https://tech.ebu.ch/files/live/sites/tech/files/shared/tech/tech2390.pdf",
title: "Tech 3390, EBU-TT-M Metadata Definitions 1.0"
},
"ttml2": {
"authors":["Glenn Adams","Cyril Concolato"],
"href":"https://www.w3.org/TR/2018/REC-ttml2-20181108/",
"title":"Timed Text Markup Language 2 (TTML2)",
"status":"REC",
"publisher":"W3C",
"id":"ttml2-20181108",
"date":"8 November 2018"
},
"xml": {
aliasOf: "xml-20081126"
},
"xml-names": {
aliasOf: "xml-names-20091208"
},
"WCAG20": {
aliasOf: "WCAG20-20081211"
},
"PNG": {
aliasOf: "PNG-20031110"
},
"namespaceState": {
aliasOf: "namespaceState-20060329"
},
"ttml-imsc1": {
aliasOf: "ttml-imsc1-20180626"
},
"ttml-imsc1.0.1": {
aliasOf: "ttml-imsc1.0.1-20180424"
},
"xmlschema-1": {
aliasOf: "xmlschema-1-20041028"
},
"XSL11": {
aliasOf: "XSL11-20061205"
},
"ttml10-sdp-us": {
aliasOf: "ttml10-sdp-us-20130205"
},
"media-accessibility-reqs": {
aliasOf: "media-accessibility-reqs-20151203"
},
"TTML1": {
"authors":["Glenn Adams","Pierre-Anthony Lemieux"],
"href":"https://www.w3.org/TR/2018/REC-ttml1-20181108/",
"title":"Timed Text Markup Language 1 (TTML1) (Third Edition)",
"status":"REC",
"publisher":"W3C",
"id":"ttml1-20181108",
"date":"8 November 2018"
},
"IMSC": {
publisher: "World Wide Web Consortium (W3C)",
href :"https://www.w3.org/TR/ttml-imsc/",
title: "TTML Profiles for Internet Media Subtitles and Captions"
}
}
};
</script>
<style>
table.coldividers td + td { border-left:1px solid gray; text-align: center;}
table.syntax { border: 0px solid black; width: 85%; border-collapse: collapse }
table.syntax caption { font-weight: bold; text-align: left; padding-bottom: 0.5em }
table.syntax th { border: 0px solid black; text-align: left }
table.syntax td { border: 0px solid black }
table.syntax div { background-color: #ffffc8 }
div.exampleInner { background-color: #d5dee3;
border-top-width: 4px;
border-top-style: double;
border-top-color: #d3d3d3;
border-bottom-width: 4px;
border-bottom-style: double;
border-bottom-color: #d3d3d3;
padding: 4px; margin: 0em }
ul.short-list { margin: 0; padding-left: 0; list-style-position: inside;}
.note {font-size:small}
.equation {text-indent: 10%;}
.example {font-size: small}
.inline-note {font-size: small}
.deprecation {background-color: #EBEBFE; border: 3px double; margin: 2px;}
.deprecation::before {content: "\26A0"; margin:0.2em; font-size:2em; float:left;}
body {
font-family: sans-serif;
line-height: 24px;
}
span.label {
display: inline-block;
border-radius: 3px;
}
span.permitted::before {
content: "\00A0\2713\00A0"
}
span.prohibited::before {
content: "\00A0\2718\00A0"
}
span.permitted-deprecated::before {
font-weight: bold;
content: "\00A0!\00A0"
}
span.label::after {
content: "\00A0";
}
span.permitted {
color: black;
background-color: #50FF50;
}
span.prohibited {
color: black;
background-color: #FF5F5F;
}
span.permitted-deprecated {
color: black;
background-color: #FFC000;
}
</style>
</head>
<body>
<section id='abstract'>
<p>This specification specifies an Hypothetical Render Model (HRM) that constrains the complexity of documents that conform to
any of the TTML Profiles for Internet Media Subtitles and Captions ([[IMSC]]).</p>
<p>The model is not intended as a specification of the processing requirements for implementations. For instance, while the
model defines a glyph buffer for the purpose of limiting the number of glyphs displayed at any given point in time, it neither
requires the implementation of such a buffer, nor models the sub-pixel character positioning and anti-aliased glyph rendering
that can be used to produce text output.</p>
</section>
<section id='sotd'>
</section>
<section id='scope'>
<h2>Scope</h2>
<p>This specification specifies an Hypothetical Render Model (HRM) that constrains the complexity of a <a>IMSC Document
Instance</a>.</p>
</section>
<section id='conventions'>
<h2>Documentation Conventions</h2>
<p>This specification uses the same conventions as [[!IMSC]].</p>
</section>
<section id='terms'>
<h2>Terms and Definitions</h2>
<p><dfn>IMSC Document Instance</dfn>. A <dfn data-lt="Document Instance|Document Instances"
data-cite="ttml2#terms-document-instance">Document Instance</dfn> that conforms to any profile defined in any edition of
[[!IMSC]].</p>
<p><dfn>empty ISD</dfn>. an <a>Intermediate Synchronic Document</a> with no <dfn
data-cite="imsc#dfn-presented-region">presented region</dfn>.</p>
</section>
<section id="conformance">
<p>
Unless noted otherwise, this specification applies to an <a>IMSC Document Instance</a>.
</p>
<p>
A sequence of consecutive <dfn data-cite="ttml2#terms-intermediate-synchronic-document">Intermediate Synchronic Documents</dfn>
conforms to the Hypothetical Render Model if is processed without error as defined in <a
href="#hypothetical-render-model-general"></a>.
</p>
<p class="note">Applying the Hypothetical Render Model to a <a>Document Instance</a> that is not an <a>IMSC Document
Instance</a> yields results that might not reflect the complexity of the <a>Document Instance</a>.</p>
</section>
<section class="informative">
<h2>Overview</h2>
<figure id='fig-hypothetical-render-model'>
<img src="figures/hypothetical-render-figure-1.png" alt="Hypothetical Render Model">
<figcaption>
Hypothetical Render Model
</figcaption>
</figure>
<p>The model illustrated in <a href="#fig-hypothetical-render-model"></a> operates on successive
<a data-lt="Intermediate Synchronic Document">Intermediate Synchronic Documents</a> obtained from an input <a>IMSC Document
Instance</a>, and uses a simple double buffering model: while an <a>Intermediate Synchronic Document</a> E<sub>n</sub> is
being painted into Presentation Buffer P<sub>n</sub> (the "front buffer" of the model), the previous <a>Intermediate
Synchronic Document</a> E<sub>n-1</sub> is available for display in Presentation Buffer P<sub>n-1</sub> (the "back buffer" of
the model).</p>
<p>The model specifies a (hypothetical) time required for completely painting an <a>Intermediate Synchronic Document</a> as
a proxy for complexity. Painting includes drawing region backgrounds, rendering and copying glyphs, and decoding and copying
images. Complexity is then limited by requiring that painting of <a>Intermediate Synchronic Document</a> E<sub>n</sub>
completes before the end of <a>Intermediate Synchronic Document</a> E<sub>n-1</sub>.</p>
<p>Whenever applicable, constraints are specified relative to <dfn data-cite="ttml2#terms-root-container-region">Root
Container Region</dfn> dimensions, allowing subtitle sequences to be authored independently of
<dfn data-cite="imsc#dfn-related-video-object">Related Video Object</dfn>
resolution.</p>
<p>To enable scenarios where the same glyphs are used in multiple successive <a data-lt=
"Intermediate Synchronic Document">Intermediate Synchronic Documents</a>, e.g. to convey a CEA-608/708-style roll-up (see
[[CEA-608]] and [[CEA-708]]), the Glyph Buffers G<sub>n</sub> and G<sub>n-1</sub> store rendered glyphs across <a data-lt=
"Intermediate Synchronic Document">Intermediate Synchronic Documents</a>, allowing glyphs to be copied into the Presentation
Buffer instead of rendered, a more costly operation.</p>
<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>
</section>
<section id='hypothetical-render-model-general'>
<h2>General</h2>
<p>The Presentation Compositor SHALL render in Presentation Buffer P<sub>n</sub> each successive <a>Intermediate Synchronic
Document</a> E<sub>n</sub> using the following steps in order:</p>
<ol>
<li>clear the pixels of the entire <a>Root Container Region</a>, unless n=0 or E<sub>n-1</sub> is an <a>empty ISD</a>;</li>
<li>paint, according to stacking order, all background pixels for each region;</li>
<li>paint all pixels for background colors associated with text or image subtitle content; and</li>
<li>paint the text or image subtitle content.</li>
</ol>
<p>The Presentation Compositor SHALL start rendering E<sub>n</sub>:</p>
<ul>
<li>at the presentation time of E<sub>m</sub>, where E<sub>m</sub> is the closest ISD for which 0<m<n and E<sub>m-1</sub>
is not an <a>empty ISD</a>, if the presentation time of E<sub>n</sub> minus that of E<sub>m</sub> is less than <a>IPD</a>; or
</li>
<li>at the presentation time of E<sub>n</sub> minus <a>IPD</a>, otherwise.</li>
</ul>
<p class="note">The Presentation Compositor never renders an ISD more than <a>IPD</a> ahead of its presentation time and treats sequences of
<a>empty ISDs</a> as a single ISD.</p>
<figure id='fig-rendering-presentation-time'>
<img src="figures/isd-rendering-time-fig.png" alt="ISD rendering and presentation times.">
<figcaption>
illustrates the rendering and presentation of <a>Intermediate Synchronic Documents</a> by the Presentation Compositor. The
Presentation Compositor renders E<sub>n</sub> at the presentation time of E<sub>n-2</sub> since E<sub>n-1</sub> is an
<a>empty ISD</a>. In contrast, the Presentation Compositor renders E<sub>n-2</sub> at the presentation time of
E<sub>n-3</sub> since E<sub>n-4</sub> is not an <a>empty ISD</a>. Finally, E<sub>0</sub> is rendered at the presentation
time of E<sub>0</sub> minus IPD.
</figcaption>
</figure>
<p>The duration DUR(E<sub>n</sub>) for painting an <a>Intermediate Synchronic Document</a> E<sub>n</sub> in the Presentation
Buffer P<sub>n</sub> SHALL be:</p>
<p class="equation">DUR(E<sub>n</sub>) = S(E<sub>n</sub>) / BDraw + DUR<sub>T</sub>(E<sub>n</sub>) +
DUR<sub>I</sub>(E<sub>n</sub>)</p>
<p>where</p>
<ul>
<li>S(E<sub>n</sub>) is the total normalized drawing area for <a>Intermediate Synchronic Document</a> E<sub>n</sub>, as
specified in <a href="#paint-regions"></a>;
</li>
<li>BDraw is the normalized background drawing performance factor;</li>
<li>DUR<sub>T</sub>(E<sub>n</sub>) is the duration, in seconds, for painting the text subtitle content for <a>Intermediate
Synchronic Document</a> E<sub>n</sub>, as specified in Section <a href="#paint-text"></a>; and
</li>
<li>DUR<sub>I</sub>(E<sub>n</sub>) is the duration, in seconds, for painting the image subtitle content for <a>Intermediate
Synchronic Document</a> E<sub>n</sub>, as specified in Section <a href="#paint-images">.</a>
</li>
</ul>
<p>The contents of the Presentation Buffer P<sub>n</sub> SHALL be transferred instantaneously to Presentation Buffer
P<sub>n-1</sub> at the presentation time of <a>Intermediate Synchronic Document</a> E<sub>n</sub>, making the latter
available for display.</p>
<p class='note'>It is possible for the contents of Presentation Buffer P<sub>n-1</sub> to never be displayed. This can happen
if Presentation Buffer P<sub>n</sub> is copied twice to Presentation Buffer P<sub>n-1</sub> between two consecutive video
frame boundaries of the <a>Related Video Object</a>.</p>
<p>It SHALL be an error for the Presentation Compositor to fail to complete painting pixels for E<sub>n</sub> before the
presentation time of E<sub>n</sub>.</p>
<p>Unless specified otherwise, the following table SHALL specify values for <a>IPD</a> and BDraw.</p>
<table class='simple'>
<thead>
<tr>
<th>Parameter</th>
<th>Initial value</th>
</tr>
</thead>
<tbody>
<tr>
<td><dfn data-lt="IPD">Initial Painting Delay</dfn> (IPD)</td>
<td>1 s</td>
</tr>
<tr>
<td>Normalized background drawing performance factor (BDraw)</td>
<td>12 s<sup>-1</sup></td>
</tr>
</tbody>
</table>
<p class='note'>BDraw effectively sets a limit on fillings regions - for example, assuming that the <a>Root Container
Region</a> is ultimately rendered at 1920×1080 resolution, a BDraw of 12 s<sup>-1</sup> would correspond to a fill rate of
1920×1080×12/s=23.7×2<sup>20</sup>pixels s<sup>-1</sup>.</p>
<p class='note'><a>IPD</a> effectively sets a limit on the complexity of any given <a>Intermediate Synchronic Document</a>.</p>
</section>
<section id='paint-regions'>
<h2>Paint Regions</h2>
<p>The total normalized drawing area S(E<sub>n</sub>) for <a>Intermediate Synchronic Document</a> E<sub>n</sub> SHALL be</p>
<p class="equation">S(E<sub>n</sub>) = CLEAR(E<sub>n</sub>) + PAINT(E<sub>n</sub> )</p>
<p>where CLEAR(E<sub>n</sub>) = 0 if n=0 or E<sub>n-1</sub> is an <a>empty ISD</a>, and CLEAR(E<sub>n</sub>) = 1 otherwise.</p>
<p class='note'>To ensure consistency of the Presentation Buffer, a new <a>Intermediate Synchronic Document</a> requires
clearing of the <a>Root Container Region</a>.</p>
<p>PAINT(E<sub>n</sub>) SHALL be the normalized area to be painted for all regions that are used in <a>Intermediate
Synchronic Document</a> E<sub>n</sub> according to:</p>
<p class="equation">PAINT(E<sub>n</sub>) = ∑<sub>R<sub>i</sub>∈R<sub>p</sub></sub> NSIZE(R<sub>i</sub>) ∙
NBG(R<sub>i</sub>)</p>
<p>where R<sub>p</sub> SHALL be the set of <a data-lt="presented region">presented regions</a> in the <a>Intermediate Synchronic
Document</a> E<sub>n</sub>.</p>
<p>NSIZE(R<sub>i</sub>) SHALL be given by:</p>
<p class="equation">NSIZE(R<sub>i</sub>) = (width of R<sub>i</sub> ∙ height of R<sub>i</sub> ) ÷ (<a>Root Container
Region</a> height ∙ <a>Root Container Region</a> width)</p>
<aside class='example'>
For a region R<sub>i</sub> in with <code>tts:extent="250px 50px"</code> within a <a>Root Container Region</a> with
<code>tts:extent="1920px 1080px"</code>, NSIZE(R<sub>i</sub>) ≈ 0.00603.
</aside>
<p>NBG(R<sub>i</sub>) SHALL be the total number of elements within the tree rooted at region R<sub>i</sub> that satisfy the following criteria:</p>
<ul>
<li>the element is either a <code>region</code>, <code>body</code>, <code>div</code>, <code>p</code> or
<code>span</code>; and</li>
<li>the opacity of the computed value of <code>tts:backgroundColor</code> is not <code>0</code>.</li>
</ul>
<p class="issue" data-number="5"></p>
<p class="note">An element and its parent that satisfy the criteria above and share identical computed values of
<code>tts:backgroundColor</code> are counted as two distinct elements for the purpose of computing NBG(R<sub>i</sub>).</p>
<p class="note">The <code>set</code> element is not included in the computation of NBG(R<sub>i</sub>). While it can affect the
computed values of <code>tts:backgroundColor</code>, it is removed during <a>Intermediate Synchronic Document</a>
construction.</p>
</section>
<section id='paint-images'>
<h2>Paint Images</h2>
<p>The Presentation Compositor SHALL paint into the Presentation Buffer P<sub>n</sub> 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 SHALL either:</p>
<ul>
<li>if an identical image is present in Decoded Image Buffer D<sub>n</sub>, copy the image from Decoded Image Buffer
D<sub>n</sub> to the Presentation Buffer P<sub>n</sub> using the Image Copier; or</li>
<li>if an identical image is present in Decoded Image Buffer D<sub>n-1</sub>, i.e. an identical image was present in
<a>Intermediate Synchronic Document</a> E<sub>n-1</sub>, copy using the Image Copier the image from Decoded Image Buffer
D<sub>n-1</sub> to both the Decoded Image Buffer D<sub>n</sub> and the Presentation Buffer P<sub>n</sub>; or
</li>
<li>otherwise, decode the image using the Image Decoder the image into the Presentation Buffer P<sub>n</sub> and Decoded
Image Buffer D<sub>n</sub>.</li>
</ul>
<p>Two images SHALL be identical if and only if they reference the same encoded image source.</p>
<p>The duration DUR<sub>I</sub>(E<sub>n</sub>) for painting images of an <a>Intermediate Synchronic Document</a>
E<sub>n</sub> in the Presentation Buffer SHALL be as follows:</p>
<p class="equation">DUR<sub>I</sub>(E<sub>n</sub>) = ∑<sub>I<sub>i</sub> ∈ I<sub>c</sub></sub> NRGA(I<sub>i</sub>) / ICpy
+ ∑<sub>I<sub>j</sub> ∈ I<sub>d</sub></sub> NSIZ(I<sub>j</sub>) / IDec</p>
<p>where</p>
<ul>
<li>I<sub>c</sub> is the set of images copied when painting <a>Intermediate Synchronic Document</a> E<sub>n</sub>;
</li>
<li>I<sub>d</sub> is the set of images decoded when painting <a>Intermediate Synchronic Document</a> E<sub>n</sub>;
</li>
<li>IDec is the image decoding rate; and</li>
<li>ICpy is the normalized image copy performance factor.</li>
</ul>
<p>NRGA(I<sub>i</sub>) is the Normalized Image Area of <a>presented image</a> I<sub>i</sub> and SHALL be equal to:</p>
<p class="equation">NRGA(I<sub>i</sub>)= (width of I<sub>i</sub> ∙ height of I<sub>i</sub> ) ÷ ( <a>Root Container
Region</a> height ∙ <a>Root Container Region</a> width )</p>
<p>NSIZ(I<sub>i</sub>) SHALL be the number of pixels of <a>presented image</a> I<sub>i</sub>.</p>
<p>The contents of the Decoded Image Buffer D<sub>n</sub> SHALL be transferred instantaneously to Decoded Image Buffer
D<sub>n-1</sub> at the presentation time of <a>Intermediate Synchronic Document</a> E<sub>n</sub>.</p>
<p>The total size occupied by images stored in Decoded Image Buffers D<sub>n</sub> or D<sub>n-1</sub> SHALL be the sum of
their Normalized Image Area.</p>
<p>The size of Decoded Image Buffers D<sub>n</sub> or D<sub>n-1</sub> SHALL be the Normalized Decoded Image Buffer Size
(NDIBS).</p>
<p>Unless specified otherwise, the following table SHALL specify ICpy, IDec, and NDBIS.</p>
<table class='simple'>
<thead>
<tr>
<th>Parameter</th>
<th>Initial value</th>
</tr>
</thead>
<tbody>
<tr>
<td>Normalized image copy performance factor (ICpy)</td>
<td>6</td>
</tr>
<tr>
<td>Image Decoding rate (IDec)</td>
<td>1 × 2<sup>20</sup> pixels s<sup>-1</sup></td>
</tr>
<tr>
<td>Normalized Decoded Image Buffer Size (NDIBS)</td>
<td>0.9885</td>
</tr>
</tbody>
</table>
</section>
<section id='paint-text'>
<h2>Paint Text</h2>
<p>In the context of this section, a <dfn>glyph</dfn> is a tuple consisting of (i) one character and (ii) the computed values
of the following style properties:</p>
<ul>
<li><code>tts:color</code></li>
<li><code>tts:fontFamily</code></li>
<li><code>tts:fontSize</code></li>
<li><code>tts:fontStyle</code></li>
<li><code>tts:fontWeight</code></li>
<li><code>tts:textDecoration</code></li>
<li><code>tts:textOutline</code></li>
<li><code>tts:textShadow</code></li>
</ul>
<p class='note'>In the case where a property is <em>prohibited</em> in a profile of [[IMSC]], the computed value of the property
specified in [[ttml2]] can be used.</p>
<p class='note'>While one-to-one mapping between characters and typographical glyphs is generally the rule in some scripts,
e.g. latin script, it is the exception in others. For instance, in arabic script, a character can yield multiple glyphs
depending on its position in a word. The Hypothetical Render Model always assumes a one-to-one mapping, but reduces the
performance of the glyph buffer for scripts where one-to-one mapping is not the general rule (see GCpy below).</p>
<p>For each <a>glyph</a> associated with a character in a <a>presented region</a> of <a>Intermediate Synchronic Document</a>
E<sub>n</sub>, the Presentation Compositor SHALL:</p>
<ul>
<li>if an identical <a>glyph</a> is present in Glyph Buffer G<sub>n</sub>, copy the <a>glyph</a> from Glyph Buffer
G<sub>n</sub> to the Presentation Buffer P<sub>n</sub> using the Glyph Copier; or
</li>
<li>if an identical <a>glyph</a> is present in Glyph Buffer G<sub>n-1</sub>, i.e. an identical <a>glyph</a> was present in
<a>Intermediate Synchronic Document</a> E<sub>n-1</sub>, copy using the Glyph Copier the <a>glyph</a> from Glyph Buffer
G<sub>n-1</sub> to both the Glyph Buffer G<sub>n</sub> and the Presentation Buffer P<sub>n</sub>; or
</li>
<li>otherwise render using the Glyph Renderer the <a>glyph</a> into the Presentation Buffer P<sub>n</sub> and Glyph Buffer
G<sub>n</sub>.
</li>
</ul>
<figure>
<img src="figures/text-render-example-figure-2.png" alt="Example of Presentation Compositor Behavior for Text Rendering">
<figcaption>
Example of Presentation Compositor Behavior for Text Rendering
</figcaption>
</figure>
<p>The duration DUR<sub>T</sub>(E<sub>n</sub>) for rendering the text of an <a>Intermediate Synchronic Document</a>
E<sub>n</sub> in the Presentation Buffer is as follows:</p>
<p class="equation">DUR<sub>T</sub>(E<sub>n</sub>) = ∑<sub>g<sub>i</sub> ∈ Γ<sub>r</sub></sub> NRGA(g<sub>i</sub>)
/ Ren(g<sub>i</sub>) + ∑<sub>g<sub>j</sub> ∈ Γ<sub>c</sub></sub> NRGA(g<sub>j</sub>) / GCpy</p>
<p>where</p>
<ul>
<li>Γ<sub>r</sub> is the set of <a data-lt="glyph">glyphs</a> rendered into the Presentation Buffer P<sub>n</sub>
using the Glyph Renderer in <a>Intermediate Synchronic Document</a> E<sub>n</sub>;
</li>
<li>Γ<sub>c</sub> is the set of <a data-lt="glyph">glyphs</a> copied to the Presentation Buffer P<sub>n</sub> using
the Glyph Copier in <a>Intermediate Synchronic Document</a> E<sub>n</sub>;
</li>
<li>Ren(g<sub>i</sub>) is the text rendering performance factor for <a>glyph</a> g<sub>i</sub>; and
</li>
<li>GCpy is the normalized glyph copy performance factor.</li>
</ul>
<p>The Normalized Rendered Glyph Area NRGA(g<sub>i</sub>) of a <a>glyph</a> g<sub>i</sub> SHALL be equal to:</p>
<p class="equation">NRGA(g<sub>i</sub>) = (fontSize of g<sub>i</sub> as percentage of <a>Root Container Region</a>
height)<sup>2</sup></p>
<p class='note'>NRGA(G<sub>i</sub>) does not take into account decorations (e.g. underline), effects (e.g. outline) or actual
typographical glyph aspect ratio. An implementation can determine an actual buffer size needs based on worst-case glyph size
complexity.</p>
<p>The contents of the Glyph Buffer G<sub>n</sub> SHALL be copied instantaneously to Glyph Buffer G<sub>n-1</sub> at the
presentation time of <a>Intermediate Synchronic Document</a> E<sub>n</sub>.</p>
<p>It SHALL be an error for the sum of NRGA(g<sub>i</sub>) over all <a data-lt="glyph">glyphs</a> Glyph Buffer G<sub>n</sub>
to be larger than the Normalized Glyph Buffer Size (NGBS).</p>
<p>Unless specified otherwise, the following table specifies values of GCpy, Ren and NGBS.</p>
<table class='simple'>
<tbody>
<tr>
<th colspan="2">Normalized glyph copy performance factor (GCpy)</th>
</tr>
<tr>
<td style="text-align: center;"><em>Script property (see Standard Annex #24 at [[!UNICODE]]) for the character of
g<sub>i</sub></em></td>
<td style="text-align: center;"><em>GCpy</em></td>
</tr>
<tr>
<td>latin, greek, cyrillic, hebrew or base</td>
<td style="text-align: center;">12</td>
</tr>
<tr>
<td><i>any other value</i></td>
<td style="text-align: center;">3</td>
</tr>
<tr>
<th colspan="2">Text rendering performance factor Ren(G<sub>i</sub>)</th>
</tr>
<tr>
<td style="text-align: center;"><em>Block property (see [[!UNICODE]]) for the character of g<sub>i</sub></em></td>
<td style="text-align: center;"><em>Ren(G<sub>i</sub>)</em></td>
</tr>
<tr>
<td>CJK Unified Ideograph</td>
<td style="text-align: center;">0.6</td>
</tr>
<tr>
<td><i>any other value</i></td>
<td style="text-align: center;">1.2</td>
</tr>
<tr>
<th colspan="2">Normalized Glyph Buffer Size (NGBS)</th>
</tr>
<tr>
<td colspan="2" style="text-align: center;">1</td>
</tr>
</tbody>
</table>
<p class='note'>The choice of font by the presentation processor can increase rendering complexity. For instance, a cursive
font can generally result in a given character yielding different typographical glyphs depending on context, even if latin
script is used.</p>
<aside class='example'>
Setting a Normalized Glyph Buffer Size effectively sets a limit on the total number of distinct <a data-lt=
"glyph">glyphs</a> present in any given <a>Intermediate Synchronic Document</a> E<sub>n</sub>. For example, assuming a
maximum Normalized Glyph Buffer Size of 1 and the default tts:fontSize of 1c are used, the font size relative to the
<a>Root Container Region</a> height is 1/15 , and the maximum number of distinct glyphs that can be buffered is
1÷(1÷15)<sup>2</sup>=225 glyphs.
</aside>
<aside class='example'>
GCpy effectively sets a limit on animating text. For example, assuming that the <a>Root Container Region</a> is ultimately
rendered at 1920×1080 resolution and no regions need to have background color painted (so only a CLEAR(E<sub>n</sub>)
operation is required for the normalized drawing area for the <a>Intermediate Synchronic Document</a>), a GCpy and BDraw of
12 s<sup>-1</sup> would mean that a group of 160 <a data-lt="glyph">glyphs</a> with a tts:fontSize equal to 5% of the
<a>Root Container Region</a> height could be moved at most approximately 12 s<sup>-1</sup> ÷ (1 + ( 160 ×
0.05<sup>2</sup> )) = 8.6 times per second.
</aside>
<aside class='example'>
Ren(G<sub>i</sub>) effectively sets a limit on the text rendering rate. For example, assuming that the <a>Root Container
Region</a> is ultimately rendered at a 1920×1080 resolution, a Ren(G<sub>i</sub>) of 1.2 s<sup>-1</sup> would mean that at
most 120 <a data-lt="glyph">glyphs</a> with a fontSize of 108 px (10% of 1080 px and NRGA(G<sub>i</sub>) = 0.01) could be
rendered every second.
</aside>
</section>
<section class="appendix informative">
<h2>Accessibility Considerations</h2>
<p>In a system where <a>IMSC Document Instances</a> are expected to conform to the Hypothetical Render Model, an <a>IMSC
Document Instance</a> that does not conform to the Hypothetical Render Model might negatively impact accessibility
during presentation of the <a>IMSC Document Instance</a> and its associated content.</p>
</section>
<section class="appendix informative">
<h2>Privacy and Security Considerations</h2>
<section>
<h3>General</h3>
<p>This specification has no inherent security or privacy implications.</p>
<p>The algorithm defined within this specification is used for static analysis of a resource.
This specification does not define any protocol or interface for obtaining such a resource,
and it does not define any interface for exposing the results of the analysis.
No personal or sensitive information is processed as part of the algorithm,
other than any such information that might happen to be part of the <a>IMSC Document Instance</a> being analysed.
No information is exposed by the algorithm to any origin.
No scripts are loaded or processed as part of the algorithm
and no links to external resources are dereferenced.
</p>
</section>
<section>
<h3>Implementation considerations</h3>
<p>Implementers of this specification should capture and meet privacy and security requirements for their intended application.
For example, an implementation could, when reporting on an error encountered during processing of an <a>IMSC Document Instance</a>,
include a section of the content of an <a>IMSC Document Instance</a> to elaborate the error.
If that content could include sensitive or personal information,
the implementation should ensure that any such output is provided using appropriately secure protocols.
No such reporting is defined or required by this specification.
</p>
</section>
</section>
<section class="appendix informative">
<h2>Acknowledgements</h2>
</section>
<section id="substantive-changes-summary" class="appendix informative">
<h2>Summary of substantive changes</h2>
</section>
</body>
</html>