View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000238 | Cinelerra-GG | [All Projects] Feature | public | 2019-06-04 11:40 | 2022-05-06 07:58 |
Reporter | Olaf | Assigned To | |||
Priority | normal | Severity | minor | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | |||||
Target Version | Fixed in Version | ||||
Summary | 0000238: Compositor: ICC profile support | ||||
Description | Support of ICC (display) profiles for the Compositor/Viewer. Cinelerra-GG recently started advertising with "8K Support" and "10-bit Color Space". Such promises have to be kept. Compositor/Viewer are stuck without profiles in the color space sRGB of X11, which can amount to that: What you see is not what you get. Color grading becomes a shot in the dark, false colors after export (colorspace BT.709, BT.2020) can be the result. A color correction can only work correctly in a controlled color space. The BT.2020 color space is of no use to you because you are forced to set the monitor down to sRGB to see what you are doing. Exporting to a larger color space then makes the colors visible that were not visible during editing. The media player mpv can integrate such profiles, maybe it serves as a source. | ||||
Tags | Color Space, Compositor, ICC profile | ||||
ffmpeg git (on road to 5.1) has some work on ICC profile support in filters https://git.ffmpeg.org/gitweb/ffmpeg.git?a=search&h=HEAD&st=commit&s=icc |
|
there is code from mlayer2, but I sadly have no skills for transplanting it.. https://github.com/astiob/mplayer2/blob/all/libvo/vo_gl3.c |
|
well, sadly implementing this a bit more than I can take. I heard GSOC now is not limited to students - but for practicating as project we need programmer who understand Cin well enough, and those ppl a bit rare.. |
|
Looking at Olive 0.2 for 10-bit support, I saw their embedded OpenColorIO. They integrated Blender's ocio.conf file (with associated LUTs) to get that support. It can be found in: /home/$USER/.cache/olivevideoeditor.org/Olive/ocioconf/ocio.conf Do you think it is possible to use it in CinGG as well? https://opencolorio.readthedocs.io/en/latest/quick_start/for_devs.html |
|
OpenColorIO makes sense, is currently also built into Olive. But it doesn't use anything as long as nobody can integrate it. | |
Probably not very related to Compositor, but there are some patches for ffmpeg adding ICC profile reading/writing (against ffmpeg 4.3-dev): http://ffmpeg.org/pipermail/ffmpeg-devel/2019-September/250398.html [FFmpeg-devel] [PATCH 0/5] adding ICC profile support to MOV decode/encode Also potentially interesting patchset about dv encode/decode: http://ffmpeg.org/pipermail/ffmpeg-devel/2019-September/249794.html [FFmpeg-devel] [PATCH] avcodec/dvdec: correctly decode bottom mb row in 1080i field mode and next few patches ( [PATCH] avcodec/dvenc: support encoding dvcprohd , [PATCH] avcodec/dvdec: correctly set interlaced and tff) |
|
yeah, OpenColorIO seems to be more complete (capable?) solution. In c++. With GPU path (hopefully GLSL, and not just Cg from NVIDIA proprietary past) , too. http://opencolorio.org/developers/usage_examples.html But probably complete support will require also saving this 'color profile' info into image formats, and reading it back? Still, display seems to be first logical (most visibly) step. |
|
I will close 64 since this refers to it and since I can still look at it for future information when/if we ever get to this ticket. Other than bugs and looking into CUDA, issue 0000002 of MASKING and all of its side issues is the oldest so takes the highest precedence. | |
A subject I'm very interested in. On the color management there is also an old ticket (0000064); maybe you can close it and leave only this. |
|
and discussion on CPU-only threaded use: https://sourceforge.net/p/lcms/mailman/message/30848823/ (relative to lcms2-2.4) --------copy------ Hughes wrote: > Hi all, > > I'm trying to make my transform go fast. I've got a 1920x1080 RGB > image being transformed from sRGB to the display profile. I've got a > quad core processor on my development box, no shaders or GPU, and I'm > trying to do the transform as quickly as possible. Re: [Lcms-user] Threading performance in LCMS2 From: Sebastien Leon <[email protected]...> - 2013-05-30 20:32:04 Hi Richard, [....] - littleCMS legacy code : 92.12 CPU Cycle per pixel transformed - littleCMS hacked : 27.75 CPU Cycle per pixel transformed --------copy end----- so, for 2Mpx image (~fullHD) it will be ... 93 * 1920 * 1080 = 194,273,280 cycles. *30 fps = 5,828,198,400 = 6Ghz core ... Note at the same thread it was said "Note that I also rewrote the critic loop with SSE4 assembly code (just for fun). I found no real improvement because most of the work is about memory exchange... So I kept the basic C code..." . Other links also alive (about measuring time spend in those transforms). Not sure if those transforms will work directly on yuv data ... so, probably initial implementation can only work with some project colorspaces (RGBA8/float?) and some video outputs (GL/X11) ? |
|
Not sure if this will be of any use, but there was little discussion about OpenGL and iccpprofiles: https://sourceforge.net/p/lcms/mailman/message/33575634/ -----------------copy-------------------- Re: [Lcms-user] Adobe's Color Engine, GPUs, And Other Rambling From: Gerhard Fuernkranz <[email protected]...> - 2015-03-10 19:25:03 Attachments: Message as HTML Create an RGB -> RGB transform and re-sample it on a regular grid, for instance like below (code is a bit older, still using lcms1, though). Regards, Gerhard #define GRIDPOINTS 64 static GLushort clut[GRIDPOINTS][GRIDPOINTS][GRIDPOINTS][3]; static GLuint img_texture; static GLuint clut_texture; static GLfloat clut_scale; static GLfloat clut_offset; void make_clut_texture(const char *profile_name) { int r, g, b, n = GRIDPOINTS; cmsHPROFILE sRGB, monitor; cmsHTRANSFORM xform; sRGB = cmsCreate_sRGBProfile (); // image profile monitor = cmsOpenProfileFromFile (profile_name, "r"); if (monitor == NULL) { fprintf(stderr, "Cannot open display profile %s\n", profile_name); exit(1); } xform = cmsCreateTransform (sRGB, TYPE_RGB_16, monitor, TYPE_RGB_16, INTENT_PERCEPTUAL, cmsFLAGS_NOTPRECALC); if (xform == NULL) { fprintf(stderr, "Failed to create transformation\n"); exit(1); } clut_scale = (double) (n - 1) / n; clut_offset = 1.0 / (2 * n); for (r = 0; r < n; r++) { for (g = 0; g < n; g++) { for (b = 0; b < n; b++) { unsigned short in[3]; in[0] = floor ((double) r / (n - 1) * 65535.0 + 0.5); in[1] = floor ((double) g / (n - 1) * 65535.0 + 0.5); in[2] = floor ((double) b / (n - 1) * 65535.0 + 0.5); cmsDoTransform (xform, in, clut[b][g][r], 1); } } } cmsDeleteTransform (xform); cmsCloseProfile (monitor); cmsCloseProfile (sRGB); glGenTextures (1, &clut_texture); /* texture 1 = clut */ glActiveTextureARB (GL_TEXTURE0_ARB + 1); glBindTexture (GL_TEXTURE_3D, clut_texture); glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP); glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP); glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri (GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage3D (GL_TEXTURE_3D, 0, GL_RGB16, n, n, n, 0, GL_RGB, GL_UNSIGNED_SHORT, clut); /* back to texture 0 = image */ glActiveTextureARB (GL_TEXTURE0_ARB); } -------------------copy end------ additionally there was this comment at the end: ----copy------------ Re: [Lcms-user] Adobe's Color Engine, GPUs, And Other Rambling From: Gerhard Fuernkranz <[email protected]...> - 2015-03-10 23:54:12 Am 11.03.2015 um 00:36 schrieb [email protected]: > > Quoting Gerhard Fuernkranz <[email protected]>: > >> Create an RGB -> RGB transform and re-sample it on a regular grid, >> for instance like below (code is a bit older, still using lcms1, though). > > Great idea. lcms2 works fine in this way. Please note in lcms2 you can get float, double or "half float" values directly, so you need not to downscale to 16 bits anymore. For instance, in half float type, use TYPE_RGB_HALF_FLT as formatter. The reason for the integer LUT texture was actually the inability of my GPU to interpolate 3D float textures with GL_LINEAR filter, when I wrote this stuff quite some years ago. Likely, recent GPUs don't suffer from such a limitation any more. Regards, Gerhard --------------------copy end------------------- so, this might help with X11-OpenGL. For plain X11 - just same thing via CPU? (GIMP 2.10.x probably uses software/CPU method) |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2019-06-04 11:40 | Olaf | New Issue | |
2019-06-04 11:40 | Olaf | File Added: Compsotor-mpv_with_display_profile.jpg | |
2019-06-04 11:48 | Olaf | Tag Attached: Compositor | |
2019-06-04 11:48 | Olaf | Tag Attached: Color Space | |
2019-06-04 11:48 | Olaf | Tag Attached: ICC profile | |
2019-06-04 18:36 | Andrew-R | Note Added: 0001653 | |
2019-06-05 11:09 | Andrew-R | Note Added: 0001657 | |
2019-06-05 14:14 | Andrea_Paz | Note Added: 0001659 | |
2019-06-05 15:11 | PhyllisSmith | Note Added: 0001660 | |
2019-06-05 19:53 | Andrew-R | Note Added: 0001663 | |
2019-09-27 06:38 | Andrew-R | Note Added: 0002185 | |
2019-10-01 10:25 | Olaf | Note Added: 0002200 | |
2021-11-16 12:30 | Andrea_Paz | Note Added: 0005187 | |
2021-11-16 16:38 | Andrew-R | Note Added: 0005188 | |
2021-11-16 16:59 | Andrew-R | Note Added: 0005189 | |
2022-05-06 07:58 | Andrew-R | Note Added: 0005299 |