Log in

View Full Version : deinterlace - smooth and colorspace


hellfred
30th April 2004, 09:21
Hi there,
I hope i ended up in the right forum for asking questions about Virtual Dub filtering an colorspace.
I am using VirtualDubMod and AviSynth for some months now and have read through some guids in doom9 and other places on the net. But i could not find an answere to this while searching this forum and the net via google.

In short: Does deinterlace - smooth automatically confert to RGB32. How to stop this?

In long:

I have a small problem when processing material captured with my analog capture card (for feeding it to e.g. Helix producer). I can not determine the colorspace of my material after preprocessing it with AviSynth and VDub (and wethere there were unwanted colorspace-transformations or not) for sure when i compress the prepared (deinterlaced, smoothed, resized) material with Huffyuv.
This is what i do:
Capture with VirtualVCR in yuy2 and using PicMJPEG codec.
(VirtualDub and AviSynth indicate YUY2)

Open the file with AviSynth script Arjuna10.avs:
--------------------------------------------
anime = AviSource ("Arjuna10.avi")
anime=Convolution3d (anime,preset="animeLQ")
anime = separatefields (anime)

return anime
--------------------------------------------

This i a preperation for the use of deinterlace - smooth (by Gunnar Thalin) in VDubMod.
In VDubMod i do this filtering:

--------------------------------------------
Deinterlace Smooth (with defaults)
null transform: cropping left 9 right 8 ->703
top 79 bottum 75 -> 422
resize: 640x384 With Lanczos3 or Precisebicubic(A=-0.75)
---------------------------------------------

Audio is just streamcopyed,
Video is full compression mode. Compressor is Huffyuv v.2.1.1

The output video's colorspace is examined in several ways:

VDubMod: File -> Avi Information
BSPlayer v1.0 -> Movie Info -> Surface type xxx
mplayer.exe file -v -> ... VDec: vo confing request - 640 X 384 <preferred csp: xxx>
AviSynth script ColorTest.avs in conjunction with VDubMod File -> Avi Information

AviSource("D:\Filme\Arjuna10\A10_unkomp_huff.avi")

ColorTest.avs is just opening the video with AviSynth to force VDobMod not just to show the Avi Information, e.g.:
-------------------------------
FourCC codec: [HFYU]
Huff Lossless Codec YUV and RGB
-------------------------------
But hopefully the real colorspace, e.g.:
-------------------------------
TestColorsace.avs:
VDub -> File -> Avi Information
FourCC codec:
[YUY2] YUV 4:2:2 as for UYVY but with different
-------------------------------


Now lets start the analysis:
Huffyuv configration:
YUY2 compression method: Predict median(best)
RGB compression method: Predict Gradient (best)
All the other options are unchecked

I end up with a file that seems to be encoded in RGB32.

A10_unkomp_huff.avi
VDub -> File -> Avi Information
FourCC codec: [HFYU]
Huff Lossless Codec YUV and RGB
-> no info

ColorTest.avs:
VDub -> File -> Avi Information
FourCC codec:[] Unknown
Decompressor: Uncompressed RGB32

BSPlayer:
Surface type RGB32

mplayer.exe -v:
VDec: vo confing request - 640 X 384 <preferred csp: RGB 32-bit>

So this is RGB32, but when did the colorspace confversion happen and how can i stop it?

Just opening the Arjuna10.avs VDubMod and BSPlayer report YUY2.

Can deinterlace - smooth only operate in RGB32?

I can force the output of Huffyuv to yuy2 by using this settings:
YUY2 compression method: Predict median(best)
RGB compression method: <--Convert to YuY2
All the other options are unchecked

mplayer.exe -v:
VDec: vo confing request - 640 X 384 <preferred csp: 422P>

TestColorsace.avs:
VDub -> File -> Avi Information
FourCC codec:
[YUY2] YUV 4:2:2 as for UYVY but with different

But i fear i thn have a yuy2->rgb->yuy2 conversion with even bigger loss.

Any hints what is going on, how to use IsYUY2(), which filter might tricker the colorspace conversion?

As alternative to Huffyuv v2.1.1 i have tested ffdshows huffyuv for encoding, but i always ended with a color shift. Forcing yuy2 input made the dubing impossible.

Hellfred

Kika
30th April 2004, 10:48
Well, all VirtualDub-Filters are working in RGB32. This is normal and can't be changed.

hellfred
30th April 2004, 11:17
And why did i type the whole essay up there, then? :mad: :D
OK, then i have to use the AviSynth port of smooth-deinterlace, which gives me a hard time sometimes, though.

BTW:
I did not find this information anywhere on http://www.virtualdub.org/.
Where are good places to learn more about VDub(Mod) tips and hacks?

Hellfred

scharfis_brain
30th April 2004, 11:47
why do you use smoothdeinterlace?

try using dgbob, or better kernelbob.

kernelbob is an AVISynth function, that gives bobbing abilities to kerneldeint140.dll:

function kernelbob(clip a, int "th",bool "mask")
{ mask=default(mask,false)
th=default(th,5)
ord = getparity(a) ? 1 : 0
f=a.kerneldeint(order=ord, sharp=true, twoway=false, threshold=th,map=mask)
e=a.separatefields.trim(1,0).weave.kerneldeint(order=1-ord, sharp=true, twoway=false, threshold=th,map=mask)
interleave(f,e).assumeframebased
}

hellfred
30th April 2004, 11:56
Originally posted by scharfis_brain
why do you use smoothdeinterlace?

try using dgbob, or better kernelbob.

kernelbob is an AVISynth function, that gives bobbing abilities to kerneldeint140.dll:

function kernelbob(clip a, int "th",bool "mask")
{ mask=default(mask,false)
th=default(th,5)
ord = getparity(a) ? 1 : 0
f=a.kerneldeint(order=ord, sharp=true, twoway=false, threshold=th,map=mask)
e=a.separatefields.trim(1,0).weave.kerneldeint(order=1-ord, sharp=true, twoway=false, threshold=th,map=mask)
interleave(f,e).assumeframebased
}

I will try kernelbob (if i figure out how it works).
I have tested smoothdeinterlacer, dgbob and TomsMoComp on very noisy material from my capture card, and smoothdeinterlace gave me subjectivly the best quality (it helped cleaning the material). This i s why i use it. As i have a strong computer i do not mind the double output rate.

Hellfred