View Full Version : YV12 and interlaced .d2v source
beber75
12th November 2002, 16:50
Hi everybody,
I've read most of the thread concerning YV12 and I found nothing about interlaced source (well not realy nothing, it is discussed in the FAQ (about decom and other filters) saying that we should wait for filters developped for avisynth 2.5).
I'd like to know if some of you have already encode a interlaced source in YV12 and how he managed to deinterlace it.
PS: I usualy use decomb.dll for deinterlacing but if I read the FAQ it shouldn't work with avisynth 2.5 so did someone know an equivalent plugin.
PS2: sorry for my bad english
PS3: sorry if my question is stupid :)
Wilbert
12th November 2002, 17:08
Your question is not stupid, but you should have more patience. Donald is working on Decomb_YV12 (TomsMoComp_YV12 has no high priority for Tom). It could be done next week, maybe in a few days, who knows ...
trbarry
12th November 2002, 21:40
TomsMoComp_YV12 has no high priority for Tom
Wilbert -
Sorry, a few days. I work on things in fits and starts and I have some other things going on. But not long.
But you may be confusing it with GreedyHMA. That was the one I said was lower priority and harder to do.
edit: Okay guys, I decided I feel guilty. :devil: I'll have TomsMoComp out tonight or tomorrow.
- Tom
cult
12th November 2002, 23:19
Thats great news!!!Thank u Tom!
errr how about unfilter?
TheUnforgiven
13th November 2002, 02:18
Okay guys, I decided I feel guilty. I'll have TomsMoComp out tonight or tomorrow.
wow good news. this will make me switch to yv12 much sooner
ookzDVD
13th November 2002, 03:53
@Forum,
how about IVTC, is there plugin working @YV12 now ?
trbarry
13th November 2002, 05:59
errr how about unfilter?
I guess I'll do UnFilter next, just because it's easier than SimpleResize.
It turned out I'd stupidly deleted some of my previously made TomsMoComp changes, but I've reconstructed everything and am testing now. More soon.
- Tom
trbarry
13th November 2002, 08:00
With some misgivings (and limitations) I just put out a YV12 test version of TomsMoComp. I replaced the old zip with one that has both the old and new versions, use the one from the Avisynth_2.5_Alpha folder for YV12 testing. See:
www.trbarry.com/Readme_TomsMoComp.txt and
www.trbarry.com/TomsMoComp.zip (source and dll's)
This version does NOT yet support the SearchEffort=-1 parm that does a vertical screen doubling. Sorry, that needs more debugging and is turned off.
You will still have to specify whether your clip is TopFirst. I put in code to automatically pick that up from Avisynth if you specified the TopFirst parm as -1, but that does not seem to work correctly with Avisynth 2.5" and "MPEG2Dec3 0.9x, so I probably did it wrong.
I noticed there is a bug with Avisynth 2.5 and MPEG2DEC3 on the Video Essential Montage, the torture test. It causes strange ghosting and wierd effects when it swithes back from video to film source. But it was a problem even without TomsMoComp, so I released this anyway.
I also put in code to say the output clip was progressive, but forgot to test it. (how do I do this?) So you are maybe better off putting an AssumeFrameBased statement after TomsMoComp.
THIS IS A TEST! IT IS ONLY A TEST! Treat accordingly.
As always I'd like feedback, but probably not until tomorrow since I'm totally burnt after all this. :confused:
Good luck, and good night.
- Tom
Marc FD
13th November 2002, 14:37
tom, please, avoid to say "Avisynth 2.05" and "MPEG2DEC3_YV12".
to avoid confusion, simply say : "Avisynth 2.5" and "MPEG2Dec3 0.9x".
thanks.
BTW,
> I noticed there is a bug with Avisynth 2.05 and MPEG2DEC3_YV12 on the
> Video Essential Montage, the torture test. It causes strange ghosting
> and wierd effects when it swithes back from video to film source. But it
> was a problem even without TomsMoComp, so I released this anyway.
i noticed it a while ago. it's not a MPEG2Dec3 bug, because it happens with XviD too. the problem is in Avisynth internals. i think some planar code is missing in the cache, or something like that. (looks like missed memcpy's for U and V planes for me)
HarryM
13th November 2002, 14:47
Originally posted by trbarry
With some misgivings (and limitations) I just put out a YV12 test version of TomsMoComp. I replaced the old zip with one that has both the old and new versions, use the one from the Avisynth_205_Alpha folder for YV12 testing. - Tom
Very thanks!
Now I have all for YV12!
Practically I need only 3 filters :)
mpeg2-decoding: Mpeg2Dec3_YV12
filtering: Convolution3d_YV12
deinterlacing: TomsMoComp_YV12
I am pleased... :D
hakko504
13th November 2002, 14:57
@trbarry
Would it be possible for you to implement a correct BOB mode in TomsMoComp? Right now you can use it to create a smart bob function, but there are some minor details that isn't right if I do it the way I currently does it.function Bob1(clip clip)
{
Top=clip.TomsMoComp(1,15,1)
Bottom=clip.TomsMoComp(0,15,1)
return Interleave(Top,Bottom)
}
function Bob2(clip clip)
{
double=clip.separatefields.DoubleWeave
return TomsMoComp(1,15,1)
}Assuming (as usual) that the input clip cosists of 1t1b 2t2b etc, then Bob1 will create the sequence 1t1b 1t1b 2t2b 2t2b... where the fields in italics are the ones altered by TomsMoComp. Bob2 on the other hand will create the following sequence: 1t1b 2t1b 2t2b 3t2b which is slightly more like it, the fields appear in the correct order, but this time only the bottoms fields are adjusted. As far as I can tell a true smart bob should create this sequence: 1t1b 2t1b 2t2b 3t2b
Other than that, I just want to say thank you to all involved in AviSynth 2.5a. With a proper deinterlacer available it is finally time to switch completely, as I usually only do quick conversions with source->deinterlace->resize most of the time.
trbarry
13th November 2002, 18:10
Hakko -
I'm not sure I understand your notation, it seems it would be more of a weave than a bob. But I am indeed looking into a version of TomsMoComp that puts out double the frame rate, for all values of SearchEffort.
I think of a bob as something that creates an entire frame from only one field, in any fashion. Is this what you also mean? It wouldn't include sequences like 2t3b???
- Tom
lighty
13th November 2002, 18:22
@trbarry
Well it seems that TomsMoComp YV12 crashes my VirtualDubMod (latest) without any message. It happens both with Avisynth 2.5 alpha 07/11 and 11/11.
So I still haven't had any chance to test it...:(
OK- so it seems that stupid Windoze got to set automatic restore point and while doing it it seems that it had restored old YUY Avisynth dll. Stupid M$ product.
My apologies to you trbarry. I will go testing ASAP!:devil:
hakko504
13th November 2002, 19:15
@trbarry
Yes, a smart-bob routine can be thought of as a double weave followed by a deinterlacing function, but where the deinterlace shifts it's field-priority, so that odd frames are based on top fields and even frames are based on bottom fields (or vice versa, top/even & bottom/odd). Your question made me think one extra time, and you're quite right, what I'm after is this:function Bob3(clip clip)
{
double=clip.Separatefields.Doubleweave
even=double.SelectEven.TomsMoComp(1,15,1)
odd=double.SelectOdd.TomsMoComp(0,15,1)
return Interleave(even,odd)
}
lighty
14th November 2002, 01:59
@trbarry
Well, it seems that any SearchEffort above 0 causes Access violation error.
Avisynth read error: Avisynth: caught an access violation at 0x0101131e, attempting to read from 0x64606167
I am using latest Avisyth alpha 11/11 with VirtualDubMod 1.4.11, mpeg2dec3 0.91.
Script is following
LoadPlugin("C:\PROGRAM FILES\AVISYNTH2\PLUGINS\MPEG2DEC3.DLL")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH2\PLUGINS\TOMSMOCOMP.DLL")
MPEG2Source("D:\Red Dwarf\video_ts\1\11.d2v")
SetMemoryMax(256)
TomsMoComp(1,15,1)
I tried several parameters combination but they all seem to result in the same message in the VirtualDub statusbar. It doesn't crash or anything and one can use search but all I got is black screen.
With SearchEffort set to 0 everything appears to work fine.
Hope this info helps a bit.:confused:
trbarry
14th November 2002, 02:40
Lighty -
Dunno. I did most of my testing with SE=5, didn't test 15.
What kind of processor do you have? I have separate code for 3 types and sometimes something sneaks through that maybe should only be an SSEMMX instruction.
Are you saying the exact same script as above will work if you set SE=0?
And has Anybody managed to make this one work with YV12? Maybe I'm compileing with a different header or uploading the wrong release or something.
- Tom
trbarry
14th November 2002, 02:46
hakko504 -
I think that's pretty much what I was going to implement.
But I'm not sure anymore that SE=15 is the best idea anymore. I think the number of false motion search matches grows over 9 or soo and the it may just use extra CPU time without much benefit. Usually I just tend to use SE=5 these days.
- Tom
MaTTeR
14th November 2002, 03:32
Tom,
I snatched the filter last night as soon as you posted it and was getting the same access violations as well. I tried various MOD-4 & 8 resolutions but no luck. I then reverted back to the YUY2 version and the script ran fine.
I didn't try SE=0 though, tried 5 and 9; both worked with YUY2 filter.
Bulletproof
14th November 2002, 07:27
Access violations here too.
lighty
14th November 2002, 11:43
@trbarry
Yes- that's exactly what I'm saying- this script indeed works with SearchEffort 0 (as a matter of fact it works rather fine but I seem to get some color distortion- I'll get back to you on that one as soon as I can get it all to run with any other setting) but not with any value higher than that.
I have AthlonXP+2000 so I guess SSEMMX shouldn't represent any problem since it supports every feat except P4 SSE2.
A bit of a prob here- eh? :D
trbarry
14th November 2002, 16:08
Well, there should not be any SSE2 currently in TomsMoComp, but something might have sneaked in somewhere and I'm testing on a P4.
But it is probably a mixed version problem. I'll down fresh copies of the current everything, including my own stuff, and test again.
- Tom
trbarry
15th November 2002, 03:36
I spent today in the worst of all worlds. The release version of TomsMoComp would crash but the moment I'd recompile it for debug it would start working so I couldn't find the problem.
I think that is related to the somewhat automatic inlining that VS 6 helpfully does. Anyway I turned that (back) off and TomsMoComp seems to work better now. There are too darn many compiler options and I think the default ones may have changed in Avisynth 2.5. And I don't understand most of them.
But please try www.trbarry.com/TomsMoComp.zip and let me know.
- Tom
CruNcher
15th November 2002, 07:15
No access violations anymore on my P4 SSE2 optimisation would be
indeed a great idear it powered mpeg2dec well :)
lighty
15th November 2002, 12:49
Yup- same here! It works on my AthlonXP without any errors (so far). :D As for speed testing I still have to do those but I will report ASAP.
Thx for the effort trbarry!;)
OK- I tested speed and I experienced speed drop from 26-28fps to 15-16fps. It seems also that when TomsMoComp deinterlace algorithm kicks in fps suddenly drops down to 3-5fps and after it's done processing those frames it gets back to 15-16fps.LoadPlugin("C:\PROGRAM FILES\AVISYNTH2\PLUGINS\MPEG2DEC3.DLL")
LoadPlugin("C:\PROGRAM FILES\AVISYNTH2\PLUGINS\TOMSMOCOMP.DLL")
MPEG2Source("D:\Red Dwarf\video_ts\1\11.d2v")
SetMemoryMax(256)
TomsMoComp(1,5,0)
crop(18,0,688,574)
LanczosResize(608,464)
trbarry
15th November 2002, 15:19
No access violations anymore on my P4 SSE2 optimisation would be indeed a great idear it powered mpeg2dec well
Glad to hear that. :)
Actually I previously wrote at least 3 different versions of TomsMoComp using SSE2. None of them showed any significant performance improvement so I ripped it all back out just to keep things simpler. SSE2 gains an advantage when you can access a lot of 16 byte aligned fields in linear fashion but TomsMoComp is looking at surrounding pixels at offsets of +1,-1, +2, etc so it doesn't seem to help as much.
Of all my Avisynth filters, only SimpleResize has any SSE2 code that really seems to give an advantage. And even there I wrote some code that I eventually removed.
But DVD2AVI and MPEG2DEC gained about 10-20% IIRC.
I think many MMX assembler video filters are limited by the memory bandwidth of accessing all the data, not the calculations that are done on it.
- Tom
hakko504
15th November 2002, 18:54
@Bach
You have a valid point, written the way I have done it in that script will produce some bobbing, and previously I've used this script with good results.function GreedyBob(clip clip, int "Topfirst")
{
Top=clip.GreedyHMA(default(Topfirst,1),0,0,0,0,0,0,0)
Bottom=clip.GreedyHMA(default(1-Topfirst,0),0,0,0,0,0,0,0)
return Interleave(Top,Bottom)
}
video=SegmentedAVISource("mjpeg_capture.avi").ConvertToYuY2() #352x576 PAL captures
GreedyBob(video)
Convolution3D(preset="MovieLQ")
VericalReduceBy2()
But that's the point I'm trying to make: by adding this function into a deinterlacer, a frame/field dependancy can be added to get rid of the bobbing effects, as it is possible to determine where edges and other moving parts are.
EDIT: Forgot C3D
wing1
21st November 2002, 07:53
@trbarry
This version does NOT yet support the SearchEffort=-1 parm that does a vertical screen doubling. Sorry, that needs more debugging and is turned off.
I just switched over to 2.5 and everything are working great, but I missed that vertical screen doubling feature in your filter; I used it on all my scripts. For now I do a convertoyuy2() and converttoyv12(), which defeat the whole purpose of 2.5 :(. Why do i do that? because of undot.dll and Marc FD's asharp.dll :D
Thank you guys for such great filters!
trbarry
21st November 2002, 08:59
Wing1 -
Sorry, I meant to get that part done right away but wrote a completely different filter instead. I'll fix that.
- Tom
wing1
21st November 2002, 17:15
@trbarry
thank you for responding....there is nothing to be sorry about. You are the developer ( free at that! ), and users like me can only request and eagerly await for the releases :D
I tried the -1 option on the 2.5 version, and it works for a few frames and then the pictures split up vertically with scramble video in between.
trbarry
21st November 2002, 18:37
It's funny it gives wierd results. I thought I had turned it off completely for YV12 for now.
- Tom
JohnMK
26th November 2002, 19:06
@ all
Thank you so much for this filter. You've undoubtedly put in a lot of effort to perfect it and I for one am appreciative.
@ trbarry
Don't lose hope with the P4 optimizations; they're certainly appreciated where and when you volunteer to implement them. More and more people are getting P4's. I just bought one in fact, after a 3-year hiatus from all Intel products.
Do you know if it would make any sense whatsoever to implement hyperthreading awareness, or is this something best done at the avisynth level? I don't know if avisynth uses multiple threads or not.
trbarry
27th November 2002, 01:05
Do you know if it would make any sense whatsoever to implement hyperthreading awareness, or is this something best done at the avisynth level? I don't know if avisynth uses multiple threads or not.
For up to 2 processors it's probably best at the Virtualdub level where it is now. I think Vdub uses a separate task for decoding and encoding, which already splits it rather well.
I have a single processor P4 running Windows/Me and know little about this part anyway. So I likely won't be doing it.
- Tom
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.