Skip to content

Support D500 BA10 calibration profiles and RAW16 preview - #15668

Merged
OhadMeir merged 1 commit into
realsenseai:developmentfrom
polejoe:rgb-calib-fourcc
Sep 14, 2026
Merged

OhadMeir merged 1 commit into
realsenseai:developmentfrom
polejoe:rgb-calib-fourcc

Conversation

@polejoe

@polejoe polejoe commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Recognize BA10 (V4L2 SGRBG10) as D500 RGB calibration data in both 3C and 2C, and allow the Viewer to display the resulting RAW16 frames as grayscale.

Tracked on [RSDEV-14616]

Changes

  • Map BA10 to the existing RS2_FORMAT_RAW16 color profile for D500 3C and 2C.
  • Preserve the native 10-bit GRBG samples in their 16-bit little-endian storage; no debayering or pixel conversion is applied to SDK frames.
  • Add a display-only RAW16 grayscale path in the Viewer. It scales the active sample range to 8-bit without modifying the source frame.
  • Keep the existing pin detection, stream indexes, image formats, and Y16I IR calibration path unchanged.

Host Requirement

The GMSL host must advertise BA10 for the D500 calibration transport

The firmware continues using its existing RAW16 transport. This change does not add the historical GR16 alias or a new public SDK format.

Validation

  • Incremental realsense-viewer build passed on Jetson67; no system SDK installation.
  • Built Viewer reports version 2.59.0.0.
  • BA10 preview was manually verified through the host test application on D5x + Jetson67.
  • Host enumeration reports BA10 at 1600x1300, stride 3200, and sizeimage 4160000.
  • A native BA10 capture contains 2,080,000 little-endian samples, all within 10 bits and not all zero.

Scope

The Viewer preview is grayscale only. Color reconstruction would require BA10/GRBG10 identity to be exposed through the public SDK format contract and a dedicated debayer path, which is intentionally outside this minimal change.

The current aggregate 2C host node does not provide left/right fan-out; this patch only adds format recognition and display support. Pixel mode and D4xx were not hardware-validated.


Generated by AI

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-generated review by rs-agentic bot. One potential bug flagged below.

Comment thread src/ds/d500/d500-color.cpp Resolved
Comment thread src/ds/d500/d500-dual-color.cpp Resolved
Comment thread src/ds/d500/d500-dual-color.cpp Resolved
@polejoe polejoe changed the title [RSDEV-14616] Recognize D500 GR16 and BA10 color calibration profiles [RSDEV-14616] Recognize D500 GR16 color calibration profiles Sep 14, 2026
@polejoe
polejoe force-pushed the rgb-calib-fourcc branch 2 times, most recently from 4388136 to 4585d19 Compare September 14, 2026 05:44
@polejoe polejoe changed the title [RSDEV-14616] Recognize D500 GR16 color calibration profiles [RSDEV-14616] Recognize D500 BA10 color calibration profiles Sep 14, 2026
@polejoe polejoe changed the title [RSDEV-14616] Recognize D500 BA10 color calibration profiles [RSDEV-14616] Support D500 BA10 calibration profiles and RAW16 preview Sep 14, 2026

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-review of new commit (synchronize) by rs-agentic bot. Backend BA10 changes previously reviewed/approved. One note on the new RAW16 rendering path below.

Comment thread common/rendering.h Resolved
@OhadMeir OhadMeir changed the title [RSDEV-14616] Support D500 BA10 calibration profiles and RAW16 preview Support D500 BA10 calibration profiles and RAW16 preview Sep 14, 2026
@polejoe

polejoe commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

Reviewed the current head against all rs-agentic comments:

  • BA10 (V4L2_PIX_FMT_SGRBG10) is an unpacked 10-bit Bayer format stored in 16-bit little-endian words. The packed 1.25-byte/pixel variant has a different FourCC (SGRBG10P), so mapping BA10 to RS2_FORMAT_RAW16 matches the validated 3200-byte stride for 1600 pixels.
  • The 2C path identifies RGB pins from their existing NV12/M420 and YUY2/YUYV companion profiles, then resolves BA10 on the same pin to Color 1/2. BA10 does not need to participate in pin classification.
  • Collapsing BA10 to the existing RS2_FORMAT_RAW16 is intentional for this minimal passthrough and grayscale-preview scope. The current head no longer adds GR16.
  • The two-pass RAW16 preview conversion has a real CPU cost, but hard-coding shift = 6 is not correct: BA10 uses the low 10 bits, and this renderer also serves generic RAW16 sources. This is a non-blocking performance consideration rather than a correctness issue.

No correctness blocker was found from the current review comments.

@OhadMeir OhadMeir left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@polejoe
polejoe marked this pull request as ready for review September 14, 2026 10:34
Comment thread common/rendering.h Resolved
Comment thread src/ds/d500/d500-dual-color.cpp Resolved
Comment thread common/rendering.h Outdated
{
const size_t row_bytes = static_cast< size_t >( width ) * sizeof( uint16_t );
const size_t pixel_count = static_cast< size_t >( width ) * height;
if( !data || stride < static_cast< int >( row_bytes )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Fixed in 1141ad2. The RAW16 renderer now rejects non-positive frame dimensions before scanning row samples.

🤖 Generated by AI

@sysrsbuild-gh-agentic sysrsbuild-gh-agentic left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-review of new commit (sync event) — one bug found in the RAW16 renderer guard.

Comment thread common/rendering.h Resolved
Signed-off-by: zhou <shengyong.zhou@realsenseai.com>
@OhadMeir
OhadMeir merged commit d6d02a3 into realsenseai:development Sep 14, 2026
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants