Removed
Link Here
|
1 |
https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=10647 |
2 |
|
3 |
--- libavcodec/Makefile.orig 2023-12-31 00:07:26 UTC |
4 |
+++ libavcodec/Makefile |
5 |
@@ -1284,7 +1284,6 @@ SKIPHEADERS += %_tablegen.h |
6 |
aacenc_quantization.h \ |
7 |
aacenc_quantization_misc.h \ |
8 |
bitstream_template.h \ |
9 |
- vulkan_video_codec_av1std.h \ |
10 |
$(ARCH)/vpx_arith.h \ |
11 |
|
12 |
SKIPHEADERS-$(CONFIG_AMF) += amfenc.h |
13 |
@@ -1306,7 +1305,7 @@ SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox |
14 |
SKIPHEADERS-$(CONFIG_VAAPI) += vaapi_decode.h vaapi_hevc.h vaapi_encode.h |
15 |
SKIPHEADERS-$(CONFIG_VDPAU) += vdpau.h vdpau_internal.h |
16 |
SKIPHEADERS-$(CONFIG_VIDEOTOOLBOX) += videotoolbox.h vt_internal.h |
17 |
-SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h vulkan_video_codec_av1std_decode.h |
18 |
+SKIPHEADERS-$(CONFIG_VULKAN) += vulkan.h vulkan_video.h vulkan_decode.h |
19 |
SKIPHEADERS-$(CONFIG_V4L2_M2M) += v4l2_buffers.h v4l2_context.h v4l2_m2m.h |
20 |
SKIPHEADERS-$(CONFIG_ZLIB) += zlib_wrapper.h |
21 |
|
22 |
--- libavcodec/cbs_av1.h.orig 2023-11-11 00:25:17 UTC |
23 |
+++ libavcodec/cbs_av1.h |
24 |
@@ -198,6 +198,7 @@ typedef struct AV1RawFrameHeader { |
25 |
uint8_t refresh_frame_flags; |
26 |
uint8_t allow_intrabc; |
27 |
uint8_t ref_order_hint[AV1_NUM_REF_FRAMES]; |
28 |
+ uint8_t ref_frame_sign_bias[AV1_NUM_REF_FRAMES]; |
29 |
uint8_t frame_refs_short_signaling; |
30 |
uint8_t last_frame_idx; |
31 |
uint8_t golden_frame_idx; |
32 |
--- libavcodec/cbs_av1_syntax_template.c.orig 2023-11-11 00:25:17 UTC |
33 |
+++ libavcodec/cbs_av1_syntax_template.c |
34 |
@@ -1572,6 +1572,16 @@ static int FUNC(uncompressed_header)(CodedBitstreamCon |
35 |
} |
36 |
|
37 |
if (!frame_is_intra) { |
38 |
+ for (i = 0; i < AV1_REFS_PER_FRAME; i++) { |
39 |
+ if (seq->enable_order_hint) { |
40 |
+ int idx = current->ref_frame_idx[i]; |
41 |
+ int hint = current->ref_order_hint[idx]; |
42 |
+ current->ref_frame_sign_bias[i] = cbs_av1_get_relative_dist(seq, hint, |
43 |
+ priv->order_hint) > 0; |
44 |
+ } else { |
45 |
+ infer(ref_frame_sign_bias[i], 0); |
46 |
+ } |
47 |
+ } |
48 |
// Derive reference frame sign biases. |
49 |
} |
50 |
|
51 |
--- libavcodec/vulkan_av1.c.orig 2023-11-11 00:25:17 UTC |
52 |
+++ libavcodec/vulkan_av1.c |
53 |
@@ -35,18 +35,33 @@ typedef struct AV1VulkanDecodePicture { |
54 |
*Can be removed once no longer needed, and threading can be enabled. */ |
55 |
FFVulkanDecodeContext *dec; |
56 |
|
57 |
- StdVideoAV1MESATile tiles[MAX_TILES]; |
58 |
- StdVideoAV1MESATileList tile_list; |
59 |
- const uint32_t *tile_offsets; |
60 |
+ uint32_t tile_count; |
61 |
+ uint32_t tile_offsets_s[MAX_TILES]; |
62 |
+ uint32_t tile_sizes[MAX_TILES]; |
63 |
+ const uint32_t *tile_offsets; |
64 |
|
65 |
/* Current picture */ |
66 |
- VkVideoDecodeAV1DpbSlotInfoMESA vkav1_ref; |
67 |
- StdVideoAV1MESAFrameHeader av1_frame_header; |
68 |
- VkVideoDecodeAV1PictureInfoMESA av1_pic_info; |
69 |
+ StdVideoDecodeAV1ReferenceInfo std_ref; |
70 |
+ VkVideoDecodeAV1DpbSlotInfoKHR vkav1_ref; |
71 |
+ uint16_t width_in_sbs_minus1[64]; |
72 |
+ uint16_t height_in_sbs_minus1[64]; |
73 |
+ uint16_t mi_col_starts[64]; |
74 |
+ uint16_t mi_row_starts[64]; |
75 |
+ StdVideoAV1TileInfo tile_info; |
76 |
+ StdVideoAV1Quantization quantization; |
77 |
+ StdVideoAV1Segmentation segmentation; |
78 |
+ StdVideoAV1LoopFilter loop_filter; |
79 |
+ StdVideoAV1CDEF cdef; |
80 |
+ StdVideoAV1LoopRestoration loop_restoration; |
81 |
+ StdVideoAV1GlobalMotion global_motion; |
82 |
+ StdVideoAV1FilmGrain film_grain; |
83 |
+ StdVideoDecodeAV1PictureInfo std_pic_info; |
84 |
+ VkVideoDecodeAV1PictureInfoKHR av1_pic_info; |
85 |
|
86 |
/* Picture refs */ |
87 |
const AV1Frame *ref_src [AV1_NUM_REF_FRAMES]; |
88 |
- VkVideoDecodeAV1DpbSlotInfoMESA vkav1_refs[AV1_NUM_REF_FRAMES]; |
89 |
+ StdVideoDecodeAV1ReferenceInfo std_ref_info[AV1_NUM_REF_FRAMES]; |
90 |
+ VkVideoDecodeAV1DpbSlotInfoKHR vkav1_refs[AV1_NUM_REF_FRAMES]; |
91 |
|
92 |
uint8_t frame_id_set; |
93 |
uint8_t frame_id; |
94 |
@@ -55,9 +70,9 @@ static int vk_av1_fill_pict(AVCodecContext *avctx, con |
95 |
static int vk_av1_fill_pict(AVCodecContext *avctx, const AV1Frame **ref_src, |
96 |
VkVideoReferenceSlotInfoKHR *ref_slot, /* Main structure */ |
97 |
VkVideoPictureResourceInfoKHR *ref, /* Goes in ^ */ |
98 |
- VkVideoDecodeAV1DpbSlotInfoMESA *vkav1_ref, /* Goes in ^ */ |
99 |
- const AV1Frame *pic, int is_current, int has_grain, |
100 |
- int dpb_slot_index) |
101 |
+ StdVideoDecodeAV1ReferenceInfo *vkav1_std_ref, |
102 |
+ VkVideoDecodeAV1DpbSlotInfoKHR *vkav1_ref, /* Goes in ^ */ |
103 |
+ const AV1Frame *pic, int is_current, int has_grain) |
104 |
{ |
105 |
FFVulkanDecodeContext *dec = avctx->internal->hwaccel_priv_data; |
106 |
AV1VulkanDecodePicture *hp = pic->hwaccel_picture_private; |
107 |
@@ -68,31 +83,48 @@ static int vk_av1_fill_pict(AVCodecContext *avctx, con |
108 |
if (err < 0) |
109 |
return err; |
110 |
|
111 |
- *vkav1_ref = (VkVideoDecodeAV1DpbSlotInfoMESA) { |
112 |
- .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_DPB_SLOT_INFO_MESA, |
113 |
- .frameIdx = hp->frame_id, |
114 |
+ *vkav1_std_ref = (StdVideoDecodeAV1ReferenceInfo) { |
115 |
+ .flags = (StdVideoDecodeAV1ReferenceInfoFlags) { |
116 |
+ .disable_frame_end_update_cdf = pic->raw_frame_header->disable_frame_end_update_cdf, |
117 |
+ .segmentation_enabled = pic->raw_frame_header->segmentation_enabled, |
118 |
+ }, |
119 |
+ .frame_type = pic->raw_frame_header->frame_type, |
120 |
+ .OrderHint = pic->raw_frame_header->order_hint, |
121 |
}; |
122 |
|
123 |
+ for (int i = 0; i < (STD_VIDEO_AV1_NUM_REF_FRAMES - 1); i++) { |
124 |
+ int hint_idx = pic->raw_frame_header->ref_frame_idx[i]; |
125 |
+ int hint = pic->raw_frame_header->ref_order_hint[hint_idx]; |
126 |
+ vkav1_std_ref->SavedOrderHints[AV1_REF_FRAME_LAST + i] = hint; // not sure |
127 |
+ } |
128 |
+ |
129 |
+ *vkav1_ref = (VkVideoDecodeAV1DpbSlotInfoKHR) { |
130 |
+ .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_DPB_SLOT_INFO_KHR, |
131 |
+ .pStdReferenceInfo = vkav1_std_ref, |
132 |
+ }; |
133 |
+ |
134 |
for (unsigned i = 0; i < 7; i++) { |
135 |
const int idx = pic->raw_frame_header->ref_frame_idx[i]; |
136 |
- vkav1_ref->ref_order_hint[i] = pic->raw_frame_header->ref_order_hint[idx]; |
137 |
+ vkav1_std_ref->SavedOrderHints[i] = pic->raw_frame_header->ref_order_hint[idx]; |
138 |
} |
139 |
|
140 |
- vkav1_ref->disable_frame_end_update_cdf = pic->raw_frame_header->disable_frame_end_update_cdf; |
141 |
+ vkav1_std_ref->flags.disable_frame_end_update_cdf = pic->raw_frame_header->disable_frame_end_update_cdf; |
142 |
+ vkav1_std_ref->flags.segmentation_enabled = pic->raw_frame_header->segmentation_enabled; |
143 |
+ vkav1_std_ref->frame_type = pic->raw_frame_header->frame_type; |
144 |
|
145 |
*ref = (VkVideoPictureResourceInfoKHR) { |
146 |
.sType = VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR, |
147 |
.codedOffset = (VkOffset2D){ 0, 0 }, |
148 |
.codedExtent = (VkExtent2D){ pic->f->width, pic->f->height }, |
149 |
.baseArrayLayer = ((has_grain || dec->dedicated_dpb) && dec->layered_dpb) ? |
150 |
- dpb_slot_index : 0, |
151 |
+ hp->frame_id : 0, |
152 |
.imageViewBinding = vkpic->img_view_ref, |
153 |
}; |
154 |
|
155 |
*ref_slot = (VkVideoReferenceSlotInfoKHR) { |
156 |
.sType = VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR, |
157 |
.pNext = vkav1_ref, |
158 |
- .slotIndex = dpb_slot_index, |
159 |
+ .slotIndex = hp->frame_id, |
160 |
.pPictureResource = ref, |
161 |
}; |
162 |
|
163 |
@@ -110,15 +142,37 @@ static int vk_av1_create_params(AVCodecContext *avctx, |
164 |
|
165 |
const AV1RawSequenceHeader *seq = s->raw_seq; |
166 |
|
167 |
- StdVideoAV1MESASequenceHeader av1_sequence_header; |
168 |
- VkVideoDecodeAV1SessionParametersAddInfoMESA av1_params_info; |
169 |
- VkVideoDecodeAV1SessionParametersCreateInfoMESA av1_params; |
170 |
+ StdVideoAV1SequenceHeader av1_sequence_header; |
171 |
+ StdVideoAV1TimingInfo av1_timing_info; |
172 |
+ StdVideoAV1ColorConfig av1_color_config; |
173 |
+ VkVideoDecodeAV1SessionParametersCreateInfoKHR av1_params; |
174 |
VkVideoSessionParametersCreateInfoKHR session_params_create; |
175 |
|
176 |
int err; |
177 |
|
178 |
- av1_sequence_header = (StdVideoAV1MESASequenceHeader) { |
179 |
- .flags = (StdVideoAV1MESASequenceHeaderFlags) { |
180 |
+ av1_timing_info = (StdVideoAV1TimingInfo) { |
181 |
+ .flags = (StdVideoAV1TimingInfoFlags) { |
182 |
+ .equal_picture_interval = seq->timing_info.equal_picture_interval, |
183 |
+ }, |
184 |
+ .num_units_in_display_tick = seq->timing_info.num_units_in_display_tick, |
185 |
+ .time_scale = seq->timing_info.time_scale, |
186 |
+ .num_ticks_per_picture_minus_1 = seq->timing_info.num_ticks_per_picture_minus_1, |
187 |
+ }; |
188 |
+ |
189 |
+ av1_color_config = (StdVideoAV1ColorConfig) { |
190 |
+ .flags = (StdVideoAV1ColorConfigFlags) { |
191 |
+ .mono_chrome = seq->color_config.mono_chrome, |
192 |
+ .color_range = seq->color_config.color_range, |
193 |
+ .separate_uv_delta_q = seq->color_config.separate_uv_delta_q, |
194 |
+ }, |
195 |
+ .BitDepth = seq->color_config.twelve_bit ? 12 : |
196 |
+ seq->color_config.high_bitdepth ? 10 : 8, |
197 |
+ .subsampling_x = seq->color_config.subsampling_x, |
198 |
+ .subsampling_y = seq->color_config.subsampling_y, |
199 |
+ }; |
200 |
+ |
201 |
+ av1_sequence_header = (StdVideoAV1SequenceHeader) { |
202 |
+ .flags = (StdVideoAV1SequenceHeaderFlags) { |
203 |
.still_picture = seq->still_picture, |
204 |
.reduced_still_picture_header = seq->reduced_still_picture_header, |
205 |
.use_128x128_superblock = seq->use_128x128_superblock, |
206 |
@@ -147,35 +201,14 @@ static int vk_av1_create_params(AVCodecContext *avctx, |
207 |
.delta_frame_id_length_minus_2 = seq->delta_frame_id_length_minus_2, |
208 |
.additional_frame_id_length_minus_1 = seq->additional_frame_id_length_minus_1, |
209 |
.order_hint_bits_minus_1 = seq->order_hint_bits_minus_1, |
210 |
- .timing_info = (StdVideoAV1MESATimingInfo) { |
211 |
- .flags = (StdVideoAV1MESATimingInfoFlags) { |
212 |
- .equal_picture_interval = seq->timing_info.equal_picture_interval, |
213 |
- }, |
214 |
- .num_units_in_display_tick = seq->timing_info.num_units_in_display_tick, |
215 |
- .time_scale = seq->timing_info.time_scale, |
216 |
- .num_ticks_per_picture_minus_1 = seq->timing_info.num_ticks_per_picture_minus_1, |
217 |
- }, |
218 |
- .color_config = (StdVideoAV1MESAColorConfig) { |
219 |
- .flags = (StdVideoAV1MESAColorConfigFlags) { |
220 |
- .mono_chrome = seq->color_config.mono_chrome, |
221 |
- .color_range = seq->color_config.color_range, |
222 |
- .separate_uv_delta_q = seq->color_config.separate_uv_delta_q, |
223 |
- }, |
224 |
- .bit_depth = seq->color_config.twelve_bit ? 12 : |
225 |
- seq->color_config.high_bitdepth ? 10 : 8, |
226 |
- .subsampling_x = seq->color_config.subsampling_x, |
227 |
- .subsampling_y = seq->color_config.subsampling_y, |
228 |
- }, |
229 |
+ .pTimingInfo = &av1_timing_info, |
230 |
+ .pColorConfig = &av1_color_config, |
231 |
}; |
232 |
|
233 |
- av1_params_info = (VkVideoDecodeAV1SessionParametersAddInfoMESA) { |
234 |
- .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_ADD_INFO_MESA, |
235 |
- .sequence_header = &av1_sequence_header, |
236 |
+ av1_params = (VkVideoDecodeAV1SessionParametersCreateInfoKHR) { |
237 |
+ .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR, |
238 |
+ .pStdSequenceHeader = &av1_sequence_header, |
239 |
}; |
240 |
- av1_params = (VkVideoDecodeAV1SessionParametersCreateInfoMESA) { |
241 |
- .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_MESA, |
242 |
- .pParametersAddInfo = &av1_params_info, |
243 |
- }; |
244 |
session_params_create = (VkVideoSessionParametersCreateInfoKHR) { |
245 |
.sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR, |
246 |
.pNext = &av1_params, |
247 |
@@ -208,6 +241,11 @@ static int vk_av1_start_frame(AVCodecContext |
248 |
const AV1RawFilmGrainParams *film_grain = &s->cur_frame.film_grain; |
249 |
const int apply_grain = !(avctx->export_side_data & AV_CODEC_EXPORT_DATA_FILM_GRAIN) && |
250 |
film_grain->apply_grain; |
251 |
+ StdVideoAV1FrameRestorationType remap_lr_type[4] = { STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_NONE, |
252 |
+ STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SWITCHABLE, |
253 |
+ STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_WIENER, |
254 |
+ STD_VIDEO_AV1_FRAME_RESTORATION_TYPE_SGRPROJ }; |
255 |
+ int uses_lr; |
256 |
|
257 |
if (!dec->session_params) { |
258 |
err = vk_av1_create_params(avctx, &dec->session_params); |
259 |
@@ -235,29 +273,37 @@ static int vk_av1_start_frame(AVCodecContext |
260 |
continue; |
261 |
|
262 |
err = vk_av1_fill_pict(avctx, &ap->ref_src[i], &vp->ref_slots[i], |
263 |
- &vp->refs[i], &ap->vkav1_refs[i], |
264 |
- ref_frame, 0, 0, i); |
265 |
+ &vp->refs[i], &ap->std_ref_info[i], &ap->vkav1_refs[i], |
266 |
+ ref_frame, 0, 0); |
267 |
if (err < 0) |
268 |
return err; |
269 |
|
270 |
+ // Really not sure |
271 |
+ ap->std_ref_info[i].RefFrameSignBias = pic->raw_frame_header->ref_frame_sign_bias[i]; |
272 |
+ |
273 |
ref_count++; |
274 |
} |
275 |
|
276 |
err = vk_av1_fill_pict(avctx, NULL, &vp->ref_slot, &vp->ref, |
277 |
+ &ap->std_ref, |
278 |
&ap->vkav1_ref, |
279 |
- pic, 1, apply_grain, 8); |
280 |
+ pic, 1, apply_grain); |
281 |
if (err < 0) |
282 |
return err; |
283 |
|
284 |
- ap->tile_list.nb_tiles = 0; |
285 |
- ap->tile_list.tile_list = ap->tiles; |
286 |
+ ap->tile_count = 0; |
287 |
|
288 |
- ap->av1_pic_info = (VkVideoDecodeAV1PictureInfoMESA) { |
289 |
- .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_MESA, |
290 |
- .frame_header = &ap->av1_frame_header, |
291 |
- .tile_list = &ap->tile_list, |
292 |
+ ap->av1_pic_info = (VkVideoDecodeAV1PictureInfoKHR) { |
293 |
+ .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_KHR, |
294 |
+ .pStdPictureInfo = &ap->std_pic_info, |
295 |
+ .tileCount = ap->tile_count, |
296 |
+ .pTileOffsets = ap->tile_offsets_s, |
297 |
+ .pTileSizes = ap->tile_sizes, |
298 |
}; |
299 |
|
300 |
+ for (int i = 0; i < STD_VIDEO_AV1_REFS_PER_FRAME; i++) |
301 |
+ ap->av1_pic_info.referenceNameSlotIndices[i] = vp->ref_slots[frame_header->ref_frame_idx[i]].slotIndex; |
302 |
+ |
303 |
vp->decode_info = (VkVideoDecodeInfoKHR) { |
304 |
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR, |
305 |
.pNext = &ap->av1_pic_info, |
306 |
@@ -274,9 +320,94 @@ static int vk_av1_start_frame(AVCodecContext |
307 |
}, |
308 |
}; |
309 |
|
310 |
+ ap->tile_info = (StdVideoAV1TileInfo) { |
311 |
+ .flags = (StdVideoAV1TileInfoFlags) { |
312 |
+ .uniform_tile_spacing_flag = frame_header->uniform_tile_spacing_flag, |
313 |
+ }, |
314 |
+ .TileCols = frame_header->tile_cols, |
315 |
+ .TileRows = frame_header->tile_rows, |
316 |
+ .context_update_tile_id = frame_header->context_update_tile_id, |
317 |
+ .tile_size_bytes_minus_1 = frame_header->tile_size_bytes_minus1, |
318 |
+ .pWidthInSbsMinus1 = ap->width_in_sbs_minus1, |
319 |
+ .pHeightInSbsMinus1 = ap->height_in_sbs_minus1, |
320 |
+ .pMiColStarts = ap->mi_col_starts, |
321 |
+ .pMiRowStarts = ap->mi_row_starts, |
322 |
+ }; |
323 |
+ |
324 |
+ ap->quantization = (StdVideoAV1Quantization) { |
325 |
+ .flags.using_qmatrix = frame_header->using_qmatrix, |
326 |
+ .flags.diff_uv_delta = frame_header->diff_uv_delta, |
327 |
+ .base_q_idx = frame_header->base_q_idx, |
328 |
+ .DeltaQYDc = frame_header->delta_q_y_dc, |
329 |
+ .DeltaQUDc = frame_header->delta_q_u_dc, |
330 |
+ .DeltaQUAc = frame_header->delta_q_u_ac, |
331 |
+ .DeltaQVDc = frame_header->delta_q_v_dc, |
332 |
+ .DeltaQVAc = frame_header->delta_q_v_ac, |
333 |
+ .qm_y = frame_header->qm_y, |
334 |
+ .qm_u = frame_header->qm_u, |
335 |
+ .qm_v = frame_header->qm_v, |
336 |
+ }; |
337 |
+ |
338 |
+ for (int i = 0; i < STD_VIDEO_AV1_MAX_SEGMENTS; i++) { |
339 |
+ for (int j = 0; j < STD_VIDEO_AV1_SEG_LVL_MAX; j++) { |
340 |
+ ap->segmentation.FeatureEnabled[i] |= frame_header->feature_enabled[i][j] << j; |
341 |
+ ap->segmentation.FeatureData[i][j] = frame_header->feature_value[i][j]; |
342 |
+ } |
343 |
+ } |
344 |
+ |
345 |
+ ap->loop_filter = (StdVideoAV1LoopFilter) { |
346 |
+ .flags = (StdVideoAV1LoopFilterFlags) { |
347 |
+ .loop_filter_delta_enabled = frame_header->loop_filter_delta_enabled, |
348 |
+ .loop_filter_delta_update = frame_header->loop_filter_delta_update, |
349 |
+ }, |
350 |
+ .loop_filter_sharpness = frame_header->loop_filter_sharpness, |
351 |
+ }; |
352 |
+ |
353 |
+ for (int i = 0; i < STD_VIDEO_AV1_MAX_LOOP_FILTER_STRENGTHS; i++) |
354 |
+ ap->loop_filter.loop_filter_level[i] = frame_header->loop_filter_level[i]; |
355 |
+ for (int i = 0; i < STD_VIDEO_AV1_LOOP_FILTER_ADJUSTMENTS; i++) |
356 |
+ ap->loop_filter.loop_filter_mode_deltas[i] = frame_header->loop_filter_mode_deltas[i]; |
357 |
+ |
358 |
+ ap->cdef = (StdVideoAV1CDEF) { |
359 |
+ .cdef_damping_minus_3 = frame_header->cdef_damping_minus_3, |
360 |
+ .cdef_bits = frame_header->cdef_bits, |
361 |
+ }; |
362 |
+ |
363 |
+ uses_lr = frame_header->lr_type[0] || frame_header->lr_type[1] || frame_header->lr_type[2], |
364 |
+ ap->loop_restoration = (StdVideoAV1LoopRestoration) { |
365 |
+ .FrameRestorationType[0] = remap_lr_type[frame_header->lr_type[0]], |
366 |
+ .FrameRestorationType[1] = remap_lr_type[frame_header->lr_type[1]], |
367 |
+ .FrameRestorationType[2] = remap_lr_type[frame_header->lr_type[2]], |
368 |
+ .LoopRestorationSize[0] = 1 + frame_header->lr_unit_shift, |
369 |
+ .LoopRestorationSize[1] = 1 + frame_header->lr_unit_shift - frame_header->lr_uv_shift, |
370 |
+ .LoopRestorationSize[2] = 1 + frame_header->lr_unit_shift - frame_header->lr_uv_shift, |
371 |
+ }; |
372 |
+ |
373 |
+ ap->film_grain = (StdVideoAV1FilmGrain) { |
374 |
+ .flags = (StdVideoAV1FilmGrainFlags) { |
375 |
+ .chroma_scaling_from_luma = film_grain->chroma_scaling_from_luma, |
376 |
+ .overlap_flag = film_grain->overlap_flag, |
377 |
+ .clip_to_restricted_range = film_grain->clip_to_restricted_range, |
378 |
+ }, |
379 |
+ .grain_scaling_minus_8 = film_grain->grain_scaling_minus_8, |
380 |
+ .ar_coeff_lag = film_grain->ar_coeff_lag, |
381 |
+ .ar_coeff_shift_minus_6 = film_grain->ar_coeff_shift_minus_6, |
382 |
+ .grain_scale_shift = film_grain->grain_scale_shift, |
383 |
+ .grain_seed = film_grain->grain_seed, |
384 |
+ .num_y_points = film_grain->num_y_points, |
385 |
+ .num_cb_points = film_grain->num_cb_points, |
386 |
+ .num_cr_points = film_grain->num_cr_points, |
387 |
+ .cb_mult = film_grain->cb_mult, |
388 |
+ .cb_luma_mult = film_grain->cb_luma_mult, |
389 |
+ .cb_offset = film_grain->cb_offset, |
390 |
+ .cr_mult = film_grain->cr_mult, |
391 |
+ .cr_luma_mult = film_grain->cr_luma_mult, |
392 |
+ .cr_offset = film_grain->cr_offset, |
393 |
+ }; |
394 |
+ |
395 |
/* Setup frame header */ |
396 |
- ap->av1_frame_header = (StdVideoAV1MESAFrameHeader) { |
397 |
- .flags = (StdVideoAV1MESAFrameHeaderFlags) { |
398 |
+ ap->std_pic_info = (StdVideoDecodeAV1PictureInfo) { |
399 |
+ .flags = (StdVideoDecodeAV1PictureInfoFlags) { |
400 |
.error_resilient_mode = frame_header->error_resilient_mode, |
401 |
.disable_cdf_update = frame_header->disable_cdf_update, |
402 |
.use_superres = frame_header->use_superres, |
403 |
@@ -297,171 +428,87 @@ static int vk_av1_start_frame(AVCodecContext |
404 |
.reference_select = frame_header->reference_select, |
405 |
.skip_mode_present = frame_header->skip_mode_present, |
406 |
.delta_q_present = frame_header->delta_q_present, |
407 |
+ .delta_lf_present = frame_header->delta_lf_present, |
408 |
+ .delta_lf_multi = frame_header->delta_lf_multi, |
409 |
+ .segmentation_enabled = frame_header->segmentation_enabled, |
410 |
+ .segmentation_update_map = frame_header->segmentation_update_map, |
411 |
+ .segmentation_temporal_update = frame_header->segmentation_temporal_update, |
412 |
+ .segmentation_update_data = frame_header->segmentation_update_data, |
413 |
+ .UsesLr = uses_lr, |
414 |
+ .apply_grain = apply_grain, |
415 |
}, |
416 |
- .frame_to_show_map_idx = frame_header->frame_to_show_map_idx, |
417 |
- .frame_presentation_time = frame_header->frame_presentation_time, |
418 |
- .display_frame_id = frame_header->display_frame_id, |
419 |
.frame_type = frame_header->frame_type, |
420 |
.current_frame_id = frame_header->current_frame_id, |
421 |
- .order_hint = frame_header->order_hint, |
422 |
+ .OrderHint = frame_header->order_hint, |
423 |
.primary_ref_frame = frame_header->primary_ref_frame, |
424 |
- .frame_width_minus_1 = frame_header->frame_width_minus_1, |
425 |
- .frame_height_minus_1 = frame_header->frame_height_minus_1, |
426 |
- .coded_denom = frame_header->coded_denom, |
427 |
- .render_width_minus_1 = frame_header->render_width_minus_1, |
428 |
- .render_height_minus_1 = frame_header->render_height_minus_1, |
429 |
.refresh_frame_flags = frame_header->refresh_frame_flags, |
430 |
.interpolation_filter = frame_header->interpolation_filter, |
431 |
- .tx_mode = frame_header->tx_mode, |
432 |
- .tiling = (StdVideoAV1MESATileInfo) { |
433 |
- .flags = (StdVideoAV1MESATileInfoFlags) { |
434 |
- .uniform_tile_spacing_flag = frame_header->uniform_tile_spacing_flag, |
435 |
- }, |
436 |
- .tile_cols = frame_header->tile_cols, |
437 |
- .tile_rows = frame_header->tile_rows, |
438 |
- .context_update_tile_id = frame_header->context_update_tile_id, |
439 |
- .tile_size_bytes_minus1 = frame_header->tile_size_bytes_minus1, |
440 |
- }, |
441 |
- .quantization = (StdVideoAV1MESAQuantization) { |
442 |
- .flags.using_qmatrix = frame_header->using_qmatrix, |
443 |
- .base_q_idx = frame_header->base_q_idx, |
444 |
- .delta_q_y_dc = frame_header->delta_q_y_dc, |
445 |
- .diff_uv_delta = frame_header->diff_uv_delta, |
446 |
- .delta_q_u_dc = frame_header->delta_q_u_dc, |
447 |
- .delta_q_u_ac = frame_header->delta_q_u_ac, |
448 |
- .delta_q_v_dc = frame_header->delta_q_v_dc, |
449 |
- .delta_q_v_ac = frame_header->delta_q_v_ac, |
450 |
- .qm_y = frame_header->qm_y, |
451 |
- .qm_u = frame_header->qm_u, |
452 |
- .qm_v = frame_header->qm_v, |
453 |
- }, |
454 |
- .delta_q = (StdVideoAV1MESADeltaQ) { |
455 |
- .flags = (StdVideoAV1MESADeltaQFlags) { |
456 |
- .delta_lf_present = frame_header->delta_lf_present, |
457 |
- .delta_lf_multi = frame_header->delta_lf_multi, |
458 |
- }, |
459 |
- .delta_q_res = frame_header->delta_q_res, |
460 |
- .delta_lf_res = frame_header->delta_lf_res, |
461 |
- }, |
462 |
- .loop_filter = (StdVideoAV1MESALoopFilter) { |
463 |
- .flags = (StdVideoAV1MESALoopFilterFlags) { |
464 |
- .delta_enabled = frame_header->loop_filter_delta_enabled, |
465 |
- .delta_update = frame_header->loop_filter_delta_update, |
466 |
- }, |
467 |
- .level = { |
468 |
- frame_header->loop_filter_level[0], frame_header->loop_filter_level[1], |
469 |
- frame_header->loop_filter_level[2], frame_header->loop_filter_level[3], |
470 |
- }, |
471 |
- .sharpness = frame_header->loop_filter_sharpness, |
472 |
- .mode_deltas = { |
473 |
- frame_header->loop_filter_mode_deltas[0], frame_header->loop_filter_mode_deltas[1], |
474 |
- }, |
475 |
- }, |
476 |
- .cdef = (StdVideoAV1MESACDEF) { |
477 |
- .damping_minus_3 = frame_header->cdef_damping_minus_3, |
478 |
- .bits = frame_header->cdef_bits, |
479 |
- }, |
480 |
- .lr = (StdVideoAV1MESALoopRestoration) { |
481 |
- .lr_unit_shift = frame_header->lr_unit_shift, |
482 |
- .lr_uv_shift = frame_header->lr_uv_shift, |
483 |
- .lr_type = { frame_header->lr_type[0], frame_header->lr_type[1], frame_header->lr_type[2] }, |
484 |
- }, |
485 |
- .segmentation = (StdVideoAV1MESASegmentation) { |
486 |
- .flags = (StdVideoAV1MESASegmentationFlags) { |
487 |
- .enabled = frame_header->segmentation_enabled, |
488 |
- .update_map = frame_header->segmentation_update_map, |
489 |
- .temporal_update = frame_header->segmentation_temporal_update, |
490 |
- .update_data = frame_header->segmentation_update_data, |
491 |
- }, |
492 |
- }, |
493 |
- .film_grain = (StdVideoAV1MESAFilmGrainParameters) { |
494 |
- .flags = (StdVideoAV1MESAFilmGrainFlags) { |
495 |
- .apply_grain = apply_grain, |
496 |
- .chroma_scaling_from_luma = film_grain->chroma_scaling_from_luma, |
497 |
- .overlap_flag = film_grain->overlap_flag, |
498 |
- .clip_to_restricted_range = film_grain->clip_to_restricted_range, |
499 |
- }, |
500 |
- .grain_scaling_minus_8 = film_grain->grain_scaling_minus_8, |
501 |
- .ar_coeff_lag = film_grain->ar_coeff_lag, |
502 |
- .ar_coeff_shift_minus_6 = film_grain->ar_coeff_shift_minus_6, |
503 |
- .grain_scale_shift = film_grain->grain_scale_shift, |
504 |
- .grain_seed = film_grain->grain_seed, |
505 |
- .num_y_points = film_grain->num_y_points, |
506 |
- .num_cb_points = film_grain->num_cb_points, |
507 |
- .num_cr_points = film_grain->num_cr_points, |
508 |
- .cb_mult = film_grain->cb_mult, |
509 |
- .cb_luma_mult = film_grain->cb_luma_mult, |
510 |
- .cb_offset = film_grain->cb_offset, |
511 |
- .cr_mult = film_grain->cr_mult, |
512 |
- .cr_luma_mult = film_grain->cr_luma_mult, |
513 |
- .cr_offset = film_grain->cr_offset, |
514 |
- }, |
515 |
+ .TxMode = frame_header->tx_mode, |
516 |
+ .delta_q_res = frame_header->delta_q_res, |
517 |
+ .delta_lf_res = frame_header->delta_lf_res, |
518 |
+ .SkipModeFrame[0] = s->cur_frame.skip_mode_frame_idx[0], |
519 |
+ .SkipModeFrame[1] = s->cur_frame.skip_mode_frame_idx[1], |
520 |
+ .coded_denom = frame_header->coded_denom, |
521 |
+ .pTileInfo = &ap->tile_info, |
522 |
+ .pQuantization = &ap->quantization, |
523 |
+ .pSegmentation = &ap->segmentation, |
524 |
+ .pLoopFilter = &ap->loop_filter, |
525 |
+ .pCDEF = &ap->cdef, |
526 |
+ .pLoopRestoration = &ap->loop_restoration, |
527 |
+ .pGlobalMotion = &ap->global_motion, |
528 |
+ .pFilmGrain = apply_grain ? &ap->film_grain : NULL, |
529 |
}; |
530 |
|
531 |
for (int i = 0; i < 64; i++) { |
532 |
- ap->av1_frame_header.tiling.width_in_sbs_minus_1[i] = frame_header->width_in_sbs_minus_1[i]; |
533 |
- ap->av1_frame_header.tiling.height_in_sbs_minus_1[i] = frame_header->height_in_sbs_minus_1[i]; |
534 |
- ap->av1_frame_header.tiling.tile_start_col_sb[i] = frame_header->tile_start_col_sb[i]; |
535 |
- ap->av1_frame_header.tiling.tile_start_row_sb[i] = frame_header->tile_start_row_sb[i]; |
536 |
+ ap->width_in_sbs_minus1[i] = frame_header->width_in_sbs_minus_1[i]; |
537 |
+ ap->height_in_sbs_minus1[i] = frame_header->height_in_sbs_minus_1[i]; |
538 |
+ ap->mi_col_starts[i] = frame_header->tile_start_col_sb[i]; |
539 |
+ ap->mi_row_starts[i] = frame_header->tile_start_row_sb[i]; |
540 |
} |
541 |
|
542 |
for (int i = 0; i < 8; i++) { |
543 |
- ap->av1_frame_header.segmentation.feature_enabled_bits[i] = 0; |
544 |
- for (int j = 0; j < 8; j++) { |
545 |
- ap->av1_frame_header.segmentation.feature_enabled_bits[i] |= (frame_header->feature_enabled[i][j] << j); |
546 |
- ap->av1_frame_header.segmentation.feature_data[i][j] = frame_header->feature_value[i][j]; |
547 |
+ ap->segmentation.FeatureEnabled[i] = 0x0; |
548 |
+ for (int j = 0; j < STD_VIDEO_AV1_SEG_LVL_MAX; j++) { |
549 |
+ ap->segmentation.FeatureEnabled[i] |= (frame_header->feature_enabled[i][j] << j); |
550 |
+ ap->segmentation.FeatureData[i][j] = frame_header->feature_value[i][j]; |
551 |
} |
552 |
|
553 |
- ap->av1_frame_header.loop_filter.ref_deltas[i] = frame_header->loop_filter_ref_deltas[i]; |
554 |
+ ap->loop_filter.loop_filter_ref_deltas[i] = frame_header->loop_filter_ref_deltas[i]; |
555 |
|
556 |
- ap->av1_frame_header.cdef.y_pri_strength[i] = frame_header->cdef_y_pri_strength[i]; |
557 |
- ap->av1_frame_header.cdef.y_sec_strength[i] = frame_header->cdef_y_sec_strength[i]; |
558 |
- ap->av1_frame_header.cdef.uv_pri_strength[i] = frame_header->cdef_uv_pri_strength[i]; |
559 |
- ap->av1_frame_header.cdef.uv_sec_strength[i] = frame_header->cdef_uv_sec_strength[i]; |
560 |
+ ap->cdef.cdef_y_pri_strength[i] = frame_header->cdef_y_pri_strength[i]; |
561 |
+ ap->cdef.cdef_y_sec_strength[i] = frame_header->cdef_y_sec_strength[i]; |
562 |
+ ap->cdef.cdef_uv_pri_strength[i] = frame_header->cdef_uv_pri_strength[i]; |
563 |
+ ap->cdef.cdef_uv_sec_strength[i] = frame_header->cdef_uv_sec_strength[i]; |
564 |
|
565 |
- ap->av1_frame_header.ref_order_hint[i] = frame_header->ref_order_hint[i]; |
566 |
- ap->av1_frame_header.global_motion[i] = (StdVideoAV1MESAGlobalMotion) { |
567 |
- .flags = (StdVideoAV1MESAGlobalMotionFlags) { |
568 |
- .gm_invalid = s->cur_frame.gm_invalid[i], |
569 |
- }, |
570 |
- .gm_type = s->cur_frame.gm_type[i], |
571 |
- .gm_params = { |
572 |
- s->cur_frame.gm_params[i][0], s->cur_frame.gm_params[i][1], |
573 |
- s->cur_frame.gm_params[i][2], s->cur_frame.gm_params[i][3], |
574 |
- s->cur_frame.gm_params[i][4], s->cur_frame.gm_params[i][5], |
575 |
- }, |
576 |
- }; |
577 |
+ /* Reference frames */ |
578 |
+ ap->std_pic_info.OrderHints[i] = frame_header->ref_order_hint[i]; |
579 |
+ ap->global_motion.GmType[i] = s->cur_frame.gm_type[i]; |
580 |
+ for (int j = 0; j < STD_VIDEO_AV1_GLOBAL_MOTION_PARAMS; j++) { |
581 |
+ ap->global_motion.gm_params[i][j] = s->cur_frame.gm_params[i][j]; |
582 |
+ } |
583 |
} |
584 |
|
585 |
- for (int i = 0; i < 7; i++) { |
586 |
- ap->av1_frame_header.ref_frame_idx[i] = frame_header->ref_frame_idx[i]; |
587 |
- ap->av1_frame_header.delta_frame_id_minus1[i] = frame_header->delta_frame_id_minus1[i]; |
588 |
- } |
589 |
- |
590 |
- ap->av1_pic_info.skip_mode_frame_idx[0] = s->cur_frame.skip_mode_frame_idx[0]; |
591 |
- ap->av1_pic_info.skip_mode_frame_idx[1] = s->cur_frame.skip_mode_frame_idx[1]; |
592 |
- |
593 |
if (apply_grain) { |
594 |
for (int i = 0; i < 14; i++) { |
595 |
- ap->av1_frame_header.film_grain.point_y_value[i] = film_grain->point_y_value[i]; |
596 |
- ap->av1_frame_header.film_grain.point_y_scaling[i] = film_grain->point_y_scaling[i]; |
597 |
+ ap->film_grain.point_y_value[i] = film_grain->point_y_value[i]; |
598 |
+ ap->film_grain.point_y_scaling[i] = film_grain->point_y_scaling[i]; |
599 |
} |
600 |
|
601 |
for (int i = 0; i < 10; i++) { |
602 |
- ap->av1_frame_header.film_grain.point_cb_value[i] = film_grain->point_cb_value[i]; |
603 |
- ap->av1_frame_header.film_grain.point_cb_scaling[i] = film_grain->point_cb_scaling[i]; |
604 |
- ap->av1_frame_header.film_grain.point_cr_value[i] = film_grain->point_cr_value[i]; |
605 |
- ap->av1_frame_header.film_grain.point_cr_scaling[i] = film_grain->point_cr_scaling[i]; |
606 |
+ ap->film_grain.point_cb_value[i] = film_grain->point_cb_value[i]; |
607 |
+ ap->film_grain.point_cb_scaling[i] = film_grain->point_cb_scaling[i]; |
608 |
+ ap->film_grain.point_cr_value[i] = film_grain->point_cr_value[i]; |
609 |
+ ap->film_grain.point_cr_scaling[i] = film_grain->point_cr_scaling[i]; |
610 |
} |
611 |
|
612 |
for (int i = 0; i < 24; i++) { |
613 |
- ap->av1_frame_header.film_grain.ar_coeffs_y_plus_128[i] = film_grain->ar_coeffs_y_plus_128[i]; |
614 |
- ap->av1_frame_header.film_grain.ar_coeffs_cb_plus_128[i] = film_grain->ar_coeffs_cb_plus_128[i]; |
615 |
- ap->av1_frame_header.film_grain.ar_coeffs_cr_plus_128[i] = film_grain->ar_coeffs_cr_plus_128[i]; |
616 |
+ ap->film_grain.ar_coeffs_y_plus_128[i] = film_grain->ar_coeffs_y_plus_128[i]; |
617 |
+ ap->film_grain.ar_coeffs_cb_plus_128[i] = film_grain->ar_coeffs_cb_plus_128[i]; |
618 |
+ ap->film_grain.ar_coeffs_cr_plus_128[i] = film_grain->ar_coeffs_cr_plus_128[i]; |
619 |
} |
620 |
|
621 |
- ap->av1_frame_header.film_grain.ar_coeffs_cb_plus_128[24] = film_grain->ar_coeffs_cb_plus_128[24]; |
622 |
- ap->av1_frame_header.film_grain.ar_coeffs_cr_plus_128[24] = film_grain->ar_coeffs_cr_plus_128[24]; |
623 |
+ ap->film_grain.ar_coeffs_cb_plus_128[24] = film_grain->ar_coeffs_cb_plus_128[24]; |
624 |
+ ap->film_grain.ar_coeffs_cr_plus_128[24] = film_grain->ar_coeffs_cr_plus_128[24]; |
625 |
} |
626 |
|
627 |
/* Workaround for a spec issue. */ |
628 |
@@ -480,26 +527,22 @@ static int vk_av1_decode_slice(AVCodecContext *avctx, |
629 |
FFVulkanDecodePicture *vp = &ap->vp; |
630 |
|
631 |
for (int i = s->tg_start; i <= s->tg_end; i++) { |
632 |
- ap->tiles[ap->tile_list.nb_tiles] = (StdVideoAV1MESATile) { |
633 |
- .size = s->tile_group_info[i].tile_size, |
634 |
- .offset = s->tile_group_info[i].tile_offset, |
635 |
- .row = s->tile_group_info[i].tile_row, |
636 |
- .column = s->tile_group_info[i].tile_column, |
637 |
- .tg_start = s->tg_start, |
638 |
- .tg_end = s->tg_end, |
639 |
- }; |
640 |
|
641 |
+ ap->tile_offsets_s[ap->tile_count] = s->tile_group_info[i].tile_offset; |
642 |
+ ap->tile_sizes[ap->tile_count] = s->tile_group_info[i].tile_size; |
643 |
+ |
644 |
err = ff_vk_decode_add_slice(avctx, vp, |
645 |
data + s->tile_group_info[i].tile_offset, |
646 |
s->tile_group_info[i].tile_size, 0, |
647 |
- &ap->tile_list.nb_tiles, |
648 |
+ &ap->tile_count, |
649 |
&ap->tile_offsets); |
650 |
if (err < 0) |
651 |
return err; |
652 |
|
653 |
- ap->tiles[ap->tile_list.nb_tiles - 1].offset = ap->tile_offsets[ap->tile_list.nb_tiles - 1]; |
654 |
+ ap->tile_offsets_s[ap->tile_count - 1] = ap->tile_offsets[ap->tile_count - 1]; |
655 |
} |
656 |
|
657 |
+ ap->av1_pic_info.tileCount = ap->tile_count; |
658 |
return 0; |
659 |
} |
660 |
|
661 |
@@ -513,7 +556,7 @@ static int vk_av1_end_frame(AVCodecContext *avctx) |
662 |
FFVulkanDecodePicture *rvp[AV1_NUM_REF_FRAMES] = { 0 }; |
663 |
AVFrame *rav[AV1_NUM_REF_FRAMES] = { 0 }; |
664 |
|
665 |
- if (!ap->tile_list.nb_tiles) |
666 |
+ if (!ap->tile_count) |
667 |
return 0; |
668 |
|
669 |
if (!dec->session_params) { |
670 |
@@ -531,7 +574,7 @@ static int vk_av1_end_frame(AVCodecContext *avctx) |
671 |
} |
672 |
|
673 |
av_log(avctx, AV_LOG_VERBOSE, "Decoding frame, %"SIZE_SPECIFIER" bytes, %i tiles\n", |
674 |
- vp->slices_size, ap->tile_list.nb_tiles); |
675 |
+ vp->slices_size, ap->tile_count); |
676 |
|
677 |
return ff_vk_decode_frame(avctx, pic->f, vp, rav, rvp); |
678 |
} |
679 |
--- libavcodec/vulkan_decode.c.orig 2023-11-11 00:25:17 UTC |
680 |
+++ libavcodec/vulkan_decode.c |
681 |
@@ -50,7 +50,7 @@ static const VkVideoProfileInfoKHR *get_video_profile( |
682 |
VkStructureType profile_struct_type = |
683 |
codec_id == AV_CODEC_ID_H264 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_INFO_KHR : |
684 |
codec_id == AV_CODEC_ID_HEVC ? VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_PROFILE_INFO_KHR : |
685 |
- codec_id == AV_CODEC_ID_AV1 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_MESA : |
686 |
+ codec_id == AV_CODEC_ID_AV1 ? VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR : |
687 |
0; |
688 |
|
689 |
profile_list = ff_vk_find_struct(ctx->s.hwfc->create_pnext, |
690 |
@@ -663,7 +663,7 @@ static VkResult vulkan_setup_profile(AVCodecContext *a |
691 |
const struct FFVkCodecMap *vk_codec, |
692 |
VkVideoDecodeH264CapabilitiesKHR *h264_caps, |
693 |
VkVideoDecodeH265CapabilitiesKHR *h265_caps, |
694 |
- VkVideoDecodeAV1CapabilitiesMESA *av1_caps, |
695 |
+ VkVideoDecodeAV1CapabilitiesKHR *av1_caps, |
696 |
VkVideoCapabilitiesKHR *caps, |
697 |
VkVideoDecodeCapabilitiesKHR *dec_caps, |
698 |
int cur_profile) |
699 |
@@ -674,7 +674,7 @@ static VkResult vulkan_setup_profile(AVCodecContext *a |
700 |
|
701 |
VkVideoDecodeH264ProfileInfoKHR *h264_profile = &prof->h264_profile; |
702 |
VkVideoDecodeH265ProfileInfoKHR *h265_profile = &prof->h265_profile; |
703 |
- VkVideoDecodeAV1ProfileInfoMESA *av1_profile = &prof->av1_profile; |
704 |
+ VkVideoDecodeAV1ProfileInfoKHR *av1_profile = &prof->av1_profile; |
705 |
|
706 |
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->sw_pix_fmt); |
707 |
if (!desc) |
708 |
@@ -702,8 +702,8 @@ static VkResult vulkan_setup_profile(AVCodecContext *a |
709 |
} else if (avctx->codec_id == AV_CODEC_ID_AV1) { |
710 |
dec_caps->pNext = av1_caps; |
711 |
usage->pNext = av1_profile; |
712 |
- av1_profile->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_MESA; |
713 |
- av1_profile->stdProfileIdc = cur_profile; |
714 |
+ av1_profile->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_KHR; |
715 |
+ av1_profile->stdProfile = cur_profile; |
716 |
} |
717 |
|
718 |
usage->sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_USAGE_INFO_KHR; |
719 |
@@ -758,8 +758,8 @@ static int vulkan_decode_get_profile(AVCodecContext *a |
720 |
VkVideoDecodeH265CapabilitiesKHR h265_caps = { |
721 |
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_KHR, |
722 |
}; |
723 |
- VkVideoDecodeAV1CapabilitiesMESA av1_caps = { |
724 |
- .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_MESA, |
725 |
+ VkVideoDecodeAV1CapabilitiesKHR av1_caps = { |
726 |
+ .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_KHR, |
727 |
}; |
728 |
|
729 |
VkPhysicalDeviceVideoFormatInfoKHR fmt_info = { |
730 |
@@ -782,7 +782,7 @@ static int vulkan_decode_get_profile(AVCodecContext *a |
731 |
cur_profile = avctx->profile; |
732 |
base_profile = avctx->codec_id == AV_CODEC_ID_H264 ? AV_PROFILE_H264_CONSTRAINED_BASELINE : |
733 |
avctx->codec_id == AV_CODEC_ID_H265 ? AV_PROFILE_HEVC_MAIN : |
734 |
- avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_MESA_PROFILE_MAIN : |
735 |
+ avctx->codec_id == AV_CODEC_ID_AV1 ? STD_VIDEO_AV1_PROFILE_MAIN : |
736 |
0; |
737 |
|
738 |
ret = vulkan_setup_profile(avctx, prof, hwctx, vk, vk_codec, |
739 |
@@ -830,7 +830,7 @@ static int vulkan_decode_get_profile(AVCodecContext *a |
740 |
|
741 |
max_level = avctx->codec_id == AV_CODEC_ID_H264 ? ff_vk_h264_level_to_av(h264_caps.maxLevelIdc) : |
742 |
avctx->codec_id == AV_CODEC_ID_H265 ? ff_vk_h265_level_to_av(h265_caps.maxLevelIdc) : |
743 |
- avctx->codec_id == AV_CODEC_ID_AV1 ? av1_caps.maxLevelIdc : |
744 |
+ avctx->codec_id == AV_CODEC_ID_AV1 ? ff_vk_av1_level_to_av(av1_caps.maxLevel) : |
745 |
0; |
746 |
|
747 |
av_log(avctx, AV_LOG_VERBOSE, "Decoder capabilities for %s profile \"%s\":\n", |
748 |
@@ -911,7 +911,7 @@ static int vulkan_decode_get_profile(AVCodecContext *a |
749 |
/* TODO: make dedicated_dpb tunable */ |
750 |
dec->dedicated_dpb = !(dec_caps->flags & VK_VIDEO_DECODE_CAPABILITY_DPB_AND_OUTPUT_COINCIDE_BIT_KHR); |
751 |
dec->layered_dpb = !(caps->flags & VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR); |
752 |
- dec->external_fg = av1_caps.flags & VK_VIDEO_DECODE_AV1_CAPABILITY_EXTERNAL_FILM_GRAIN_MESA; |
753 |
+ // dec->external_fg = av1_caps.flags & VK_VIDEO_DECODE_AV1_CAPABILITY_EXTERNAL_FILM_GRAIN_KHR; |
754 |
|
755 |
if (dec->dedicated_dpb) { |
756 |
fmt_info.imageUsage = VK_IMAGE_USAGE_VIDEO_DECODE_DPB_BIT_KHR; |
757 |
@@ -1118,8 +1118,8 @@ int ff_vk_decode_init(AVCodecContext *avctx) |
758 |
VkVideoDecodeH265SessionParametersCreateInfoKHR h265_params = { |
759 |
.sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_KHR, |
760 |
}; |
761 |
- VkVideoDecodeAV1SessionParametersCreateInfoMESA av1_params = { |
762 |
- .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_MESA, |
763 |
+ VkVideoDecodeAV1SessionParametersCreateInfoKHR av1_params = { |
764 |
+ .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_KHR, |
765 |
}; |
766 |
VkVideoSessionParametersCreateInfoKHR session_params_create = { |
767 |
.sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR, |
768 |
--- libavcodec/vulkan_decode.h.orig 2023-11-11 00:25:17 UTC |
769 |
+++ libavcodec/vulkan_decode.h |
770 |
@@ -28,7 +28,7 @@ typedef struct FFVulkanDecodeProfileData { |
771 |
typedef struct FFVulkanDecodeProfileData { |
772 |
VkVideoDecodeH264ProfileInfoKHR h264_profile; |
773 |
VkVideoDecodeH265ProfileInfoKHR h265_profile; |
774 |
- VkVideoDecodeAV1ProfileInfoMESA av1_profile; |
775 |
+ VkVideoDecodeAV1ProfileInfoKHR av1_profile; |
776 |
VkVideoDecodeUsageInfoKHR usage; |
777 |
VkVideoProfileInfoKHR profile; |
778 |
VkVideoProfileListInfoKHR profile_list; |
779 |
--- libavcodec/vulkan_video.c.orig 2023-11-11 00:25:17 UTC |
780 |
+++ libavcodec/vulkan_video.c |
781 |
@@ -37,7 +37,7 @@ const FFVkCodecMap ff_vk_codec_map[AV_CODEC_ID_FIRST_A |
782 |
0, |
783 |
0, |
784 |
FF_VK_EXT_VIDEO_DECODE_AV1, |
785 |
- 0x01000000 /* TODO fix this */ |
786 |
+ VK_VIDEO_CODEC_OPERATION_DECODE_AV1_BIT_KHR |
787 |
}, |
788 |
}; |
789 |
|
790 |
@@ -196,6 +196,37 @@ int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level) |
791 |
case STD_VIDEO_H265_LEVEL_IDC_6_1: return 61; |
792 |
default: |
793 |
case STD_VIDEO_H265_LEVEL_IDC_6_2: return 62; |
794 |
+ } |
795 |
+} |
796 |
+ |
797 |
+int ff_vk_av1_level_to_av(StdVideoAV1Level level) |
798 |
+{ |
799 |
+ switch (level) { |
800 |
+ case STD_VIDEO_AV1_LEVEL_2_0: return 20; |
801 |
+ case STD_VIDEO_AV1_LEVEL_2_1: return 21; |
802 |
+ case STD_VIDEO_AV1_LEVEL_2_2: return 22; |
803 |
+ case STD_VIDEO_AV1_LEVEL_2_3: return 23; |
804 |
+ case STD_VIDEO_AV1_LEVEL_3_0: return 30; |
805 |
+ case STD_VIDEO_AV1_LEVEL_3_1: return 31; |
806 |
+ case STD_VIDEO_AV1_LEVEL_3_2: return 32; |
807 |
+ case STD_VIDEO_AV1_LEVEL_3_3: return 33; |
808 |
+ case STD_VIDEO_AV1_LEVEL_4_0: return 40; |
809 |
+ case STD_VIDEO_AV1_LEVEL_4_1: return 41; |
810 |
+ case STD_VIDEO_AV1_LEVEL_4_2: return 42; |
811 |
+ case STD_VIDEO_AV1_LEVEL_4_3: return 43; |
812 |
+ case STD_VIDEO_AV1_LEVEL_5_0: return 50; |
813 |
+ case STD_VIDEO_AV1_LEVEL_5_1: return 51; |
814 |
+ case STD_VIDEO_AV1_LEVEL_5_2: return 52; |
815 |
+ case STD_VIDEO_AV1_LEVEL_5_3: return 53; |
816 |
+ case STD_VIDEO_AV1_LEVEL_6_0: return 60; |
817 |
+ case STD_VIDEO_AV1_LEVEL_6_1: return 61; |
818 |
+ case STD_VIDEO_AV1_LEVEL_6_2: return 62; |
819 |
+ case STD_VIDEO_AV1_LEVEL_6_3: return 63; |
820 |
+ case STD_VIDEO_AV1_LEVEL_7_0: return 70; |
821 |
+ case STD_VIDEO_AV1_LEVEL_7_1: return 71; |
822 |
+ case STD_VIDEO_AV1_LEVEL_7_2: return 72; |
823 |
+ default: |
824 |
+ case STD_VIDEO_AV1_LEVEL_7_3: return 73; |
825 |
} |
826 |
} |
827 |
|
828 |
--- libavcodec/vulkan_video.h.orig 2023-11-11 00:25:17 UTC |
829 |
+++ libavcodec/vulkan_video.h |
830 |
@@ -23,8 +23,6 @@ |
831 |
#include "vulkan.h" |
832 |
|
833 |
#include <vk_video/vulkan_video_codecs_common.h> |
834 |
-#include "vulkan_video_codec_av1std.h" |
835 |
-#include "vulkan_video_codec_av1std_decode.h" |
836 |
|
837 |
#define CODEC_VER_MAJ(ver) (ver >> 22) |
838 |
#define CODEC_VER_MIN(ver) ((ver >> 12) & ((1 << 10) - 1)) |
839 |
@@ -77,6 +75,7 @@ int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level) |
840 |
*/ |
841 |
int ff_vk_h264_level_to_av(StdVideoH264LevelIdc level); |
842 |
int ff_vk_h265_level_to_av(StdVideoH265LevelIdc level); |
843 |
+int ff_vk_av1_level_to_av(StdVideoAV1Level level); |
844 |
|
845 |
typedef struct FFVkVideoBuffer { |
846 |
FFVkBuffer buf; |
847 |
--- libavcodec/vulkan_video_codec_av1std.h 2023-11-11 00:25:17 UTC |
848 |
+++ /dev/null |
849 |
@@ -1,403 +0,0 @@ |
850 |
-/* Copyright 2023 Lynne |
851 |
- * Copyright 2023 Dave Airlie |
852 |
- * |
853 |
- * Licensed under the Apache License, Version 2.0 (the "License"); |
854 |
- * you may not use this file except in compliance with the License. |
855 |
- * You may obtain a copy of the License at |
856 |
- * |
857 |
- * http://www.apache.org/licenses/LICENSE-2.0 |
858 |
- * |
859 |
- * Unless required by applicable law or agreed to in writing, software |
860 |
- * distributed under the License is distributed on an "AS IS" BASIS, |
861 |
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
862 |
- * See the License for the specific language governing permissions and |
863 |
- * limitations under the License. |
864 |
- */ |
865 |
- |
866 |
-#ifndef VULKAN_VIDEO_CODEC_AV1STD_H_ |
867 |
-#define VULKAN_VIDEO_CODEC_AV1STD_H_ 1 |
868 |
- |
869 |
-/* |
870 |
-** This header is NOT YET generated from the Khronos Vulkan XML API Registry. |
871 |
-** |
872 |
-*/ |
873 |
- |
874 |
-#ifdef __cplusplus |
875 |
-extern "C" { |
876 |
-#endif |
877 |
-#define vulkan_video_codec_av1std 1 |
878 |
- |
879 |
-#define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \ |
880 |
- ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) |
881 |
-#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_0_1_0 VK_MAKE_VIDEO_STD_VERSION(0, 1, 0) |
882 |
-#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_SPEC_VERSION VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_API_VERSION_0_1_0 |
883 |
-#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_EXTENSION_NAME "VK_STD_vulkan_video_codec_av1_decode" |
884 |
- |
885 |
-typedef enum StdVideoAV1MESAProfile { |
886 |
- STD_VIDEO_AV1_MESA_PROFILE_MAIN = 0, |
887 |
- STD_VIDEO_AV1_MESA_PROFILE_HIGH = 1, |
888 |
- STD_VIDEO_AV1_MESA_PROFILE_PROFESSIONAL = 2, |
889 |
-} StdVideoAV1MESAProfile; |
890 |
- |
891 |
-typedef enum StdVideoAV1MESALevel { |
892 |
- STD_VIDEO_AV1_MESA_LEVEL_2_0 = 0, |
893 |
- STD_VIDEO_AV1_MESA_LEVEL_2_1 = 1, |
894 |
- STD_VIDEO_AV1_MESA_LEVEL_2_2 = 2, |
895 |
- STD_VIDEO_AV1_MESA_LEVEL_2_3 = 3, |
896 |
- STD_VIDEO_AV1_MESA_LEVEL_3_0 = 4, |
897 |
- STD_VIDEO_AV1_MESA_LEVEL_3_1 = 5, |
898 |
- STD_VIDEO_AV1_MESA_LEVEL_3_2 = 6, |
899 |
- STD_VIDEO_AV1_MESA_LEVEL_3_3 = 7, |
900 |
- STD_VIDEO_AV1_MESA_LEVEL_4_0 = 8, |
901 |
- STD_VIDEO_AV1_MESA_LEVEL_4_1 = 9, |
902 |
- STD_VIDEO_AV1_MESA_LEVEL_4_2 = 10, |
903 |
- STD_VIDEO_AV1_MESA_LEVEL_4_3 = 11, |
904 |
- STD_VIDEO_AV1_MESA_LEVEL_5_0 = 12, |
905 |
- STD_VIDEO_AV1_MESA_LEVEL_5_1 = 13, |
906 |
- STD_VIDEO_AV1_MESA_LEVEL_5_2 = 14, |
907 |
- STD_VIDEO_AV1_MESA_LEVEL_5_3 = 15, |
908 |
- STD_VIDEO_AV1_MESA_LEVEL_6_0 = 16, |
909 |
- STD_VIDEO_AV1_MESA_LEVEL_6_1 = 17, |
910 |
- STD_VIDEO_AV1_MESA_LEVEL_6_2 = 18, |
911 |
- STD_VIDEO_AV1_MESA_LEVEL_6_3 = 19, |
912 |
- STD_VIDEO_AV1_MESA_LEVEL_7_0 = 20, |
913 |
- STD_VIDEO_AV1_MESA_LEVEL_7_1 = 21, |
914 |
- STD_VIDEO_AV1_MESA_LEVEL_7_2 = 22, |
915 |
- STD_VIDEO_AV1_MESA_LEVEL_7_3 = 23, |
916 |
- STD_VIDEO_AV1_MESA_LEVEL_MAX = 31, |
917 |
-} StdVideoAV1MESALevel; |
918 |
- |
919 |
-typedef struct StdVideoAV1MESAFilmGrainFlags { |
920 |
- uint8_t apply_grain; |
921 |
- uint8_t chroma_scaling_from_luma; |
922 |
- uint8_t overlap_flag; |
923 |
- uint8_t clip_to_restricted_range; |
924 |
-} StdVideoAV1MESAFilmGrainFlags; |
925 |
- |
926 |
-typedef struct StdVideoAV1MESAFilmGrainParameters { |
927 |
- StdVideoAV1MESAFilmGrainFlags flags; |
928 |
- uint32_t grain_scaling_minus_8; |
929 |
- uint32_t ar_coeff_lag; |
930 |
- uint32_t ar_coeff_shift_minus_6; |
931 |
- uint32_t grain_scale_shift; |
932 |
- |
933 |
- uint16_t grain_seed; |
934 |
- uint8_t num_y_points; |
935 |
- uint8_t point_y_value[14]; |
936 |
- uint8_t point_y_scaling[14]; |
937 |
- |
938 |
- uint8_t num_cb_points; |
939 |
- uint8_t point_cb_value[10]; |
940 |
- uint8_t point_cb_scaling[10]; |
941 |
- |
942 |
- uint8_t num_cr_points; |
943 |
- uint8_t point_cr_value[10]; |
944 |
- uint8_t point_cr_scaling[10]; |
945 |
- |
946 |
- int8_t ar_coeffs_y_plus_128[24]; |
947 |
- int8_t ar_coeffs_cb_plus_128[25]; |
948 |
- int8_t ar_coeffs_cr_plus_128[25]; |
949 |
- uint8_t cb_mult; |
950 |
- uint8_t cb_luma_mult; |
951 |
- uint16_t cb_offset; |
952 |
- uint8_t cr_mult; |
953 |
- uint8_t cr_luma_mult; |
954 |
- uint16_t cr_offset; |
955 |
-} StdVideoAV1MESAFilmGrainParameters; |
956 |
- |
957 |
-typedef struct StdVideoAV1MESAGlobalMotionFlags { |
958 |
- uint8_t gm_invalid; |
959 |
-} StdVideoAV1MESAGlobalMotionFlags; |
960 |
- |
961 |
-typedef struct StdVideoAV1MESAGlobalMotion { |
962 |
- StdVideoAV1MESAGlobalMotionFlags flags; |
963 |
- uint8_t gm_type; |
964 |
- uint32_t gm_params[6]; |
965 |
-} StdVideoAV1MESAGlobalMotion; |
966 |
- |
967 |
-typedef struct StdVideoAV1MESALoopRestoration { |
968 |
- uint8_t lr_type[3]; |
969 |
- uint8_t lr_unit_shift; |
970 |
- uint8_t lr_uv_shift; |
971 |
-} StdVideoAV1MESALoopRestoration; |
972 |
- |
973 |
-typedef struct StdVideoAV1MESATileInfoFlags { |
974 |
- uint8_t uniform_tile_spacing_flag; |
975 |
-} StdVideoAV1MESATileInfoFlags; |
976 |
- |
977 |
-typedef struct StdVideoAV1MESATileInfo { |
978 |
- StdVideoAV1MESATileInfoFlags flags; |
979 |
- uint8_t tile_cols; |
980 |
- uint8_t tile_rows; |
981 |
- uint8_t tile_start_col_sb[64]; |
982 |
- uint8_t tile_start_row_sb[64]; |
983 |
- uint8_t width_in_sbs_minus_1[64]; |
984 |
- uint8_t height_in_sbs_minus_1[64]; |
985 |
- uint16_t context_update_tile_id; |
986 |
- uint8_t tile_size_bytes_minus1; |
987 |
-} StdVideoAV1MESATileInfo; |
988 |
- |
989 |
-typedef struct StdVideoAV1MESAQuantizationFlags { |
990 |
- uint8_t using_qmatrix; |
991 |
-} StdVideoAV1MESAQuantizationFlags; |
992 |
- |
993 |
-typedef struct StdVideoAV1MESAQuantization { |
994 |
- StdVideoAV1MESAQuantizationFlags flags; |
995 |
- uint8_t base_q_idx; |
996 |
- int8_t delta_q_y_dc; |
997 |
- uint8_t diff_uv_delta; |
998 |
- int8_t delta_q_u_dc; |
999 |
- int8_t delta_q_u_ac; |
1000 |
- int8_t delta_q_v_dc; |
1001 |
- int8_t delta_q_v_ac; |
1002 |
- uint8_t qm_y; |
1003 |
- uint8_t qm_u; |
1004 |
- uint8_t qm_v; |
1005 |
-} StdVideoAV1MESAQuantization; |
1006 |
- |
1007 |
-typedef struct StdVideoAV1MESACDEF { |
1008 |
- uint8_t damping_minus_3; |
1009 |
- uint8_t bits; |
1010 |
- uint8_t y_pri_strength[8]; |
1011 |
- uint8_t y_sec_strength[8]; |
1012 |
- uint8_t uv_pri_strength[8]; |
1013 |
- uint8_t uv_sec_strength[8]; |
1014 |
-} StdVideoAV1MESACDEF; |
1015 |
- |
1016 |
-typedef struct StdVideoAV1MESADeltaQFlags { |
1017 |
- uint8_t delta_lf_present; |
1018 |
- uint8_t delta_lf_multi; |
1019 |
-} StdVideoAV1MESADeltaQFlags; |
1020 |
- |
1021 |
-typedef struct StdVideoAV1MESADeltaQ { |
1022 |
- StdVideoAV1MESADeltaQFlags flags; |
1023 |
- uint8_t delta_q_res; |
1024 |
- uint8_t delta_lf_res; |
1025 |
-} StdVideoAV1MESADeltaQ; |
1026 |
- |
1027 |
-typedef struct StdVideoAV1MESASegmentationFlags { |
1028 |
- uint8_t enabled; |
1029 |
- uint8_t update_map; |
1030 |
- uint8_t temporal_update; |
1031 |
- uint8_t update_data; |
1032 |
-} StdVideoAV1MESASegmentationFlags; |
1033 |
- |
1034 |
-typedef struct StdVideoAV1MESASegmentation { |
1035 |
- StdVideoAV1MESASegmentationFlags flags; |
1036 |
- uint8_t feature_enabled_bits[8]; |
1037 |
- int16_t feature_data[8][8]; |
1038 |
-} StdVideoAV1MESASegmentation; |
1039 |
- |
1040 |
-typedef struct StdVideoAV1MESALoopFilterFlags { |
1041 |
- uint8_t delta_enabled; |
1042 |
- uint8_t delta_update; |
1043 |
-} StdVideoAV1MESALoopFilterFlags; |
1044 |
- |
1045 |
-typedef struct StdVideoAV1MESALoopFilter { |
1046 |
- StdVideoAV1MESALoopFilterFlags flags; |
1047 |
- uint8_t level[4]; |
1048 |
- uint8_t sharpness; |
1049 |
- int8_t ref_deltas[8]; |
1050 |
- int8_t mode_deltas[2]; |
1051 |
-} StdVideoAV1MESALoopFilter; |
1052 |
- |
1053 |
-typedef struct StdVideoAV1MESAFrameHeaderFlags { |
1054 |
- uint8_t error_resilient_mode; |
1055 |
- uint8_t disable_cdf_update; |
1056 |
- uint8_t use_superres; |
1057 |
- uint8_t render_and_frame_size_different; |
1058 |
- uint8_t allow_screen_content_tools; |
1059 |
- uint8_t is_filter_switchable; |
1060 |
- uint8_t force_integer_mv; |
1061 |
- uint8_t frame_size_override_flag; |
1062 |
- uint8_t buffer_removal_time_present_flag; |
1063 |
- uint8_t allow_intrabc; |
1064 |
- uint8_t frame_refs_short_signaling; |
1065 |
- uint8_t allow_high_precision_mv; |
1066 |
- uint8_t is_motion_mode_switchable; |
1067 |
- uint8_t use_ref_frame_mvs; |
1068 |
- uint8_t disable_frame_end_update_cdf; |
1069 |
- uint8_t allow_warped_motion; |
1070 |
- uint8_t reduced_tx_set; |
1071 |
- uint8_t reference_select; |
1072 |
- uint8_t skip_mode_present; |
1073 |
- uint8_t delta_q_present; |
1074 |
- uint8_t UsesLr; |
1075 |
-} StdVideoAV1MESAFrameHeaderFlags; |
1076 |
- |
1077 |
-typedef struct StdVideoAV1MESAFrameHeader { |
1078 |
- StdVideoAV1MESAFrameHeaderFlags flags; |
1079 |
- |
1080 |
- uint32_t frame_presentation_time; |
1081 |
- uint32_t display_frame_id; |
1082 |
- uint32_t current_frame_id; |
1083 |
- uint8_t frame_to_show_map_idx; |
1084 |
- uint8_t frame_type; |
1085 |
- uint8_t order_hint; |
1086 |
- uint8_t primary_ref_frame; |
1087 |
- uint16_t frame_width_minus_1; |
1088 |
- uint16_t frame_height_minus_1; |
1089 |
- uint16_t render_width_minus_1; |
1090 |
- uint16_t render_height_minus_1; |
1091 |
- uint8_t coded_denom; |
1092 |
- |
1093 |
- uint8_t refresh_frame_flags; |
1094 |
- uint8_t ref_order_hint[8]; |
1095 |
- int8_t ref_frame_idx[7]; |
1096 |
- uint32_t delta_frame_id_minus1[7]; |
1097 |
- |
1098 |
- uint8_t interpolation_filter; |
1099 |
- uint8_t tx_mode; |
1100 |
- |
1101 |
- StdVideoAV1MESATileInfo tiling; |
1102 |
- StdVideoAV1MESAQuantization quantization; |
1103 |
- StdVideoAV1MESASegmentation segmentation; |
1104 |
- StdVideoAV1MESADeltaQ delta_q; |
1105 |
- StdVideoAV1MESALoopFilter loop_filter; |
1106 |
- StdVideoAV1MESACDEF cdef; |
1107 |
- StdVideoAV1MESALoopRestoration lr; |
1108 |
- StdVideoAV1MESAGlobalMotion global_motion[8]; // One per ref frame |
1109 |
- StdVideoAV1MESAFilmGrainParameters film_grain; |
1110 |
-} StdVideoAV1MESAFrameHeader; |
1111 |
- |
1112 |
-typedef struct StdVideoAV1MESAScreenCoding { |
1113 |
- uint8_t seq_force_screen_content_tools; |
1114 |
-} StdVideoAV1MESAScreenCoding; |
1115 |
- |
1116 |
-typedef struct StdVideoAV1MESATimingInfoFlags { |
1117 |
- uint8_t equal_picture_interval; |
1118 |
-} StdVideoAV1MESATimingInfoFlags; |
1119 |
- |
1120 |
-typedef struct StdVideoAV1MESATimingInfo { |
1121 |
- StdVideoAV1MESATimingInfoFlags flags; |
1122 |
- uint32_t num_units_in_display_tick; |
1123 |
- uint32_t time_scale; |
1124 |
- uint32_t num_ticks_per_picture_minus_1; |
1125 |
-} StdVideoAV1MESATimingInfo; |
1126 |
- |
1127 |
-typedef struct StdVideoAV1MESAColorConfigFlags { |
1128 |
- uint8_t mono_chrome; |
1129 |
- uint8_t color_range; |
1130 |
- uint8_t separate_uv_delta_q; |
1131 |
-} StdVideoAV1MESAColorConfigFlags; |
1132 |
- |
1133 |
-typedef struct StdVideoAV1MESAColorConfig { |
1134 |
- StdVideoAV1MESAColorConfigFlags flags; |
1135 |
- uint8_t bit_depth; |
1136 |
- uint8_t subsampling_x; |
1137 |
- uint8_t subsampling_y; |
1138 |
-} StdVideoAV1MESAColorConfig; |
1139 |
- |
1140 |
-typedef struct StdVideoAV1MESASequenceHeaderFlags { |
1141 |
- uint8_t still_picture; |
1142 |
- uint8_t reduced_still_picture_header; |
1143 |
- uint8_t use_128x128_superblock; |
1144 |
- uint8_t enable_filter_intra; |
1145 |
- uint8_t enable_intra_edge_filter; |
1146 |
- uint8_t enable_interintra_compound; |
1147 |
- uint8_t enable_masked_compound; |
1148 |
- uint8_t enable_warped_motion; |
1149 |
- uint8_t enable_dual_filter; |
1150 |
- uint8_t enable_order_hint; |
1151 |
- uint8_t enable_jnt_comp; |
1152 |
- uint8_t enable_ref_frame_mvs; |
1153 |
- uint8_t frame_id_numbers_present_flag; |
1154 |
- uint8_t enable_superres; |
1155 |
- uint8_t enable_cdef; |
1156 |
- uint8_t enable_restoration; |
1157 |
- uint8_t film_grain_params_present; |
1158 |
- uint8_t timing_info_present_flag; |
1159 |
- uint8_t initial_display_delay_present_flag; |
1160 |
-} StdVideoAV1MESASequenceHeaderFlags; |
1161 |
- |
1162 |
-typedef struct StdVideoAV1MESASequenceHeader { |
1163 |
- StdVideoAV1MESASequenceHeaderFlags flags; |
1164 |
- |
1165 |
- StdVideoAV1MESAProfile seq_profile; |
1166 |
- uint8_t frame_width_bits_minus_1; |
1167 |
- uint8_t frame_height_bits_minus_1; |
1168 |
- uint16_t max_frame_width_minus_1; |
1169 |
- uint16_t max_frame_height_minus_1; |
1170 |
- uint8_t delta_frame_id_length_minus_2; |
1171 |
- uint8_t additional_frame_id_length_minus_1; |
1172 |
- uint8_t order_hint_bits_minus_1; |
1173 |
- uint8_t seq_choose_integer_mv; |
1174 |
- uint8_t seq_force_integer_mv; |
1175 |
- |
1176 |
- StdVideoAV1MESATimingInfo timing_info; |
1177 |
- StdVideoAV1MESAColorConfig color_config; |
1178 |
-} StdVideoAV1MESASequenceHeader; |
1179 |
- |
1180 |
-typedef struct StdVideoAV1MESATile { |
1181 |
- uint16_t tg_start; |
1182 |
- uint16_t tg_end; |
1183 |
- uint16_t row; |
1184 |
- uint16_t column; |
1185 |
- uint32_t size; |
1186 |
- uint32_t offset; |
1187 |
-} StdVideoAV1MESATile; |
1188 |
- |
1189 |
-typedef struct StdVideoAV1MESATileList { |
1190 |
- StdVideoAV1MESATile *tile_list; |
1191 |
- uint32_t nb_tiles; |
1192 |
-} StdVideoAV1MESATileList; |
1193 |
- |
1194 |
-typedef struct VkVideoDecodeAV1PictureInfoMESA { |
1195 |
- VkStructureType sType; |
1196 |
- const void *pNext; |
1197 |
- StdVideoAV1MESAFrameHeader *frame_header; |
1198 |
- StdVideoAV1MESATileList *tile_list; |
1199 |
- uint8_t skip_mode_frame_idx[2]; |
1200 |
-} VkVideoDecodeAV1PictureInfoMESA; |
1201 |
- |
1202 |
-typedef struct VkVideoDecodeAV1DpbSlotInfoMESA { |
1203 |
- VkStructureType sType; |
1204 |
- const void *pNext; |
1205 |
- uint8_t frameIdx; |
1206 |
- uint8_t ref_order_hint[7]; |
1207 |
- uint8_t disable_frame_end_update_cdf; |
1208 |
-} VkVideoDecodeAV1DpbSlotInfoMESA; |
1209 |
- |
1210 |
-typedef struct VkVideoDecodeAV1SessionParametersAddInfoMESA { |
1211 |
- VkStructureType sType; |
1212 |
- const void *pNext; |
1213 |
- StdVideoAV1MESASequenceHeader *sequence_header; |
1214 |
-} VkVideoDecodeAV1SessionParametersAddInfoMESA; |
1215 |
- |
1216 |
-typedef struct VkVideoDecodeAV1SessionParametersCreateInfoMESA { |
1217 |
- VkStructureType sType; |
1218 |
- const void *pNext; |
1219 |
- const VkVideoDecodeAV1SessionParametersAddInfoMESA *pParametersAddInfo; |
1220 |
-} VkVideoDecodeAV1SessionParametersCreateInfoMESA; |
1221 |
- |
1222 |
-typedef struct VkVideoDecodeAV1ProfileInfoMESA { |
1223 |
- VkStructureType sType; |
1224 |
- const void *pNext; |
1225 |
- StdVideoAV1MESAProfile stdProfileIdc; |
1226 |
-} VkVideoDecodeAV1ProfileInfoMESA; |
1227 |
- |
1228 |
-typedef enum VkVideoDecodeAV1CapabilityFlagBitsMESA { |
1229 |
- VK_VIDEO_DECODE_AV1_CAPABILITY_EXTERNAL_FILM_GRAIN_MESA = 0x00000001, |
1230 |
- VK_VIDEO_DECODE_AV1_CAPABILITY_FLAG_BITS_MAX_ENUM_MESA = 0x7FFFFFFF |
1231 |
-} VkVideoDecodeAV1CapabilityFlagBitsMESA; |
1232 |
-typedef VkFlags VkVideoDecodeAV1CapabilityFlagsMESA; |
1233 |
- |
1234 |
-typedef struct VkVideoDecodeAV1CapabilitiesMESA { |
1235 |
- VkStructureType sType; |
1236 |
- const void *pNext; |
1237 |
- VkVideoDecodeAV1CapabilityFlagsMESA flags; |
1238 |
- StdVideoAV1MESALevel maxLevelIdc; |
1239 |
-} VkVideoDecodeAV1CapabilitiesMESA; |
1240 |
- |
1241 |
-#define VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_MESA 1000509000 |
1242 |
-#define VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_MESA 1000509001 |
1243 |
-#define VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_ADD_INFO_MESA 1000509002 |
1244 |
-#define VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_DPB_SLOT_INFO_MESA 1000509003 |
1245 |
-#define VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_CAPABILITIES_MESA 1000509004 |
1246 |
-#define VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PROFILE_INFO_MESA 1000509005 |
1247 |
- |
1248 |
-#ifdef __cplusplus |
1249 |
-} |
1250 |
-#endif |
1251 |
- |
1252 |
-#endif |
1253 |
--- libavcodec/vulkan_video_codec_av1std_decode.h 2023-11-11 00:25:17 UTC |
1254 |
+++ /dev/null |
1255 |
@@ -1,36 +0,0 @@ |
1256 |
-/* Copyright 2023 Lynne |
1257 |
- * Copyright 2023 Dave Airlie |
1258 |
- * |
1259 |
- * Licensed under the Apache License, Version 2.0 (the "License"); |
1260 |
- * you may not use this file except in compliance with the License. |
1261 |
- * You may obtain a copy of the License at |
1262 |
- * |
1263 |
- * http://www.apache.org/licenses/LICENSE-2.0 |
1264 |
- * |
1265 |
- * Unless required by applicable law or agreed to in writing, software |
1266 |
- * distributed under the License is distributed on an "AS IS" BASIS, |
1267 |
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
1268 |
- * See the License for the specific language governing permissions and |
1269 |
- * limitations under the License. |
1270 |
- */ |
1271 |
- |
1272 |
-#ifndef VULKAN_VIDEO_CODEC_AV1STD_DECODE_H_ |
1273 |
-#define VULKAN_VIDEO_CODEC_AV1STD_DECODE_H_ 1 |
1274 |
- |
1275 |
-/* |
1276 |
-** This header is NOT YET generated from the Khronos Vulkan XML API Registry. |
1277 |
-** |
1278 |
-*/ |
1279 |
- |
1280 |
-#ifdef __cplusplus |
1281 |
-extern "C" { |
1282 |
-#endif |
1283 |
-#define vulkan_video_codec_av1std_decode 1 |
1284 |
- |
1285 |
- |
1286 |
- |
1287 |
-#ifdef __cplusplus |
1288 |
-} |
1289 |
-#endif |
1290 |
- |
1291 |
-#endif |
1292 |
--- libavutil/hwcontext_vulkan.c.orig 2023-12-31 00:07:26 UTC |
1293 |
+++ libavutil/hwcontext_vulkan.c |
1294 |
@@ -437,7 +437,7 @@ static const VulkanOptExtension optional_device_exts[] |
1295 |
{ VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_QUEUE }, |
1296 |
{ VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_H264 }, |
1297 |
{ VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_H265 }, |
1298 |
- { "VK_MESA_video_decode_av1", FF_VK_EXT_VIDEO_DECODE_AV1 }, |
1299 |
+ { VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_AV1 }, |
1300 |
}; |
1301 |
|
1302 |
static VkBool32 VKAPI_CALL vk_dbg_callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity, |
1303 |
--- libavutil/vulkan_functions.h.orig 2023-11-11 00:25:17 UTC |
1304 |
+++ libavutil/vulkan_functions.h |
1305 |
@@ -43,7 +43,7 @@ typedef enum FFVulkanExtensions { |
1306 |
FF_VK_EXT_VIDEO_DECODE_QUEUE = 1ULL << 11, /* VK_KHR_video_decode_queue */ |
1307 |
FF_VK_EXT_VIDEO_DECODE_H264 = 1ULL << 12, /* VK_EXT_video_decode_h264 */ |
1308 |
FF_VK_EXT_VIDEO_DECODE_H265 = 1ULL << 13, /* VK_EXT_video_decode_h265 */ |
1309 |
- FF_VK_EXT_VIDEO_DECODE_AV1 = 1ULL << 14, /* VK_MESA_video_decode_av1 */ |
1310 |
+ FF_VK_EXT_VIDEO_DECODE_AV1 = 1ULL << 14, /* VK_KHR_video_decode_av1 */ |
1311 |
FF_VK_EXT_ATOMIC_FLOAT = 1ULL << 15, /* VK_EXT_shader_atomic_float */ |
1312 |
FF_VK_EXT_COOP_MATRIX = 1ULL << 16, /* VK_KHR_cooperative_matrix */ |
1313 |
|
1314 |
--- libavutil/vulkan_loader.h.orig 2023-11-11 00:25:17 UTC |
1315 |
+++ libavutil/vulkan_loader.h |
1316 |
@@ -56,7 +56,7 @@ static inline uint64_t ff_vk_extensions_to_mask(const |
1317 |
{ VK_KHR_VIDEO_DECODE_QUEUE_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_QUEUE }, |
1318 |
{ VK_KHR_VIDEO_DECODE_H264_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_H264 }, |
1319 |
{ VK_KHR_VIDEO_DECODE_H265_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_H265 }, |
1320 |
- { "VK_MESA_video_decode_av1", FF_VK_EXT_VIDEO_DECODE_AV1 }, |
1321 |
+ { VK_KHR_VIDEO_DECODE_AV1_EXTENSION_NAME, FF_VK_EXT_VIDEO_DECODE_AV1 }, |
1322 |
}; |
1323 |
|
1324 |
FFVulkanExtensions mask = 0x0; |