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-h265]]
6e5c31af7Sopenharmony_ci== H.265 Decode Operations
7e5c31af7Sopenharmony_ci
8e5c31af7Sopenharmony_ciVideo decode operations using an <<decode-h265-profile,H.265 decode
9e5c31af7Sopenharmony_ciprofile>> can: be used to decode elementary video stream sequences compliant
10e5c31af7Sopenharmony_cito the <<itu-t-h265,ITU-T H.265 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 <<itu-t-h265,ITU-T H.265 Specification>>:
23e5c31af7Sopenharmony_ci
24e5c31af7Sopenharmony_ci  * Syntax elements, derived values, and other parameters are applied from
25e5c31af7Sopenharmony_ci    the following structures:
26e5c31af7Sopenharmony_ci  ** The code:StdVideoH265VideoParameterSet structure corresponding to the
27e5c31af7Sopenharmony_ci     <<decode-h265-active-vps,active VPS>> specifying the <<decode-h265-vps,
28e5c31af7Sopenharmony_ci     H.265 video parameter set>>.
29e5c31af7Sopenharmony_ci  ** The code:StdVideoH265SequenceParameterSet structure corresponding to
30e5c31af7Sopenharmony_ci     the <<decode-h265-active-sps,active SPS>> specifying the
31e5c31af7Sopenharmony_ci     <<decode-h265-sps, H.265 sequence parameter set>>.
32e5c31af7Sopenharmony_ci  ** The code:StdVideoH265PictureParameterSet structure corresponding to the
33e5c31af7Sopenharmony_ci     <<decode-h265-active-pps,active PPS>> specifying the <<decode-h265-pps,
34e5c31af7Sopenharmony_ci     H.265 picture parameter set>>.
35e5c31af7Sopenharmony_ci  ** The code:StdVideoDecodeH265PictureInfo structure specifying the
36e5c31af7Sopenharmony_ci     <<decode-h265-picture-info,H.265 picture information>>.
37e5c31af7Sopenharmony_ci  ** The code:StdVideoDecodeH265ReferenceInfo structures specifying the
38e5c31af7Sopenharmony_ci     <<decode-h265-reference-info,H.265 reference information>>
39e5c31af7Sopenharmony_ci     corresponding to the optional <<reconstructed-picture,reconstructed
40e5c31af7Sopenharmony_ci     picture>> and any <<active-reference-pictures,active reference
41e5c31af7Sopenharmony_ci     pictures>>.
42e5c31af7Sopenharmony_ci  * The contents of the provided video bitstream buffer range are
43e5c31af7Sopenharmony_ci    interpreted as defined in the <<decode-h265-bitstream-data-access,H.265
44e5c31af7Sopenharmony_ci    Decode Bitstream Data Access>> section.
45e5c31af7Sopenharmony_ci  * Picture data in the <<video-picture-resources,video picture resources>>
46e5c31af7Sopenharmony_ci    corresponding to the used <<decode-h265-active-reference-picture-info,
47e5c31af7Sopenharmony_ci    active reference pictures>>, <<decode-h265-output-picture-info,decode
48e5c31af7Sopenharmony_ci    output picture>>, and optional <<decode-h265-reconstructed-picture-info,
49e5c31af7Sopenharmony_ci    reconstructed picture>> is accessed as defined in the
50e5c31af7Sopenharmony_ci    <<decode-h265-picture-data-access,H.265 Decode Picture Data Access>>
51e5c31af7Sopenharmony_ci    section.
52e5c31af7Sopenharmony_ci  * The decision on <<decode-ref-pic-setup,reference picture setup>> is made
53e5c31af7Sopenharmony_ci    according to the parameters specified in the
54e5c31af7Sopenharmony_ci    <<decode-h265-ref-pic-setup,H.265 picture information>>.
55e5c31af7Sopenharmony_ci
56e5c31af7Sopenharmony_ciIf the parameters and the bitstream adhere to the syntactic and semantic
57e5c31af7Sopenharmony_cirequirements defined in the corresponding sections of the <<itu-t-h265,ITU-T
58e5c31af7Sopenharmony_ciH.265 Specification>>, as described above, and the <<dpb-slot,DPB slots>>
59e5c31af7Sopenharmony_ciassociated with the <<active-reference-pictures,active reference pictures>>
60e5c31af7Sopenharmony_ciall refer to <<dpb-slot-states,valid picture references>>, then the video
61e5c31af7Sopenharmony_cidecode operation will complete successfully.
62e5c31af7Sopenharmony_ciOtherwise, the video decode operation may: complete
63e5c31af7Sopenharmony_ci<<decode-unsuccessful,unsuccessfully>>.
64e5c31af7Sopenharmony_ci
65e5c31af7Sopenharmony_ci
66e5c31af7Sopenharmony_ci[[decode-h265-bitstream-data-access]]
67e5c31af7Sopenharmony_ci=== H.265 Decode Bitstream Data Access
68e5c31af7Sopenharmony_ci
69e5c31af7Sopenharmony_ciThe video bitstream buffer range should: contain a VCL NAL unit comprised of
70e5c31af7Sopenharmony_cithe slice segment headers and data of a picture representing a frame, as
71e5c31af7Sopenharmony_cidefined in sections 7.3.6 and 7.3.8, and this data is interpreted as defined
72e5c31af7Sopenharmony_ciin sections 7.4.7 and 7.4.9 of the <<itu-t-h265, ITU-T H.265
73e5c31af7Sopenharmony_ciSpecification>>, respectively.
74e5c31af7Sopenharmony_ci
75e5c31af7Sopenharmony_ciThe offsets provided in
76e5c31af7Sopenharmony_cislink:VkVideoDecodeH265PictureInfoKHR::pname:pSliceSegmentOffsets should:
77e5c31af7Sopenharmony_cispecify the starting offsets corresponding to each slice segment header
78e5c31af7Sopenharmony_ciwithin the video bitstream buffer range.
79e5c31af7Sopenharmony_ci
80e5c31af7Sopenharmony_ci
81e5c31af7Sopenharmony_ci[[decode-h265-picture-data-access]]
82e5c31af7Sopenharmony_ci=== H.265 Decode Picture Data Access
83e5c31af7Sopenharmony_ci
84e5c31af7Sopenharmony_ciAccesses to image data within a video picture resource happen at the
85e5c31af7Sopenharmony_cigranularity indicated by
86e5c31af7Sopenharmony_cislink:VkVideoCapabilitiesKHR::pname:pictureAccessGranularity, as returned by
87e5c31af7Sopenharmony_ciflink:vkGetPhysicalDeviceVideoCapabilitiesKHR for the used <<video-profiles,
88e5c31af7Sopenharmony_civideo profile>>.
89e5c31af7Sopenharmony_ciAccordingly, the complete image subregion of a
90e5c31af7Sopenharmony_ci<<decode-output-picture,decode output picture>>,
91e5c31af7Sopenharmony_ci<<reference-picture,reference picture>>, or
92e5c31af7Sopenharmony_ci<<reconstructed-picture,reconstructed picture>> accessed by video coding
93e5c31af7Sopenharmony_cioperations using an <<decode-h265-profile,H.265 decode profile>> is defined
94e5c31af7Sopenharmony_cias the set of texels within the coordinate range:
95e5c31af7Sopenharmony_ci
96e5c31af7Sopenharmony_ci  {empty}:: [eq]#([0,pname:endX),[0,pname:endY))#
97e5c31af7Sopenharmony_ci
98e5c31af7Sopenharmony_ciWhere:
99e5c31af7Sopenharmony_ci
100e5c31af7Sopenharmony_ci  * [eq]#pname:endX# equals [eq]#pname:codedExtent.width# rounded up to the
101e5c31af7Sopenharmony_ci    nearest integer multiple of pname:pictureAccessGranularity.width and
102e5c31af7Sopenharmony_ci    clamped to the width of the image subresource
103e5c31af7Sopenharmony_ci    <<video-image-subresource-reference,referred>> to by the corresponding
104e5c31af7Sopenharmony_ci    slink:VkVideoPictureResourceInfoKHR structure;
105e5c31af7Sopenharmony_ci  * [eq]#endY# equals [eq]#pname:codedExtent.height# rounded up to the
106e5c31af7Sopenharmony_ci    nearest integer multiple of pname:pictureAccessGranularity.height and
107e5c31af7Sopenharmony_ci    clamped to the height of the image subresource
108e5c31af7Sopenharmony_ci    <<video-image-subresource-reference, referred>> to by the corresponding
109e5c31af7Sopenharmony_ci    slink:VkVideoPictureResourceInfoKHR structure;
110e5c31af7Sopenharmony_ci
111e5c31af7Sopenharmony_ciWhere pname:codedExtent is the member of the
112e5c31af7Sopenharmony_cislink:VkVideoPictureResourceInfoKHR structure corresponding to the picture.
113e5c31af7Sopenharmony_ci
114e5c31af7Sopenharmony_ciIn case of video decode operations using an <<decode-h265-profile,H.265
115e5c31af7Sopenharmony_cidecode profile>>, any access to a picture at the coordinates
116e5c31af7Sopenharmony_ci[eq]#(pname:x,pname:y)#, as defined by the <<itu-t-h265,ITU-T H.265
117e5c31af7Sopenharmony_ciSpecification>>, is an access to the image subresource
118e5c31af7Sopenharmony_ci<<video-image-subresource-reference,referred>> to by the corresponding
119e5c31af7Sopenharmony_cislink:VkVideoPictureResourceInfoKHR structure at the texel coordinates
120e5c31af7Sopenharmony_ci[eq]#(pname:x,pname:y)#.
121e5c31af7Sopenharmony_ci
122e5c31af7Sopenharmony_ci
123e5c31af7Sopenharmony_ci[[decode-h265-profile]]
124e5c31af7Sopenharmony_ci=== H.265 Decode Profile
125e5c31af7Sopenharmony_ci
126e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH265ProfileInfoKHR',desc='Structure specifying H.265 decode profile',type='structs']
127e5c31af7Sopenharmony_ci--
128e5c31af7Sopenharmony_ciA video profile supporting H.265 video decode operations is specified by
129e5c31af7Sopenharmony_cisetting slink:VkVideoProfileInfoKHR::pname:videoCodecOperation to
130e5c31af7Sopenharmony_ciename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR and adding a
131e5c31af7Sopenharmony_cisname:VkVideoDecodeH265ProfileInfoKHR structure to the
132e5c31af7Sopenharmony_cislink:VkVideoProfileInfoKHR::pname:pNext chain.
133e5c31af7Sopenharmony_ci
134e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH265ProfileInfoKHR structure is defined as:
135e5c31af7Sopenharmony_ci
136e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH265ProfileInfoKHR.adoc[]
137e5c31af7Sopenharmony_ci
138e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
139e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
140e5c31af7Sopenharmony_ci    structure.
141e5c31af7Sopenharmony_ci  * pname:stdProfileIdc is a code:StdVideoH265ProfileIdc value specifying
142e5c31af7Sopenharmony_ci    the H.265 codec profile IDC, as defined in section A.3 of the
143e5c31af7Sopenharmony_ci    <<itu-t-h265,ITU-T H.265 Specification>>.
144e5c31af7Sopenharmony_ci
145e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH265ProfileInfoKHR.adoc[]
146e5c31af7Sopenharmony_ci--
147e5c31af7Sopenharmony_ci
148e5c31af7Sopenharmony_ci
149e5c31af7Sopenharmony_ci=== H.265 Decode Capabilities
150e5c31af7Sopenharmony_ci
151e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH265CapabilitiesKHR',desc='Structure describing H.265 decode capabilities',type='structs']
152e5c31af7Sopenharmony_ci--
153e5c31af7Sopenharmony_ciWhen calling flink:vkGetPhysicalDeviceVideoCapabilitiesKHR to query the
154e5c31af7Sopenharmony_cicapabilities for an <<decode-h265-profile,H.265 decode profile>>, the
155e5c31af7Sopenharmony_cislink:VkVideoCapabilitiesKHR::pname:pNext chain must: include a
156e5c31af7Sopenharmony_cisname:VkVideoDecodeH265CapabilitiesKHR structure that will be filled with
157e5c31af7Sopenharmony_cithe profile-specific capabilities.
158e5c31af7Sopenharmony_ci
159e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH265CapabilitiesKHR structure is defined as:
160e5c31af7Sopenharmony_ci
161e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH265CapabilitiesKHR.adoc[]
162e5c31af7Sopenharmony_ci
163e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
164e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
165e5c31af7Sopenharmony_ci    structure.
166e5c31af7Sopenharmony_ci  * pname:maxLevelIdc is a code:StdVideoH265LevelIdc value indicating the
167e5c31af7Sopenharmony_ci    maximum H.265 level supported by the profile, where enum constant
168e5c31af7Sopenharmony_ci    `STD_VIDEO_H265_LEVEL_IDC_<major>_<minor>` identifies H.265 level
169e5c31af7Sopenharmony_ci    `<major>.<minor>` as defined in section A.4 of the <<itu-t-h265,ITU-T
170e5c31af7Sopenharmony_ci    H.265 Specification>>.
171e5c31af7Sopenharmony_ci
172e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH265CapabilitiesKHR.adoc[]
173e5c31af7Sopenharmony_ci--
174e5c31af7Sopenharmony_ci
175e5c31af7Sopenharmony_ci
176e5c31af7Sopenharmony_ci[[decode-h265-parameter-sets]]
177e5c31af7Sopenharmony_ci=== H.265 Decode Parameter Sets
178e5c31af7Sopenharmony_ci
179e5c31af7Sopenharmony_ci<<video-session-parameters,Video session parameters>> objects created with
180e5c31af7Sopenharmony_cithe video codec operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR
181e5c31af7Sopenharmony_cican: contain the following types of parameters:
182e5c31af7Sopenharmony_ci
183e5c31af7Sopenharmony_ci:operationType: decode
184e5c31af7Sopenharmony_ciinclude::{chapters}/video/h265_parameter_sets.adoc[]
185e5c31af7Sopenharmony_ci
186e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH265SessionParametersCreateInfoKHR',desc='Structure specifies H.265 decoder parameter set information',type='structs']
187e5c31af7Sopenharmony_ci--
188e5c31af7Sopenharmony_ciWhen a <<video-session-parameters,video session parameters>> object is
189e5c31af7Sopenharmony_cicreated with the codec operation
190e5c31af7Sopenharmony_ciename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, the
191e5c31af7Sopenharmony_cislink:VkVideoSessionParametersCreateInfoKHR::pname:pNext chain must: include
192e5c31af7Sopenharmony_cia sname:VkVideoDecodeH265SessionParametersCreateInfoKHR structure specifying
193e5c31af7Sopenharmony_cithe capacity and initial contents of the object.
194e5c31af7Sopenharmony_ci
195e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH265SessionParametersCreateInfoKHR structure is
196e5c31af7Sopenharmony_cidefined as:
197e5c31af7Sopenharmony_ci
198e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH265SessionParametersCreateInfoKHR.adoc[]
199e5c31af7Sopenharmony_ci
200e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
201e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
202e5c31af7Sopenharmony_ci    structure.
203e5c31af7Sopenharmony_ci  * pname:maxStdVPSCount is the maximum number of <<decode-h265-vps,H.265
204e5c31af7Sopenharmony_ci    VPS>> entries the created sname:VkVideoSessionParametersKHR can:
205e5c31af7Sopenharmony_ci    contain.
206e5c31af7Sopenharmony_ci  * pname:maxStdSPSCount is the maximum number of <<decode-h265-sps,H.265
207e5c31af7Sopenharmony_ci    SPS>> entries the created sname:VkVideoSessionParametersKHR can:
208e5c31af7Sopenharmony_ci    contain.
209e5c31af7Sopenharmony_ci  * pname:maxStdPPSCount is the maximum number of <<decode-h265-pps,H.265
210e5c31af7Sopenharmony_ci    PPS>> entries the created sname:VkVideoSessionParametersKHR can:
211e5c31af7Sopenharmony_ci    contain.
212e5c31af7Sopenharmony_ci  * pname:pParametersAddInfo is `NULL` or a pointer to a
213e5c31af7Sopenharmony_ci    slink:VkVideoDecodeH265SessionParametersAddInfoKHR structure specifying
214e5c31af7Sopenharmony_ci    H.265 parameters to add upon object creation.
215e5c31af7Sopenharmony_ci
216e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH265SessionParametersCreateInfoKHR.adoc[]
217e5c31af7Sopenharmony_ci--
218e5c31af7Sopenharmony_ci
219e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH265SessionParametersAddInfoKHR',desc='Structure specifies H.265 decoder parameter set information',type='structs']
220e5c31af7Sopenharmony_ci--
221e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH265SessionParametersAddInfoKHR structure is defined
222e5c31af7Sopenharmony_cias:
223e5c31af7Sopenharmony_ci
224e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH265SessionParametersAddInfoKHR.adoc[]
225e5c31af7Sopenharmony_ci
226e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
227e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
228e5c31af7Sopenharmony_ci    structure.
229e5c31af7Sopenharmony_ci  * pname:stdVPSCount is the number of elements in the pname:pStdVPSs array.
230e5c31af7Sopenharmony_ci  * pname:pStdVPSs is a pointer to an array of
231e5c31af7Sopenharmony_ci    code:StdVideoH265VideoParameterSet structures describing the
232e5c31af7Sopenharmony_ci    <<decode-h265-vps,H.265 VPS>> entries to add.
233e5c31af7Sopenharmony_ci  * pname:stdSPSCount is the number of elements in the pname:pStdSPSs array.
234e5c31af7Sopenharmony_ci  * pname:pStdSPSs is a pointer to an array of
235e5c31af7Sopenharmony_ci    code:StdVideoH265SequenceParameterSet structures describing the
236e5c31af7Sopenharmony_ci    <<decode-h265-sps,H.265 SPS>> entries to add.
237e5c31af7Sopenharmony_ci  * pname:stdPPSCount is the number of elements in the pname:pStdPPSs array.
238e5c31af7Sopenharmony_ci  * pname:pStdPPSs is a pointer to an array of
239e5c31af7Sopenharmony_ci    code:StdVideoH265PictureParameterSet structures describing the
240e5c31af7Sopenharmony_ci    <<decode-h265-pps,H.265 PPS>> entries to add.
241e5c31af7Sopenharmony_ci
242e5c31af7Sopenharmony_ciThis structure can: be specified in the following places:
243e5c31af7Sopenharmony_ci
244e5c31af7Sopenharmony_ci  * In the pname:pParametersAddInfo member of the
245e5c31af7Sopenharmony_ci    slink:VkVideoDecodeH265SessionParametersCreateInfoKHR structure
246e5c31af7Sopenharmony_ci    specified in the pname:pNext chain of
247e5c31af7Sopenharmony_ci    slink:VkVideoSessionParametersCreateInfoKHR used to create a
248e5c31af7Sopenharmony_ci    <<video-session-parameters,video session parameters>> object.
249e5c31af7Sopenharmony_ci    In this case, if the video codec operation the video session parameters
250e5c31af7Sopenharmony_ci    object is created with is
251e5c31af7Sopenharmony_ci    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then it defines the
252e5c31af7Sopenharmony_ci    set of initial parameters to add to the created object (see
253e5c31af7Sopenharmony_ci    <<creating-video-session-parameters,Creating Video Session
254e5c31af7Sopenharmony_ci    Parameters>>).
255e5c31af7Sopenharmony_ci  * In the pname:pNext chain of slink:VkVideoSessionParametersUpdateInfoKHR.
256e5c31af7Sopenharmony_ci    In this case, if the video codec operation the
257e5c31af7Sopenharmony_ci    <<video-session-parameters,video session parameters>> object to be
258e5c31af7Sopenharmony_ci    updated was created with is
259e5c31af7Sopenharmony_ci    ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, then it defines the
260e5c31af7Sopenharmony_ci    set of parameters to add to it (see
261e5c31af7Sopenharmony_ci    <<video-session-parameters-update,Updating Video Session Parameters>>).
262e5c31af7Sopenharmony_ci
263e5c31af7Sopenharmony_ci.Valid Usage
264e5c31af7Sopenharmony_ci****
265e5c31af7Sopenharmony_ci  * [[VUID-VkVideoDecodeH265SessionParametersAddInfoKHR-None-04833]]
266e5c31af7Sopenharmony_ci    The pname:vps_video_parameter_set_id member of each
267e5c31af7Sopenharmony_ci    code:StdVideoH265VideoParameterSet structure specified in the elements
268e5c31af7Sopenharmony_ci    of pname:pStdVPSs must: be unique within pname:pStdVPSs
269e5c31af7Sopenharmony_ci  * [[VUID-VkVideoDecodeH265SessionParametersAddInfoKHR-None-04834]]
270e5c31af7Sopenharmony_ci    The pair constructed from the pname:sps_video_parameter_set_id and
271e5c31af7Sopenharmony_ci    pname:sps_seq_parameter_set_id members of each
272e5c31af7Sopenharmony_ci    code:StdVideoH265SequenceParameterSet structure specified in the
273e5c31af7Sopenharmony_ci    elements of pname:pStdSPSs must: be unique within pname:pStdSPSs
274e5c31af7Sopenharmony_ci  * [[VUID-VkVideoDecodeH265SessionParametersAddInfoKHR-None-04835]]
275e5c31af7Sopenharmony_ci    The triplet constructed from the pname:sps_video_parameter_set_id,
276e5c31af7Sopenharmony_ci    pname:pps_seq_parameter_set_id, and pname:pps_pic_parameter_set_id
277e5c31af7Sopenharmony_ci    members of each code:StdVideoH265PictureParameterSet structure specified
278e5c31af7Sopenharmony_ci    in the elements of pname:pStdPPSs must: be unique within pname:pStdPPSs
279e5c31af7Sopenharmony_ci****
280e5c31af7Sopenharmony_ci
281e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH265SessionParametersAddInfoKHR.adoc[]
282e5c31af7Sopenharmony_ci--
283e5c31af7Sopenharmony_ci
284e5c31af7Sopenharmony_ci
285e5c31af7Sopenharmony_ci=== H.265 Decoding Parameters
286e5c31af7Sopenharmony_ci
287e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH265PictureInfoKHR',desc='Structure specifies H.265 picture information when decoding a frame',type='structs']
288e5c31af7Sopenharmony_ci--
289e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH265PictureInfoKHR structure is defined as:
290e5c31af7Sopenharmony_ci
291e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH265PictureInfoKHR.adoc[]
292e5c31af7Sopenharmony_ci
293e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
294e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
295e5c31af7Sopenharmony_ci    structure.
296e5c31af7Sopenharmony_ci  * pname:pStdPictureInfo is a pointer to a
297e5c31af7Sopenharmony_ci    code:StdVideoDecodeH265PictureInfo structure specifying
298e5c31af7Sopenharmony_ci    <<decode-h265-picture-info,H.265 picture information>>.
299e5c31af7Sopenharmony_ci  * pname:sliceSegmentCount is the number of elements in
300e5c31af7Sopenharmony_ci    pname:pSliceSegmentOffsets.
301e5c31af7Sopenharmony_ci  * pname:pSliceSegmentOffsets is a pointer to an array of
302e5c31af7Sopenharmony_ci    pname:sliceSegmentCount offsets specifying the start offset of the slice
303e5c31af7Sopenharmony_ci    segments of the picture within the video bitstream buffer range
304e5c31af7Sopenharmony_ci    specified in slink:VkVideoDecodeInfoKHR.
305e5c31af7Sopenharmony_ci
306e5c31af7Sopenharmony_ciThis structure is specified in the pname:pNext chain of the
307e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR structure passed to flink:vkCmdDecodeVideoKHR to
308e5c31af7Sopenharmony_cispecify the codec-specific picture information for an <<decode-h265,H.265
309e5c31af7Sopenharmony_cidecode operation>>.
310e5c31af7Sopenharmony_ci
311e5c31af7Sopenharmony_ci[[decode-h265-output-picture-info]]
312e5c31af7Sopenharmony_ciDecode Output Picture Information::
313e5c31af7Sopenharmony_ci
314e5c31af7Sopenharmony_ciWhen this structure is specified in the pname:pNext chain of the
315e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR structure passed to flink:vkCmdDecodeVideoKHR,
316e5c31af7Sopenharmony_cithe information related to the <<decode-output-picture-info,decode output
317e5c31af7Sopenharmony_cipicture>> is defined as follows:
318e5c31af7Sopenharmony_ci
319e5c31af7Sopenharmony_ci  * The image subregion used is determined according to the
320e5c31af7Sopenharmony_ci    <<decode-h265-picture-data-access,H.265 Decode Picture Data Access>>
321e5c31af7Sopenharmony_ci    section.
322e5c31af7Sopenharmony_ci  * The decode output picture is associated with the
323e5c31af7Sopenharmony_ci    <<decode-h265-picture-info,H.265 picture information>> provided in
324e5c31af7Sopenharmony_ci    pname:pStdPictureInfo.
325e5c31af7Sopenharmony_ci
326e5c31af7Sopenharmony_ci[[decode-h265-picture-info]]
327e5c31af7Sopenharmony_ciStd Picture Information::
328e5c31af7Sopenharmony_ci
329e5c31af7Sopenharmony_ciThe members of the code:StdVideoDecodeH265PictureInfo structure pointed to
330e5c31af7Sopenharmony_ciby pname:pStdPictureInfo are interpreted as follows:
331e5c31af7Sopenharmony_ci
332e5c31af7Sopenharmony_ci  * code:reserved is used only for padding purposes and is otherwise
333e5c31af7Sopenharmony_ci    ignored;
334e5c31af7Sopenharmony_ci  * code:flags.IrapPicFlag as defined in section 3.73 of the <<itu-t-h265,
335e5c31af7Sopenharmony_ci    ITU-T H.265 Specification>>;
336e5c31af7Sopenharmony_ci  * code:flags.IdrPicFlag as defined in section 3.67 of the
337e5c31af7Sopenharmony_ci    <<itu-t-h265,ITU-T H.265 Specification>>;
338e5c31af7Sopenharmony_ci  * code:flags.IsReference as defined in section 3.132 of the <<itu-t-h265,
339e5c31af7Sopenharmony_ci    ITU-T H.265 Specification>>;
340e5c31af7Sopenharmony_ci  * code:sps_video_parameter_set_id, code:pps_seq_parameter_set_id, and
341e5c31af7Sopenharmony_ci    code:pps_pic_parameter_set_id are used to identify the active parameter
342e5c31af7Sopenharmony_ci    sets, as described below;
343e5c31af7Sopenharmony_ci  * code:PicOrderCntVal as defined in section 8.3.1 of the
344e5c31af7Sopenharmony_ci    <<itu-t-h265,ITU-T H.265 Specification>>;
345e5c31af7Sopenharmony_ci  * code:NumBitsForSTRefPicSetInSlice is the number of bits used in
346e5c31af7Sopenharmony_ci    `st_ref_pic_set` when `short_term_ref_pic_set_sps_flag` is `0`, or `0`
347e5c31af7Sopenharmony_ci    otherwise, as defined in sections 7.4.7 and 7.4.8 of the <<itu-t-h265,
348e5c31af7Sopenharmony_ci    ITU-T H.265 Specification>>;
349e5c31af7Sopenharmony_ci  * code:NumDeltaPocsOfRefRpsIdx is the value of `NumDeltaPocs[RefRpsIdx]`
350e5c31af7Sopenharmony_ci    when `short_term_ref_pic_set_sps_flag` is `1`, or `0` otherwise, as
351e5c31af7Sopenharmony_ci    defined in sections 7.4.7 and 7.4.8 of the <<itu-t-h265,ITU-T H.265
352e5c31af7Sopenharmony_ci    Specification>>;
353e5c31af7Sopenharmony_ci  * code:RefPicSetStCurrBefore, code:RefPicSetStCurrAfter, and
354e5c31af7Sopenharmony_ci    code:RefPicSetLtCurr are interpreted as defined in section 8.3.2 of the
355e5c31af7Sopenharmony_ci    <<itu-t-h265,ITU-T H.265 Specification>> where each element of these
356e5c31af7Sopenharmony_ci    arrays either identifies an
357e5c31af7Sopenharmony_ci    <<decode-active-reference-picture-info,active reference picture>> using
358e5c31af7Sopenharmony_ci    its <<dpb-slot,DPB slot>> index or contains the value
359e5c31af7Sopenharmony_ci    code:STD_VIDEO_H265_NO_REFERENCE_PICTURE to indicate "`no reference
360e5c31af7Sopenharmony_ci    picture`";
361e5c31af7Sopenharmony_ci  * all other members are interpreted as defined in section 8.3.2 of the
362e5c31af7Sopenharmony_ci    <<itu-t-h265,ITU-T H.265 Specification>>.
363e5c31af7Sopenharmony_ci
364e5c31af7Sopenharmony_ci[[decode-h265-ref-pic-setup]]
365e5c31af7Sopenharmony_ciReference picture setup is controlled by the value of
366e5c31af7Sopenharmony_cicode:StdVideoDecodeH265PictureInfo::pname:flags.IsReference.
367e5c31af7Sopenharmony_ciIf it is set and a <<decode-reconstructed-picture-info,reconstructed
368e5c31af7Sopenharmony_cipicture>> is specified, then the latter is used as the target of picture
369e5c31af7Sopenharmony_cireconstruction to <<dpb-slot-states,activate>> the corresponding
370e5c31af7Sopenharmony_ci<<dpb-slot,DPB slot>>.
371e5c31af7Sopenharmony_ciIf code:StdVideoDecodeH265PictureInfo::pname:flags.IsReference is not set,
372e5c31af7Sopenharmony_cibut a <<decode-reconstructed-picture-info,reconstructed picture>> is
373e5c31af7Sopenharmony_cispecified, then the corresponding picture reference associated with the
374e5c31af7Sopenharmony_ci<<dpb-slot,DPB slot>> is invalidated, as described in the
375e5c31af7Sopenharmony_ci<<dpb-slot-states,DPB Slot States>> section.
376e5c31af7Sopenharmony_ci
377e5c31af7Sopenharmony_ciActive Parameter Sets::
378e5c31af7Sopenharmony_ci
379e5c31af7Sopenharmony_ciThe members of the code:StdVideoDecodeH265PictureInfo structure pointed to
380e5c31af7Sopenharmony_ciby pname:pStdPictureInfo are used to select the active parameter sets to use
381e5c31af7Sopenharmony_cifrom the bound video session parameters object, as follows:
382e5c31af7Sopenharmony_ci
383e5c31af7Sopenharmony_ci  * [[decode-h265-active-vps]] The _active VPS_ is the
384e5c31af7Sopenharmony_ci    <<decode-h265-vps,VPS>> identified by the key specified in
385e5c31af7Sopenharmony_ci    code:StdVideoDecodeH265PictureInfo::code:sps_video_parameter_set_id.
386e5c31af7Sopenharmony_ci  * [[decode-h265-active-sps]] The _active SPS_ is the
387e5c31af7Sopenharmony_ci    <<decode-h265-sps,SPS>> identified by the key specified by the pair
388e5c31af7Sopenharmony_ci    constructed from
389e5c31af7Sopenharmony_ci    code:StdVideoDecodeH265PictureInfo::code:sps_video_parameter_set_id and
390e5c31af7Sopenharmony_ci    code:StdVideoDecodeH265PictureInfo::code:pps_seq_parameter_set_id.
391e5c31af7Sopenharmony_ci  * [[decode-h265-active-pps]] The _active PPS_ is the
392e5c31af7Sopenharmony_ci    <<decode-h265-pps,PPS>> identified by the key specified by the triplet
393e5c31af7Sopenharmony_ci    constructed from
394e5c31af7Sopenharmony_ci    code:StdVideoDecodeH265PictureInfo::code:sps_video_parameter_set_id,
395e5c31af7Sopenharmony_ci    code:StdVideoDecodeH265PictureInfo::code:pps_seq_parameter_set_id, and
396e5c31af7Sopenharmony_ci    code:StdVideoDecodeH265PictureInfo::code:pps_pic_parameter_set_id.
397e5c31af7Sopenharmony_ci
398e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH265PictureInfoKHR.adoc[]
399e5c31af7Sopenharmony_ci--
400e5c31af7Sopenharmony_ci
401e5c31af7Sopenharmony_ci[open,refpage='VkVideoDecodeH265DpbSlotInfoKHR',desc='Structure specifies H.265 DPB information when decoding a frame',type='structs']
402e5c31af7Sopenharmony_ci--
403e5c31af7Sopenharmony_ciThe sname:VkVideoDecodeH265DpbSlotInfoKHR structure is defined as:
404e5c31af7Sopenharmony_ci
405e5c31af7Sopenharmony_ciinclude::{generated}/api/structs/VkVideoDecodeH265DpbSlotInfoKHR.adoc[]
406e5c31af7Sopenharmony_ci
407e5c31af7Sopenharmony_ci  * pname:sType is a elink:VkStructureType value identifying this structure.
408e5c31af7Sopenharmony_ci  * pname:pNext is `NULL` or a pointer to a structure extending this
409e5c31af7Sopenharmony_ci    structure.
410e5c31af7Sopenharmony_ci  * pname:pStdReferenceInfo is a pointer to a
411e5c31af7Sopenharmony_ci    code:StdVideoDecodeH265ReferenceInfo structure specifying reference
412e5c31af7Sopenharmony_ci    picture information described in section 8.3 of the <<itu-t-h265,ITU-T
413e5c31af7Sopenharmony_ci    H.265 Specification>>.
414e5c31af7Sopenharmony_ci
415e5c31af7Sopenharmony_ciThis structure is specified in the pname:pNext chain of
416e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot, if not `NULL`, and
417e5c31af7Sopenharmony_cithe pname:pNext chain of the elements of
418e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pReferenceSlots to specify the
419e5c31af7Sopenharmony_cicodec-specific reference picture information for an <<decode-h265,H.265
420e5c31af7Sopenharmony_cidecode operation>>.
421e5c31af7Sopenharmony_ci
422e5c31af7Sopenharmony_ci[[decode-h265-active-reference-picture-info]]
423e5c31af7Sopenharmony_ciActive Reference Picture Information::
424e5c31af7Sopenharmony_ci
425e5c31af7Sopenharmony_ciWhen this structure is specified in the pname:pNext chain of the elements of
426e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pReferenceSlots, one element is added to
427e5c31af7Sopenharmony_cithe list of <<decode-active-reference-picture-info,active reference
428e5c31af7Sopenharmony_cipictures>> used by the video decode operation for each element of
429e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pReferenceSlots as follows:
430e5c31af7Sopenharmony_ci
431e5c31af7Sopenharmony_ci  * The image subregion used is determined according to the
432e5c31af7Sopenharmony_ci    <<decode-h265-picture-data-access,H.265 Decode Picture Data Access>>
433e5c31af7Sopenharmony_ci    section.
434e5c31af7Sopenharmony_ci  * The reference picture is associated with the <<dpb-slot,DPB slot>> index
435e5c31af7Sopenharmony_ci    specified in the pname:slotIndex member of the corresponding element of
436e5c31af7Sopenharmony_ci    slink:VkVideoDecodeInfoKHR::pname:pReferenceSlots.
437e5c31af7Sopenharmony_ci  * The reference picture is associated with the
438e5c31af7Sopenharmony_ci    <<decode-h265-reference-info,H.265 reference information>> provided in
439e5c31af7Sopenharmony_ci    pname:pStdReferenceInfo.
440e5c31af7Sopenharmony_ci
441e5c31af7Sopenharmony_ci[[decode-h265-reconstructed-picture-info]]
442e5c31af7Sopenharmony_ciReconstructed Picture Information::
443e5c31af7Sopenharmony_ci
444e5c31af7Sopenharmony_ciWhen this structure is specified in the pname:pNext chain of
445e5c31af7Sopenharmony_cislink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot, the information
446e5c31af7Sopenharmony_cirelated to the <<decode-reconstructed-picture-info,reconstructed picture>>
447e5c31af7Sopenharmony_ciis defined as follows:
448e5c31af7Sopenharmony_ci
449e5c31af7Sopenharmony_ci  * The image subregion used is determined according to the
450e5c31af7Sopenharmony_ci    <<decode-h265-picture-data-access,H.265 Decode Picture Data Access>>
451e5c31af7Sopenharmony_ci    section.
452e5c31af7Sopenharmony_ci  * If <<decode-h265-ref-pic-setup,reference picture setup>> is requested,
453e5c31af7Sopenharmony_ci    then the reconstructed picture is used to <<dpb-slot-states,activate>>
454e5c31af7Sopenharmony_ci    the <<dpb-slot,DPB slot>> with the index specified in
455e5c31af7Sopenharmony_ci    slink:VkVideoDecodeInfoKHR::pname:pSetupReferenceSlot->slotIndex.
456e5c31af7Sopenharmony_ci  * The reconstructed picture is associated with the
457e5c31af7Sopenharmony_ci    <<decode-h265-reference-info,H.265 reference information>> provided in
458e5c31af7Sopenharmony_ci    pname:pStdReferenceInfo.
459e5c31af7Sopenharmony_ci
460e5c31af7Sopenharmony_ci[[decode-h265-reference-info]]
461e5c31af7Sopenharmony_ciStd Reference Information::
462e5c31af7Sopenharmony_ci
463e5c31af7Sopenharmony_ciThe members of the code:StdVideoDecodeH265ReferenceInfo structure pointed to
464e5c31af7Sopenharmony_ciby pname:pStdReferenceInfo are interpreted as follows:
465e5c31af7Sopenharmony_ci
466e5c31af7Sopenharmony_ci  * code:flags.used_for_long_term_reference is used to indicate whether the
467e5c31af7Sopenharmony_ci    picture is marked as "`used for long-term reference`" as defined in
468e5c31af7Sopenharmony_ci    section 8.3.2 of the <<itu-t-h265,ITU-T H.265 Specification>>;
469e5c31af7Sopenharmony_ci  * code:flags.unused_for_reference is used to indicate whether the picture
470e5c31af7Sopenharmony_ci    is marked as "`unused for reference`" as defined in section 8.3.2 of the
471e5c31af7Sopenharmony_ci    <<itu-t-h265,ITU-T H.265 Specification>>;
472e5c31af7Sopenharmony_ci  * all other members are interpreted as defined in section 8.3 of the
473e5c31af7Sopenharmony_ci    <<itu-t-h265,ITU-T H.265 Specification>>.
474e5c31af7Sopenharmony_ci
475e5c31af7Sopenharmony_ciinclude::{generated}/validity/structs/VkVideoDecodeH265DpbSlotInfoKHR.adoc[]
476e5c31af7Sopenharmony_ci--
477e5c31af7Sopenharmony_ci
478e5c31af7Sopenharmony_ci
479e5c31af7Sopenharmony_ci[[decode-h265-requirements]]
480e5c31af7Sopenharmony_ci=== H.265 Decode Requirements
481e5c31af7Sopenharmony_ci
482e5c31af7Sopenharmony_ciThis section describes the required: H.265 decoding capabilities for
483e5c31af7Sopenharmony_ciphysical devices that have at least one queue family that supports the video
484e5c31af7Sopenharmony_cicodec operation ename:VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR, as
485e5c31af7Sopenharmony_cireturned by flink:vkGetPhysicalDeviceQueueFamilyProperties2 in
486e5c31af7Sopenharmony_cislink:VkQueueFamilyVideoPropertiesKHR::pname:videoCodecOperations.
487e5c31af7Sopenharmony_ci
488e5c31af7Sopenharmony_ci.Required <<video-std-header-version,Video Std Header Versions>>
489e5c31af7Sopenharmony_ci[options="header"]
490e5c31af7Sopenharmony_ci|====
491e5c31af7Sopenharmony_ci| Video Std Header Name | Version
492e5c31af7Sopenharmony_ci| `vulkan_video_codec_h265std_decode` | 1.0.0
493e5c31af7Sopenharmony_ci|====
494e5c31af7Sopenharmony_ci
495e5c31af7Sopenharmony_ciifdef::VK_KHR_video_maintenance1[]
496e5c31af7Sopenharmony_ci.Required Video Capabilities
497e5c31af7Sopenharmony_ci[width="100%",cols="<35,<14,<11",options="header"]
498e5c31af7Sopenharmony_ci|====
499e5c31af7Sopenharmony_ci| Video Capability | Requirement | Requirement Type^1^
500e5c31af7Sopenharmony_ci| **slink:VkVideoCapabilitiesKHR** | |
501e5c31af7Sopenharmony_ci| pname:flags | - | min
502e5c31af7Sopenharmony_ci| pname:minBitstreamBufferOffsetAlignment | 4096 | max
503e5c31af7Sopenharmony_ci| pname:minBitstreamBufferSizeAlignment | 4096 | max
504e5c31af7Sopenharmony_ci| pname:pictureAccessGranularity | (64,64) | max
505e5c31af7Sopenharmony_ci| pname:minCodedExtent | - | max
506e5c31af7Sopenharmony_ci| pname:maxCodedExtent | - | min
507e5c31af7Sopenharmony_ci| pname:maxDpbSlots | 0 | min
508e5c31af7Sopenharmony_ci| pname:maxActiveReferencePictures | 0 | min
509e5c31af7Sopenharmony_ci| **slink:VkVideoDecodeCapabilitiesKHR** | |
510e5c31af7Sopenharmony_ci| pname:flags | ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR or
511e5c31af7Sopenharmony_ci                ename:VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_DISTINCT_BIT_KHR | min
512e5c31af7Sopenharmony_ci| **slink:VkVideoDecodeH265CapabilitiesKHR** | |
513e5c31af7Sopenharmony_ci| pname:maxLevelIdc | code:STD_VIDEO_H265_LEVEL_IDC_1_0 | min
514e5c31af7Sopenharmony_ci|====
515e5c31af7Sopenharmony_ci
516e5c31af7Sopenharmony_ci1::
517e5c31af7Sopenharmony_ci    The *Requirement Type* column specifies the requirement is either the
518e5c31af7Sopenharmony_ci    minimum value all implementations must: support, the maximum value all
519e5c31af7Sopenharmony_ci    implementations must: support, or the exact value all implementations
520e5c31af7Sopenharmony_ci    must: support.
521e5c31af7Sopenharmony_ci    For bitmasks a minimum value is the least bits all implementations must:
522e5c31af7Sopenharmony_ci    set, but they may: have additional bits set beyond this minimum.
523e5c31af7Sopenharmony_ciendif::VK_KHR_video_maintenance1[]
524