Log in

View Full Version : Levels problem


Si
15th September 2003, 22:30
I was checking a sample video that had Y levels of 0 - 255 so I tried to adjust this using Levels(0,1,255,16,235) but I got strange results from ColorYUV(analyse=true).

If I use Levels(0,1,255,0,255) I get Y values from 16 to 235.

Bug? (or me :confused: - I'm 15-all this month)

regards
Simon

Wilbert
15th September 2003, 22:45
No it's made that way, it's automatically scaled to [16,235] if you do nothing.

Si
15th September 2003, 22:51
No - I don't think thats quite right :(

I could sort of go for it in the case of Levels() but not Levels(0,1,255,xxx,yyy) - I'd expect (nay demand ;) ) that I'd get Y values from xxx to yyy if the original range was 0-255.

regards
Simon

stickboy
15th September 2003, 23:23
Originally posted by siwalters
I could sort of go for it in the case of Levels() but not Levels(0,1,255,xxx,yyy) - I'd expect (nay demand ;) ) that I'd get Y values from xxx to yyy if the original range was 0-255.Since when can you call Levels with no arguments (and why would you want to)?

Si
15th September 2003, 23:53
@stickboy
I think we're drifting away from the point here :)

I was trying to be polite to Wilbert :)

Do you think/expect that Levels(0,1,255,16,235) would give a Y range of 16-235 if the input range was 0-255?

regards
Simon

sh0dan
16th September 2003, 09:07
If you do a levels(0,1.0,255,0,255) your material is not scaled, but all your material is capped within CCIR 601 range. Using this is the same as using limiter().

There could be made a coring = true/false, defaulting to true.

BTW, Tweak also does coring (at least in the C-code).

Kurosu
16th September 2003, 09:32
Originally posted by sh0dan
There could be made a coring = true/false, defaulting to true.
Definetely. I had to modify levels in order to properly process planes as masks - having 16/235 instead of 0/255 is quite troublesome.

sh0dan
16th September 2003, 09:51
Implemented. Levels and Tweak now has optional coring. Tweak actually had inconsistent coring between YUY2 and YV12.

None of the other parameters have changed. It still needs to be tested, but I'll probably get around to that! ;)

Si
16th September 2003, 19:33
Thanks [EDIT] And you were right Wilbert:) [/EDIT}

Simon

yaz
17th September 2003, 10:06
Originally posted by sh0dan
If you do a levels(0,1.0,255,0,255) your material is not scaled, but all your material is capped within CCIR 601 range ... Tweak also does coring (at least in the C-code).
yeah ... the problems i'd mentioned months ago :-/
Originally posted by sh0dan
Implemented. Levels and Tweak now has optional coring
which version do u mean ? i've just checked v1209 & no word about it.
in add., docs says :
- tweak; yuy2 only
- levels; works prop in rgb only ("I don't know how to do it properly in YUY2")
so ... how's it goin'? :-)

the bests
y

sh0dan
17th September 2003, 10:30
Please - the post is from sept. 16th - do you expect it to be in a binary from sept. 12th?

I have tested it, and it seem to work nicely. Sept 17th binary available.

yaz
17th September 2003, 11:59
@sh0dan:
sorry ... no blame on u! just a (too) short drop in. i admire your never-exhausting energy on keeping everything at best. thx for all your efforts. really.
the bests
y
ps. i'll fecth the new fix

jorel
17th September 2003, 12:48
[QUOTE]Originally posted by yaz
[B]@sh0dan:
i admire your never-exhausting energy on keeping everything at best.
thx for all your efforts. really.
the bests


i see and feel the same!
great as always.
:)

Si
17th September 2003, 16:44
Just tried the following using the 17thSep release


DirectShowSource("D:\Download\sample.mpeg",fps=25)
Levels(0, 1, 255, 0, 255,coring=false)
ColorYUV(analyze=true)


And it still gives me Y range of 16-235.
If I comment out the Levels line, I get Y range 0-255.

(mis)setting coring to true makes no difference.

regards
Simon