Opened 4 years ago
Closed 4 years ago
Add ITU BT709 colorspace support and studio levels (RGB 16-235) for VDPAU playback
|Reported by:||jyavenard||Owned by:||ijr|
|Component:||MythTV - General||Version:||unknown|
Description (last modified by jyavenard)
By default VDPAU uses PC RGB levels (0-255 range), this is good for your typical PC monitors, but TV's are usually calibrated for different levels (black at 16 and white at 235). Using PC levels with a TV expecting studio levels result in poor black and white levels (crushed).
This could be fixed by changing the contrast and brightness default value, but obviously this isn't ideal.
Another issue is that HD videos uses a different colorspace than SD (ITU BT.709 vs ITU BT.601). VDPAU by default uses BT601, so all colours with HD videos are actually wrong ; they would be shifted, slightly under or over saturated. This is particularly noticeable with skin tones.
So ideally, you would want to use BT601 colorspace for SD videos and BT709 for HD videos.
This patch adds ITU BT709 video support and RGB studio levels to VDPAU playback.
Parameters are set using the custom filter option in the deinterlacer configuration screen.
Utilities/Setup? -> Setup -> TV Settings -> Playback -> Playback Profiles -> Custom Filters
studio: will prevent converting to PC levels
colorspace=n will set the colorspace to be used.
n=0: will use BT709 for HD videos and BT601 for SD
n=1 (default): will always use BT601
n=2: will always use BT709
Custom Filters: studio,colorspace=0
Original RGB conversion formulas and ideas are taken from mplayer OpenGL display code (vo_gl) and a patch from LauriM for mplayer.