From f266c195233abc94ae3fe287811665d5a176309d Mon Sep 17 00:00:00 2001 From: Avia Avraham <145359432+AviaAv@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:47:09 +0200 Subject: [PATCH] deprecate Z16H format --- common/rendering.h | 2 +- src/ds/d400/d400-device.cpp | 6 ------ src/ds/d500/d500-device.cpp | 3 --- src/image.cpp | 2 +- src/proc/synthetic-stream.cpp | 2 +- src/uvc-sensor.cpp | 2 +- third-party/realdds/src/dds-stream-profile.cpp | 4 +--- 7 files changed, 5 insertions(+), 16 deletions(-) diff --git a/common/rendering.h b/common/rendering.h index d317d31a2b..30501b98e5 100644 --- a/common/rendering.h +++ b/common/rendering.h @@ -511,7 +511,7 @@ namespace rs2 case RS2_FORMAT_ANY: throw std::runtime_error("not a valid format"); case RS2_FORMAT_Z16H: - throw std::runtime_error("unexpected format: Z16H. Check decoder processing block"); + throw std::runtime_error("unexpected format: Z16H is deprecated! Check decoder processing block"); case RS2_FORMAT_Z16: case RS2_FORMAT_DISPARITY16: case RS2_FORMAT_DISPARITY32: diff --git a/src/ds/d400/d400-device.cpp b/src/ds/d400/d400-device.cpp index e830f182d9..e1a96e1e3a 100644 --- a/src/ds/d400/d400-device.cpp +++ b/src/ds/d400/d400-device.cpp @@ -64,7 +64,6 @@ namespace librealsense {fourcc('Y','1','6',' '), RS2_FORMAT_Y16}, {fourcc('Y','1','2','I'), RS2_FORMAT_Y12I}, {fourcc('Z','1','6',' '), RS2_FORMAT_Z16}, - {fourcc('Z','1','6','H'), RS2_FORMAT_Z16H}, {fourcc('R','G','B','2'), RS2_FORMAT_BGR8}, {fourcc('M','J','P','G'), RS2_FORMAT_MJPEG}, {fourcc('B','Y','R','2'), RS2_FORMAT_RAW16} @@ -638,11 +637,6 @@ namespace librealsense usb_modality = false; } - if (_fw_version >= firmware_version("5.12.1.1")) - { - depth_sensor.register_processing_block(processing_block_factory::create_id_pbf(RS2_FORMAT_Z16H, RS2_STREAM_DEPTH)); - } - depth_sensor.register_processing_block( { {RS2_FORMAT_Y8I} }, { {RS2_FORMAT_Y8, RS2_STREAM_INFRARED, 1} , {RS2_FORMAT_Y8, RS2_STREAM_INFRARED, 2} }, diff --git a/src/ds/d500/d500-device.cpp b/src/ds/d500/d500-device.cpp index 892f29a539..f90d407e94 100644 --- a/src/ds/d500/d500-device.cpp +++ b/src/ds/d500/d500-device.cpp @@ -54,7 +54,6 @@ namespace librealsense {rs_fourcc('Y','1','2','I'), RS2_FORMAT_Y12I}, {rs_fourcc('Y','1','6','I'), RS2_FORMAT_Y16I}, {rs_fourcc('Z','1','6',' '), RS2_FORMAT_Z16}, - {rs_fourcc('Z','1','6','H'), RS2_FORMAT_Z16H}, {rs_fourcc('R','G','B','2'), RS2_FORMAT_BGR8}, {rs_fourcc('M','J','P','G'), RS2_FORMAT_MJPEG}, {rs_fourcc('B','Y','R','2'), RS2_FORMAT_RAW16} @@ -505,8 +504,6 @@ namespace librealsense _is_symmetrization_enabled = check_symmetrization_enabled(); - depth_sensor.register_processing_block(processing_block_factory::create_id_pbf(RS2_FORMAT_Z16H, RS2_STREAM_DEPTH)); - depth_sensor.register_processing_block( { {RS2_FORMAT_Y8I} }, { {RS2_FORMAT_Y8, RS2_STREAM_INFRARED, 1} , {RS2_FORMAT_Y8, RS2_STREAM_INFRARED, 2} }, diff --git a/src/image.cpp b/src/image.cpp index ec17560964..2ecc09cef1 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -49,7 +49,7 @@ namespace librealsense case RS2_FORMAT_INZI: return 32; case RS2_FORMAT_INVI: return 16; case RS2_FORMAT_W10: return 32; - case RS2_FORMAT_Z16H: return 16; + case RS2_FORMAT_Z16H: return 16; // DEPRECATED! case RS2_FORMAT_FG: return 16; case RS2_FORMAT_Y411: return 12; case RS2_FORMAT_Y16I: return 32; diff --git a/src/proc/synthetic-stream.cpp b/src/proc/synthetic-stream.cpp index c49beb62b7..74349dc7eb 100644 --- a/src/proc/synthetic-stream.cpp +++ b/src/proc/synthetic-stream.cpp @@ -142,7 +142,7 @@ namespace librealsense composite.foreach_rs([&](const rs2::frame& frame) { auto format = frame.get_profile().format(); - if (depth_result_frame && val_in_range(format, { RS2_FORMAT_DISPARITY32, RS2_FORMAT_DISPARITY16, RS2_FORMAT_Z16H })) + if (depth_result_frame && val_in_range(format, { RS2_FORMAT_DISPARITY32, RS2_FORMAT_DISPARITY16 })) return; if (disparity_result_frame && format == RS2_FORMAT_Z16) return; diff --git a/src/uvc-sensor.cpp b/src/uvc-sensor.cpp index fab565af0f..61f616340e 100644 --- a/src/uvc-sensor.cpp +++ b/src/uvc-sensor.cpp @@ -193,7 +193,7 @@ void uvc_sensor::open( const stream_profiles & requests ) expected_size = compute_frame_expected_size( width, height, bpp ); // For compressed formats copy the raw data as is - if( val_in_range( req_profile_base->get_format(), { RS2_FORMAT_MJPEG, RS2_FORMAT_Z16H } ) ) + if( val_in_range( req_profile_base->get_format(), { RS2_FORMAT_MJPEG } ) ) expected_size = static_cast< int >( f.frame_size ); auto extension = frame_source::stream_to_frame_types( req_profile_base->get_stream_type() ); diff --git a/third-party/realdds/src/dds-stream-profile.cpp b/third-party/realdds/src/dds-stream-profile.cpp index 54ef8222ae..faf39da8a4 100644 --- a/third-party/realdds/src/dds-stream-profile.cpp +++ b/third-party/realdds/src/dds-stream-profile.cpp @@ -64,7 +64,7 @@ enum rs2_format // copy from rs2_sensor.h RS2_FORMAT_INZI, /**< multi-planar Depth 16bit + IR 10bit. */ RS2_FORMAT_INVI, /**< 8-bit IR stream. */ RS2_FORMAT_W10, /**< Grey-scale image as a bit-packed array. 4 pixel data stream taking 5 bytes */ - RS2_FORMAT_Z16H, /**< Variable-length Huffman-compressed 16-bit depth values. */ + RS2_FORMAT_Z16H, /**< DEPRECATED! - Variable-length Huffman-compressed 16-bit depth values. */ RS2_FORMAT_FG, /**< 16-bit per-pixel frame grabber format. */ RS2_FORMAT_Y411, /**< 12-bit per-pixel. */ RS2_FORMAT_COMBINED_MOTION, @@ -84,7 +84,6 @@ int dds_video_encoding::to_rs2() const { "Y12I", RS2_FORMAT_Y12I }, // { "Y16I", RS2_FORMAT_Y16I }, { "16UC1", RS2_FORMAT_Z16 }, // Used by depth streams; ROS2-compatible - { "Z16H", RS2_FORMAT_Z16H }, { "rgb8", RS2_FORMAT_RGB8 }, // Used by color streams; ROS2-compatible { "RGBA", RS2_FORMAT_RGBA8 }, { "RGB2", RS2_FORMAT_BGR8 }, @@ -117,7 +116,6 @@ dds_video_encoding dds_video_encoding::from_rs2( int rs2_format ) case RS2_FORMAT_Y12I: encoding = "Y12I"; break; // case RS2_FORMAT_Y16I: encoding = "Y16I"; break; case RS2_FORMAT_Z16: encoding = "16UC1"; break; - case RS2_FORMAT_Z16H: encoding = "Z16H"; break; case RS2_FORMAT_RGB8: encoding = "rgb8"; break; case RS2_FORMAT_RGBA8: encoding = "RGBA"; break; // todo case RS2_FORMAT_BGR8: encoding = "RGB2"; break;