1## 5.3\. Video Decoding
2
3If device implementations support VP8, VP9, H.264, or H.265 codecs, they:
4
5*   [C-1-1] MUST support dynamic video resolution and frame rate switching
6through the standard Android APIs within the same stream for all VP8, VP9,
7H.264, and H.265 codecs in real time and up to the maximum resolution supported
8by each codec on the device.
9
10### 5.3.1\. MPEG-2
11
12If device implementations support MPEG-2 decoders, they:
13
14*   [C-1-1] MUST support the Main Profile High Level.
15
16### 5.3.2\. H.263
17
18If device implementations support H.263 decoders, they:
19
20*   [C-1-1] MUST support Baseline Profile Level 30 and Level 45.
21
22### 5.3.3\. MPEG-4
23
24If device implementations with MPEG-4 decoders, they:
25
26*   [C-1-1] MUST support Simple Profile Level 3.
27
28### 5.3.4\. H.264
29
30If device implementations support H.264 decoders, they:
31
32*   [C-1-1] MUST support Main Profile Level 3.1 and Baseline Profile. Support
33for ASO (Arbitrary Slice Ordering), FMO (Flexible Macroblock Ordering) and RS
34(Redundant Slices) is OPTIONAL.
35*   [C-1-2] MUST be capable of decoding videos with the SD (Standard Definition)
36    profiles listed in the following table and encoded with the Baseline Profile
37    and Main Profile Level 3.1 (including 720p30).
38*   SHOULD be capable of decoding videos with the HD (High Definition) profiles
39    as indicated in the following table.
40
41If the height that is reported by the `Display.getSupportedModes()` method is
42equal or greater than the video resolution, device implementations:
43
44*   [C-2-1] MUST support the HD 720p video decoding profiles in the following
45table.
46*   [C-2-2] MUST support the HD 1080p video decoding profiles in the following
47table.
48
49
50<table>
51 <tr>
52    <th></th>
53    <th>SD (Low quality)</th>
54    <th>SD (High quality)</th>
55    <th>HD 720p</th>
56    <th>HD 1080p</th>
57 </tr>
58 <tr>
59    <th>Video resolution</th>
60    <td>320 x 240 px</td>
61    <td>720 x 480 px</td>
62    <td>1280 x 720 px</td>
63    <td>1920 x 1080 px</td>
64 </tr>
65 <tr>
66    <th>Video frame rate</th>
67    <td>30 fps</td>
68    <td>30 fps</td>
69    <td>60 fps</td>
70    <td>30 fps (60 fps<sup>Television</sup>)</td>
71 </tr>
72 <tr>
73    <th>Video bitrate</th>
74    <td>800 Kbps </td>
75    <td>2 Mbps</td>
76    <td>8 Mbps</td>
77    <td>20 Mbps</td>
78 </tr>
79</table>
80
81### 5.3.5\. H.265 (HEVC)
82
83
84If device implementations support H.265 codec, they:
85
86*   [C-1-1] MUST support the Main Profile Level 3 Main tier and the SD video
87decoding profiles as indicated in the following table.
88*   SHOULD support the HD decoding profiles as indicated in the following table.
89*   [C-1-2] MUST support the HD decoding profiles as indicated in the following
90table if there is a hardware decoder.
91
92If the height that is reported by the `Display.getSupportedModes()` method is
93equal to or greater than the video resolution, then:
94
95*   [C-2-1] Device implementations MUST support at least one of H.265 or VP9
96decoding of 720, 1080 and UHD profiles.
97
98<table>
99 <tr>
100    <th></th>
101    <th>SD (Low quality)</th>
102    <th>SD (High quality)</th>
103    <th>HD 720p</th>
104    <th>HD 1080p</th>
105    <th>UHD</th>
106 </tr>
107 <tr>
108    <th>Video resolution</th>
109    <td>352 x 288 px</td>
110    <td>720 x 480 px</td>
111    <td>1280 x 720 px</td>
112    <td>1920 x 1080 px</td>
113    <td>3840 x 2160 px</td>
114 </tr>
115 <tr>
116    <th>Video frame rate</th>
117    <td>30 fps</td>
118    <td>30 fps</td>
119    <td>30 fps</td>
120    <td>30/60 fps (60 fps<sup>Television with H.265 hardware decoding</sup>)</td>
121    <td>60 fps</td>
122 </tr>
123 <tr>
124    <th>Video bitrate</th>
125    <td>600 Kbps </td>
126    <td>1.6 Mbps</td>
127    <td>4 Mbps</td>
128    <td>5 Mbps</td>
129    <td>20 Mbps</td>
130 </tr>
131</table>
132
133If device implementations claim to support an HDR Profile through the Media
134APIs:
135
136*   [C-3-1] Device implementations MUST accept the required HDR metadata from
137the application, as well as support extracting and outputting the required HDR
138metadata from the bitstream and/or container.
139*   [C-3-2] Device implementations MUST properly display HDR content on the
140device screen or on a standard video output port (e.g., HDMI).
141
142### 5.3.6\. VP8
143
144If device implementations support VP8 codec, they:
145
146*   [C-1-1] MUST support the SD decoding profiles in the following table.
147*   SHOULD use a hardware VP8 codec that meets the
148[requirements]("http://www.webmproject.org/hardware/rtc-coding-requirements/").
149*   SHOULD support the HD decoding profiles in the following table.
150
151
152If the height as reported by the `Display.getSupportedModes()` method is equal
153or greater than the video resolution, then:
154
155*   [C-2-1] Device implementations MUST support 720p profiles in the
156following table.
157*   [C-2-2] Device implementations MUST support 1080p profiles in the
158following table.
159
160
161<table>
162 <tr>
163    <th></th>
164    <th>SD (Low quality)</th>
165    <th>SD (High quality)</th>
166    <th>HD 720p</th>
167    <th>HD 1080p</th>
168 </tr>
169 <tr>
170    <th>Video resolution</th>
171    <td>320 x 180 px</td>
172    <td>640 x 360 px</td>
173    <td>1280 x 720 px</td>
174    <td>1920 x 1080 px</td>
175 </tr>
176 <tr>
177    <th>Video frame rate</th>
178    <td>30 fps</td>
179    <td>30 fps</td>
180    <td>30 fps (60 fps<sup>Television</sup>)</td>
181    <td>30 (60 fps<sup>Television</sup>)</td>
182 </tr>
183 <tr>
184    <th>Video bitrate</th>
185    <td>800 Kbps </td>
186    <td>2 Mbps</td>
187    <td>8 Mbps</td>
188    <td>20 Mbps</td>
189 </tr>
190</table>
191
192
193### 5.3.7\. VP9
194
195If device implementations support VP9 codec, they:
196
197*   [C-1-1] MUST support the SD video decoding profiles as indicated in the
198following table.
199*   SHOULD support the HD decoding profiles as indicated in the following table.
200
201If device implementations support VP9 codec and a hardware decoder:
202
203*   [C-2-1] MUST support the HD decoding profiles as indicated in the following
204table.
205
206If the height that is reported by the `Display.getSupportedModes()` method is
207equal to or greater than the video resolution, then:
208
209*   [C-3-1] Device implementations MUST support at least one of VP9 or H.265
210decoding of the 720, 1080 and UHD profiles.
211
212<table>
213 <tr>
214    <th></th>
215    <th>SD (Low quality)</th>
216    <th>SD (High quality)</th>
217    <th>HD 720p</th>
218    <th>HD 1080p</th>
219    <th>UHD</th>
220 </tr>
221 <tr>
222    <th>Video resolution</th>
223    <td>320 x 180 px</td>
224    <td>640 x 360 px</td>
225    <td>1280 x 720 px</td>
226    <td>1920 x 1080 px</td>
227    <td>3840 x 2160 px</td>
228 </tr>
229 <tr>
230    <th>Video frame rate</th>
231    <td>30 fps</td>
232    <td>30 fps</td>
233    <td>30 fps</td>
234    <td>30 fps (60 fps<sup>Television with VP9 hardware decoding</sup>)</td>
235    <td>60 fps</td>
236 </tr>
237 <tr>
238    <th>Video bitrate</th>
239    <td>600 Kbps</td>
240    <td>1.6 Mbps</td>
241    <td>4 Mbps</td>
242    <td>5 Mbps</td>
243    <td>20 Mbps</td>
244 </tr>
245</table>
246
247If device implementations claim to support `VP9Profile2` or `VP9Profile3`
248through the ['CodecProfileLevel'](
249https://developer.android.com/reference/android/media/MediaCodecInfo.CodecProfileLevel)
250media APIs:
251
252*   Support for 12-bit format is OPTIONAL.
253
254If device implementations claim to support an HDR Profile (`VP9Profile2HDR`,
255`VP9Profile2HDR10Plus`, `VP9Profile3HDR`, `VP9Profile3HDR10Plus`) through the
256media APIs:
257
258*   [C-4-1] Device implementations MUST accept the required HDR metadata
259([`KEY_HDR_STATIC_INFO`](
260https://developer.android.com/reference/android/media/MediaFormat.html#KEY_HDR_STATIC_INFO)
261for all HDR profiles, as well as
262['KEY_HDR10_PLUS_INFO'](
263https://developer.android.com/reference/android/media/MediaFormat.html#KEY_HDR10_PLUS_INFO)
264for HDR10Plus profiles)
265from the application. They also MUST support extracting and outputting the
266required HDR metadata from the bitstream and/or container.
267*   [C-4-2] Device implementations MUST properly display HDR content on the
268device screen or on a standard video output port (e.g., HDMI).
269
270
271## 5.3.8\.  Dolby Vision
272
273If device implementations declare support for the Dolby Vision decoder through
274[`HDR_TYPE_DOLBY_VISION`](
275https://developer.android.com/reference/android/view/Display.HdrCapabilities.html#HDR_TYPE_DOLBY_VISION)
276, they:
277
278*   [C-1-1] MUST provide a Dolby Vision-capable extractor.
279*   [C-1-2] MUST properly display Dolby Vision content on the device screen or
280on a standard video output port (e.g., HDMI).
281*   [C-1-3] MUST set the track index of backward-compatible base-layer(s) (if
282present) to be the same as the combined Dolby Vision layer's track index.
283
284### 5.3.9\. AV1
285
286If device implementations support AV1 codec, they:
287
288*   [C-1-1] MUST support Profile 0 including 10-bit content.
289