Skip to content

Add BAYER8_GBRG debayering for visualization#246

Open
georges-berenger wants to merge 2 commits into
facebookresearch:mainfrom
georges-berenger:export-D108072630
Open

Add BAYER8_GBRG debayering for visualization#246
georges-berenger wants to merge 2 commits into
facebookresearch:mainfrom
georges-berenger:export-D108072630

Conversation

@georges-berenger

Copy link
Copy Markdown
Contributor

Summary:
D102023707 adds BAYER8_GBRG as a VRS pixel format and routes it to RGB8 normalization in FB-internal builds, but vrsplayer still needs an explicit color debayer path for visualization.

This mirrors the BAYER10_GBRG visualization follow-up in D103575802 by adding BAYER8_GBRG handling in PixelFrame_fb.cpp. The fast path downsamples each 2x2 GBRG block directly to RGB8 for visualization performance, while the quality path uses perception::debayerGbrgBilinearToRGB() for full-resolution RGB8 output.

This does not change VRS serialization, pyvrs bindings, or existing MONO/RGB/BAYER formats.

Differential Revision: D108072630

Maryam Zahiri added 2 commits June 9, 2026 12:14
Summary:
Add BAYER8_GBRG (8-bit Bayer GBRG pattern) pixel format to VRS, following the same pattern as existing Bayer formats (BAYER8_RGGB, BAYER8_BGGR). BAYER8_GBRG is 8 bits per pixel stored as single-byte values (1 byte per pixel), same memory layout as GREY8.

Changes include:
- New `BAYER8_GBRG` enum value (=26) in `RecordFormat.h`
- Serialization support, static_assert for enum stability, channel count and bytes-per-pixel in `RecordFormat.cpp`
- Normalization path (maps to GREY8) in `PixelFrame.cpp` for correct viewer/player display
- Synthetic VRS file generation support in `SyntheticVRS.cpp`
- Unit test in `RecordFormatTest.cpp` validating parsing, bytes per pixel, channels, and block size
- Python bindings (`PyRecord.cpp`, `PyBuffer.cpp`) and regenerated type stubs (`vrsbindings.pyi`)
- Updated test stream count expectations in `FilteredFileReaderTest.cpp` and `CompressAsyncImageFilterTest.cpp`

Differential Revision: D102023707
Summary:
D102023707 adds `BAYER8_GBRG` as a VRS pixel format and routes it to `RGB8` normalization in FB-internal builds, but vrsplayer still needs an explicit color debayer path for visualization.

This mirrors the `BAYER10_GBRG` visualization follow-up in D103575802 by adding `BAYER8_GBRG` handling in `PixelFrame_fb.cpp`. The fast path downsamples each 2x2 GBRG block directly to RGB8 for visualization performance, while the quality path uses `perception::debayerGbrgBilinearToRGB()` for full-resolution RGB8 output.

This does not change VRS serialization, pyvrs bindings, or existing MONO/RGB/BAYER formats.

Differential Revision: D108072630
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 10, 2026
@meta-codesync

meta-codesync Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

@georges-berenger has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108072630.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant