Log in

View Full Version : Bug in Overlay + YV12 sources


Didée
25th February 2004, 23:08
Hello.

After wondering why a certain script produced output with misaligned color planes, I finally found "Overlay()" to be the culprit. (It was the very last item I suspected...)

Play around with the following script, it's very easy to see.

AnySource(MySource)

# ConvertToYV12() # if needed, to show the bug

# converttoyuy2() # for comparison. this will work correctly.

before = last
quirky = Overlay( last, last, opacity=0.5) # opacity's value doesn't matter at all
Overlay( last, last, opacity=0.5)
Overlay( last, last, opacity=0.5)
Overlay( last, last, opacity=0.5)
Overlay( last, last, opacity=0.5)
Overlay( last, last, opacity=0.5)
Overlay( last, last, opacity=0.5)
Overlay( last, last, opacity=0.5)
Overlay( last, last, opacity=0.5)
test_simple = Overlay( before.UtoY(), quirky.UtoY(),mode="difference")
test_8fold = Overlay( before.VtoY(), last.VtoY(), mode="difference")

return test_simple #.coloryuv(autogain=true) # You probably won't
return test_8fold #.coloryuv(autogain=true) # even need the enhancement

# Masked operations behave similar
Made a report on SourceForge's AviSynth bug tracker, too.


BTW, it's not the "difference" mode. You can also try MaskTools's "YV12subtract()" to show the shift.


- Didée

mf
25th February 2004, 23:45
Yeah, though I didn't use my brain when I encountered it (I'm getting used to chroma getting trashed at random), and simply followed it with Greyscale(), I had a color shift too. Just remove the final greyscale at the end of CoronaEdgeMask and see the crappiness. Both clips are 100% greyscale but the output is colored.

sh0dan
26th February 2004, 09:46
Thanks for the report - an off by one bug (again). Chroma was moved one pixel to the left on each overlay. Not intended, of course.

This will be fixed in the next CVS binary.

BlindWanderer
27th February 2004, 12:04
i wasn't sure if this was an issue but if you use any of the resizes in yv12 and resize it down to not a multiple of 8 you get shifting, but no warnings.

mf
27th February 2004, 13:50
Originally posted by sh0dan
Thanks for the report - an off by one bug (again). Chroma was moved one pixel to the left on each overlay. Not intended, of course.

This will be fixed in the next CVS binary.
And about the creating chroma from scratch (meaning color from greyscale) ? I can't imagine that having to do with a shift.

sh0dan
27th February 2004, 18:07
@mf: I don't understand your problem. Please elaborate - or give a simple(!) example to show it.

mf
27th February 2004, 23:32
Edit: hold on.

Can't reproduce. Sorry! :( Must've been memory corruption from too many refreshes without restarting vdubmod at the time.