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

Improve metering #28

Open
natural-harmonia-gropius opened this issue Jun 25, 2023 · 10 comments
Open

Improve metering #28

natural-harmonia-gropius opened this issue Jun 25, 2023 · 10 comments

Comments

@natural-harmonia-gropius
Copy link
Owner

natural-harmonia-gropius commented Jun 25, 2023

What I did?

  • Convert linear values to perceptual intensity (PQ)
  • Downscaling image to fixed size (512x288)
  • Spatial filtering for image of metering (fast gaussian blur, default to 2 iterations)
  • Get metered values (max)
  • Temporal filtering for metered values (harmonic mean, default to 1/3 fps samples)

What does Dolby do?

视界·本色|杜比视界全新 L1 元数据介绍

  • Spatial filtering (downscaling, fixed resolution(?), 基于最大空间频率的滤波算法(?))
  • Highlight processing (5 levels analysis tuning, from most to least highlight, default to balance, blurring(?)).
  • Get values (in PQ, max: weighted maxRGB, avg: improved(?), min: minY)
  • Working space (BT.2020)
  • Three-segment spline curve.

What I want

  • Reduce flickering
  • Better black and white clipping, tm(w_in) == w_out, tm(b_in) == b_out
  • Mid-grey adaptation, tm(m_in) == m_out
This was referenced Jun 25, 2023
@pbiancardi
Copy link

Is this in the code already or we have to update?

@natural-harmonia-gropius
Copy link
Owner Author

natural-harmonia-gropius commented Jun 25, 2023

Is this in the code already or we have to update?

update
6de0218

Sample in #20 is much better now.

@pbiancardi
Copy link

Yes this looks very promising thank you.

@pbiancardi
Copy link

The flickering seems much better but I have always had the issue where hdr toys looks much more washed out than spline, almost like a gamma or levels issue?

HDR Toys 181109 Spline 181109

@Vern2
Copy link

Vern2 commented Jun 26, 2023

I am having an issue where brightness is sometimes changing in the middle of a scene. These brightness changes are significant.

For example, there are times when the brightness will change when someone new walks into a scene or someone in the scene moves from sunlight into a shadow. I do have the latest changes in dynamic.gsl.

Another one I just came across involves a dark haired lady in a side on shot. When she turns to face the camera, the image gets darker for about a second or so then returns to its original brightness. It also seems to more common in low APL scenes. Other than that, it's looking really really good.

@movieperson
Copy link

movieperson commented Jun 28, 2023

Here is a capture of the HEVC frames of the 5 second sequence from Mamma Mia that clearly shows the brightness fluctuation mentioned in my previous post.

mm.zip

my settings:

vo=gpu-next
gpu-api=d3d11
gpu-context=d3d11

[bt.2100-pq]
profile-cond=get("video-params/primaries") == "bt.2020" and get("video-params/gamma") == "pq"
profile-restore=copy
target-trc=pq
target-prim=bt.2020
glsl-shader=/shaders/hdr-toys/utils/clip_both.glsl
glsl-shader=
/shaders/hdr-toys/transfer-function/pq_to_l.glsl
glsl-shader=/shaders/hdr-toys/transfer-function/l_to_linear.glsl
glsl-shader=
/shaders/hdr-toys/utils/chroma_correction.glsl
glsl-shader=/shaders/hdr-toys/tone-mapping/dynamic.glsl
glsl-shader=
/shaders/hdr-toys/gamut-mapping/matrix.glsl
glsl-shader=~~/shaders/hdr-toys/transfer-function/linear_to_bt1886.glsl
#set glsl-shader-opts L_sdr=500
#glsl-shader-opts sigma=.10

Using latest code and hdr-toys-helper.lua

Please let me know if you need more info.

BTW, I watched "Puss in Boots The Last Wish" and "Mario Bros" on my JVC RS3100 (110 nits on screen) last night and the results were amazing!!!

Just tried the 06/28 build, issue is still present.

@wlb123git
Copy link

作者你好,我发现画面场景黑暗部分跳变过快,则动态映射会造成画面亮度明显变化
在madvr的sdr映射上也同样能观察到画面闪烁,这是一个小片段,扫灰的时候,左边手指这亮度变化明显

使用的是tone-mapping/dynamic.glsl,更换成bt2390或其他则不会
The Exorcist (3).zip

hello toys' developer! I found is there's some dark scenes changes fast, the daynamic tone mapping will make the brightness fluctuating too. When use madvr to sdr tone mapping, this clip would also show up fluctuation.

I used dynamic.glsl, but if use others shaders this wouldn't show up.

@natural-harmonia-gropius
Copy link
Owner Author

刷子的金属反光亮度跳动很厉害,对这种片源换bt2390画面总体没什么太大问题的话,应该是最好的解决办法

@natural-harmonia-gropius natural-harmonia-gropius changed the title Reduce flickering Improve metering Feb 15, 2024
@geextahslex
Copy link

Wouldn't it be possible to implement a lookahead function like it is used in music programs? He could lookahead 30s-60s so he would already know which scene is coming next and be prepared instead of making noticeable adjustments on the fly.
This would solve this issue for good

@natural-harmonia-gropius
Copy link
Owner Author

I can only observe the present and record a limited past, not the future.

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

No branches or pull requests

6 participants