1e5c31af7Sopenharmony_ci// Copyright 2018-2024 The Khronos Group Inc.
2e5c31af7Sopenharmony_ci//
3e5c31af7Sopenharmony_ci// SPDX-License-Identifier: CC-BY-4.0
4e5c31af7Sopenharmony_ci
5e5c31af7Sopenharmony_ci[[decode-h264]]
6e5c31af7Sopenharmony_ci== H.264 Decode Operations
7e5c31af7Sopenharmony_ci
8e5c31af7Sopenharmony_ciVideo decode operations using an <<decode-h264-profile,H.264 decode
9e5c31af7Sopenharmony_ciprofile>> can: be used to decode elementary video stream sequences compliant
10e5c31af7Sopenharmony_cito the <<itu-t-h264,ITU-T H.264 Specification>>.
11e5c31af7Sopenharmony_ci
12e5c31af7Sopenharmony_ci[NOTE]
13e5c31af7Sopenharmony_ci.Note
14e5c31af7Sopenharmony_ci====
15e5c31af7Sopenharmony_ciRefer to the <<preamble,Preamble>> for information on how the Khronos
16e5c31af7Sopenharmony_ciIntellectual Property Rights Policy relates to normative references to
17e5c31af7Sopenharmony_ciexternal materials not created by Khronos.
18e5c31af7Sopenharmony_ci====
19e5c31af7Sopenharmony_ci
20e5c31af7Sopenharmony_ciThis process is performed according to the <<decode-operation-steps,video
21e5c31af7Sopenharmony_cidecode operation steps>> with the codec-specific semantics defined in
22e5c31af7Sopenharmony_cisection 8 of the <<itu-t-h264,ITU-T H.264 Specification>> as follows:
23e5c31af7Sopenharmony_ci
24e5c31af7Sopenharmony_ci  * Syntax elements, derived values, and other parameters are applied from
25e5c31af7Sopenharmony_ci    the following structures:
26e5c31af7Sopenharmony_ci  ** The code:StdVideoH264SequenceParameterSet structure corresponding to
27e5c31af7Sopenharmony_ci     the <<decode-h264-active-sps,active SPS>> specifying the
28e5c31af7Sopenharmony_ci     <<decode-h264-sps, H.264 sequence parameter set>>.
29e5c31af7Sopenharmony_ci  ** The code:StdVideoH264PictureParameterSet structure corresponding to the
30e5c31af7Sopenharmony_ci     <<decode-h264-active-pps,active PPS>> specifying the <<decode-h264-pps,
31e5c31af7Sopenharmony_ci     H.264 picture parameter set>>.
32e5c31af7Sopenharmony_ci  ** The code:StdVideoDecodeH264PictureInfo structure specifying the
33e5c31af7Sopenharmony_ci     <<decode-h264-picture-info,H.264 picture information>>.
34e5c31af7Sopenharmony_ci  ** The code:StdVideoDecodeH264ReferenceInfo structures specifying the
35e5c31af7Sopenharmony_ci     <<decode-h264-reference-info,H.264 reference information>>
36e5c31af7Sopenharmony_ci     corresponding to the optional <<reconstructed-picture,reconstructed
37e5c31af7Sopenharmony_ci     picture>> and any <<active-reference-pictures,active reference
38e5c31af7Sopenharmony_ci     pictures>>.
39e5c31af7Sopenharmony_ci  * The contents of the provided video bitstream buffer range are
40e5c31af7Sopenharmony_ci    interpreted as defined in the <<decode-h264-bitstream-data-access,H.264
41e5c31af7Sopenharmony_ci    Decode Bitstream Data Access>> section.
42e5c31af7Sopenharmony_ci  * Picture data in the <<video-picture-resources,video picture resources>>
43e5c31af7Sopenharmony_ci    corresponding to the used <<decode-h264-active-reference-picture-info,
44e5c31af7Sopenharmony_ci    active reference pictures>>, <<decode-h264-output-picture-info,decode
45e5c31af7Sopenharmony_ci    output picture>>, and optional <<decode-h264-reconstructed-picture-info,
46e5c31af7Sopenharmony_ci    reconstructed picture>> is accessed as defined in the
47e5c31af7Sopenharmony_ci    <<decode-h264-picture-data-access,H.264 Decode Picture Data Access>>
48e5c31af7Sopenharmony_ci    section.
49e5c31af7Sopenharmony_ci  * The decision on <<decode-ref-pic-setup,reference picture setup>> is made
50e5c31af7Sopenharmony_ci    according to the parameters specified in the
51e5c31af7Sopenharmony_ci    <<decode-h264-ref-pic-setup,H.264 picture information>>.
52e5c31af7Sopenharmony_ci
53e5c31af7Sopenharmony_ciIf the parameters and the bitstream adhere to the syntactic and semantic
54e5c31af7Sopenharmony_cirequirements defined in the corresponding sections of the <<itu-t-h264,ITU-T
55e5c31af7Sopenharmony_ciH.264 Specification>>, as described above, and the <<dpb-slot,DPB slots>>
56e5c31af7Sopenharmony_ciassociated with the <<active-reference-pictures,active reference pictures>>
57e5c31af7Sopenharmony_ciall refer to <<dpb-slot-states,valid picture references>>, then the video
58e5c31af7Sopenharmony_cidecode operation will complete successfully.
59e5c31af7Sopenharmony_ciOtherwise, the video decode operation may: complete
60e5c31af7Sopenharmony_ci<<decode-unsuccessful,unsuccessfully>>.
61e5c31af7Sopenharmony_ci
62e5c31af7Sopenharmony_ci
63e5c31af7Sopenharmony_ci[[decode-h264-bitstream-data-access]]
64e5c31af7Sopenharmony_ci=== H.264 Decode Bitstream Data Access
65e5c31af7Sopenharmony_ci
66e5c31af7Sopenharmony_ciIf the target <<decode-h264-output-picture-info,decode output picture>> is a
67e5c31af7Sopenharmony_ciframe, then the video bitstream buffer range should: contain a VCL NAL unit
68e5c31af7Sopenharmony_cicomprised of the slice headers and data of a picture representing an entire
69e5c31af7Sopenharmony_ciframe, as defined in sections 7.3.3 and 7.3.4, and this data is interpreted
70e5c31af7Sopenharmony_cias defined in sections 7.4.3 and 7.4.4 of the <<itu-t-h264,ITU-T H.264
71e5c31af7Sopenharmony_ciSpecification>>, respectively.
72e5c31af7Sopenharmony_ci
73e5c31af7Sopenharmony_ciIf the target <<decode-h264-output-picture-info,decode output picture>> is a
74e5c31af7Sopenharmony_cifield, then the video bitstream buffer range should contain a VCL NAL unit
75e5c31af7Sopenharmony_cicomprised of the slice headers and data of a picture representing a field,
76e5c31af7Sopenharmony_cias defined in sections 7.3.3 and 7.3.4, and this data is interpreted as
77e5c31af7Sopenharmony_cidefined in sections 7.4.3 and 7.4.4 of the <<itu-t-h264,ITU-T H.264
78e5c31af7Sopenharmony_ciSpecification>>, respectively.
79e5c31af7Sopenharmony_ci
80e5c31af7Sopenharmony_ciThe offsets provided in
81e5c31af7Sopenharmony_cislink:VkVideoDecodeH264PictureInfoKHR::pname:pSliceOffsets should: specify
82e5c31af7Sopenharmony_cithe starting offsets corresponding to each slice header within the video
83e5c31af7Sopenharmony_cibitstream buffer range.
84e5c31af7Sopenharmony_ci
85e5c31af7Sopenharmony_ci
86e5c31af7Sopenharmony_ci[[decode-h264-picture-data-access]]
87e5c31af7Sopenharmony_ci=== H.264 Decode Picture Data Access
88e5c31af7Sopenharmony_ci
89e5c31af7Sopenharmony_ciThe effective pname:imageOffset and pname:imageExtent corresponding to a
90e5c31af7Sopenharmony_ci<<decode-output-picture,decode output picture>>,
91e5c31af7Sopenharmony_ci<<reference-picture,reference picture>>, or
92e5c31af7Sopenharmony_ci<<reconstructed-picture,reconstructed picture>> used in video decode
93e5c31af7Sopenharmony_cioperations with an <<decode-h264-profile,H.264 decode profile>> are defined
94e5c31af7Sopenharmony_cias follows:
95e5c31af7Sopenharmony_ci
96e5c31af7Sopenharmony_ci  * pname:imageOffset is [eq]#(pname:codedOffset.x,pname:codedOffset.y)# and
97e5c31af7Sopenharmony_ci    pname:imageExtent is [eq]#(pname:codedExtent.width,
98e5c31af7Sopenharmony_ci    pname:codedExtent.height)#, if the picture represents a frame.
99e5c31af7Sopenharmony_ci  * pname:imageOffset is [eq]#(pname:codedOffset.x,pname:codedOffset.y)# and
100e5c31af7Sopenharmony_ci    pname:imageExtent is [eq]#(pname:codedExtent.width,
101e5c31af7Sopenharmony_ci    pname:codedExtent.height)#, if the picture represents a field and the
102e5c31af7Sopenharmony_ci    picture layout of the used <<decode-h264-profile,H.264 decode profile>>
103e5c31af7Sopenharmony_ci    is
104e5c31af7Sopenharmony_ci    ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR.
105e5c31af7Sopenharmony_ci  * pname:imageOffset is [eq]#(pname:codedOffset.x,pname:codedOffset.y)# and
106e5c31af7Sopenharmony_ci    pname:imageExtent is [eq]#(pname:codedExtent.width,
107e5c31af7Sopenharmony_ci    pname:codedExtent.height / 2)#, if the picture represents a field and
108e5c31af7Sopenharmony_ci    the picture layout of the used <<decode-h264-profile,H.264 decode
109e5c31af7Sopenharmony_ci    profile>> is
110e5c31af7Sopenharmony_ci    ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR.
111e5c31af7Sopenharmony_ci
112e5c31af7Sopenharmony_ciWhere pname:codedOffset and pname:codedExtent are the members of the
113e5c31af7Sopenharmony_cislink:VkVideoPictureResourceInfoKHR structure corresponding to the picture.
114e5c31af7Sopenharmony_ci
115e5c31af7Sopenharmony_ciHowever, accesses to image data within a video picture resource happen at
116e5c31af7Sopenharmony_cithe granularity indicated by
117e5c31af7Sopenharmony_cislink:VkVideoCapabilitiesKHR::pname:pictureAccessGranularity, as returned by
118e5c31af7Sopenharmony_ciflink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used <<video-profiles,
119e5c31af7Sopenharmony_civideo profile>>.
120e5c31af7Sopenharmony_ciThis means that the complete image subregion accessed by video coding
121e5c31af7Sopenharmony_cioperations using an <<decode-h264-profile,H.264 decode profile>> for the
122e5c31af7Sopenharmony_civideo picture resource is defined as the set of texels within the coordinate
123e5c31af7Sopenharmony_cirange:
124e5c31af7Sopenharmony_ci
125e5c31af7Sopenharmony_ci  {empty}:: [eq]#([pname:startX,pname:endX),[pname:startY,pname:endY))#
126e5c31af7Sopenharmony_ci
127e5c31af7Sopenharmony_ciWhere:
128e5c31af7Sopenharmony_ci
129e5c31af7Sopenharmony_ci  * [eq]#pname:startX# equals pname:imageOffset.x rounded down to the
130e5c31af7Sopenharmony_ci    nearest integer multiple of pname:pictureAccessGranularity.width;
131e5c31af7Sopenharmony_ci  * [eq]#pname:endX# equals [eq]#pname:imageOffset.x {plus}
132e5c31af7Sopenharmony_ci    pname:imageExtent.width# rounded up to the nearest integer multiple of
133e5c31af7Sopenharmony_ci    pname:pictureAccessGranularity.width and clamped to the width of the
134e5c31af7Sopenharmony_ci    image subresource <<video-image-subresource-reference,referred>> to by
135e5c31af7Sopenharmony_ci    the corresponding slink:VkVideoPictureResourceInfoKHR structure;
136e5c31af7Sopenharmony_ci  * [eq]#startY# equals pname:imageOffset.y rounded down to the nearest
137e5c31af7Sopenharmony_ci    integer multiple of pname:pictureAccessGranularity.height;
138e5c31af7Sopenharmony_ci  * [eq]#endY# equals [eq]#pname:imageOffset.y {plus}
139e5c31af7Sopenharmony_ci    pname:imageExtent.height# rounded up to the nearest integer multiple of
140e5c31af7Sopenharmony_ci    pname:pictureAccessGranularity.height and clamped to the height of the
141e5c31af7Sopenharmony_ci    image subresource <<video-image-subresource-reference,referred>> to by
142e5c31af7Sopenharmony_ci    the corresponding slink:VkVideoPictureResourceInfoKHR structure.
143e5c31af7Sopenharmony_ci
144e5c31af7Sopenharmony_ciIn case of video decode operations using an <<decode-h264-profile,H.264
145e5c31af7Sopenharmony_cidecode profile>>, any access to a picture at the coordinates
146e5c31af7Sopenharmony_ci[eq]#(pname:x,pname:y)#, as defined by the <<itu-t-h264,ITU-T H.264
147e5c31af7Sopenharmony_ciSpecification>>, is an access to the image subresource
148e5c31af7Sopenharmony_ci<<video-image-subresource-reference,referred>> to by the corresponding
149e5c31af7Sopenharmony_cislink:VkVideoPictureResourceInfoKHR structure at the texel coordinates
150e5c31af7Sopenharmony_cispecified below:
151e5c31af7Sopenharmony_ci
152e5c31af7Sopenharmony_ci  * [eq]#(pname:x,pname:y)#, if the accessed picture represents a frame.
153e5c31af7Sopenharmony_ci  * [eq]#(pname:x,pname:y {times} 2)#, if the accessed picture represents a
154e5c31af7Sopenharmony_ci    top field and the picture layout of the used <<decode-h264-profile,H.264
155e5c31af7Sopenharmony_ci    decode profile>> is
156e5c31af7Sopenharmony_ci    ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR.
157e5c31af7Sopenharmony_ci  * [eq]#(pname:x,pname:y {times} 2 {plus} 1)#, if the accessed picture
158e5c31af7Sopenharmony_ci    represents a bottom field and the picture layout of the used
159e5c31af7Sopenharmony_ci    <<decode-h264-profile,H.264 decode profile>> is
160e5c31af7Sopenharmony_ci    ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR.
161e5c31af7Sopenharmony_ci  * [eq]#(pname:x,pname:y)#, if the accessed picture represents a top field
162e5c31af7Sopenharmony_ci    and the picture layout of the used <<decode-h264-profile,H.264 decode
163e5c31af7Sopenharmony_ci    profile>> is
164e5c31af7Sopenharmony_ci    ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR.
165e5c31af7Sopenharmony_ci  * [eq]#(pname:codedOffset.x {plus} pname:x,pname:codedOffset.y {plus}
166e5c31af7Sopenharmony_ci    pname:y)#, if the accessed picture represents a bottom field and the
167e5c31af7Sopenharmony_ci    picture layout of the used <<decode-h264-profile,H.264 decode profile>>
168e5c31af7Sopenharmony_ci    is
169e5c31af7Sopenharmony_ci    ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR.
170e5c31af7Sopenharmony_ci
171e5c31af7Sopenharmony_ciWhere pname:codedOffset is the member of the corresponding
172e5c31af7Sopenharmony_cislink:VkVideoPictureResourceInfoKHR structure.
173e5c31af7Sopenharmony_ci
174e5c31af7Sopenharmony_ci
175e5c31af7Sopenharmony_ci[[decode-h264-profile]]
176e5c31af7Sopenharmony_ci=== H.264 Decode Profile
177e5c31af7Sopenharmony_ci
178e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH264ProfileInfoKHR',desc='Structure specifying H.264 decode-specific video profile parameters',type='structs']
179e5c31af7Sopenharmony_ci--
180e5c31af7Sopenharmony_ciA video profile supporting H.264 video decode operations is specified by
181e5c31af7Sopenharmony_cisetting slink:VkVideoProfileInfoKHR::pname:videoCodecOperation to
182e5c31af7Sopenharmony_ciename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR and adding a
183e5c31af7Sopenharmony_cisname:VkVideoDecodeH264ProfileInfoKHR structure to the
184e5c31af7Sopenharmony_cislink:VkVideoProfileInfoKHR::pname:pNext chain.
185e5c31af7Sopenharmony_ci
186e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH264ProfileInfoKHR structure is defined as:
187e5c31af7Sopenharmony_ci
188e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH264ProfileInfoKHR.adoc[]
189e5c31af7Sopenharmony_ci
190e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
191e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
192e5c31af7Sopenharmony_ci    structure.
193e5c31af7Sopenharmony_ci  * pname:stdProfileIdc is a code:StdVideoH264ProfileIdc value specifying
194e5c31af7Sopenharmony_ci    the H.264 codec profile IDC, as defined in section A.2 of the
195e5c31af7Sopenharmony_ci    <<itu-t-h264,ITU-T H.264 Specification>>.
196e5c31af7Sopenharmony_ci  * pname:pictureLayout is a elink:VkVideoDecodeH264PictureLayoutFlagBitsKHR
197e5c31af7Sopenharmony_ci    value specifying the picture layout used by the H.264 video sequence to
198e5c31af7Sopenharmony_ci    be decoded.
199e5c31af7Sopenharmony_ci
200e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH264ProfileInfoKHR.adoc[]
201e5c31af7Sopenharmony_ci--
202e5c31af7Sopenharmony_ci
203e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH264PictureLayoutFlagBitsKHR',desc='H.264 video decode picture layout flags',type='enums']
204e5c31af7Sopenharmony_ci--
205e5c31af7Sopenharmony_ciThe H.264 video decode picture layout flags are defined as follows:
206e5c31af7Sopenharmony_ci
207e5c31af7Sopenharmony_ciinclude::{generated}/api/enums/VkVideoDecodeH264PictureLayoutFlagBitsKHR.adoc[]
208e5c31af7Sopenharmony_ci
209e5c31af7Sopenharmony_ci  * ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_PROGRESSIVE_KHR specifies
210e5c31af7Sopenharmony_ci    support for progressive content.
211e5c31af7Sopenharmony_ci    This flag has the value `0`.
212e5c31af7Sopenharmony_ci  * ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR
213e5c31af7Sopenharmony_ci    specifies support for or use of a picture layout for interlaced content
214e5c31af7Sopenharmony_ci    where all lines belonging to the top field are decoded to the
215e5c31af7Sopenharmony_ci    even-numbered lines within the picture resource, and all lines belonging
216e5c31af7Sopenharmony_ci    to the bottom field are decoded to the odd-numbered lines within the
217e5c31af7Sopenharmony_ci    picture resource.
218e5c31af7Sopenharmony_ci  * ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR
219e5c31af7Sopenharmony_ci    specifies support for or use of a picture layout for interlaced content
220e5c31af7Sopenharmony_ci    where all lines belonging to a field are grouped together in a single
221e5c31af7Sopenharmony_ci    image subregion, and the two fields comprising the frame can: be stored
222e5c31af7Sopenharmony_ci    in separate image subregions of the same image subresource or in
223e5c31af7Sopenharmony_ci    separate image subresources.
224e5c31af7Sopenharmony_ci--
225e5c31af7Sopenharmony_ci
226e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH264PictureLayoutFlagsKHR',desc='Bitmask of VkVideoDecodeH264PictureLayoutFlagBitsKHR',type='flags']
227e5c31af7Sopenharmony_ci--
228e5c31af7Sopenharmony_ciinclude::{generated}/api/flags/VkVideoDecodeH264PictureLayoutFlagsKHR.adoc[]
229e5c31af7Sopenharmony_ci
230e5c31af7Sopenharmony_citname:VkVideoDecodeH264PictureLayoutFlagsKHR is a bitmask type for setting a
231e5c31af7Sopenharmony_cimask of zero or more elink:VkVideoDecodeH264PictureLayoutFlagBitsKHR.
232e5c31af7Sopenharmony_ci--
233e5c31af7Sopenharmony_ci
234e5c31af7Sopenharmony_ci
235e5c31af7Sopenharmony_ci=== H.264 Decode Capabilities
236e5c31af7Sopenharmony_ci
237e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH264CapabilitiesKHR',desc='Structure describing H.264 decode capabilities',type='structs']
238e5c31af7Sopenharmony_ci--
239e5c31af7Sopenharmony_ciWhen calling flink:vkGetPhysicalDeviceVideoCapabilitiesKHR to query the
240e5c31af7Sopenharmony_cicapabilities for an <<decode-h264-profile,H.264 decode profile>>, the
241e5c31af7Sopenharmony_cislink:VkVideoCapabilitiesKHR::pname:pNext chain must: include a
242e5c31af7Sopenharmony_cisname:VkVideoDecodeH264CapabilitiesKHR structure that will be filled with
243e5c31af7Sopenharmony_cithe profile-specific capabilities.
244e5c31af7Sopenharmony_ci
245e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH264CapabilitiesKHR structure is defined as:
246e5c31af7Sopenharmony_ci
247e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH264CapabilitiesKHR.adoc[]
248e5c31af7Sopenharmony_ci
249e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
250e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
251e5c31af7Sopenharmony_ci    structure.
252e5c31af7Sopenharmony_ci  * pname:maxLevelIdc is a code:StdVideoH264LevelIdc value indicating the
253e5c31af7Sopenharmony_ci    maximum H.264 level supported by the profile, where enum constant
254e5c31af7Sopenharmony_ci    `STD_VIDEO_H264_LEVEL_IDC_<major>_<minor>` identifies H.264 level
255e5c31af7Sopenharmony_ci    `<major>.<minor>` as defined in section A.3 of the <<itu-t-h264,ITU-T
256e5c31af7Sopenharmony_ci    H.264 Specification>>.
257e5c31af7Sopenharmony_ci  * pname:fieldOffsetGranularity is the minimum alignment for
258e5c31af7Sopenharmony_ci    slink:VkVideoPictureResourceInfoKHR::pname:codedOffset specified for a
259e5c31af7Sopenharmony_ci    <<video-picture-resources,video picture resource>> when using the
260e5c31af7Sopenharmony_ci    picture layout
261e5c31af7Sopenharmony_ci    ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR.
262e5c31af7Sopenharmony_ci
263e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH264CapabilitiesKHR.adoc[]
264e5c31af7Sopenharmony_ci--
265e5c31af7Sopenharmony_ci
266e5c31af7Sopenharmony_ci
267e5c31af7Sopenharmony_ci[[decode-h264-parameter-sets]]
268e5c31af7Sopenharmony_ci=== H.264 Decode Parameter Sets
269e5c31af7Sopenharmony_ci
270e5c31af7Sopenharmony_ci<<video-session-parameters,Video session parameters>> objects created with
271e5c31af7Sopenharmony_cithe video codec operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR
272e5c31af7Sopenharmony_cican: contain the following types of parameters:
273e5c31af7Sopenharmony_ci
274e5c31af7Sopenharmony_ci:operationType: decode
275e5c31af7Sopenharmony_ciinclude::{chapters}/video/h264_parameter_sets.adoc[]
276e5c31af7Sopenharmony_ci
277e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH264SessionParametersCreateInfoKHR',desc='Structure specifies H.264 decoder parameter set information',type='structs']
278e5c31af7Sopenharmony_ci--
279e5c31af7Sopenharmony_ciWhen a <<video-session-parameters,video session parameters>> object is
280e5c31af7Sopenharmony_cicreated with the codec operation
281e5c31af7Sopenharmony_ciename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, the
282e5c31af7Sopenharmony_cislink:VkVideoSessionParametersCreateInfoKHR::pname:pNext chain must: include
283e5c31af7Sopenharmony_cia sname:VkVideoDecodeH264SessionParametersCreateInfoKHR structure specifying
284e5c31af7Sopenharmony_cithe capacity and initial contents of the object.
285e5c31af7Sopenharmony_ci
286e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH264SessionParametersCreateInfoKHR structure is
287e5c31af7Sopenharmony_cidefined as:
288e5c31af7Sopenharmony_ci
289e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH264SessionParametersCreateInfoKHR.adoc[]
290e5c31af7Sopenharmony_ci
291e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
292e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
293e5c31af7Sopenharmony_ci    structure.
294e5c31af7Sopenharmony_ci  * pname:maxStdSPSCount is the maximum number of <<decode-h264-sps,H.264
295e5c31af7Sopenharmony_ci    SPS>> entries the created sname:VkVideoSessionParametersKHR can:
296e5c31af7Sopenharmony_ci    contain.
297e5c31af7Sopenharmony_ci  * pname:maxStdPPSCount is the maximum number of <<decode-h264-pps,H.264
298e5c31af7Sopenharmony_ci    PPS>> entries the created sname:VkVideoSessionParametersKHR can:
299e5c31af7Sopenharmony_ci    contain.
300e5c31af7Sopenharmony_ci  * pname:pParametersAddInfo is `NULL` or a pointer to a
301e5c31af7Sopenharmony_ci    slink:VkVideoDecodeH264SessionParametersAddInfoKHR structure specifying
302e5c31af7Sopenharmony_ci    H.264 parameters to add upon object creation.
303e5c31af7Sopenharmony_ci
304e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH264SessionParametersCreateInfoKHR.adoc[]
305e5c31af7Sopenharmony_ci--
306e5c31af7Sopenharmony_ci
307e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH264SessionParametersAddInfoKHR',desc='Structure specifies H.264 decoder parameter set information',type='structs']
308e5c31af7Sopenharmony_ci--
309e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH264SessionParametersAddInfoKHR structure is defined
310e5c31af7Sopenharmony_cias:
311e5c31af7Sopenharmony_ci
312e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH264SessionParametersAddInfoKHR.adoc[]
313e5c31af7Sopenharmony_ci
314e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
315e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
316e5c31af7Sopenharmony_ci    structure.
317e5c31af7Sopenharmony_ci  * pname:stdSPSCount is the number of elements in the pname:pStdSPSs array.
318e5c31af7Sopenharmony_ci  * pname:pStdSPSs is a pointer to an array of
319e5c31af7Sopenharmony_ci    code:StdVideoH264SequenceParameterSet structures describing the
320e5c31af7Sopenharmony_ci    <<decode-h264-sps,H.264 SPS>> entries to add.
321e5c31af7Sopenharmony_ci  * pname:stdPPSCount is the number of elements in the pname:pStdPPSs array.
322e5c31af7Sopenharmony_ci  * pname:pStdPPSs is a pointer to an array of
323e5c31af7Sopenharmony_ci    code:StdVideoH264PictureParameterSet structures describing the
324e5c31af7Sopenharmony_ci    <<decode-h264-pps,H.264 PPS>> entries to add.
325e5c31af7Sopenharmony_ci
326e5c31af7Sopenharmony_ciThis structure can: be specified in the following places:
327e5c31af7Sopenharmony_ci
328e5c31af7Sopenharmony_ci  * In the pname:pParametersAddInfo member of the
329e5c31af7Sopenharmony_ci    slink:VkVideoDecodeH264SessionParametersCreateInfoKHR structure
330e5c31af7Sopenharmony_ci    specified in the pname:pNext chain of
331e5c31af7Sopenharmony_ci    slink:VkVideoSessionParametersCreateInfoKHR used to create a
332e5c31af7Sopenharmony_ci    <<video-session-parameters,video session parameters>> object.
333e5c31af7Sopenharmony_ci    In this case, if the video codec operation the video session parameters
334e5c31af7Sopenharmony_ci    object is created with is
335e5c31af7Sopenharmony_ci    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then it defines the
336e5c31af7Sopenharmony_ci    set of initial parameters to add to the created object (see
337e5c31af7Sopenharmony_ci    <<creating-video-session-parameters,Creating Video Session
338e5c31af7Sopenharmony_ci    Parameters>>).
339e5c31af7Sopenharmony_ci  * In the pname:pNext chain of slink:VkVideoSessionParametersUpdateInfoKHR.
340e5c31af7Sopenharmony_ci    In this case, if the video codec operation the
341e5c31af7Sopenharmony_ci    <<video-session-parameters,video session parameters>> object to be
342e5c31af7Sopenharmony_ci    updated was created with is
343e5c31af7Sopenharmony_ci    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, then it defines the
344e5c31af7Sopenharmony_ci    set of parameters to add to it (see
345e5c31af7Sopenharmony_ci    <<video-session-parameters-update,Updating Video Session Parameters>>).
346e5c31af7Sopenharmony_ci
347e5c31af7Sopenharmony_ci.Valid Usage
348e5c31af7Sopenharmony_ci****
349e5c31af7Sopenharmony_ci  * [[VUID-VkVideoDecodeH264SessionParametersAddInfoKHR-None-04825]]
350e5c31af7Sopenharmony_ci    The pname:seq_parameter_set_id member of each
351e5c31af7Sopenharmony_ci    code:StdVideoH264SequenceParameterSet structure specified in the
352e5c31af7Sopenharmony_ci    elements of pname:pStdSPSs must: be unique within pname:pStdSPSs
353e5c31af7Sopenharmony_ci  * [[VUID-VkVideoDecodeH264SessionParametersAddInfoKHR-None-04826]]
354e5c31af7Sopenharmony_ci    The pair constructed from the pname:seq_parameter_set_id and
355e5c31af7Sopenharmony_ci    pname:pic_parameter_set_id members of each
356e5c31af7Sopenharmony_ci    code:StdVideoH264PictureParameterSet structure specified in the elements
357e5c31af7Sopenharmony_ci    of pname:pStdPPSs must: be unique within pname:pStdPPSs
358e5c31af7Sopenharmony_ci****
359e5c31af7Sopenharmony_ci
360e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH264SessionParametersAddInfoKHR.adoc[]
361e5c31af7Sopenharmony_ci--
362e5c31af7Sopenharmony_ci
363e5c31af7Sopenharmony_ci
364e5c31af7Sopenharmony_ci=== H.264 Decoding Parameters
365e5c31af7Sopenharmony_ci
366e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH264PictureInfoKHR',desc='Structure specifies H.264 decode picture parameters when decoding a picture',type='structs']
367e5c31af7Sopenharmony_ci--
368e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH264PictureInfoKHR structure is defined as:
369e5c31af7Sopenharmony_ci
370e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH264PictureInfoKHR.adoc[]
371e5c31af7Sopenharmony_ci
372e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
373e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
374e5c31af7Sopenharmony_ci    structure.
375e5c31af7Sopenharmony_ci  * pname:pStdPictureInfo is a pointer to a
376e5c31af7Sopenharmony_ci    code:StdVideoDecodeH264PictureInfo structure specifying
377e5c31af7Sopenharmony_ci    <<decode-h264-picture-info,H.264 picture information>>.
378e5c31af7Sopenharmony_ci  * pname:sliceCount is the number of elements in pname:pSliceOffsets.
379e5c31af7Sopenharmony_ci  * pname:pSliceOffsets is a pointer to an array of pname:sliceCount offsets
380e5c31af7Sopenharmony_ci    specifying the start offset of the slices of the picture within the
381e5c31af7Sopenharmony_ci    video bitstream buffer range specified in slink:VkVideoDecodeInfoKHR.
382e5c31af7Sopenharmony_ci
383e5c31af7Sopenharmony_ciThis structure is specified in the pname:pNext chain of the
384e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR structure passed to flink:vkCmdDecodeVideoKHR to
385e5c31af7Sopenharmony_cispecify the codec-specific picture information for an <<decode-h264,H.264
386e5c31af7Sopenharmony_cidecode operation>>.
387e5c31af7Sopenharmony_ci
388e5c31af7Sopenharmony_ci[[decode-h264-output-picture-info]]
389e5c31af7Sopenharmony_ciDecode Output Picture Information::
390e5c31af7Sopenharmony_ci
391e5c31af7Sopenharmony_ciWhen this structure is specified in the pname:pNext chain of the
392e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR structure passed to flink:vkCmdDecodeVideoKHR,
393e5c31af7Sopenharmony_cithe information related to the <<decode-output-picture-info,decode output
394e5c31af7Sopenharmony_cipicture>> is defined as follows:
395e5c31af7Sopenharmony_ci
396e5c31af7Sopenharmony_ci  * If pname:pStdPictureInfo->flags.field_pic_flag is not set, then the
397e5c31af7Sopenharmony_ci    picture represents a frame.
398e5c31af7Sopenharmony_ci  * If pname:pStdPictureInfo->flags.field_pic_flag is set, then the picture
399e5c31af7Sopenharmony_ci    represents a field.
400e5c31af7Sopenharmony_ci    Specifically:
401e5c31af7Sopenharmony_ci  ** If pname:pStdPictureInfo->flags.bottom_field_flag is not set, then the
402e5c31af7Sopenharmony_ci     picture represents the top field of the frame.
403e5c31af7Sopenharmony_ci  ** If pname:pStdPictureInfo->flags.bottom_field_flag is set, then the
404e5c31af7Sopenharmony_ci     picture represents the bottom field of the frame.
405e5c31af7Sopenharmony_ci  * The image subregion used is determined according to the
406e5c31af7Sopenharmony_ci    <<decode-h264-picture-data-access,H.264 Decode Picture Data Access>>
407e5c31af7Sopenharmony_ci    section.
408e5c31af7Sopenharmony_ci  * The decode output picture is associated with the
409e5c31af7Sopenharmony_ci    <<decode-h264-picture-info,H.264 picture information>> provided in
410e5c31af7Sopenharmony_ci    pname:pStdPictureInfo.
411e5c31af7Sopenharmony_ci
412e5c31af7Sopenharmony_ci[[decode-h264-picture-info]]
413e5c31af7Sopenharmony_ciStd Picture Information::
414e5c31af7Sopenharmony_ci
415e5c31af7Sopenharmony_ciThe members of the code:StdVideoDecodeH264PictureInfo structure pointed to
416e5c31af7Sopenharmony_ciby pname:pStdPictureInfo are interpreted as follows:
417e5c31af7Sopenharmony_ci
418e5c31af7Sopenharmony_ci  * code:reserved1 and code:reserved2 are used only for padding purposes and
419e5c31af7Sopenharmony_ci    are otherwise ignored;
420e5c31af7Sopenharmony_ci  * code:flags.is_intra as defined in section 3.73 of the <<itu-t-h264,ITU-T
421e5c31af7Sopenharmony_ci    H.264 Specification>>;
422e5c31af7Sopenharmony_ci  * code:flags.is_reference as defined in section 3.136 of the <<itu-t-h264,
423e5c31af7Sopenharmony_ci    ITU-T H.264 Specification>>;
424e5c31af7Sopenharmony_ci  * code:flags.complementary_field_pair as defined in section 3.35 of the
425e5c31af7Sopenharmony_ci    <<itu-t-h264,ITU-T H.264 Specification>>;
426e5c31af7Sopenharmony_ci  * code:seq_parameter_set_id and code:pic_parameter_set_id are used to
427e5c31af7Sopenharmony_ci    identify the active parameter sets, as described below;
428e5c31af7Sopenharmony_ci  * all other members are interpreted as defined in section 7.4.3 of the
429e5c31af7Sopenharmony_ci    <<itu-t-h264,ITU-T H.264 Specification>>.
430e5c31af7Sopenharmony_ci
431e5c31af7Sopenharmony_ci[[decode-h264-ref-pic-setup]]
432e5c31af7Sopenharmony_ciReference picture setup is controlled by the value of
433e5c31af7Sopenharmony_cicode:StdVideoDecodeH264PictureInfo::pname:flags.is_reference.
434e5c31af7Sopenharmony_ciIf it is set and a <<decode-reconstructed-picture-info,reconstructed
435e5c31af7Sopenharmony_cipicture>> is specified, then the latter is used as the target of picture
436e5c31af7Sopenharmony_cireconstruction to <<dpb-slot-states,activate>> the <<dpb-slot,DPB slot>>
437e5c31af7Sopenharmony_cispecified in pname:pDecodeInfo->pSetupReferenceSlot->slotIndex.
438e5c31af7Sopenharmony_ciIf code:StdVideoDecodeH264PictureInfo::pname:flags.is_reference is not set,
439e5c31af7Sopenharmony_cibut a <<decode-reconstructed-picture-info,reconstructed picture>> is
440e5c31af7Sopenharmony_cispecified, then the corresponding picture reference associated with the
441e5c31af7Sopenharmony_ci<<dpb-slot,DPB slot>> is invalidated, as described in the
442e5c31af7Sopenharmony_ci<<dpb-slot-states,DPB Slot States>> section.
443e5c31af7Sopenharmony_ci
444e5c31af7Sopenharmony_ciActive Parameter Sets::
445e5c31af7Sopenharmony_ci
446e5c31af7Sopenharmony_ciThe members of the code:StdVideoDecodeH264PictureInfo structure pointed to
447e5c31af7Sopenharmony_ciby pname:pStdPictureInfo are used to select the active parameter sets to use
448e5c31af7Sopenharmony_cifrom the bound video session parameters object, as follows:
449e5c31af7Sopenharmony_ci
450e5c31af7Sopenharmony_ci  * [[decode-h264-active-sps]] The _active SPS_ is the
451e5c31af7Sopenharmony_ci    <<decode-h264-sps,SPS>> identified by the key specified in
452e5c31af7Sopenharmony_ci    code:StdVideoDecodeH264PictureInfo::code:seq_parameter_set_id.
453e5c31af7Sopenharmony_ci  * [[decode-h264-active-pps]] The _active PPS_ is the
454e5c31af7Sopenharmony_ci    <<decode-h264-pps,PPS>> identified by the key specified by the pair
455e5c31af7Sopenharmony_ci    constructed from
456e5c31af7Sopenharmony_ci    code:StdVideoDecodeH264PictureInfo::code:seq_parameter_set_id and
457e5c31af7Sopenharmony_ci    code:StdVideoDecodeH264PictureInfo::code:pic_parameter_set_id.
458e5c31af7Sopenharmony_ci
459e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH264PictureInfoKHR.adoc[]
460e5c31af7Sopenharmony_ci--
461e5c31af7Sopenharmony_ci
462e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH264DpbSlotInfoKHR',desc='Structure specifies H.264 decode DPB picture information',type='structs']
463e5c31af7Sopenharmony_ci--
464e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH264DpbSlotInfoKHR structure is defined as:
465e5c31af7Sopenharmony_ci
466e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH264DpbSlotInfoKHR.adoc[]
467e5c31af7Sopenharmony_ci
468e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
469e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
470e5c31af7Sopenharmony_ci    structure.
471e5c31af7Sopenharmony_ci  * pname:pStdReferenceInfo is a pointer to a
472e5c31af7Sopenharmony_ci    code:StdVideoDecodeH264ReferenceInfo structure specifying
473e5c31af7Sopenharmony_ci    <<decode-h264-reference-info,H.264 reference information>>.
474e5c31af7Sopenharmony_ci
475e5c31af7Sopenharmony_ciThis structure is specified in the pname:pNext chain of
476e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot, if not `NULL`, and
477e5c31af7Sopenharmony_cithe pname:pNext chain of the elements of
478e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pReferenceSlots to specify the
479e5c31af7Sopenharmony_cicodec-specific reference picture information for an <<decode-h264,H.264
480e5c31af7Sopenharmony_cidecode operation>>.
481e5c31af7Sopenharmony_ci
482e5c31af7Sopenharmony_ci[[decode-h264-active-reference-picture-info]]
483e5c31af7Sopenharmony_ciActive Reference Picture Information::
484e5c31af7Sopenharmony_ci
485e5c31af7Sopenharmony_ciWhen this structure is specified in the pname:pNext chain of the elements of
486e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pReferenceSlots, one or two elements are
487e5c31af7Sopenharmony_ciadded to the list of <<decode-active-reference-picture-info,active reference
488e5c31af7Sopenharmony_cipictures>> used by the video decode operation for each element of
489e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pReferenceSlots as follows:
490e5c31af7Sopenharmony_ci
491e5c31af7Sopenharmony_ci  * If neither pname:pStdReferenceInfo->flags.top_field_flag nor
492e5c31af7Sopenharmony_ci    pname:pStdReferenceInfo->flags.bottom_field_flag is set, then the
493e5c31af7Sopenharmony_ci    picture is added as a frame reference to the list of active reference
494e5c31af7Sopenharmony_ci    pictures.
495e5c31af7Sopenharmony_ci  * If pname:pStdReferenceInfo->flags.top_field_flag is set, then the
496e5c31af7Sopenharmony_ci    picture is added as a top field reference to the list of active
497e5c31af7Sopenharmony_ci    reference pictures.
498e5c31af7Sopenharmony_ci  * If pname:pStdReferenceInfo->flags.bottom_field_flag is set, then the
499e5c31af7Sopenharmony_ci    picture is added as a bottom field reference to the list of active
500e5c31af7Sopenharmony_ci    reference pictures.
501e5c31af7Sopenharmony_ci  * For each added reference picture, the corresponding image subregion used
502e5c31af7Sopenharmony_ci    is determined according to the <<decode-h264-picture-data-access,H.264
503e5c31af7Sopenharmony_ci    Decode Picture Data Access>> section.
504e5c31af7Sopenharmony_ci  * Each added reference picture is associated with the <<dpb-slot,DPB
505e5c31af7Sopenharmony_ci    slot>> index specified in the pname:slotIndex member of the
506e5c31af7Sopenharmony_ci    corresponding element of
507e5c31af7Sopenharmony_ci    slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots.
508e5c31af7Sopenharmony_ci  * Each added reference picture is associated with the
509e5c31af7Sopenharmony_ci    <<decode-h264-reference-info,H.264 reference information>> provided in
510e5c31af7Sopenharmony_ci    pname:pStdReferenceInfo.
511e5c31af7Sopenharmony_ci
512e5c31af7Sopenharmony_ci[NOTE]
513e5c31af7Sopenharmony_ci.Note
514e5c31af7Sopenharmony_ci====
515e5c31af7Sopenharmony_ciWhen both the top and bottom field of an interlaced frame currently
516e5c31af7Sopenharmony_ciassociated with a DPB slot is intended to be used as an active reference
517e5c31af7Sopenharmony_cipicture and both fields are stored in the same image subregion (which is the
518e5c31af7Sopenharmony_cicase when using
519e5c31af7Sopenharmony_ciename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_INTERLEAVED_LINES_BIT_KHR
520e5c31af7Sopenharmony_ciwhich stores the two fields at even and odd scanlines of the same image
521e5c31af7Sopenharmony_cisubregion), both references have to be provided through a single
522e5c31af7Sopenharmony_cislink:VkVideoReferenceSlotInfoKHR structure that has both
523e5c31af7Sopenharmony_cicode:flags.top_field_flag and code:flags.bottom_field_flag set in the
524e5c31af7Sopenharmony_cicode:StdVideoDecodeH264ReferenceInfo structure pointed to by the
525e5c31af7Sopenharmony_cipname:pStdReferenceInfo member of the slink:VkVideoDecodeH264DpbSlotInfoKHR
526e5c31af7Sopenharmony_cistructure included in the corresponding slink:VkVideoReferenceSlotInfoKHR
527e5c31af7Sopenharmony_cistructure's pname:pNext chain.
528e5c31af7Sopenharmony_ciHowever, this approach can only be used when both fields are stored in the
529e5c31af7Sopenharmony_cisame image subregion.
530e5c31af7Sopenharmony_ciIf that is not the case (e.g. when using
531e5c31af7Sopenharmony_ciename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR
532e5c31af7Sopenharmony_ciwhich requires separate pname:codedOffset values for the two fields and also
533e5c31af7Sopenharmony_ciallows storing the two fields of a frame in separate image layers or
534e5c31af7Sopenharmony_cientirely separate images), then a separate slink:VkVideoReferenceSlotInfoKHR
535e5c31af7Sopenharmony_cistructure needs to be provided for referencing the two fields, each only
536e5c31af7Sopenharmony_cisetting one of code:flags.top_field_flag or code:flags.bottom_field_flag,
537e5c31af7Sopenharmony_ciand providing the appropriate video picture resource information in
538e5c31af7Sopenharmony_cislink:VkVideoReferenceSlotInfoKHR::pname:pPictureResource.
539e5c31af7Sopenharmony_ci====
540e5c31af7Sopenharmony_ci
541e5c31af7Sopenharmony_ci[[decode-h264-reconstructed-picture-info]]
542e5c31af7Sopenharmony_ciReconstructed Picture Information::
543e5c31af7Sopenharmony_ci
544e5c31af7Sopenharmony_ciWhen this structure is specified in the pname:pNext chain of
545e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot, the information
546e5c31af7Sopenharmony_cirelated to the <<decode-reconstructed-picture-info,reconstructed picture>>
547e5c31af7Sopenharmony_ciis defined as follows:
548e5c31af7Sopenharmony_ci
549e5c31af7Sopenharmony_ci  * If neither pname:pStdReferenceInfo->flags.top_field_flag nor
550e5c31af7Sopenharmony_ci    pname:pStdReferenceInfo->flags.bottom_field_flag is set, then the
551e5c31af7Sopenharmony_ci    picture represents a frame.
552e5c31af7Sopenharmony_ci  * If pname:pStdReferenceInfo->flags.top_field_flag is set, then the
553e5c31af7Sopenharmony_ci    picture represents a field, specifically, the top field of the frame.
554e5c31af7Sopenharmony_ci  * If pname:pStdReferenceInfo->flags.bottom_field_flag is set, then the
555e5c31af7Sopenharmony_ci    picture represents a field, specifically, the bottom field of the frame.
556e5c31af7Sopenharmony_ci  * The image subregion used is determined according to the
557e5c31af7Sopenharmony_ci    <<decode-h264-picture-data-access,H.264 Decode Picture Data Access>>
558e5c31af7Sopenharmony_ci    section.
559e5c31af7Sopenharmony_ci  * If <<decode-ref-pic-setup,reference picture setup>> is requested, then
560e5c31af7Sopenharmony_ci    the reconstructed picture is used to <<dpb-slot-states,activate>> the
561e5c31af7Sopenharmony_ci    <<dpb-slot,DPB slot>> with the index specified in
562e5c31af7Sopenharmony_ci    slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->slotIndex.
563e5c31af7Sopenharmony_ci  * The reconstructed picture is associated with the
564e5c31af7Sopenharmony_ci    <<decode-h264-reference-info,H.264 reference information>> provided in
565e5c31af7Sopenharmony_ci    pname:pStdReferenceInfo.
566e5c31af7Sopenharmony_ci
567e5c31af7Sopenharmony_ci[[decode-h264-reference-info]]
568e5c31af7Sopenharmony_ciStd Reference Information::
569e5c31af7Sopenharmony_ci
570e5c31af7Sopenharmony_ciThe members of the code:StdVideoDecodeH264ReferenceInfo structure pointed to
571e5c31af7Sopenharmony_ciby pname:pStdReferenceInfo are interpreted as follows:
572e5c31af7Sopenharmony_ci
573e5c31af7Sopenharmony_ci  * code:flags.top_field_flag is used to indicate whether the reference is
574e5c31af7Sopenharmony_ci    used as top field reference;
575e5c31af7Sopenharmony_ci  * code:flags.bottom_field_flag is used to indicate whether the reference
576e5c31af7Sopenharmony_ci    is used as bottom field reference;
577e5c31af7Sopenharmony_ci  * code:flags.used_for_long_term_reference is used to indicate whether the
578e5c31af7Sopenharmony_ci    picture is marked as "`used for long-term reference`" as defined in
579e5c31af7Sopenharmony_ci    section 8.2.5.1 of the <<itu-t-h264,ITU-T H.264 Specification>>;
580e5c31af7Sopenharmony_ci  * code:flags.is_non_existing is used to indicate whether the picture is
581e5c31af7Sopenharmony_ci    marked as "`non-existing`" as defined in section 8.2.5.2 of the
582e5c31af7Sopenharmony_ci    <<itu-t-h264,ITU-T H.264 Specification>>;
583e5c31af7Sopenharmony_ci  * all other members are interpreted as defined in section 8.2 of the
584e5c31af7Sopenharmony_ci    <<itu-t-h264,ITU-T H.264 Specification>>.
585e5c31af7Sopenharmony_ci
586e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH264DpbSlotInfoKHR.adoc[]
587e5c31af7Sopenharmony_ci--
588e5c31af7Sopenharmony_ci
589e5c31af7Sopenharmony_ci
590e5c31af7Sopenharmony_ci[[decode-h264-requirements]]
591e5c31af7Sopenharmony_ci=== H.264 Decode Requirements
592e5c31af7Sopenharmony_ci
593e5c31af7Sopenharmony_ciThis section describes the required: H.264 decoding capabilities for
594e5c31af7Sopenharmony_ciphysical devices that have at least one queue family that supports the video
595e5c31af7Sopenharmony_cicodec operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR, as
596e5c31af7Sopenharmony_cireturned by flink:vkGetPhysicalDeviceQueueFamilyProperties2 in
597e5c31af7Sopenharmony_cislink:VkQueueFamilyVideoPropertiesKHR::pname:videoCodecOperations.
598e5c31af7Sopenharmony_ci
599e5c31af7Sopenharmony_ci.Required <<video-std-header-version,Video Std Header Versions>>
600e5c31af7Sopenharmony_ci[options="header"]
601e5c31af7Sopenharmony_ci|====
602e5c31af7Sopenharmony_ci| Video Std Header Name | Version
603e5c31af7Sopenharmony_ci| `vulkan_video_codec_h264std_decode` | 1.0.0
604e5c31af7Sopenharmony_ci|====
605e5c31af7Sopenharmony_ci
606e5c31af7Sopenharmony_ciifdef::VK_KHR_video_maintenance1[]
607e5c31af7Sopenharmony_ci.Required Video Capabilities
608e5c31af7Sopenharmony_ci[width="100%",cols="<35,<14,<11",options="header"]
609e5c31af7Sopenharmony_ci|====
610e5c31af7Sopenharmony_ci| Video Capability | Requirement | Requirement Type^1^
611e5c31af7Sopenharmony_ci| **slink:VkVideoCapabilitiesKHR** | |
612e5c31af7Sopenharmony_ci| pname:flags | - | min
613e5c31af7Sopenharmony_ci| pname:minBitstreamBufferOffsetAlignment | 4096 | max
614e5c31af7Sopenharmony_ci| pname:minBitstreamBufferSizeAlignment | 4096 | max
615e5c31af7Sopenharmony_ci| pname:pictureAccessGranularity | (64,64) | max
616e5c31af7Sopenharmony_ci| pname:minCodedExtent | - | max
617e5c31af7Sopenharmony_ci| pname:maxCodedExtent | - | min
618e5c31af7Sopenharmony_ci| pname:maxDpbSlots | 0 | min
619e5c31af7Sopenharmony_ci| pname:maxActiveReferencePictures | 0 | min
620e5c31af7Sopenharmony_ci| **slink:VkVideoDecodeCapabilitiesKHR** | |
621e5c31af7Sopenharmony_ci| pname:flags | ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR or
622e5c31af7Sopenharmony_ci                ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR | min
623e5c31af7Sopenharmony_ci| **slink:VkVideoDecodeH264CapabilitiesKHR** | |
624e5c31af7Sopenharmony_ci| pname:maxLevelIdc | code:STD_VIDEO_H264_LEVEL_IDC_1_0 | min
625e5c31af7Sopenharmony_ci| pname:fieldOffsetGranularity | (0,0) except for profiles using ename:VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_INTERLACED_SEPARATE_PLANES_BIT_KHR | implementation-dependent
626e5c31af7Sopenharmony_ci|====
627e5c31af7Sopenharmony_ci
628e5c31af7Sopenharmony_ci1::
629e5c31af7Sopenharmony_ci    The *Requirement Type* column specifies the requirement is either the
630e5c31af7Sopenharmony_ci    minimum value all implementations must: support, the maximum value all
631e5c31af7Sopenharmony_ci    implementations must: support, or the exact value all implementations
632e5c31af7Sopenharmony_ci    must: support.
633e5c31af7Sopenharmony_ci    For bitmasks a minimum value is the least bits all implementations must:
634e5c31af7Sopenharmony_ci    set, but they may: have additional bits set beyond this minimum.
635e5c31af7Sopenharmony_ciendif::VK_KHR_video_maintenance1[]
636