| Printable Version of Topic
Click here to view this topic in its original format |
| Unofficial VirtualDub Support Forums > Codec Discussion > Sampling In Vdub's Dv Decoder (pal) |
| Posted by: Wilbert Aug 28 2005, 12:53 PM |
| @Avery, I've a question about your dv decoder and its sampling, in particular PAL DV YV12 -> YUY2. How is the sampling done? I created a post about how i think upsampling (and subsampling) should be done. This is not the same as your decoder is doing: http://forum.doom9.org/showthread.php?p=700231#post700231 As shown by an example in that thread (the results for the VDub decoder is exactly the same as Cedocida's decoder). I'd like to know which one is correct |
| Posted by: phaeron Aug 28 2005, 08:16 PM | ||
VirtualDub's rules for interpolating DV 4:2:0 to 4:2:2:
Note that if VirtualDub did support 4:2:2 to DV 4:2:0 conversion, it would thus use a rule of (3*V1 + V3)/4 instead of (2*V1 + V3)/3, avoiding having to change the interpolation rule. It's a bit strange that VirtualDub and Cedocida would produce exactly the same output. You're sure that VirtualDub's DV codec was active? (Check File > File Information.) Do you have a sample clip available for testing? Also, I don't get the same "correct result" as you do when interpolating the source data. Here's what I get:
U39 is present in both the source and output test data, but is different (37 vs. 38). That seems like an error...? When I tested the MSDV codec, I found that it output PAL data as two bob-deinterlaced frames — seeking in Windows Media Player produced the first field, quickly followed by the second. That makes it hard to compare to other decoders. |
| Posted by: Wilbert Aug 28 2005, 09:04 PM | ||||||||
I guess i should have used a calculator
Oops, you're right test file (yuy2): http://www.geocities.com/wilbertdijkhof/DumpU.zip
I used the following avs filter to create the test file (thanks to neuron2 http://www.geocities.com/wilbertdijkhof/Sample_Wilbert.zip I encoded dumpU.avi to DV with Cedocida (DV sampling), and the resulting output is given in that doom9 thread.
I'm not sure what you mean here. Are you only talking about the chroma, or also about the luma? |
| Posted by: phaeron Aug 29 2005, 12:42 AM | ||||||
No, not currently. The fastest way is to edit the Drivers32 key in the registry, renaming the entries for the existing DV codecs. You only need to restart VirtualDub after doing this.
Both — it looks like you get a field-based display. |
| Posted by: Wilbert Aug 29 2005, 10:02 PM |
| Ok, i tried it again. I opened the dv in VDub 1.6.10, under file info it says "Internal DV decoder". When i recompress it to huffyuv (yuy2) (this way the YV12->YUY2 conversion is done by VDub right?) and request the U samples from the huffyuv clip, i get the same values as the Cedocida's (and not the ones you posted). |
| Posted by: phaeron Aug 30 2005, 04:22 AM | ||||
Here's what I'm seeing in the decoder:
Interpolating this gives:
...which I believe is what you got. Given that the Cedocida decoder looks nothing like mine, but you're getting identical results out of both decoders, I'm inclined to think that your DV file doesn't contain the Cb values you think it does. By the way, as for why the Panasonic DV results are whacked: it's because the colors you are encoding are waaaay out of the RGB gamut and are being clamped badly. The first pixel is Y=200, Cr=16, Cb=16, which converts to a green of 349/255. |
| Posted by: Wilbert Aug 31 2005, 09:00 AM | ||||
Yes, this turned out to be right. I should have checked this before wasting your time with it. Sorry
That's what i suspected, but i didn't bother to recalculate it. Y=200, U=V=16 => R=35, G=255, B=0 => Y=154, U=48, V=49. The correct value should be U=49. Seems close enough |