Skip to content

Add YCbCr range to the scaled encode API - #25

Merged
Themaister merged 3 commits into
Themaister:masterfrom
bscubed:scaled-encode-ycbcr-range
Oct 7, 2026
Merged

Themaister merged 3 commits into
Themaister:masterfrom
bscubed:scaled-encode-ycbcr-range

Conversation

@bscubed

@bscubed bscubed commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #24

Adds ycbcr_range and ycbcr_range_bit_depth to pyrowave_scaled_encode_info and forwards them to Granite's new VideoScaler::set_ycbcr_range() (Themaister/Granite#156). Zero-initialized structs keep the current full range output.

  • An invalid range value, or a narrow range bit depth outside 8 to 16, returns PYROWAVE_ERROR_INVALID_ARGUMENT.
  • NV12 input is scaled without color conversion, so the range only applies to RGB input. This is documented in pyrowave.h.
  • test_direct_interop_scaling now runs for full range, 8-bit narrow and 10-bit narrow, and checks the decoded planes against the expected values.

checkout_granite.sh will need to be updated to reference the new commit with the required range APIs (if this feature is approved) once it's merged into Granite. Tested with my own fork's commit in the local checkout and confirmed working.

Tested on Linux with an AMD Radeon RX 7900 XTX (RADV): pyrowave-c-interop-test passes. Streaming through games-on-whales/wolf#517 with narrow range, a color chart now matches the source within 0.4/255 on average.

@bscubed
bscubed marked this pull request as draft October 6, 2026 15:27
@bscubed

bscubed commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Marking as draft since Granite changes are needed (and Granite commit pin subsequently in this repo) before this can be merged. Feel free to review in the meantime.

@Themaister
Themaister merged commit 16bd8c4 into Themaister:master Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: limited range YCbCr output for the scaled encode path

2 participants