PDA

View Full Version : yv12 to yuy2 chroma upsampling (top and bottom line pairs)


squid_80
29th March 2006, 09:11
(I get the feeling that this has been discussed before but I can't find the thread.)

I'm looking at the progressive yv12->yuy2 routines from avisynth 2.5.6 (isse_yv12_to_yuy2, from convert\convert_yv12.cpp to be specific) and I can understand why it copies chroma values (instead of interpolating) for the top and bottom lines. But it also copies chroma for the lines at top+1 and bottom-1 - why aren't these values interpolated, like the table at http://www.avisynth.org/Sampling would seem to indicate?

Edit: link fixed. The table I'm talking about is just above the "2.4 References" heading.

henryho_hk
31st March 2006, 03:24
Interpolated with ... blackness?

squid_80
31st March 2006, 04:08
This is why I made a point to say progressive yv12... Only the lines on the top and bottom can't be interpolated (because they only have a sample in one direction and not the other), the lines at top+1 and bottom-1 have chroma samples in both directions. I was hoping sh0dan or IanB would be able to give me answer (also why interlaced yv12->yuy2 copies chroma for 8 lines, when it should only be necessary to do it for 4 lines). The tables in the link are meant to describe how avisynth performs the upsampling, but the code simply doesn't match.

IanB
31st March 2006, 05:15
Yes I think you are right. It is early Sh0dan 2.5.0 code. In 2.6 we are changing the way this works to use the resizer core and YV16 <-> YUY2 to do this more correctly and efficiently, so I can't get to excited about this soon to be retired code. You have CVS access fix it if it really annoys you.

squid_80
31st March 2006, 05:40
It's not that it annoys me (the difference is practically invisible to the eye), just that I was asked to do a 64-bit translation and found it easier and faster to pair processing of the lines situated between two chroma samples, rather than how the existing code does it. Copying chroma for only the top and bottom lines makes this much more convenient.