Skip to content

Commit

Permalink
Update README and example
Browse files Browse the repository at this point in the history
  • Loading branch information
erazortt committed Feb 10, 2024
1 parent e375f47 commit 22ae1a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,18 @@ The following arguments control the tonemapping function:
- `kneeOffset` is a parameter of the tonemapping function, which governs the size of the region where the tonemapping function is flattened (see figure below). The mathematical validity range is [0.5, 2.0]. In the report BT.2408 this value is fixed at 0.5, which leads to very low contrast in the high range favoring max brightness. Here the default value used is 0.75 which should be a better compromise overall, especially when using dynamic tonemapping.
- `normalizeOutput` normalizes the output from [`targetMinNits`, `targetMaxNits`] to the full range. This can be usefull when the output is just an intermediate result which is further processed, since the usage of the full value range decreases rounding errors down the line. Default is `false`.

This example applies a dynamic tonemapping to a 1000nits target reading the current max brightness value off the frame properties which are set by DoViBaker. The luminosity scale used is 1.0. In order to increase the perceived total brightness, this factor can be increased to 1.5 or 2.0 or even higher.
This example applies a dynamic tonemapping to a 1000nits target while reading the current max and min brightness values off the frame properties which are set by DoViBaker. The luminosity scale is not given thus the default of 1.0 is used. In order to increase the perceived total brightness, this factor can be increased to 1.5 or 2.0 or even higher.
```
DoViBaker(bl,el)
DoViTonemap(lumScale=1.0, masterMaxNits=-1, targetMaxNits=1000, masterMinNits=0, targetMinNits=0)
DoViTonemap(targetMaxNits=1000, targetMinNits=0)
```

This is the functional form of the tonemapping function with the following parameters: masterMaxNits=10000, targetMaxNits=1000, masterMinNits=0, targetMinNits=0.1, lumscale=1.
If your source is just PQ and doesn't have a DolbyVision stream, there are two options:
- use static tonemapping by explicitly defining `masterMaxNits` and `masterMinNits` to `DoViTonemap`
- analyse the source using `StatsFileCreator.avs` and provide the created files to `DoViStatsFileLoader` for a dynamic tonemapping with `DoViTonemap`

![Tonemapping function](EETF.png "Tonemapping function")
Above shown is the functional form of the tonemapping function with the following parameters: masterMaxNits=10000, targetMaxNits=1000, masterMinNits=0, targetMinNits=0.1, lumscale=1.
## Frame Properties
The following frame properties will be consumed, if the related arguments are set to -1:
- `_dovi_dynamic_max_pq` the max_pq value of the current scene
Expand Down
2 changes: 1 addition & 1 deletion scripts/example.avs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bl=bl.z_ConvertFormat(chromaloc_op="top_left=>top_left",width=bl.Width()/2,heigh
#the el clip does not need downsizing since its usually already at that size

DoViBaker(bl,el)
DoViTonemap(masterMaxNits=-1, masterMinNits=0, targetMaxNits=1000, targetMinNits=0, lumScale=1.0).AVSCube("PQ2HLG.cube")
DoViTonemap(targetMaxNits=1000, targetMinNits=0).AVSCube("PQ2HLG.cube")
z_ConvertFormat(chromaloc_op="center=>top_left",pixel_type="YUV420P16",colorspace_op="rgb:std-b67:2020:full=>2020ncl:std-b67:2020:limited",dither_type="none",resample_filter="spline36",resample_filter_uv="spline36")

ScriptClip("""
Expand Down

0 comments on commit 22ae1a5

Please sign in to comment.