quietvoid / dovi_tool

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

Support for L10 and L11 metadata for XML generation #85

Closed quietvoid closed 2 years ago

quietvoid commented 2 years ago

If anyone is interested in this, I'm missing XML file samples that contain L10 or L11 metadata.

saindriches commented 2 years ago

Doing some guesswork about this, found something makes the color primaries related blocks (L9 L10) a bit complex to generate. L10 depends on custom target display, which is a normal TargetDisplay node with ID other than pre-defined IDs. Since it appears in 5.1.0 (5.0.0 actually, which is a beta version), ApplicationType is also present. Encoder only generates trim blocks of HOME type targets. Still finding more rules with verifier. L11 metadata does not appear before XML version 5.1.0, and it should be like this:

              ......
            </DVGlobalData>
            <Level11 level="11">
              <ContentType>arg1</ContentType>
              <IntendedWhitePoint>arg2</IntendedWhitePoint>
            </Level11>
            <Level 254 level="254">
              ......

arg1 [0-4] arg2 [0-15]

It's together with L254. No other big difference between 5.1.0 and 4.0.2, but we need check XML version with number to handle more versions correctly. I'm doing a naive implementation, will make a draft pr later.

quietvoid commented 2 years ago

I've not yet bothered with versions from the XML but we should probably be using the L254 from it, as long as DM version stays 2.

quietvoid commented 2 years ago

L10 is now generated from target displays in the XML. Gonna add L11 now.

quietvoid commented 2 years ago

We're still not able to do a comparison with the XML for L11, so still unclear whether it's correct.