View Single Post
Old 15th April 2005, 13:58   #14  |  Link
trevlac
budala
 
Join Date: Oct 2003
Location: U.S.
Posts: 545
Re: YES YES YES!

Quote:
Originally posted by khmann
I very much want to "fakeconverttorgb()" so that I can use virtualdub RGB plugin "deshaker" to stabilize my NTSC DV footage without any colorspace conversions or luma/chroma range clipping (my Canon Optura Xi outputs a wider range than 16-235)

should be fairly easy to script with something like 'pointresize' to upconvert chroma to fit 4:4:4, but I have not yet done it. please post your success!
Hello

I'm not sure what deshaker does on the inside .... but I'm sure it tries to figure things out based upon the pixel values. If you give it screwy values ... i can't see how it would work.

On color space conversions ....

Blah blah blah ... color space conversions are bad ... don't do em .... blah blah blah .....

This is a real crock. There is zero change to luma on a conversion between YCbCr and RGB if you don't change the range. This is because the standard coefficients add to 1. And any decent process gets it right. There are many DV codecs that output RGB in 16-235 range. As I mentioned.

In addition .... if you start with crappy color YCbCr 4:2:0 or 4:1:1 and go to 4:4:4 RGB, the MAXIMUM color change is miniscule. This is because the RGB color space has 4 times the depth of (4:4:4) YCbCr . There may well be changes introduced by the up sample down sample (4:2:0 -> 4:4:4 -> 4:2:0) .... but what you are talking about does not get around that problem. The problem Dimwitted is addressing is that a crappy codec is not doing a decent job at exactly this. Point sample is exactly what it is doing .....


--------------------

@Dimwitted

Having said all of that ....

I put together a quick filter that stuffs YUY2 into RGB24. You gotta get it to YUY2. YUY2inRGB(clip, true/flase). The true/false option does a simple average to come up with the missing UVs.

In case this is not clear ...

YUYVYUYV -> YUVYUVYUV
11113333 -> 1112xx333

The xx UV are U1+U3/2 and V1+V3/2

http://trevlac.us/YUY2inRGB.zip

Sorry ... I couldn't test it because I can't install avs on my work machine. I included the source. You gotta get it back to a usable colorspace/packaging. Which sounds like what you are doing.

PS: If you want code comments ... let me know. I just didn't want to do that typing if you didn't really care.

[edit]
Also, In case it was not clear. I want you to do the YV12 to YUY2 conversion ... because this is an area you are trying to address and I did not want to 'get in the way'. I'm sure there are lots of ways to do this with avs as is being pointed out. I guess you might have wanted some sort of YV12 in a packed format. But YV12 is planar so I really don't know what that would look like.

Last edited by trevlac; 15th April 2005 at 14:10.
trevlac is offline   Reply With Quote