View Full Version : Port of MPlayer Yadif deinterlace filter (C-Plugin)
canTsTop
25th August 2009, 22:13
opt=0 - 23.09 fps
opt=1 - 22.80 fps
opt=2 - 23.12 fps
opt=3 - 23.01 fps
version 0.9 - 27.70 fps
Fizick
25th August 2009, 23:18
try v1.6 (blind fix, I do not have such CPU around)
canTsTop
26th August 2009, 11:12
It works, with version 1.6 i get 28.53 fps
Thank You
burfadel
26th August 2009, 11:53
I keep getting directed to this page:
http://ifastnet.com/notify/2.php
When trying to get to http://avisynth.org.ru
Is it just temporarily down? I'd love to try out v1.6!
AVIL
26th August 2009, 15:26
Hi,
I've download the plugin without problems. Could be malware.
burfadel
26th August 2009, 17:03
I just tried again and it worked! I think the site might have been down for a short while thats all :) I was probably a little impatient to try it since I was about to start an encode! Its great to see Fizick ported those changes over, I was waiting for someone to do that ever since the changes showed in the ffdshow changelog. An earlier YADIF discussion in another thread about this didn't lead anyway (well I guess it possibly did...), but I didn't know anything had been done about it as this thread got lost in amongst the new post threads!
@Fizick :)
Just wondering whether you could update your first post and the thread title? Thanks!
If you change it to reflect the new version number and SSE2/SSSE3 inclusion etc it should grab a few more peoples attention!
Thanks for the updates, its much appreciated by everyone! (and more once they realise they exist ;))
Fizick
26th August 2009, 18:01
i do not see any reason to change first post or title. history must be preserved.
But I updated my site news.
SSE2 gain is no so big.
SSSE3 gain is not visible (only one instruction is used really).
It is possible to port my SSE2 bug fix back to ffdshow, but seems developers waiting for H.Yamagata :)
http://forum.doom9.org/showthread.php?p=1314061#post1314061
and maybe it is a time to implement some Tritical's suggestions to improve yadif quality without speed decreasing.
Mr VacBob
30th August 2009, 07:21
Rather than ffdshow, it would be nice to port them back to mplayer and then to ffdshow from there. That way the original filter has all the optimizations and a Michael review.
Fizick
30th August 2009, 19:10
Mr VacBob,
if you need it, try contact Michael. But he was not very excited by first (no my) suggestion ;)
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2008-November/058981.html
Atak_Snajpera
30th August 2009, 20:24
Yadif in ffdshow is multithreaded but avisynth plugin is still single threaded. Any reason why?
Fizick
30th August 2009, 21:41
several reasons
Atak_Snajpera
30th August 2009, 22:04
Too bad. Yadif MT would a major leap in performance. :(
Fizick
31st August 2009, 00:21
it should perfectly work with MT filter with small overlap.
So why reinvent the wheel
burfadel
31st August 2009, 03:31
Just for info, YADIF works perfectly fine on mine with SetMTmode (1,4) (4 = quad core), with SetMTmode (1,x) being the fastest MT mode (where x should be equal to system cores/parallel threads). If you have to use a SetMTmode of 3 or higher then its not really beneficial, unless its:
Source...()
SetMTMode(1,4)
Filter...()
Filter2...()
SetMTMode(3,4)
Filter3...()
SetMTMode(1,4)
Filter4...()
Where Filter3...() requires SetMTmode(3) for stability.
BigDid
31st August 2009, 20:20
several reasons
it should perfectly work with MT filter with small overlap...
Hi,
I have tried MT() with overlap of 4 or 8: MT("""yadif(movie,1)""",2,8); not working,
error message being something like "Invalid arguments to function "MT"..."
I am no avisynth expert so I may be missing something, but if confirmed, I would appreciate to have the possibility to use MT().
:thanks:
Did
Adub
31st August 2009, 20:53
Have out tried using named parameters? Like MT("""blah""",overlap=8)?
buzzqw
31st August 2009, 21:07
any possibility to make a yadif a standard plugin and not a loadCplugin ?
(yes, i know, silly request)
BHH
Gavino
31st August 2009, 21:20
I have tried MT() with overlap of 4 or 8: MT("""yadif(movie,1)""",2,8); not working,
error message being something like "invalid arguments to MT..."
The filter string passed to MT should not include a clip.
Do it this way:
MT(movie, """yadif(1)""",2,8)
or
movie.MT("""yadif(1)""",2,8)
Fizick
31st August 2009, 21:57
Yes, such possibility exists. You should port GCC inline ASM macros to inline VC, MASM or NASM, and make appropriate interface changes.
BigDid
31st August 2009, 22:54
The filter string passed to MT should not include a clip.
Do it this way:
MT(movie, """yadif(1)""",2,8)
or
movie.MT("""yadif(1)""",2,8)
Hi,
Both ways are working. Also tried with overlap=4, seems/* to be working. Thanks.
* not at home, so no good source or PC to test...
Did
vlada
19th September 2009, 00:42
Hi, I tried to use Yadif. But in VirtualDub I only get black video and this message in status bar:
Avisynth read error: CAVIStreamSynth: System exception - Illegal instruction at 0x1bf277d
If I remove Yadif from the script, everything works fine. Do you have any idea what might be wrong?
Fizick
19th September 2009, 06:31
http://avisynth.org/mediawiki/Troubleshooting#Reporting_bugs_.2F_Asking_for_help
~Revolution~
21st September 2009, 05:01
I have this material that is semi-interlaced 25fps PAL progressive material. Do I just do Yadif(mode=1,order=1).ChangeFPS(25) with multiple trim functions in the parts that there is interlacing present?Also because I saw no field-blending in the source I didn't use srestore() instead of ChangeFPS(25).
Gavino
21st September 2009, 09:27
Do I just do Yadif(mode=1,order=1).ChangeFPS(25) with multiple trim functions in the parts that there is interlacing present?
Use Yadif(mode=0, order=1) without the need for ChangeFPS.
If you have a lot of sections, you might find it easier to use ApplyRange (http://avisynth.org/mediawiki/ApplyRange) or ReplaceFramesSimple (http://avisynth.org/stickboy/RemapFrames.zip) instead of multiple trims.
~Revolution~
22nd September 2009, 00:46
Use Yadif(mode=0, order=1) without the need for ChangeFPS.
If you have a lot of sections, you might find it easier to use ApplyRange (http://avisynth.org/mediawiki/ApplyRange) or ReplaceFramesSimple (http://avisynth.org/stickboy/RemapFrames.zip) instead of multiple trims.
I read the readme for ReplaceFramesSimple but I don't quite understand how to use it :confused: I'm still sort of a n00b but not a total n00b :). Thanks for your help :)
~Revolution~
22nd September 2009, 18:08
Plz help ^ :thanks:
Gavino
22nd September 2009, 19:49
You should
a) be more patient
b) try using "Search", I recall a number of examples posted fairly recently.
Anyway, the idea is you apply Yadif once to the whole clip and then select from that the frames you need to replace in the original. Example:
...
deint = Yadif(mode=0, order=1)
ReplaceFramesSimple(deint, mappings="[100 200] [400 600]")
would replace frames 100-200 and 400-600 with the corresponding deinterlaced frames.
~Revolution~
23rd September 2009, 17:46
I'm sorry fo being a bit impatient :o . On the other hand your example makes perfect sense. :thanks: :)
vlada
23rd September 2009, 18:46
Hi, I tried to use Yadif. But in VirtualDub I only get black video and this message in status bar:
Avisynth read error: CAVIStreamSynth: System exception - Illegal instruction at 0x1bf277d
If I remove Yadif from the script, everything works fine. Do you have any idea what might be wrong?
Here are some more details: Avisynth 2.58, Yadif 1.6, any resolution, YV12 colorspace, VD 1.8.6, but I get the same error in MPC-HC too.
A sample script that causes the error:
LoadCPlugin("E:\yadif\yadif.dll")
Version()
ConvertToYV12()
Yadif()
The address at the end of the error message (0x1bf277d) is changing.
Fizick
24th September 2009, 19:04
vlada, what is your CPU?
Try different "opt" options.
vlada
24th September 2009, 22:15
My CPU is a P4. I'll try it tomorrow, thanks for the advice.
vlada
7th October 2009, 11:50
My CPU is a P4. I'll try it tomorrow, thanks for the advice.
Yes, changing opt to 0, 1 or 2 solves the problem. It seems that the auto detection of SSE instructions availability is incorrect. Is this a trivial bug or would it be difficult to fix it?
I need the filter to work on as many computer types as possible with the same script. Would using "opt = 0" be a good temporal solution or would it be to slow? What about forgetting about anything below P4 and using "opt = 2"? Would it be a better choice?
Fizick
7th October 2009, 17:26
vlada, the bug with autodetecting of SSSE3 must be fixed.
Please provide your result (first screen screen) of CPUZ http://www.cpuid.com/cpuz.php
Can anybody confirm P4 bug?
tritical
7th October 2009, 19:05
Fizick, do you use env->GetCPUFlags() function to detect SSSE3? If so, there is a bug in avisynth 2.5.8 (and maybe earlier 2.5.x releases, I don't know off hand when ssse3 check was added) in detection of SSSE3/SSE4.1/SSE4.2. The bit checking from return of cpuid is off by one bit. It will sometimes result in false positives. IanB fixed it in late June, but no official 2.5 branch releases have been made incorporating it. The latest 2.6 branch release should be ok. I ended up adding code to my filter to do the check so that it would work with older versions.
Fizick
7th October 2009, 21:18
I know about error in env->GetCPUFlags(), and I use my home-made addition to it in Yadif :)
But probably it has own bug :(
vlada, try new v1.7
vlada
8th October 2009, 16:29
1.7 works for me. Thanks a lot for the quick fix, Fizick.
zyrill
22nd November 2009, 23:17
as soon as I load yadif, either explicitly with LoadCplugin("yadif.dll") or implicitly with Yadif() i get the attached output.
btw: I run Win7pro 64bit - maybe that's the problem? The 64bit? Avisynth version is 2.58 and yadif version is 1.7.
oddball
16th July 2010, 05:58
I am trying to use Yadif in realtime playback using ffdshow and notice that with both the internal Yadif and external plugin using the fastest mode (I set it to yadif()) I get bits of detail dropped out of things like fine lines. It makes fine lines look like they have been drawn with a pencil rather than a pen if you know what I mean?
I tried a couple of different modes but they made things look uglier or were just too slow for my E6600 OC'd to keep up with on a 1280x720 upscale setting using ffdshow resizer. At present I have not really found a satisfactory way to upscale and deinterlace DVD's in realtime. The closest I have found is the internal median deinterlace as it seems to interfere the least with progressive frames.
I guess I need a more powerful CPU/GPU combo.
burfadel
7th December 2010, 16:58
I see SSE2 and SSSE3 optimisation updates have just been committed in ffmpeg, any chance of them being utilised in the avisynth version?
http://git.ffmpeg.org/?p=ffmpeg;a=commitdiff;h=9a4c5a77ee7455da186b5a8e0fcffe120cf213d0
I don't know what relevance these other changes have:
http://git.ffmpeg.org/?p=ffmpeg;a=commitdiff;h=4fbe76287af32212aa17209c9c459743fac4ccf5
http://git.ffmpeg.org/?p=ffmpeg;a=commitdiff;h=9adb3db27d6ec3245ae651859fc972ae6478b5e0
http://git.ffmpeg.org/?p=ffmpeg;a=commitdiff;h=ee61e6e26d502e053e000679a1661be0fd43d958
Of course, the avisynth version of FFdshow revision 2352 YADIF would be nice too (multithreading) :)
I think a multithreaded YADIF with the updated SSE2/SSSE3 optimsations etc would be nice when working with 1080i video!
IanB
7th December 2010, 22:01
as soon as I load yadif, either explicitly with LoadCplugin("yadif.dll") or implicitly with Yadif() i get the attached output.
btw: I run Win7pro 64bit - maybe that's the problem? The 64bit? Avisynth version is 2.58 and yadif version is 1.7.
The output display has the rows skewed. This is a bug in the player you are using, where the width is incorrectly assumed to be some multiple of some power of 2, usually 16.
Unfortunately the image you posted has been cropped and resized after skewing, which makes reversing the skew to see the error text very difficult.
Anyway part of the error text is :-
"Script error: there is no function named Yadif"
"avs, line 3)"
the rest is to badly scrambled to read.
Use VirtualDub when debugging script errors, it correctly works with all width output and has an Avisynth Error handler that will display the error text in a message box.
Fizick
9th December 2010, 21:35
burfadel, ffmeg SSE2 and SSSE3 optimisation is same as already used in ffdshow and (besides multithreading) in Avisynth yadif.
I am not sure, that ffmeg yadif has same bug (regression) as older ffdshow
http://sourceforge.net/tracker/?func=detail&aid=2836414&group_id=173941&atid=867362
what is the macro for xmm in ffmpeg?
PSHUF(MM"3", MM"2")
burfadel
10th December 2010, 03:10
I did see it was very similar, but not quite exact, which is why I thought there were some refinements... maybe its just like you said, they used an older implementation, with the differences being the things that were refined and used in FFDshow
NoX1911
18th May 2011, 20:14
Edit: Resolved. Read my next post.
Hallo,
the picture shows two consecutive frames created with yadif 1.7, avisynth 2.6 (25Jan2011). The chrominance channel is off by one frame in normal modes and alternates (chrom +1, -1) in double-frame modes. Depending on TFF/BFF the chrominance channel is off by -1 or +1 but never +0.
Source video is HuffYUV/YV12 (FFmpeg variant/FFDShow).
Any ideas what's wrong?
LoadCPlugin("yadif.dll")
AviSource("capture.avi")
AssumeTFF
Yadif(mode=1, order=1)
http://www.abload.de/thumb/untitled-1mqlh.jpg (http://www.abload.de/img/untitled-1mqlh.jpg)
Didée
18th May 2011, 20:44
The capture is 704x480? But you seem to be a PAL user, hence I would suppose the)capture to be 7xx*576. See those combing artifacts all over the place? Those should not be there in the first place.
So, most probably your raw capture is already faulty. Try replacing "Yadif(..)" with a simple "bob()". If the result shows a problem, then the capture is bad.
Please describe your setup. How did you capture the video, and what video standard is actually used by the Xbox?
NoX1911
18th May 2011, 21:00
Looks like its not Yadif related at all, other deinterlacers create the same temporal chrominance offset as well. Its something else. Never mind, sorry.
The video is PAL60. Everything's fine there (720x480+PAL chrom).
Edit: It was a color conversion fault. Adding pixel_type="YUY2" (for AviSource) fixed the problem.
cweb
24th August 2011, 10:51
Hi, I tried to use Yadif. But in VirtualDub I only get black video and this message in status bar:
Avisynth read error: CAVIStreamSynth: System exception - Illegal instruction at 0x1bf277d
If I remove Yadif from the script, everything works fine. Do you have any idea what might be wrong?
Experimenting a bit, I found that specifying the 64 bit yadif's path
Loadcplugin("c:\apps\avisynth2\plugins 64\yadif.dll")
meant that it loads successfully.
You have to place the path for your 64 bit plugins of course.
cweb
27th April 2012, 12:16
I noticed that Yadif won't load using the latest beta 2.6 avisynth (32 bit). I was wondering if it's something others have experienced...
NoX1911
6th September 2012, 04:58
You have to load it explicitly with 'Loadcplugin'. Works for me (32Bit, Avisynth v2.60 25.May.2011).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.