Skip to content

Commit

Permalink
Add a definition for sub-sampling concepts, an example, and link to t…
Browse files Browse the repository at this point in the history
…hose definitions.
  • Loading branch information
padenot committed Jul 15, 2021
1 parent e563c61 commit 24ba038
Showing 1 changed file with 30 additions and 15 deletions.
45 changes: 30 additions & 15 deletions index.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -3214,9 +3214,9 @@

1. Let |plane| be the Plane identified by |planeIndex| as defined by
{{VideoFrame/[[format]]}}.
2. Let |sampleWidth| be the horizontal pixel size of each subsample
for |plane|.
3. Let |sampleHeight| be the vertical pixel size of each subsample
2. Let |sampleWidth| be the horizontal [=sub-sampling factor=] of each
subsample for |plane|.
3. Let |sampleHeight| be the vertical [=sub-sampling factor=] of each subsample
for |plane|.
4. If |sourceRect|.{{DOMRectReadOnly/x}} and
|sourceRect|.{{DOMRectReadOnly/width}} are not both multiples of
Expand All @@ -3241,10 +3241,10 @@
1. Let |plane| be the Plane identified by |planeIndex| as defined by
{{VideoFrame/[[format]]}}.
2. Let |sampleBytes| be the number of bytes per sample for |plane|.
3. Let |sampleWidth| be the horizontal pixel size of each subsample
for |plane|.
4. Let |sampleHeight| be the vertical pixel size of each subsample
for |plane|.
3. Let |sampleWidth| be the horizontal [=sub-sampling factor=] of each
subsample for |plane|.
4. Let |sampleHeight| be the vertical [=sub-sampling factor=] of each
subsample for |plane|.
5. Let |sampleWidthBytes| be the product of multiplying |sampleWidth| by
|sampleBytes|.
6. Let |computedLayout| be a new [=computed plane layout=].
Expand Down Expand Up @@ -3453,15 +3453,30 @@
};
</xmp>

<dfn lt="sub-sampling|sub-sampled">Sub-sampling</dfn> is a technique
where a single sample contains information for multiple pixels in the final
image. [=Sub-sampling=] can be horizontal, vertical or both, and has a <dfn
lt="sub-sampling factor|factor">factor</dfn>, that is the number of final pixels
in the image that are derived from a [=sub-sampled=] sample.

<div class=example>
If a {{VideoFrame}} is in {{I420}} format, then the very first
component of the second plane (the U plane) corresponds to four pixels, that are
the pixels in the top-left angle of the image. Consequently, the first
component of the second row corresponds to the four pixels below those initial
four top-left pixels. The [=sub-sampling factor=] is 2 in both the horizontal
and vertical direction.
</div>

<dl>
<dt><dfn enum-value for=PixelFormat>I420</dfn></dt>
<dd>
This format is composed of three distinct planes, one plane of Luma and two
planes of Chroma, denoted Y, U and V, and present in this order. It is also
often refered to as Planar YUV 4:2:0.

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

Each sample in this format is 8 bits.

Expand All @@ -3487,8 +3502,8 @@
present in this order. It is also often refered to as Planar YUV 4:2:0 with
an alpha channel.

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

Each sample in this format is 8 bits.

Expand All @@ -3513,8 +3528,8 @@
planes of Chroma, denoted Y, U and V, and present in this order. It is also
often refered to as Planar YUV 4:2:2.

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

Each sample in this format is 8 bits.

Expand Down Expand Up @@ -3554,8 +3569,8 @@
another plane for the two Chroma components. The two planes are present in
this order, and are refered to as respectively the Y plane and the UV plane.

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

Each sample in this format is 8 bits.

Expand Down

0 comments on commit 24ba038

Please sign in to comment.