Log in

View Full Version : Help with levels (Please)?!?


oo_void
18th August 2004, 18:44
Okay, I'm getting to the point of desperation ... After many months of trial and error; I finally have a script (http://www.badassgeek.com/files/starwars_disc-1.avs) (comments welcome) that takes an immensely crappy, 4:3 source, the 'Star Wars Definitive Edition Laser Disc', and outputs an amazing 16:9 image ready for encoding an anamorphic DVD.

My problem though lies in the levels, after countless test burns using CCE as the encoder, I just can’t seem to get it right. Using the process outlined I’ve outlined in this thread (http://forum.doom9.org/showthread.php?s=&threadid=80020), my correction routine looks as follows –

chroma_u_input = UtoY()
chroma_u_fixed = YLevels(chroma_u_input, 14, 1, 251, 16 , 240)
chroma_v_input = VtoY()
chroma_v_fixed = YLevels(chroma_v_input, 16, 1, 239, 16 , 240)
chroma_y_fixed = YLevels(15, 1, 255, 16, 235)
YtoUV(chroma_u_fixed, chroma_v_fixed)
MergeLuma(chroma_y_fixed)

The color and saturation look great; it’s just that the image is much too bright when the resulting DVD is viewed on an NTSC monitor… About 20% too bright based on correction I have to make to the NTSC monitor to get it to look right. Sure, I can toy with the brightness levels within the script, but then I’d just be sliding everything in the luma channel down and loosing the whites (correct?). Any recommendations? Here are a few sample images …

Frame 4500 (Source) (http://www.badassgeek.com/files/starwars_disc-1_4500-source.png)
Frame 4500 (Processed) (http://www.badassgeek.com/files/starwars_disc-1_4500.png)

Frame 5100 (Source) (http://www.badassgeek.com/files/starwars_disc-1_5100-source.png)
Frame 5100 (Processed) (http://www.badassgeek.com/files/starwars_disc-1_5100.png)

Frame 8200 (Source) (http://www.badassgeek.com/files/starwars_disc-1_8200-source.png)
Frame 8200 (Processed) (http://www.badassgeek.com/files/starwars_disc-1_8200.png)

Frame 9195 (Source) (http://www.badassgeek.com/files/starwars_disc-1_9195-source.png)
Frame 9195 (Processed) (http://www.badassgeek.com/files/starwars_disc-1_9195.png)

edit: Corrected the aspect ratio of the output samples (Virtual Dub was set to 1:1).

Additionally, you'll notice that I'm using Didee's YLevels instead of the built in AviSynth Levels() command. If you look at the curved bulkhead in the lower right hand portion of the screen, it looks a little washed out in the source. Levels() didn't fix it (nor some playing in Photoshop), but YLevels seems to restore the it showing more of a curve as seen in the processed file. Additionally, the detail (http://www.badassgeek.com/files/ylevels.png) within the black bars under R2's head seems to be restored with YLevels() and not with a standard Levels() function.

------
oo_void

jorel
18th August 2004, 23:20
sorry but i see different from you:
1 : the pictures from the source no seems 4:3...
2 : the resulting is too green
3 : the resulting is ~20% darken then source(you wrote the reverse?)
4 : the result is anamorphic(egg head-too tall)...r2d2 seems an egg!
5 : don't need to see the script...
...you have to change "everything".....you turning something cool in something bad! .....sorry but true! :o

oo_void
18th August 2004, 23:48
Originally posted by jorel
sorry but i see different from you:
1 : the pictures from the source no seems 4:3...
2 : the resulting is too green
3 : the resulting is ~20% darken then source(you wrote the reverse?)
4 : the result is anamorphic(egg head-too tall)...r2d2 seems an egg!
5 : don't need to see the script...
...you have to change "everything".....you turning something cool in something bad! .....sorry but true! :o

1. The caps from VirtualDub are off... I forget to make sure the aspect ratio was set correctly when I saved the PNG's. I'll try and update them, but it still doesn't effect the levels issue.

2. It is a little green (looking at it in photoshop especially), but seems to compensate for the red push most NTSC monitor exhibit. I'd only want to start tweaking that once I figured out what the proper luma levels are though.

3. Yes, the processed version is darker than the source (captured via the Canopus Codec BTW), but it's still way too light when viewed on an NTSC screen. My well calibrated NTCS monitor is set to a brightness of 38, I have to turn it down to 30 for the encoded DVD to start looking right, thus the ~20% number.

4. I want anamorphic!

------
oo_void

oo_void
19th August 2004, 02:17
I think I have it... it's one of those 'doh!' type revelations. It turns out that those mis-cropped images I originally posted offered a clue.

My problem all along is that ColorYUV(analyze = true) has been showing values way below the expected range after applying YLevels(15, 1, 255, 16, 235) I'd get values like 3 and 4, way below 16 which is what I would expect. My crop, because it had to be MOD4, had one line of the letterbox frame at the bottom and one to the left.

My revelation/theory is that the black letterbox frame is below IRE compatible values and something along the input chain decided, "hey, your black is all off some I'm going to compensate" knocking everything way out of whack. Adding 16 to my Ylevels, resulting in YLevels(31, 1, 255, 16, 235), seems to look much better (but what am I now losing?). Extending my crop in a bit more for purposes of analysis now shows a good legal range, a minimum that doesn't go below 16.

The question is, does anyone have any insight as to what might be this mystery compensation? Is it the DV cam, or maybe Edius and the Canopus DV codec? I'm dreading having to recapture :mad:

------
oo_void