Thanks guys!
In the end, I used
Code:
SmoothLevels(input_low=24, input_high=229, output_low=16, output_high=235)
I realized I should still output 16-235 for YUV, and that the luma had been over-compressed ( I was getting 24 for solid black in ColorYUV). At least I think this is what is happening. I wonder if the 229 should have been 227, since pitch black was off by 8. 235-227=8. But it doesn't seem to make any huge difference.
I had been using AvsPmod's %YUV luma showing in the bar, and for some reason it showed blacks too high, and whites too low. I went with ColorYUV() and used the loose min/max values and it seems to be correct.
After using the Smoothlevels() code,
Avisynth histogram showed pitch black as 16 ( the first black frame of the video) while the brightest scenes hit 255 max in the histogram. So, I guess it's good now?
Should I do anything with the colors since I stretched the luma?