Log in

View Full Version : Port of MPlayer Yadif deinterlace filter (C-Plugin)


Pages : 1 2 [3] 4

foxyshadis
9th August 2007, 05:21
I don't think that would work properly in all cases, though for the most part it would, because order and field should normally be the same. (And normally, there's no need to specify either.) yadif is good enough that it might not create artifacts either way, though.

Razorholt
9th August 2007, 05:29
Gotcha! Thanks a lot foxyshadis.

salehin
14th August 2007, 17:10
Using DGIndex I get the folllowing info (cf. attahced image). [Please ignore th fps. I ran the the preview only for a few seconds.]

In MeGUI, using the analyse option from script editor, i get the following deinterlacing option (i've added the full script below).

# deblocking, LSF, soothe
# Set DAR in encoder to 37 : 20. The following line is for automatic signalling
global MeGUI_darx = 37
global MeGUI_dary = 20
DGDecode_mpeg2source("G:\Temp\Elements of Dynamic Optimization 1080i.ts",cpu=4)

edeintted = last.AssumeBFF().SeparateFields().SelectEven().EEDI2(field=-1)
TDeint(order=0,full=false,edeint=edeintted)

crop( 2, 0, -2, -10)

dull = last.Spline36Resize(1280,720)
sharp = dull.LimitedSharpenFaster(dest_x=1280,dest_y=720,Strength=80)
Soothe(sharp,dull,40)

Can you please advise me what code should use to employ Yadif if this specific source.

Thanks a lot :)

foxyshadis
14th August 2007, 18:51
Swap

edeintted = last.AssumeBFF().SeparateFields().SelectEven().EEDI2(field=-1)
TDeint(order=0,full=false,edeint=edeintted)

with

Yadif()

and it should work fine.

Atak_Snajpera
15th August 2007, 00:39
I would say Yadif(order=0)

Boulder
15th August 2007, 03:38
No need for that, MPEG2Source will already set the field order flag.

juhu
22nd August 2007, 12:13
Hi.
I switched from tdeint to yadif as a bobber, to transcode stuff with mrestore (v2) in order to speed up things a bit.
although it worked fine, RAM occupation constantly increases during the whole encoding and is really gigantic after some time

ie a simple
yadif(mode=1).mrestore()
applied on a ntsc ->pal transcoded vob culminates with 1.7 GB of ram occupation for a 110mn film
as I don't have a fixed size swap file and didn't do anything else during encoding, there was no crash, but still, I assume there's something wrong there?

as far as I can tell, I didn't notice similar behavior with
tdeint(mode=1).mrestore()
so I tend to think it's a problem on yadif side

Fizick
22nd August 2007, 15:49
juhu,
it is important, I will inverstigate it.
but can you provide some simpler (without mrestore) script with memory leakage?

Fizick
28th August 2007, 16:19
juhu,
it it not yadif fault.
Bob() gives same memory leakage (about 1000 bytes per frame) here, please post report to mrestore or other thread.

salehin
7th September 2007, 00:33
Swap

edeintted = last.AssumeBFF().SeparateFields().SelectEven().EEDI2(field=-1)
TDeint(order=0,full=false,edeint=edeintted)

with

Yadif()

and it should work fine.

Tried but I'm getting two different errors:

1. When LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll") is not added (, which I suspect is not required), I get the following error:
Script Error: there is no function named "Yadif"

2. If I add the loadplugin(...) line, then I get an error with some junk symbols and it direct towards the loadplugin(...) line of the avs script

I dropped the yadif.dll file into my plugins folder under AviSynth directory. I am using MeGUI 0.2.6.1005 and AsiSynth 2.5.7. I suspect I am missing something. Can anyone please advise

Thanks :)

Atak_Snajpera
7th September 2007, 00:48
LoadCPlugin() not LoadPlugin()!

salehin
7th September 2007, 11:16
LoadCPlugin() not LoadPlugin()!

Thanks a lot, Atak_Snajpera. It's working now :)

zdark
20th September 2007, 06:23
Thanks for plug, I solved my problem with enterlaced!!!

DVD - Show Yanni 2006 :P

BeNooL
22nd September 2007, 14:43
anyone wanna port this to ffdshow ?

scharfis_brain
22nd September 2007, 16:57
no need to!
just use the avisynth section of ffdshow!

Fizick
22nd September 2007, 19:41
BeNooL,
I do not know anybody working on the porting, so you may do it. ;)

Delerue
23rd September 2007, 19:48
no need to!
just use the avisynth section of ffdshow!

Yeah! I confirm this. Works perfectly.

bauerhorscht
18th December 2007, 23:24
Hi!

I want to use Yadif with FFDShow and libmpeg2 for watching live satellite TV and recorded mpeg2 stuff also.

Using the following three lines I get a very nice picture:

LoadCPlugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
AssumeTFF()
Yadif (mode=1,order=-1)

BUT after a while or particularly after entering and leaving the OSD of DVBViewer (my TV app), I MAY get a scrumbled picture, i.e. all movements start to jitter terribly combined with horizontal und vertical tearing. To stop this I need to switch to the next channel and then back.

Is there a mistake in my script?

Thanks a lot!
Bauerhorscht

Fizick
19th December 2007, 20:13
Your script is correct.
But error may be related not to yadif.
Please do same test with some other deinterlacer, for example TomsMoComp

bauerhorscht
20th December 2007, 01:39
You're right. It's the same with other deinterlacers. I tried Dscaler's Greedy 2 Frame and after half an hour jittering started.

Any idea what to do?

scharfis_brain
20th December 2007, 01:42
replace assumetff() with assumebff()

IanB
20th December 2007, 02:29
I take this is not regular Avisynth. FFmpeg internal scripting ?? or ...

You are probably running close to the wind CPU wise, and when you fall behind you overrun the video capture buffers and things fall apart from there.

Fizick
20th December 2007, 06:38
If it is not related to Yadif and Avisynth, probably it is problem with ffdshow or DVBViewer or your channel. Try ask in other (correspondent) thread

bauerhorscht
20th December 2007, 23:14
IanB, yes it's FFDShow internal scipting. Anyhow, you made me try the MT plugin (I got an X2 4000+) and I haven't had jittering now for a while.

But it seems, the picture is split horizontally (for being processed by the two threads?) and it isn't reassembled properly. Not very bad, but sometimes one can see the split.

It's the following script I use now:
LoadCPlugin("C:\Program Files\AviSynth 2.5\plugins\yadif.dll")
AssumeTFF()
MT("Yadif (mode=1,order=-1)",2)

And jittering still may start after leavin the OSD AND as I haven't mentioned, after switching from fullscreen to window mode and vice versa.

@scharfis: assumebff() causes immediate jittering.

@Fizick: It obviously occurs on every channel. Still gotta try without DVBViewer.

IanB
21st December 2007, 01:32
... it isn't reassembled properly. Not very bad, but sometimes one can see the splitTry either overlap=2 or splitvertical=true, either should fix the problem, one may be faster than the other.

overlap int = 0
- number of pixel to add at the top and bottom border or left and right border. Increase this if you see artifacts where the frame is split.

splitvertical bool = false
- if true the frame are cut vertical(and the filter is allowed to change the height) else it is cut horizontal(and the filter is allowed to change the width).

Delerue
21st December 2007, 07:11
Try either overlap=2 or splitvertical=true, either should fix the problem, one may be faster than the other.

Weird... The script that bauerhorscht uses doesn't seem to fuction always here. There's a intermittent bug that makes the usage difficult. The error reports that 'AssumeTFF' has invalid arguments. I pasted exactly this on the FFDShow Avisynth tab:


LoadCplugin("C:\Arquivos de programas\AviSynth\plugins\yadif.dll")
AssumeTFF()
MT("Yadif (mode=1,order=-1)",2)


Also, I don't get the idea of the 'overlap=2' and 'splitvertical bool = false' commands. Where do I have to put it exactly?

I'm using FFDShow 1703 from _xxl, MPC last build from clsid with MT 0.7, and I can make Mvtools works in dual-thread, for example.

Thanks

talen9
21st December 2007, 11:04
You could try to use a different version of FFDshow ... where "different" could mean even a less recent (and, maybe, more stable) version , if you're using any "tryout" or beta version.

IanB
21st December 2007, 11:34
Also, I don't get the idea of the 'overlap=2' and 'splitvertical bool = false' commands. Where do I have to put it exactly?There is documentation that comes with the MT pluggin, you could always try reading it. RTFM!

Each thread process half plus 2 extra lines to avoid boundary problems with some filters....
MT("Yadif (mode=1,order=-1)",2, overlap=2)
Split the work into left and right halves instead of top and bottom halves....
MT("Yadif (mode=1,order=-1)",2, splitvertical=false)

Delerue
21st December 2007, 13:46
You could try to use a different version of FFDshow ... where "different" could mean even a less recent (and, maybe, more stable) version , if you're using any "tryout" or beta version.

I already tried three different versions. :(

There is documentation that comes with the MT pluggin, you could always try reading it. RTFM!

Well, I read the first page of the MT thread, and I don't get it. You know, I always think that we need examples of all the commands. Also, I already used the commands you told me right now, but I got script errors. That's why I'm asking you. Thanks a lot, man. I'll check deeper.

vcmohan
22nd December 2007, 04:24
unable to access the plugin for download

Delerue
22nd December 2007, 05:59
unable to access the plugin for download

No problem for me here: http://avisynth.org.ru/yadif/yadif09.zip

vcmohan
23rd December 2007, 03:10
Yes. Now I got it.

Vesi
2nd January 2008, 18:21
DGindex reported my source field order as top and frame rate as 23,976fps

http://maxupload.com/img/5960E6BF.png

Now when i am doing analyse with MeGUI, MeGUI suggest this type of work for me with TIVTC

http://maxupload.com/img/3FE5F257.png
Now I want to use yadif in my rip. Should I cahnge the source type to Interlaced and Deinterlacer yadif? And field order to Top field first?

as I am new to this filter i will do reading on this for sure, and I have bit problems with deinterlacing part, so I need help here. Thanks in advance

Delerue
3rd January 2008, 06:04
IanB, I finally discovered the problem with Yadif + MT. If you use it with FFDShow Avisynth tab, you have to check the 'Add ffdshow video source' option. But, this option crashes MPC if you use a MVTools script. Do you know how to use MVTools scripts without the 'source=ffdshow_source()' line? Or maybe a way to use Yadif without the 'Add ffdshow video source' option; I tried 'MT("Yadif (source,mode=1,order=-1)",2)' without sucess.

I also found that if you use a MVTools script with Yadif at the same time you can uncheck the 'Add ffdshow video source' option, and everything works perfectly (well, besides the CPU death, hehehe). Example:

SetMtmode(1,5)
source=ffdshow_source()
SetMTMode(2)
LoadPlugin("C:\arquivos de programas\avisynth\plugins\mvtools.dll")
backward_vec = source.MVAnalyse(blksize=16, isb = true, pel=2, search=2, idx=1)
forward_vec = source.MVAnalyse(blksize=16, isb = false, pel=2, search=2, idx=1)
source.MVFlowFps(backward_vec, forward_vec, num=2*FramerateNumerator(source), \
den=FramerateDenominator(source), mask=1, idx=1)
distributor()
LoadCplugin("C:\Arquivos de programas\AviSynth\plugins\yadif.dll")
AssumeTFF()
MT("Yadif (mode=1,order=-1)",2)

Thanks
;)

Didée
3rd January 2008, 11:50
@ Delerue: Perhaps try without the distributor() call? >Hint< (http://forum.doom9.org/showthread.php?p=1080974#post1080974)

Delerue
3rd January 2008, 18:32
Didée, I already tried only this, but without sucess:

LoadCplugin("C:\Arquivos de programas\AviSynth\plugins\yadif.dll")
AssumeTFF()
MT("Yadif (mode=1,order=-1)",2)

The 'distributor()' call is there (in the other script) in order to make the MVTools script works.

Thanks anyway.

drunken_clam
22nd July 2008, 09:27
Hi, i'm using Yadif through mplayer/mencoder, i know this thread is avisynth related but maybe the problem also appears there or somebody has an idea what the problem is:

Here is the link to my post in the "PC Hard & Software" section:

http://forum.doom9.org/showthread.php?t=139703

leeperry
30th May 2009, 13:45
hi there,

atm I'm using Yadif(multithreaded on 4 threads) in the Avisynth filter of ffdshow to get double framerate on progressive content(23.976fps@48Hz mostly).

it works amazingly well! talk about perfect Trimension

except that it was really meant for deinterlacing in the first place, so credits look interlaced and blinking...

is there any way you could offer a plain and simple framerate doubler mode? so it doesn't do any deinterlace at all...just interpolate frames(which it does amazingly well :eek: )

thanks!

scharfis_brain
30th May 2009, 15:09
don't cross-post, please:
http://forum.doom9.org/showthread.php?t=147421&

Delerue
30th May 2009, 15:09
hi there,

atm I'm using Yadif(multithreaded on 4 threads) in the Avisynth filter of ffdshow to get double framerate on progressive content(23.976fps@48Hz mostly).

it works amazingly well! talk about perfect Trimension

except that it was really meant for deinterlacing in the first place, so credits look interlaced and blinking...

is there any way you could offer a plain and simple framerate doubler mode? so it doesn't do any deinterlace at all...just interpolate frames(which it does amazingly well :eek: )

thanks!

Try MVTools (http://avisynth.org.ru/mvtools/mvtools2.html) with the following script:


setMTMode(2,6)
source=ffdshow_source()
LoadPlugin("C:\MVTOOLS_PLUGIN_PATH\mvtools2.dll")
super = source.MSuper(pel=1)
backward_vec = MAnalyse(super, blksize=8, overlap=0, dct=1, isb = true, search=2, searchparam=2)
forward_vec = MAnalyse(super, blksize=8, overlap=0, dct=1, isb = false, search=2, searchparam=2)
source.MFlowFps(super, backward_vec, ThSCD1=350, blend=false, forward_vec, num=2*FramerateNumerator(source), \
den=FramerateDenominator(source))
distributor()


You'll have to use it in the FFDShow AviSynth tab and with AviSynth MT (http://forum.doom9.org/showthread.php?t=144852) (in order to have multi-threading). Also, you can play with the number '6' (number of threads) in the first line; here with a dual-core CPU, '3' is the magic number, although you may think that is '2'. Ah! And remember to always have a Buffer after (in the FFDShow) with values at least equal to the number of threads.

Good luck!

leeperry
30th May 2009, 17:17
don't cross-post, please:
http://forum.doom9.org/showthread.php?t=147421&
I didn't crosspost, I'm asking the plugin coder if he could modify it so it'd only do progressive double framerate w/o any combing artifacts.
Try MVTools (http://avisynth.org.ru/mvtools/mvtools2.html) with the following script:
thanks, I'll look into it! hopefully it won't need to me to specify the framerate...I really need something fully automatic that'll do 2X whatever i's 23.976/24/25/29.97/30 :)

scharfis_brain
30th May 2009, 17:25
I really need something fully automatic that'll do 2X whatever i's 23.976/24/25/29.97/30
I think that is shown in the documentation of mvtools.
you just have to double the framerate numerator!

I'm asking the plugin coder if he could modify it so it'd only do progressive double framerate w/o any combing artifacts.
That won't be possible, cause it is not meant to do it. It is a deinterlacer. any deinterlacer will exhibit artifact.
You could even use Selectevery(1,0,0) to double the framerate with the same effect on the motion like yadif.

leeperry
30th May 2009, 19:46
You could even use Selectevery(1,0,0) to double the framerate with the same effect on the motion like yadif.
I just tried, it's not smooth at all..it's constantly hiccuping.

YADIF is actually fast to do double framerate and very smooth, too bad combing/jaggies occur.

I've found out through google that Didée did a 2X framerate script, might give a go at that...I'm quite a fan of his scripts ^^

but I'm afraid all these script would be slower than YADIF :o

scharfis_brain
31st May 2009, 01:52
didée's script most probably is a more complex version of the scripts suggested to you before.

Delerue
31st May 2009, 02:13
thanks, I'll look into it! hopefully it won't need to me to specify the framerate...I really need something fully automatic that'll do 2X whatever i's 23.976/24/25/29.97/30 :)

That's what this line does:

num=2*FramerateNumerator(source)

;)

But bear in mind that this script is REALLY heavy. You won't be able to use it with HD videos, I guarantee. Yadif only recreates half of a frame, but MFlowFPS recreates a new whole frame.

vampiredom
14th June 2009, 10:18
Hi --

I was reading this thread and now I'm a bit confused: Does Yadif() have any known issues when running with SetMTMode(2)?

Sorry if this has been answered already, but I was having trouble finding this exact information through searches.

Thanks.

Fizick
12th August 2009, 20:58
Version 1.1 (06.08.2009)
Added faster SSE2 (and some SSSE3) custom optimization by H.Yamagata from ffdshow-tryout. Compiled with GCC versions above 4.1.
Added a little faster MMX conversion for YUY2 format.
Added planar hacked YUY2 color format (compatible with SSETools by Kassandro).

Version 1.2 (07.08.2009)
A little faster SSEMMX conversion for YUY2 format.

Version 1.3 (12.08.2009)
Added "opt" parameter for manual selecting of CPU optimization.
Fixed bug in SSE2/SSE3 code (from ffdshow), now results should be same as C/iSSE.

Version 1.4 (13.08.2009)
Enabled SSEMMX YUY2 conversion for forced SSE2/SSSE3 opt.

Version 1.5 (16.08.2009)
Fixed detection of SSSE3 (thanks to Shingo Harada for bug report for Athlon).

Please test and post

XhmikosR
12th August 2009, 21:01
Hi. Where can I download the new version? Your site still has v0.9.
Thank you.:)


EDIT:
It seems that by manually changing the link I can download v1.3 (http://avisynth.org.ru/yadif/yadif13.zip).

canTsTop
25th August 2009, 13:06
for my cpu AMD Athlon II X2 250 http://www.cpu-world.com/CPUs/K10/AMD-Athlon%20II%20X2%20250%20-%20ADX250OCK23GQ%20%28ADX250OCGQBOX%29.html

version 0.9 is faster then 1.5

0.9 - 27.41 fps
1.5 - 22.71 fps

avs script:
dss2("atk_sample_0.ts")
Trim(26, 899)
Crop(16, 16, -16, -16)
Yadif(order=1)
BilinearResize(640,480)

Fizick
25th August 2009, 21:36
Please report your results with various "opt" parameter (0,1,2,3).