Skip to content

Commit e9b8cd3

Browse files
tidoustdalecurtis
authored andcommitted
Fix memory layout of NV12 image example
According to the text: - The coded width and coded height must be even. So image cannot be 16x9. This update makes it 16x10 - There should be one Y byte per pixel, so 16x10 Y bytes (example only had 14 bytes per row) - The U and V components are sub-sampled horizontally and vertically by a factor of 2, and interleaved, so there should 16x10/4 = 40 UV blocks (example only sub-sampled horizontally). This update also fixes occurrences of "horizontaly".
1 parent 47b8051 commit e9b8cd3

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

index.src.html

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4268,7 +4268,7 @@
42684268
planes of Chroma, denoted Y, U and V, and present in this order. It is also
42694269
often refered to as Planar YUV 4:2:0.
42704270

4271-
The U an V planes are [=sub-sampled=] horizontaly and vertically by a
4271+
The U an V planes are [=sub-sampled=] horizontally and vertically by a
42724272
[=factor=] of 2 compared to the Y plane.
42734273

42744274
Each sample in this format is 8 bits.
@@ -4296,7 +4296,7 @@
42964296
present in this order. It is also often refered to as Planar YUV 4:2:0 with
42974297
an alpha channel.
42984298

4299-
The U an V planes are [=sub-sampled=] horizontaly and vertically by a
4299+
The U an V planes are [=sub-sampled=] horizontally and vertically by a
43004300
[=factor=] of 2 compared to the Y and Alpha planes.
43014301

43024302
Each sample in this format is 8 bits.
@@ -4325,7 +4325,7 @@
43254325
planes of Chroma, denoted Y, U and V, and present in this order. It is also
43264326
often refered to as Planar YUV 4:2:2.
43274327

4328-
The U an V planes are [=sub-sampled=] horizontaly by a [=factor=] of 2
4328+
The U an V planes are [=sub-sampled=] horizontally by a [=factor=] of 2
43294329
compared to the Y plane, and not [=sub-sampled=] vertically.
43304330

43314331
Each sample in this format is 8 bits.
@@ -4366,7 +4366,7 @@
43664366
another plane for the two Chroma components. The two planes are present in
43674367
this order, and are refered to as respectively the Y plane and the UV plane.
43684368

4369-
The U an V components are [=sub-sampled=] horizontaly and vertically by a
4369+
The U an V components are [=sub-sampled=] horizontally and vertically by a
43704370
[=factor=] of 2 compared to the components in the Y planes.
43714371

43724372
Each sample in this format is 8 bits.
@@ -4389,28 +4389,25 @@
43894389
{{VideoFrame/visibleRect}}.{{DOMRectInit/y}}) MUST be even.
43904390

43914391
<div class=example>
4392-
An image in the NV12 pixel format that is 16 pixels wide and 9 pixels tall
4392+
An image in the NV12 pixel format that is 16 pixels wide and 10 pixels tall
43934393
will be arranged like so in memory:
43944394

43954395
```
4396-
YYYYYYYYYYYYYY
4397-
YYYYYYYYYYYYYY
4398-
YYYYYYYYYYYYYY
4399-
YYYYYYYYYYYYYY
4400-
YYYYYYYYYYYYYY
4401-
YYYYYYYYYYYYYY
4402-
YYYYYYYYYYYYYY
4403-
YYYYYYYYYYYYYY
4404-
YYYYYYYYYYYYYY
4405-
UVUVUVUVUVUVUV
4406-
UVUVUVUVUVUVUV
4407-
UVUVUVUVUVUVUV
4408-
UVUVUVUVUVUVUV
4409-
UVUVUVUVUVUVUV
4410-
UVUVUVUVUVUVUV
4411-
UVUVUVUVUVUVUV
4412-
UVUVUVUVUVUVUV
4413-
UVUVUVUVUVUVUV
4396+
YYYYYYYYYYYYYYYY
4397+
YYYYYYYYYYYYYYYY
4398+
YYYYYYYYYYYYYYYY
4399+
YYYYYYYYYYYYYYYY
4400+
YYYYYYYYYYYYYYYY
4401+
YYYYYYYYYYYYYYYY
4402+
YYYYYYYYYYYYYYYY
4403+
YYYYYYYYYYYYYYYY
4404+
YYYYYYYYYYYYYYYY
4405+
YYYYYYYYYYYYYYYY
4406+
UVUVUVUVUVUVUVUV
4407+
UVUVUVUVUVUVUVUV
4408+
UVUVUVUVUVUVUVUV
4409+
UVUVUVUVUVUVUVUV
4410+
UVUVUVUVUVUVUVUV
44144411
```
44154412

44164413
All samples being linear in memory.

0 commit comments

Comments
 (0)