Log in

View Full Version : Levels command - any way to work in 10-bit space?


Lyris
9th December 2017, 01:23
I have some masters in Apple ProRes 4444 (RGB) format, and whoever's prepared them has their understanding of video/PC levels wrong - the black pillarboxes on the left and right of the frame are gray, and even the video generated white text doesn't hit full white.

The target is standard Blu-ray, so 8-bit 4:2:0.

ProRes is 10-bit internally, and I'm using a recent version of the FFMS2 command + AviSynth 2.5 to pipe to x264. My understanding is that using the standard "levels" command - levels(16,1,235, 0,255) will work in 8-bit space, so will throw away precision. Certainly when I run histogram() afterwards, it shows banding, so is unacceptable.

My current workaround is to use Davinci Resolve to correct the levels and write out corrected masters, then encode those as usual, which seems like overkill. With AviSynth, is there any way to decode the 10-bit ProRes master, correct the levels still in 10-bit (or higher?) space, then go down to 8-bit?

:thanks:

raffriff42
9th December 2017, 01:32
Levels in AviSynth+ works at high bit depth, but you need to scale the arguments.
http://avisynth.nl/index.php/Autoscale_parameter

If you Import this script (http://avisynth.nl/images/Utils-r41.avsi) of mine, you can just call LevelsPlus (http://avisynth.nl/index.php/User:Raffriff42/Utils-r41_Quick_Reference#LevelsPlus) with familiar 0-255 arguments

Lyris
9th December 2017, 01:48
Aha! So all it takes in AviSynth+ is to reference 64 and 940 rather than 16 and 235? I'll need to give it a whirl. Thanks!