From 7ec0fdc7e3b0dbccba33b06b28217199adb752d6 Mon Sep 17 00:00:00 2001 From: Jerzy Wilczek <72213407+jerzywilczek@users.noreply.github.com> Date: Thu, 17 Oct 2024 15:46:05 +0200 Subject: [PATCH] [vk-video] Various minor fixes (#829) --- vk-video/src/parser/au_splitter.rs | 11 ++--------- vk-video/src/vulkan_decoder/vulkan_ctx.rs | 24 +++++++---------------- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/vk-video/src/parser/au_splitter.rs b/vk-video/src/parser/au_splitter.rs index ad46ffabd..580bd4b28 100644 --- a/vk-video/src/parser/au_splitter.rs +++ b/vk-video/src/parser/au_splitter.rs @@ -46,20 +46,17 @@ impl AUSplitter { // defguardp first_mb_in_slice_zero(a) // when a.first_mb_in_slice == 0 and // a.nal_unit_type in [1, 2, 5] -// fn first_mb_in_slice_zero(slice: &Slice) -> bool { slice.header.first_mb_in_slice == 0 } // defguardp frame_num_differs(a, b) when a.frame_num != b.frame_num -// fn frame_num_differs(last: &Slice, curr: &Slice) -> bool { last.header.frame_num != curr.header.frame_num } // defguardp pic_parameter_set_id_differs(a, b) // when a.pic_parameter_set_id != b.pic_parameter_set_id -// fn pps_id_differs(last: &Slice, curr: &Slice) -> bool { last.pps_id != curr.pps_id } @@ -67,7 +64,6 @@ fn pps_id_differs(last: &Slice, curr: &Slice) -> bool { // defguardp field_pic_flag_differs(a, b) when a.field_pic_flag != b.field_pic_flag // // defguardp bottom_field_flag_differs(a, b) when a.bottom_field_flag != b.bottom_field_flag -// fn field_pic_flag_differs(last: &Slice, curr: &Slice) -> bool { last.header.field_pic != curr.header.field_pic } @@ -75,7 +71,6 @@ fn field_pic_flag_differs(last: &Slice, curr: &Slice) -> bool { // defguardp nal_ref_idc_differs_one_zero(a, b) // when (a.nal_ref_idc == 0 or b.nal_ref_idc == 0) and // a.nal_ref_idc != b.nal_ref_idc -// fn nal_ref_idc_differs_one_zero(last: &Slice, curr: &Slice) -> bool { (last.nal_header.nal_ref_idc() == 0 || curr.nal_header.nal_ref_idc() == 0) && last.nal_header.nal_ref_idc() != curr.nal_header.nal_ref_idc() @@ -85,7 +80,6 @@ fn nal_ref_idc_differs_one_zero(last: &Slice, curr: &Slice) -> bool { // when a.pic_order_cnt_type == 0 and b.pic_order_cnt_type == 0 and // (a.pic_order_cnt_lsb != b.pic_order_cnt_lsb or // a.delta_pic_order_cnt_bottom != b.delta_pic_order_cnt_bottom) -// fn pic_order_cnt_zero_check(last: &Slice, curr: &Slice) -> bool { let (last_pic_order_cnt_lsb, last_delta_pic_order_cnt_bottom) = match last.header.pic_order_cnt_lsb { @@ -111,20 +105,19 @@ fn pic_order_cnt_zero_check(last: &Slice, curr: &Slice) -> bool { || last_delta_pic_order_cnt_bottom != curr_delta_pic_order_cnt_bottom } +// TODO // defguardp pic_order_cnt_one_check_zero(a, b) // when a.pic_order_cnt_type == 1 and b.pic_order_cnt_type == 1 and // hd(a.delta_pic_order_cnt) != hd(b.delta_pic_order_cnt) -// TODO +// TODO // defguardp pic_order_cnt_one_check_one(a, b) // when a.pic_order_cnt_type == 1 and b.pic_order_cnt_type == 1 and // hd(hd(a.delta_pic_order_cnt)) != hd(hd(b.delta_pic_order_cnt)) -// TODO // defguardp idr_and_non_idr(a, b) // when (a.nal_unit_type == 5 or b.nal_unit_type == 5) and // a.nal_unit_type != b.nal_unit_type -// fn idr_and_non_idr(last: &Slice, curr: &Slice) -> bool { (last.nal_header.nal_unit_type().id() == 5) ^ (curr.nal_header.nal_unit_type().id() == 5) } diff --git a/vk-video/src/vulkan_decoder/vulkan_ctx.rs b/vk-video/src/vulkan_decoder/vulkan_ctx.rs index befb3c19b..4aa4bb185 100644 --- a/vk-video/src/vulkan_decoder/vulkan_ctx.rs +++ b/vk-video/src/vulkan_decoder/vulkan_ctx.rs @@ -4,7 +4,7 @@ use std::{ }; use ash::{vk, Entry}; -use tracing::{error, info}; +use tracing::{debug, error}; use super::{ Allocator, CommandBuffer, CommandPool, DebugMessenger, Device, H264ProfileInfo, Instance, @@ -142,13 +142,6 @@ impl VulkanCtx { ) -> Result { let entry = Arc::new(unsafe { Entry::load()? }); - let instance_extension_properties = - unsafe { entry.enumerate_instance_extension_properties(None)? }; - info!( - "instance_extension_properties amount: {}", - instance_extension_properties.len() - ); - let api_version = vk::make_api_version(0, 1, 3, 0); let app_info = vk::ApplicationInfo { api_version, @@ -248,9 +241,6 @@ impl VulkanCtx { let wgpu_features = wgpu_features | wgpu::Features::TEXTURE_FORMAT_NV12; - // TODO: we can only get the required extensions after exposing the adapter; the creation - // of the adapter and verification of whether the device supports all extensions should - // happen while picking the device. let wgpu_extensions = wgpu_adapter .adapter .required_device_extensions(wgpu_features); @@ -495,7 +485,7 @@ fn find_device<'a>( .max_dpb_slots(caps.max_dpb_slots) .max_active_reference_pictures(caps.max_active_reference_pictures) .std_header_version(caps.std_header_version); - info!("caps: {caps:#?}"); + debug!("video_caps: {caps:#?}"); let flags = decode_caps.flags; @@ -563,7 +553,7 @@ fn find_device<'a>( .contains(vk::QueueFlags::VIDEO_DECODE_KHR) }) .map(|(i, _)| i) - .collect::>(); // TODO: have to split the queues + .collect::>(); let Some(transfer_queue_idx) = queues .iter() @@ -603,10 +593,10 @@ fn find_device<'a>( continue; }; - info!("deocde_caps: {decode_caps:#?}"); - info!("h264_caps: {h264_caps:#?}"); - info!("dpb_format_properties: {h264_dpb_format_properties:#?}"); - info!("dst_format_properties: {h264_dst_format_properties:#?}"); + debug!("deocde_caps: {decode_caps:#?}"); + debug!("h264_caps: {h264_caps:#?}"); + debug!("dpb_format_properties: {h264_dpb_format_properties:#?}"); + debug!("dst_format_properties: {h264_dst_format_properties:#?}"); return Ok(ChosenDevice { physical_device: device,