PDA

View Full Version : Bug in ConvertTo YV12<->YUY2???


tedkunich
23rd June 2004, 16:48
I'm doing a bunch of LD captures to DVD and noticed an odd behavior that to me, is a bug in Avisynth (v2.54), or it could be that I'm clueless.... :)

I noticed this when I turned on the histogram function. As my caps originated in TV color space and are destined for TV color space, what I'm seeing confuses me: If I show the histogram on the unconverted clip, I see that the luma ranges are within the TV limits, but as soon as there is any conversion to YV12 the limits get expanded, i.e. PC color space. I have found that adding adding Levels(0, 1, 255, 0, 255) to my script, which as far as I can tell should have no effect, the luma is again correctly diplayed in the TV color space range in the histogram. Is this a bug, or am I just confused????

Thanks,

T


This is an example of the script that I'm using (on the other PC, so not a cut and paste, sorry)

clip1=avisource("AVI source")
clip2=avisource("AVI source2")

clip1 + clip2

# Histogram() <<- Histogram displays the proper Luma ranges

ConvertToYV12(interlaced=false)

# Histogram() <<- Histogram displays incorrect Luma ranges

Levels(0, 1, 255, 0, 255)

Histogram() <<- Histogram now displays the proper Luma ranges

Wilbert
23rd June 2004, 17:24
For clarity

clip1 + clip2
# Histogram() <<- Histogram displays the proper Luma ranges
You meant a luma range of [16,235] right?

And you are saying that

clip1 + clip2
ConvertToYV12(interlaced=false)
# Histogram()
gives [0,255] ?

tedkunich
23rd June 2004, 20:40
Originally posted by Wilbert
For clarity

You meant a luma range of [16,235] right?

And you are saying that

gives [0,255] ?

Correct, Looking at the raw AVI, the Luma range is within the [16,235] borders of the histogram, once converted to YV12, the Luma range is the full width of the histogram, presumably [0,255]. Does the behavior of the histogram differ between YUY2 and YV12 color space?

Does this site have a picture poster? I can post a before and after clip, but I have no hosting capabilites.

trevlac
23rd June 2004, 22:07
I would be very surprized if the convert makes such a change. The clasic mode histo shows the luma ranges. So a 4:2:0<->4:2:2 conversion would not even touch the luma.

IIRC, The clasic mode histo is actually a waveform monitor. It looks like it shows different info for YV12 vs YUY2, with regard to color. The Luma should be the same. The YV12 does have green bars on the sides which I don't think are on the YUY2 type.

Anyway, If you are talking luma ... I think there is a 0% chance there is a problem with the conversion. Are you talking U&V?

You might be able to use the functions that swap planes to test.

tedkunich
24th June 2004, 09:14
OK, I'm an idiot.... The histogram is slightly different between the YUY2 and YV12 color spaces..... I was comparing apples to oranges....

Thanks


T