VP9 CodecPrivate

Objective

Add optional VP9 metadata to the WebM and Matroska containers.

Background

Hardware video decoders have an upper bound on features of a codec that they can reliably encode and decode. The combination of different codec features that can be set is exponential. From content creators to hardware codec designers, everyone needs a language to talk about specific codec capabilities. The distribution of codec features into buckets make it very easy for everyone to know about the capabilities of many different hardware decoders. These buckets have been defined [2].

Design

VP9 levels, profiles, bit depth and chroma subsampling values defined are specific to VP9, so the data will be stored in the CodecPrivate element. This will be the first time CodecPrivate data will be specified for the VP9 codec. VP9 CodecPrivate data will be defined as a list of codec features.


VP9 Codec Feature Format

0                   1                   2                   3

0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

|    ID Byte    |     Length    |                               |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               |

|                                                               |

:               Bytes 1..Length of Codec Feature                :

|                                                               |

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Each codec feature will defined by the binary format of ID byte, length, and data.


ID Byte Format

ID byte will be an unsigned byte.

0 1 2 3 4 5 6 7

+-+-+-+-+-+-+-+-+
|X|    ID       |

+-+-+-+-+-+-+-+-+



X bit:

Reserved for future expansion (currently MUST be set to 0).


ID bits:

These bits signify the identification bits of the VP9 codec feature.


Length Format

Length will be stored as an unsigned 8 bit integer.


Current Codec Features

VP9 Profile

ID = 1, Length = 1

The data is an unsigned 8 bit integer that specifies the number of decoded bits per channel. The VP9 profile in the bitstream is canonical and should match the VP9 profile set in the container. Possible values are from 0-3. All other values are undefined. See VP9 spec [1] for the value definitions.


VP9 Level

ID = 2, Length = 1

The data is an unsigned 8 bit integer that specifies the VP9 level. Possible values are:

10: Level 1

11: Level 1.1

20: Level 2

21: Level 2.1

30: Level 3

31: Level 3.1

40: Level 4

41: Level 4.1

50: Level 5

51: Level 5.1

52: Level 5.2

60: Level 6

61: Level 6.1

62: Level 6.2

All other values are currently undefined. See VP9 Levels [2] for definitions.


Bit Depth

ID = 3, Length = 1

The data is an unsigned 8 bit integer that specifies the number of decoded bits per channel. Possible values are 8, 10, and 12.


Chroma Subsampling

ID = 4, Length = 1

The data is an unsigned 8 bit integer that specifies the chroma subsampling. Possible values are:

0: 4:2:0

1: Reserved for future use.

2: 4:2:2

3: 4:4:4

All other values are currently undefined.

References

[1] https://storage.googleapis.com/downloads.webmproject.org/docs/vp9/vp9-bitstream-specification-v0.6-20160331-draft.pdf

[2] http://www.webmproject.org/vp9/levels/


Comments