Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3dlut and simple ICC linking support for color correction #9731

Merged
merged 24 commits into from Jul 1, 2016

Conversation

laurimyllari
Copy link
Contributor

This PR adds a ColorManager class that supports loading madVR 3DLUT files, and loading ICC display profiles, creating source profiles and linking them.

The end user can use this to correct their display response with a 3DLUT file, or emulate other displays (with whitepoint, primaries and gamma selectable at runtime) with an ICC profile of their own display.

Code changes are in two commits. The first one implements a (hopefully) platform independent ColorManager class. If lcms2 is not available, only 3DLUT file format is supported. The second commit adds the necessary bits to the Linux OpenGL renderer, building on the previously added output stage.

The ICC profile linking is still work in progress, but I included it as it is functional and shows what can be done with it. It will also be needed if/when color management is implemented for the photo viewer. The 3DLUT files provide the best accuracy (at the cost of runtime flexibility) - ArgyllCMS is very smart and the linker here is quite simple.

Slight adjustments may be needed for #9720 - I'll update if/when that is merged to master.

One significant improvement I would like help with: it would be nice to keep the 3D lookup texture around as it takes a while to upload. It is most noticeable when running many short video clips back to back. @FernetMenta, any thoughts?

I'm still pretty new to the Kodi codebase. Any feedback is welcome.

Pinging @Memphiz and @popcornmix since my previous work broke gles - would you mind checking this out? Are there any gles platforms that could be supported, or better to just disable this and make sure not to break anything?


void main()
{
vec4 rgb = process();

#if defined(XBMC_3DLUT)
// FIXME: can this be optimized?

This comment was marked as spam.

@Memphiz
Copy link
Member

Memphiz commented May 2, 2016

Well if it can't be done for gles with the human ressources this pr has available ( you ;) ) - then it should be as defensive as possible for gles. As of the looks it doesn't touch gles - so theoretically this should be ok.

@FernetMenta
Copy link
Contributor

nice!

@laurimyllari
Copy link
Contributor Author

I updated the code to address the feedback above, and to apply to current master.


CMS_PRIMARIES videoFlagsToPrimaries(int flags)
{
if (flags & CONF_FLAGS_COLPRI_BT709) return CMS_PRIMARIES_BT709;

This comment was marked as spam.

@laurimyllari
Copy link
Contributor Author

Updated to remove the singleton. @FernetMenta - would you mind giving this another look?

@FernetMenta
Copy link
Contributor

@laurimyllari sorry, I almost missed this. I will have a look this weekend.

@FernetMenta FernetMenta self-assigned this Jun 4, 2016
#endif // HAVE_LCMS2

// current configuration:
CMS_PRIMARIES curVideoPrimaries;

This comment was marked as spam.

This comment was marked as spam.

bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 23, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 23, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 24, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 24, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 24, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 24, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 24, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 24, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 24, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 24, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 24, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 25, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 25, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 25, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 26, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 26, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 27, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 27, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 27, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 28, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 28, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 29, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 29, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 30, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 30, 2016
Colormanager support for was added with
xbmc/xbmc#9731
bkuhls added a commit to bkuhls/buildroot that referenced this pull request Jul 30, 2016
Colormanager support for was added with
xbmc/xbmc#9731
@MartijnKaijser
Copy link
Member

@bkuhls STOP linking this PR please!!!

@MartijnKaijser
Copy link
Member

@laurimyllari could you please update the TODO strings as we are going to beta it's best that we have proper strings.

@laurimyllari
Copy link
Contributor Author

@MartijnKaijser I've created pull request #10296 with updated strings.

{
CLog::Log(LOGDEBUG, "CMS configuration changed, reload LUT");
if (!LoadCLUT())
return false;

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Video rendering Type: Feature non-breaking change which adds functionality v17 Krypton
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants