Skip to content

Commit

Permalink
Use the metadata blocks when generating from HDR10+ or madVR
Browse files Browse the repository at this point in the history
Fixes #91.
  • Loading branch information
quietvoid committed Jan 3, 2022
1 parent 6673e09 commit 7b8af22
Show file tree
Hide file tree
Showing 19 changed files with 1,259 additions and 184 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ The minimum Rust version to build `dovi_tool` is 1.51.0.
* Example: `dovi_tool generate --xml dolbyvision_metadata.xml -o RPU_from_xml.bin`
 
##### From a generic profile 8.1 configuration JSON file
* See documentation: [generator.md](generator.md) or [example](assets/generator_example.json)
* Example: `dovi_tool generate -j assets/generator_example.json -o RPU_generated.bin`
* See documentation: [generator.md](docs/generator.md) or [examples](assets/generator_examples)
* Example: `dovi_tool generate -j assets/generator_examples/default_cmv40.json -o RPU_generated.bin`
 
##### From an existing HDR10+ metadata JSON file
The metadata is generated from a configuration JSON file, and the L1 metadata is derived from HDR10+ metadata.
* The HDR10+ metadata has to contain scene information for proper scene cuts.
* Example: `dovi_tool generate -j assets/generator_example.json --hdr10plus-json hdr10plus_metadata.json -o RPU_from_hdr10plus.bin`
* Example: `dovi_tool generate -j assets/generator_examples/default_cmv40.json --hdr10plus-json hdr10plus_metadata.json -o RPU_from_hdr10plus.bin`
 
##### From a madVR HDR measurement file
The metadata is generated from a configuration JSON file, and the L1 metadata is derived from the madVR measurements.
Supports using custom targets nits from Soulnight's madMeasureHDR Optimizer, with flag `--use-custom-targets`.
* Example: `dovi_tool generate -j assets/generator_example.json --madvr-file madmeasure-output.bin -o RPU_from_madVR.bin`
* Example: `dovi_tool generate -j assets/generator_examples/default_cmv40.json --madvr-file madmeasure-output.bin -o RPU_from_madVR.bin`
 
* #### editor
Allows editing a binary RPU according to a JSON config.
See documentation: [editor.md](editor.md) or [examples](assets/editor_examples).
See documentation: [editor.md](docs/editor.md) or [examples](assets/editor_examples).
All indices start at 0, and are inclusive. For example, using "0-39" edits the first 40 frames.
* Example: `dovi_tool editor -i RPU.bin -j assets/editor_examples/mode.json -o RPU_mode2.bin`
 
Expand Down
42 changes: 0 additions & 42 deletions assets/generator_example.json

This file was deleted.

10 changes: 10 additions & 0 deletions assets/generator_examples/default_cmv29.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"cm_version": "V29",
"length": 10,
"level6": {
"max_display_mastering_luminance": 1000,
"min_display_mastering_luminance": 1,
"max_content_light_level": 1000,
"max_frame_average_light_level": 400
}
}
10 changes: 10 additions & 0 deletions assets/generator_examples/default_cmv40.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"cm_version": "V40",
"length": 10,
"level6": {
"max_display_mastering_luminance": 1000,
"min_display_mastering_luminance": 1,
"max_content_light_level": 1000,
"max_frame_average_light_level": 400
}
}
80 changes: 80 additions & 0 deletions assets/generator_examples/full_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"cm_version": "V40",
"level5": {
"active_area_left_offset": 0,
"active_area_right_offset": 0,
"active_area_top_offset": 40,
"active_area_bottom_offset": 40
},
"level6": {
"max_display_mastering_luminance": 1000,
"min_display_mastering_luminance": 1,
"max_content_light_level": 1000,
"max_frame_average_light_level": 400
},
"default_metadata_blocks": [
{
"Level2": {
"target_max_pq": 3079,
"trim_slope": 2048,
"trim_offset": 2048,
"trim_power": 2048,
"trim_chroma_weight": 2048,
"trim_saturation_gain": 2048,
"ms_weight": 2048
}
},
{
"Level9": {
"source_primary_index": 0
}
},
{
"Level11": {
"content_type": 4,
"whitepoint": 0,
"reference_mode_flag": true
}
}
],
"shots": [
{
"start": 0,
"duration": 10,
"metadata_blocks": [
{
"Level1": {
"min_pq": 2,
"max_pq": 2938,
"avg_pq": 1456
}
},
{
"Level2": {
"target_max_pq": 2851,
"trim_slope": 2048,
"trim_offset": 2048,
"trim_power": 1800,
"trim_chroma_weight": 2048,
"trim_saturation_gain": 2048,
"ms_weight": 2048
}
}
],
"frame_edits": [
{
"edit_offset": 5,
"metadata_blocks": [
{
"Level1": {
"min_pq": 0,
"max_pq": 3079,
"avg_pq": 1229
}
}
]
}
]
}
]
}
110 changes: 110 additions & 0 deletions assets/generator_examples/no_duration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"cm_version": "V40",
"level6": {
"max_display_mastering_luminance": 1000,
"min_display_mastering_luminance": 1,
"max_content_light_level": 1000,
"max_frame_average_light_level": 400
},
"default_metadata_blocks": [
{
"Level1": {
"min_pq": 0,
"max_pq": 123,
"avg_pq": 39
}
},
{
"Level9": {
"source_primary_index": 0
}
}
],
"shots": [
{
"start": 0,
"duration": 0,
"metadata_blocks": [
{
"Level1": {
"min_pq": 0,
"max_pq": 123,
"avg_pq": 39
}
},
{
"Level2": {
"target_max_pq": 2851,
"trim_slope": 2048,
"trim_offset": 2048,
"trim_power": 1800,
"trim_chroma_weight": 2048,
"trim_saturation_gain": 2048,
"ms_weight": 2048
}
}
]
},
{
"start": 0,
"duration": 0,
"metadata_blocks": [
{
"Level2": {
"target_max_pq": 2851,
"trim_slope": 1400,
"trim_offset": 1234,
"trim_power": 1800,
"trim_chroma_weight": 2048,
"trim_saturation_gain": 2048,
"ms_weight": 2048
}
},
{
"Level5": {
"active_area_left_offset": 0,
"active_area_right_offset": 0,
"active_area_top_offset": 276,
"active_area_bottom_offset": 276
}
}
],
"frame_edits": [
{
"edit_offset": 2,
"metadata_blocks": [
{
"Level1": {
"min_pq": 0,
"max_pq": 3079,
"avg_pq": 1229
}
},
{
"Level2": {
"target_max_pq": 2851,
"trim_slope": 1999,
"trim_offset": 1999,
"trim_power": 1999,
"trim_chroma_weight": 2048,
"trim_saturation_gain": 2048,
"ms_weight": 2048
}
},
{
"Level2": {
"target_max_pq": 3079,
"trim_slope": 2048,
"trim_offset": 2048,
"trim_power": 2048,
"trim_chroma_weight": 2048,
"trim_saturation_gain": 2048,
"ms_weight": 2048
}
}
]
}
]
}
]
}
Loading

0 comments on commit 7b8af22

Please sign in to comment.