erazortt / DoViBaker

Bake the DoVi into your clip
GNU General Public License v3.0
44 stars 7 forks source link

Downscaling question #35

Closed Boulder08 closed 3 months ago

Boulder08 commented 3 months ago

Thank you for the wonderful tool, it's becoming very useful 👍

A question regarding downscaling: is it recommended (quality-wise) to use the full sized BL track or are the differences basically negligible if it is downscaled to 1440p or 1080p before baking?

erazortt commented 3 months ago

As long as downscaling it is done properly and at the right time it's perfectly fine to do that. See the example script on how to do that: example.avs

Boulder08 commented 3 months ago

Thanks! And does DoViBaker require YUV input or can I downscale in linear light RGB and use that phase as the intermediate clip for BL?

Boulder08 commented 3 months ago

Also, should the RPU be cropped in case I'm cropping the black borders off prior to downscaling. I'm assuming that needs to be done.

erazortt commented 3 months ago

Thanks! And does DoViBaker require YUV input or can I downscale in linear light RGB and use that phase as the intermediate clip for BL?

The idea behind DoViBaker is to process the data exactly like a DolbyVision capable TV would process it. Thus it also expects the same input that the RPU data was supposed to have as input. This means that the input format must not be changed prior to feeding it to DoViBaker. With the notable exception being bitdepth: you can change the bitdepth prior to DoViBaker, and BL and EL can even have different bit depths. Usually the input data is indeed going to be "YUV", which to be more exact is actually called YCrBr. So, if you want to downscale your BL in linear light, then do that, but be sure to convert it back to whatever format the BL was previously before feeding it to DoViBake, while it can be of up to 16 bits, instead of 10 bits.

Also, should the RPU be cropped in case I'm cropping the black borders off prior to downscaling. I'm assuming that needs to be done.

DoViBaker does not make use of the Level5 data, since that is useless for what DoViBaker is supposed to do. Thus, yes, you can crop your BL (and EL accrodingly!) prior to calling DoViBaker, and you do not need to do anything at all to the RPU.

quietvoid commented 3 months ago

It shouldn't be recommended to alter the inputs prior to DoviBaker. The BL and EL are meant to be processed at their native resolutions.

You can do what you want afterwards.

erazortt commented 3 months ago

It shouldn't be recommended to alter the inputs prior to DoviBaker. The BL and EL are meant to be processed at their native resolutions.

While this is true in principle, I think that downsacling the BL to the EL size should be fine. Especially since in normal operation the EL is internally upscaled from 1080p to 4K prior to applying it to the BL. So, downsizing the BL to the 1080p size of the EL before DoViBaker should not introduce any issues, since then the internal upscaling of the EL is just getting skipped. Or what am I missing?

quietvoid commented 3 months ago

It probably doesn't matter in the end, just different from expected processing by real players.

Boulder08 commented 3 months ago

Is there a specific reason why there is the "same or quarter" rule between the frame sizes if there is upscaling done anyway? I just tested to downscale the BL to 1440p but that won't work.

erazortt commented 3 months ago

Is there a specific reason why there is the "same or quarter" rule between the frame sizes if there is upscaling done anyway? I just tested to downscale the BL to 1440p but that won't work.

Yes, the reason is that Dolby spells out exactly how to upscale the EL. And that upscaling is only defined for 1080p to 4K. The only other possibilities given by Dolby is that EL is already of the 4K size, or that BL is of the 1080p size, in which case no upscaling is done of course.

So, if you correctly scale the BL down to 1080p I don't see what could possibly go wrong. Thats however basically a "hack" to the specifications, since these actually expect you to leave the BL and EL both unaltered. Which is why @quietvoid's interjection is valid. And especially all other up or down scalings are just not supported since these are not expected by the specifications.

So if you want any other size than I would follow @quietvoid's advice and leave the sizes unchanged before DoViBaker and do whatever you want afterwards.

Boulder08 commented 3 months ago

Fair enough, thank you both. Fortunately I am a "quality first" person so in this case it's easy to choose to bake first and downscale later.