quietvoid / dovi_tool

dovi_tool is a CLI tool combining multiple utilities for working with Dolby Vision.
MIT License
621 stars 59 forks source link

Missing Level3 in rpu extraction? #198

Closed erazortt closed 1 year ago

erazortt commented 1 year ago

I am not really sure, but I wonder why I have never seen Level3 data in rpus from profile 7 streams. I ask because I'm trying to implement the Level2 trims (stuff in DoviExtMetadataBlockLevel2) where follwing the documentation I would expect to also have offsets for those (DoviExtMetadataBlockLevel3). However, just always taking the default which is to be used in case of missing offsets seems to produce wrong outputs. So I wonder whether the Level3 stuff might perhaps be missing by mistake, especially since all other levels are there in almost all streams I tried.

Example output using info, with all levels being there apart from 3:

"cmv29_metadata": {
  "num_ext_blocks": 5,
  "ext_metadata_blocks": [
    {
      "Level1": {
        "min_pq": 12,
        "max_pq": 2715,
        "avg_pq": 1167
      }
    },
    {
      "Level2": {
        "target_max_pq": 2081,
        "trim_slope": 1991,
        "trim_offset": 2162,
        "trim_power": 1992,
        "trim_chroma_weight": 2121,
        "trim_saturation_gain": 2072,
        "ms_weight": 512
      }
    },
    {
      "Level4": {
        "anchor_pq": 1119,
        "anchor_power": 641
      }
    },
    {
      "Level5": {
        "active_area_left_offset": 0,
        "active_area_right_offset": 0,
        "active_area_top_offset": 0,
        "active_area_bottom_offset": 0
      }
    },
    {
      "Level6": {
        "max_display_mastering_luminance": 4000,
        "min_display_mastering_luminance": 50,
        "max_content_light_level": 1633,
        "max_frame_average_light_level": 114
      }
    }
  ]
}
saindriches commented 1 year ago

Level 3 is part of cmv40_metadata, so it won't appear if the metadata is CM v2.9, which is what most Blu-ray titles use.

quietvoid commented 1 year ago

L3 is not related to L2, either. It's supposed to affect the base L1 values. So if it's not present, there's nothing more to do.