Skip to content

Support limited color range for RGB/Y800 sources#1846

Merged
jp9000 merged 3 commits intoobsproject:masterfrom
jpark37:rgb-limited
Apr 25, 2019
Merged

Support limited color range for RGB/Y800 sources#1846
jp9000 merged 3 commits intoobsproject:masterfrom
jpark37:rgb-limited

Conversation

@jpark37
Copy link
Copy Markdown
Contributor

@jpark37 jpark37 commented Apr 23, 2019

libobs: Add support for limited to full color range conversions when
using RGB or Y800 formats, and move RGB converison for Y800 formats to
the GPU.

decklink: Stop hiding color space/range properties for RGB formats, and
remove "YUV" from "YUV Color Space" and "YUV Color Range".

obs-ffmpeg: Remove "YUV" from "YUV Color Range".

win-dshow: Remove "YUV" from "YUV Color Space" and "YUV Color Range".

UI: Remove "YUV" from "YUV Color Space" and "YUV Color Range".

@jpark37
Copy link
Copy Markdown
Contributor Author

jpark37 commented Apr 23, 2019

Devices can output both limited and full RGB signals (Nintendo Switch was tested), but OBS cannot currently remap limited RGB signals to full range. This changelist attempts to address that. This seemed like a good time to move Y800 processing to the GPU since it also lacks handling for limited color range.

@jpark37
Copy link
Copy Markdown
Contributor Author

jpark37 commented Apr 24, 2019

NES Classic, Intensity Pro 4K, Source=Blackmagic Device
Pixel Format=8-bit YUV: [Blank screen]
Pixel Format=8-bit RGB, no PR: Black=16, White=236 Bad
Pixel Format=8-bit RGB, PR, Color Range=Full: Black=16, White=236 Bad
Pixel Format=8-bit RGB, PR, Color Range=Partial: Black=0, White=255 Good
Only RGB works, and I assume the signal is passed through pure.

NES Classic, Micomsoft SC-512N1-L/DVI, Source=Video Capture Device
Video Format=XRGB: works Bad colors without PR fix.
Video Format=NV12: works
Video Format=YV12: works
Video Format=YUY2: works
All formats display, and I assume the something has converted the signal.

Intensity Pro Capture, Bad, Limited RGB as Full
bad

Intensity Pro Capture, Good, Limited RGB as Limited
good

jp9000 and others added 3 commits April 25, 2019 15:12
Fixes handling of the `obs_source_frame::full_range` member variable,
which is often set to false by default by many plugins even when using
RGB, which would cause RGB to be marked as "partial range".  This change
is crucial for when partial range RBG support is implemented.

Adds `obs_source_frame2` structure that replaces the `full_range` member
variable with a `range` variable, which uses the `video_range_type` enum
to allow handling default range values.  This member variable treats
VIDEO_RANGE_DEFAULT as full range if the format is RGB, and partial
range if the format is YUV.

Also adds `obs_source_output_video2` and `obs_source_preload_video2`
functions which use the `obs_source_frame2` structure instead of the
`obs_source_frame` structure.

When using the original `obs_source_frame`, `obs_source_output_video`,
and `obs_source_preload_video` functions, RGB will always be full range
by default for backward compatibility purposes.
Allows the ability to override and use partial range RGB with the
DirectShow and Decklink device sources when partial range RGB is
implemented.  Fixes certain cases where devices could capture RGB in
limited range via HDMI (per the HDMI specs).
libobs: Add support for limited to full color range conversions when
using RGB or Y800 formats, and move RGB converison for Y800 formats to
the GPU.

decklink: Stop hiding color space/range properties for RGB formats, and
remove "YUV" from "YUV Color Space" and "YUV Color Range".

win-dshow: Remove "YUV" from "YUV Color Space" and "YUV Color Range".

UI: Remove "YUV" from "YUV Color Space" and "YUV Color Range".
@jp9000 jp9000 merged commit 6f23c1c into obsproject:master Apr 25, 2019
@jpark37 jpark37 deleted the rgb-limited branch April 26, 2019 03:14
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.

2 participants