Skip to content

Commit

Permalink
Width, Height, Metadata in version 3.5
Browse files Browse the repository at this point in the history
  • Loading branch information
JeromeMartinez committed Feb 7, 2018
1 parent 4428ead commit af285de
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions ffv1.md
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,13 @@ Parameters( ) { |
ec | ur
intra | ur
} |
if (version == 3 && micro_version >= 5) { |{V3}
if ((version == 3 && micro_version >= 5) |{V4}
|| version >= 4) { |{V4}
width | ur
height | ur
Metadata( ) |
} |
} |
```
Expand Down Expand Up @@ -1070,6 +1077,7 @@ Meaning of micro_version for version 3:
|-------|:------------------------|
|0...3 | reserved\* |
|4 | first stable variant |
|5 | frame size and metadata |
|Other | reserved for future use |
\* development versions which may be incompatible with the stable variants.
Expand Down Expand Up @@ -1215,6 +1223,14 @@ Inferred to be 0 if not present.
|1 | Frames are independent (keyframes only) |
|Other | reserved for future use |

### width

0 if unspecified in the bitstream (provided by container)

### height

0 if unspecified in the bitstream (provided by container)

## Quantization Table Set

The Quantization Table Sets are stored by storing the number of equal entries -1 of the first half of the table (represented as `len - 1` in the pseudo-code below) using the method described in [Range Non Binary Values](#range-non-binary-values). The second half doesn’t need to be stored as it is identical to the first with flipped sign. `scale` and `len_count[ i ][ j ]` are temporary values used for the computing of `context_count[ i ]` and are not used outside Quantization Table Set pseudo-code.
Expand Down Expand Up @@ -1271,6 +1287,54 @@ QuantizationTable(i, j, scale) { |

`context_count[ i ]` indicates the count of contexts for Quantization Table Set `i`.

## Metadata

(Intro TODO). A tool using a bitstream conforming to this specification SHOULD prioritize metadata in the bitstream over metadata in the container.

```c
pseudo-code | type
--------------------------------------------------------------|-----
Metadata( ) { |
metadata_count | ur
for( i = 0; i < metadata_count; i++ ) { |
metadata_id | ur
metadata_type | ur
metadata_size [ i ] - 1 | ur
for( j = 0; j < metadata_size [ i ]; j++ ) { |
if (metadata_type == 0) |
metadata_content [ i ] [ j ] | br
if (metadata_type == 1) |
metadata_content [ i ] [ j ] | ur
if (metadata_type == 2) |
metadata_content [ i ] [ j ] | sr
} |
} |
} |
```
### metadata_count
### metadata_id
|value | metadata meaning |
|-------|:-----------------------------------------------------------------|
|0 | Range (1 = Broadcast, 2 = Full...) |
|1 | Primaries |
|2 | TransferCharacteristics |
|3 | MatrixCoefficients |
|4 | MaxCLL |
|5 | MaxFALL |
|6 | PrimaryRChromaticityX |
|... | (TODO) |
| | WhitePointChromaticityY |
| | ChromaSitingHorz |
| | Encoding library name and version (e.g. "Lavc57.107.100 ffv1") |
|Other | reserved for future use |
### metadata_type
### metadata_content
# Restrictions
To ensure that fast multithreaded decoding is possible, starting version 3 and if frame\_pixel\_width * frame\_pixel\_height is more than 101376, slice\_width * slice\_height MUST be less or equal to num\_h\_slices * num\_v\_slices / 4.
Expand Down

0 comments on commit af285de

Please sign in to comment.