Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#1 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
Port of MPlayer Yadif deinterlace filter (C-Plugin)
I do not like deinterlace but i try lo learn C-plugin creation again
![]() As an exercise I ported MPlayer Yadif (Yet Another DeInterlacing Filter). http://www.mplayerhq.hu http://guru.multimedia.cx/deinterlacing-filters/ It is well MMX assembler opimized but with GNU GCC inline compiler. Assembler porting is hard task. That is why I use Avisynth C plugin interface and MinGW. But I have an another question. How to create Avisynth C plugins with Microsoft compiler? Generaly it does not produce correct function name avisynth_c_plugin_init@4. MSVC (6,7,8) produces underscored _avisynth_c_plugin_init@4 instead, and it is not possible to use LoadCPlugin command. I use avisynth_c.h file from Avisynth 2.5.7 distrib. The only workaround I found is to use yadif.def file for link: LIBRARY yadif.dll EXPORTS avisynth_c_plugin_init@4=_avisynth_c_plugin_init@4 This way I produce yadif.dll with both _avisynth_c_plugin_init@4 and avisynth_c_plugin_init@4 functions. ![]() Is it the only way (besides hex editing of DLL)?
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. Last edited by Fizick; 5th April 2007 at 19:47. |
![]() |
![]() |
![]() |
#2 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
I found some bug in v0.1 (parity-related).
Released new v0.2 today.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
![]() |
![]() |
![]() |
#3 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
coolies. i'll try this one out over easter. if it's faster/more robust than leakkerneldeint i might just make it my preferred one for fast processing
![]()
__________________
sucking the life out of your videos since 2004 |
![]() |
![]() |
![]() |
#5 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
yes, not all my plugins are slow
![]() But it seems, that all fast of them were originally developed by some other (great) people (like Tom Barry, 'Kassandro', Michael Niedermayer) ![]()
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
![]() |
![]() |
![]() |
#7 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
Yes, I forget about it.
use assumefps ![]()
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
![]() |
![]() |
![]() |
#8 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
Fixed bugs with bob-fps and finally with parity in v0.3
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
![]() |
![]() |
![]() |
#9 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,650
|
hmm this seems to become my preferred filter for quick and dirty conversions.
so far as I could conclude form looking at the results for ióne minute, I think it has the following impementations: - edi-interpolation similar to tomsmocomp - temporal motion masking over 5 fields in temporal - soft motion masking, i.e. no hard thresholding
__________________
Don't forget the 'c'! Don't PM me for technical support, please. |
![]() |
![]() |
![]() |
#10 | Link |
Registered User
Join Date: Dec 2003
Location: MO, US
Posts: 999
|
You're pretty close for only a minute of watching... pseudo code for what it does (Fizick correct me if I'm wrong, I only glanced at the source code):
temporal sequence of pixels (trying to create pixel 'x'): Code:
c h a f k d x i b g l e j int p0 = (c+h)/2; int p1 = f; int p2 = (d+i)/2; int p3 = g; int p4 = (e+j)/2; int tdiff0 = abs(d-i); int tdiff1 = (abs(a-f)+abs(b-g))/2; int tdiff2 = (abs(k-f)+abs(g-l))/2; int diff = max3(tdiff0,tdiff1,tdiff2); int spatial_pred = edi_value; if (mode < 2) { int max = max3(p2-p3,p2-p1,min(p0-p1,p4-p3)); int min = min3(p2-p3,p2-p1,max(p0-p1,p4-p3)); diff = max3(diff,min,-max); } if (spatial_pred > p2 + diff) spatial_pred = p2 + diff; if (spatial_pred < p2 - diff) spatial_pred = p2 - diff; x = spatial_pred; edi_value is determined by: trying to create pixel 'x' from neighboring lines: Code:
a b c d e f g x h i j k l m n int spatial_pred = (d+k)/2; int spatial_score = abs(c-j)+abs(d-k)+abs(e-l); int score = abs(b-k)+abs(c-l)+abs(d-m); if (score < spatial_score) { spatial_pred = (c+l)/2; spatial_score = score; score = abs(a-l)+abs(b-m)+abs(c-n); if (score < spatial_score) { spatial_pred = (b+m)/2; spatial_score = score; } } score = abs(d-i)+abs(e-j)+abs(f-k); if (score < spatial_score) { spatial_pred = (e+j)/2; spatial_score = score; score = abs(e-h)+abs(f-i)+abs(g-j); if (score < spatial_score) { spatial_pred = (f+i)/2; spatial_score = score; } } |
![]() |
![]() |
![]() |
#11 | Link |
interlace this!
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
|
ooh, this is a very sensitive deinterlacer - it'll pick up an interlaced fade in over 200 fields without passing through combs, but it'll also leave static stuff static. it's also more than twice as fast as tdeint and doesn't require vinverse afterward to guard against stray combs.
i might just plop this into my generic standards converter and see what kind of speedup it gives me. [edit] btw, i seem to only be able to load it with Load_Stdcall_plugin, as opposed to loadcplugin. not a big deal, but for a while i was quite confused :|
__________________
sucking the life out of your videos since 2004 |
![]() |
![]() |
![]() |
#12 | Link |
Doom9 Member
Join Date: Sep 2003
Location: Australia
Posts: 210
|
To my eyes this deinterlacer does a very good job, works better than TDeint, faster too. Very simple parameters. Bob mode works well.
scharfi, would you recommend this deinterlacer for quick crop, resize, denoise, reinterlace. I use TDeint for now, simple Bob seems like is blurring too much. LoadCPlugin works for me. Thanks for the plugin Fizick ![]() |
![]() |
![]() |
![]() |
#15 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
Terka,
more reading of doc is required...
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
![]() |
![]() |
![]() |
#16 | Link |
brainless
Join Date: Mar 2003
Location: Germany
Posts: 3,650
|
fizick, could you alter yadif in a way so it has an additional parameter like TDeint's edeint?
so we could use its pretty good motionmasking with kernel or eedi2 interpolation.
__________________
Don't forget the 'c'! Don't PM me for technical support, please. |
![]() |
![]() |
![]() |
#17 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
scharfis_brain,
No. Yadif is yadif. Let's not slowdown it.
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
![]() |
![]() |
![]() |
#19 | Link |
Registered User
Join Date: Sep 2005
Location: Vancouver
Posts: 600
|
Looks like a nice deinterlacer, but the order=-1 setting is still using the wrong parity with v0.3 for me, and like Mug Funky said it will only load with Load_stdcall_plugin. Also, not a big deal, but the HTML file is missing the CSS since it points to a location that doesn't exist on my computer...
|
![]() |
![]() |
![]() |
#20 | Link |
AviSynth plugger
Join Date: Nov 2003
Location: Russia
Posts: 2,183
|
ChiDragon,
probably LoadCplugin is overrided by some other old C plugin and LoadPlugin("avisynth_c.dll") command in your system? Load_stdcall_plugin command was introduced in Avisynth for such case. order=-1 is wrong with TFF or BFF clip?
__________________
My Avisynth plugins are now at http://avisynth.org.ru and mirror at http://avisynth.nl/users/fizick I usually do not provide a technical support in private messages. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|