ACES Filmic tonemapping has been ported to GLES

Hi, those of us without HDR displays but still trying to futureproof our collections by getting 4k versions of movies have been kind of screwed, because the HDR>SDR tonemapping in Coreelec is not really useable - the saturation, contrast, etc just aren’t there.

The Windows version of Kodi has includes ACES Filmic tonemapping for awhile now, and tonemapping HDR>SDR with it near perfectly matches the native SDR appearance.

Per Kodi developer jjd-uk, this tonemapping has now been ported to GLES and works on ARM devices.

Any chance this could be added to a nightly or a 19.4 version of Coreelec? It would be a godsend for those of us in the above situation.

From the thread at kodi:

ARM devices can do ACES Filmic and Hable tonemapping, it’s just that nobody got round to doing it for v19, it’s now been recently added to the code for v20.

… Alternatively as you’re a CE user, then perhaps you can ask on their forums if someone would be willing to backport it to v19, it was added in [GLES] add ACES and Hable tone mapping by lrusak · Pull Request #20157 · xbmc/xbmc · GitHub if anyone wants to take a look at what’s needed.

This would be very very very useful!!!

You can try CE20 nightly builds and check if it really works.

I tried the 10-29 nexus nightly but it doesn’t have the tone mapping algorithm selection in the video osd as the windows version does. As far as I can tell the only option at all remains a generic tone mapping on/off in settings/system/Correlec, and image is unchanged from the Matrix versions. So I have no idea if the new algorithms are implemented or if they’re working, or if the problem is just that there’s no gui to turn them on or off.

yes, same to me on N2… :disappointed:

According to the PR I think you would see this in your debug log if it was activated:

2021-09-19 23:55:02.732 T:1406921    INFO <general>: GLES: Selecting YUV 2 RGB shader
2021-09-19 23:55:02.732 T:1406921   DEBUG <general>: GLES: BaseYUV2RGBGLSLShader: defines:
                                                   #define XBMC_NV12_RRG
                                                   #define XBMC_COL_CONVERSION
                                                   #define KODI_TONE_MAPPING_ACES

So shouldn’t be hard to determine

I can’t see any skin changes in those PRs though…having a poke around looks like there is a keyboard control you could try to cycle the available methods

https://github.com/xbmc/xbmc/search?p=2&q=tone+map+method

i.e.

…you could of course map that to a remote key…

Thank you, I will try all that tonight.

I set-up a new CE20 nightly install and turned on HDR to SDR tone mapping.

Could not replace the keyboard.xml in /usr/share/kodi/system/keymaps as it is read only.

So copied it to /storage/.kodi/userdata/keymaps based on some advice on another thread.

Rebooted and played an HDR file, cycling the F11 key during playback.

But the visual quality did not change for me as it does on an X86 box.

The HDR to SDR tone mapping option under “CoreELEC” menu is not part of the standard Kodi functionality, it’s applied on kernel level.
I assume you would want to disable that before using the Kodi functionality.
I haven’t looked into it, or how it’s supposed to work, but maybe there’s an option we’re missing to make it available.

Thanks for the tip.

I turned it off but no luck.

Hopefully others will test to confirm their findings.

Same for me with CE20-nightly-20211029. HDR to SDR in CoreElec-settings is turned off, but toggling F11 during playback of an HDR-movie has no effect on my SDR-TV.

You all noticed it is alt F11 not just F11 right?

Did you check your debug logs for the mentioned notices?

Windows Kodi has had these options in the videoOSD since Matrix, do you mean you don’t see it at all or just don’t see new changes?

Just that I don’t see changes. I don’t use Windows Kodi (well, only for addon dev) so I haven’t seen them, and new ones aren’t coming with this PR…that’s all.

Not sure if they will just magically show up for a different platform, lots of IFDEF guards in there…

Aaah, I missed the ALT part.

Yes it does toggle between ACES, Hable and Reinhard (you get a brief confirmation prompt) but there is no effect on the quality.

I also tested it on the last 19 nightly and the toggle works without having to do anything with a keyboard.xml but returns the same the same results.

I seem to recall somebody saying that the Odroid C4 does a better job with tonemapping, so users of this SBC might potentially see results.

If there’s no effect on quality, then it is not actually applying the tone mapping.

True but the fact that the feature can be accessed does indicate that some form of it’s implementation is present, so it is 1 step forward.

Yes, with ALT-F11 there is a cycling between Reinhard, ACES Filmic and Hable with a OSD-notice during movie playback.
But there is no noticable change in the picture when cycling.
In Estuary and Confluence there is no setting possible in the GUI, only with ALT-F11 the tone mapping can be changed, but as said, with no effect.

Hopefully one of the devs can have a look at it, why the tone mappiong is not activated with ALT-F11.

This all is true with my N2.

Tonight I will try with my C4.

And definitely no change if you first change the tone mapping, then re-start the video? I don’t know anything about the code/how it works in Kodi - just an idle though it might set the mapping values only on video start? Probably not but worth a check if you’ve got a test system set up anyway.

(My guess is that something about the current CE tone-mapping implementation (i.e. what the CE setting controls) - causes this to be skipped over somehow…)

Same behaviour on C4 as on N2.
Cycling within the tonemapping occurs with ALT-F11, but no visible change of picture quality.

And in CoreELEC settings the switch HDRtoSDR has no effect.
Pressing ‘o’ the info is always ‘EOTF & Gamut: SDR BT.709’

In kodi.log there is only this regarding GLES:

CoreELEC20:~/.kodi/temp # grep -i gles kodi.log
2021-11-04 21:57:59.638 T:4967     INFO <general>: RetroPlayer[RENDER]: Registering renderer factory for OpenGLES
2021-11-04 21:58:00.119 T:4967     INFO <general>: GLES: Maximum texture width: 8192
2021-11-04 21:58:01.132 T:4967     INFO <general>: GLES: Enabling VSYNC
CoreELEC20:~/.kodi/temp #