View Full Version : New duplicate detection filter
Guest
8th September 2002, 00:58
As a result of my work to develop a new duplicate detection engine, I have created a filter as a testbed for it. Duplicate detection can be useful in many applications: decimation, frame copying for bitrate reduction, field matching, etc.
I want to get some wider exposure on test clips from community members. But I had to give it some useful functionality. :) Therefore, I have implemented basic frame copying for bitrate reduction. Of course, Marc FD pioneered this with his CopySame(), and I hasten to add that this is not intended to compete as his filter is much faster. Perhaps this filter has better thresholding and performance in dark and/or noisy clips. If so, it would be in our interests for Marc and I to combine efforts.
Those interested in a theoretical analysis of the issue should refer to the thread "New smart sharpening filter". I'd like to thank High Speed Dubb in particular for his help and ideas.
As always, I'll appreciate feedback to make it better. Remember, it's a first beta and I don't recommend random access when in copy mode.
http://shelob.mordor.net/dgraft/dup/dup10b1.zip
Marc FD
8th September 2002, 01:07
I will test a bit. (not too much ;) )
i _hope_ it's better than CopySame, because improvements are awaiting.
let's tests everything :cool:
Guest
8th September 2002, 01:08
Marc, non! Let's keep the best features of each in a combined filter. I'll post the source as soon as I feel it is not too bug-ridden. Smart sharpener code is being released tonight, as I remember you were interested in the edge detection code. It uses separated kernels and you can make it really fast if you low-level code it.
Marc FD
8th September 2002, 01:09
too late i edited it BEFORE your post :D (and :p too)
New technique : Now i read my posts and i try to think how an american guy would understand it ;)
Let's keep the best features of each in a combined filter. Great. It was EXACTLY what i was trying to say. But i saw a little bit too late that my words were not clear.
kyousuke
8th September 2002, 03:41
our animes will become perfect of you continue you two :p
i'll try tomorrow if i've the time.
hmm combine your filters would be great ^^
@marc, rien à avoir le sujet.
ta un gui de prevu pr avs ?
pq j'ai une idée d'interface mais comm je suis une merde en VB, je crois cé pas demain j'arriverai à coder mon idée d'interface. j'ai en tete un truc simple.
1. deux fenetres (input/output) la vdub pr voir les modif en tps réèl, une barre de navigation, en dessous un textbox avec le script avs en cours. ça cé plutot simple et clair (bien que je sais pas coder ça)
2. quelque part (popup, menu, fenetre sur coté?) les fonctions de base et les plugs de base avec tout les fonctions éditables (bouton radio, cochable ou autres) bon cé vrai que cette partie là est assez titanesque, enfin pr moi ça le serait ^^
bref cé surtout la partie 1 qui me semble interessante pr le coté output tps réèl et édition du script simultanée (pq à part bloc note + le reload de ma video ss vdub, connais pas d'autre sol pr voir le résultat d'un script et cé un peu lourd à la longue...)
sorry for french ^^;;;;;;
sumimasen
+
sherpya
8th September 2002, 04:25
neuron2 you are a plugin machine :D
Dark-Cracker
8th September 2002, 07:23
hi,
this post have not a direct link with the thread but.
@all the avisynth's filters coders
i think u could perhaps create a sourceforge project with all the avisynth plugin. or perhaps release (when your plugin will be stable) a new BIG plugin for avisynth (with all the filter) in order a lot of people could use your filters.
Ps: very nice work with your filters, and keeping avisynth alive.
@neuron2
PS: do u think create an warpsharp in YUV ?
Guest
8th September 2002, 11:56
>PS: do u think create an warpsharp in YUV ?
Of course, I could. But I have no plans to do it because I do not find it to be a useful filter. It's a cute toy, IMHO.
Tell you what, show me a clip that is indubitably improved by warpsharp in a way that you can't get otherwise and I might consider it. Ball's in your court. :)
ErMaC
8th September 2002, 12:50
Neuron - I have one of those. Sadly I do not have it here with me in Japan.
There's a scene in the Japanese Region 2 release of Evagelion: Death & Rebirth. In one scene in Rebirth (first shot of the scene with Misato hacking into the MAGI) there's a panel of crosscrossed red lines that exibit this "dot crawl" effect where it looks like speckles have occured (similar to the one in the screenshot I showed you a while ago but much worse). This is present in many other scenes on the disc, but since it's is bright red against a black background it is most apparent here.
The only way I managed to fix that problem was with WarpSharp. Nowadays I might be able to fix it with waveletNoiseReduction, but that is very iffy and it haven't been able to test it on the current clip I have because WNR requires SSE and I'm stuck on a P2 366 in Japan.
People have commented that my encode of Rebirth looked BETTER than the DVD, and I will say that 95% of that is due to the tweaking I did with WarpSharp and SmartSmoother (which at the time were the best tools available), with more of the emphasis on the WarpSharp.
It is a very, very useful filter. When I was doing fansub encode for AnimeInc (I went by the nick DrasticMouse in fansub circles) WarpSharp was an invaluable tool. A very light warpsharp can do wonders for a DivX/MP42 -> DivX transcode, especially when the source is somewhat iffy. One episode of Sugar: the Little Snow Fairy (episode 7) had no high-quality raw to work from because the broadcaster changed their schedule lineup without telling anyone so all the good raw encoders missed it, leaving us with a badly IVTC'd 480x360 resolution raw with cross-coloration artifacts as the best we could use. WarpSharp single-handedly allowed us to make it at least semi watchable, I spent so much time tweaking settings on that encode that most people never noticed the fact that we used a different raw encoder. It was all thanks to WarpSharp.
Now in an era when I'm doing everything I can in AVS to maintain YUV colorspace, a YUY2 WarpSharp would be invaluable to me, and I'm sure to many others as well.
It is a great filter whose effects I've never seen duplicated the same way by anything else.
EDIT: BTW people don't go bother looking for it in the US release of D&R, because the US release isn't really Rebirth - it's just a chunk of End of Eva spliced together with the Rebirth titles. The actual Rebirth was more of a workprint of the first chunk of EoE, and had a few errors in it and a different music score. For EoE they added new music, fixed, some of the problems, reshot everything on new film and rerecorded many of the voices (most obvious when Misato says "Korosareru wa, hayaku isoi de" when they're looking for Rei - if she says it with a great sense of urgency and the last part in a whisper, it's the EoE voice track, if it's playful sounding it's the original Rebirth recording). Yes, I know too much about Eva
Schlumpf
8th September 2002, 13:11
@kyosuke
Si je t´ai compris correcte, tu cherches quelque sort de GUI pour Avisynth qui resemble Virtual Dub?
Alors, regarde ce thread ici: Avisynth-Monitor (http://forum.doom9.org/showthread.php?s=&threadid=32125)
Ca paraît d´être un "tool" (mot français qui correspond?) comfortable, bien que j´aie manqué du temps pour le tester jusque à aujourd´hui.
Hope I could help and please excuse my poor french. I know it sucks...
Didée
8th September 2002, 16:18
Originally posted by neuron2
>PS: do u think create an warpsharp in YUV ?
Of course, I could. But I have no plans to do it because I do not find it to be a useful filter. It's a cute toy, IMHO.
Tell you what, show me a clip that is indubitably improved by warpsharp in a way that you can't get otherwise and I might consider it. Ball's in your court. :)
(I´m not getting tired of repeating myself ...)
Shall I show you every single TV-cap of mine?
My ceterum censo:
WarpSharp sharpens, but doesn´t make a clip less compressable.
I gave more detailed reasons here (http://forum.doom9.org/showthread.php?s=&postid=176394)
You never will make WarpSharp useless with a sharpener that enhances contrast on a per-pixel-base.
Excuse me, I don´t want to get annoying.
But WarpSharp is a little pearl, and sometimes I fear there will never be a version that operates in YUY2. That would be a shame somehow.
Guest
8th September 2002, 17:58
I ask for a clip that proves it and all I get is blah-blah-blah. :)
ErMaC
8th September 2002, 18:02
Check your private messages.
Guest
8th September 2002, 18:04
Thanks, I will.
Umm, can we move WarpSharp to a separate thread. I'd really like to get some feedback on the Dup filter. Thank you.
kyousuke
8th September 2002, 18:29
c'est vrai.
i know this DLL, it's already a beginning :)
perhaps the gui will comme soon
Marc FD
8th September 2002, 19:03
i tested the dup.dll some hours...
and it gives me exactly the same result than copysame.
at least in my user point of view.
i definitively can't tell which is better.
i compared both on many scenes, and they worked both or failed both.
the whole trick is in the threshold selection.
i'd say : par
(off topic : is warpsharp that hard to adapt to YUVY2??? )
Dark-Cracker
8th September 2002, 21:15
Hi,
i have tested your dup plugin and it was a bit slower than copysame
Parameters used :
Dup(5,80,false,true,10,false)
VS
CopySame(1,4,8,4,0.1,987654321,50,50,3)
(seems the result was the same but my eyes are not perfects.)
but the output filesize was less big with dup.
i must do more test but i have no time.
@all
PS: i am sorry to have speak about warpsharp plugin in this thread, i try to correct my error :) so plz stop to speak about this filter in this thread , respect the donald wish.
bye
vidiot
8th September 2002, 23:20
Originally posted by kyousuke
our animes will become perfect of you continue you two :p
i'll try tomorrow if i've the time.
hmm combine your filters would be great ^^
@marc, rien à avoir le sujet.
ta un gui de prevu pr avs ?
pq j'ai une idée d'interface mais comm je suis une merde en VB, je crois cé pas demain j'arriverai à coder mon idée d'interface. j'ai en tete un truc simple.
1. deux fenetres (input/output) la vdub pr voir les modif en tps réèl, une barre de navigation, en dessous un textbox avec le script avs en cours. ça cé plutot simple et clair (bien que je sais pas coder ça)
2. quelque part (popup, menu, fenetre sur coté?) les fonctions de base et les plugs de base avec tout les fonctions éditables (bouton radio, cochable ou autres) bon cé vrai que cette partie là est assez titanesque, enfin pr moi ça le serait ^^
bref cé surtout la partie 1 qui me semble interessante pr le coté output tps réèl et édition du script simultanée (pq à part bloc note + le reload de ma video ss vdub, connais pas d'autre sol pr voir le résultat d'un script et cé un peu lourd à la longue...)
sorry for french ^^;;;;;;
sumimasen
+
:confused:
(because the only thing I liked in french class was the women who teaches...)
But what you are askin for: A gui like VD for tweaking AVISYNTH is already done by belgabor (and it is really fun to tweak filters with that.).
Look at the thread:
http://forum.doom9.org/showthread.php?threadid=32336&perpage=10&pagenumber=3
...and you´ll find virtualdubavs Version 0.2a.
...did I get you right or should I take some more classes french?
Harald
ACClarke
9th September 2002, 00:04
Originally posted by vidiot
:confused:
(because the only thing I liked in french class was the women who teaches...)
But what you are askin for: A gui like VD for tweaking AVISYNTH is already done by belgabor (and it is really fun to tweak filters with that.).
Look at the thread:
http://forum.doom9.org/showthread.php?threadid=32336&perpage=10&pagenumber=3
...and you´ll find virtualdubavs Version 0.2a.
...did I get you right or should I take some more classes french?
Harald
you're right
unfortunetly for me my english teacher wasn't pretty as yours :D
Guest
9th September 2002, 02:00
Guys, please stay on topic. See that "New Thread" button? :) Thank you.
My tests show Dup() slightly faster than CopySame() 1.1b. CopySame() crashes on several of my clips. The smallest one is 74MB. I can make it available if wanted.
When I can run CopySame() without crashes I can test it properly. I've asked Marc for all source needed to build it (the distribution is not buildable due to missing files), so I can fix the crashing bug.
Dark-Cracker
9th September 2002, 03:04
My computer was a P3 it perhaps for that copysame was a bit more speed. doest your dup was SSE optimized (silly question but it perhaps for that) ?
think to post a fixed version of copysame if u could fix the crashbug.
Ps: i hope u and marc could make a good plugin buy muxing your two sources.
PS2 : sorry for my poor english :) Frenchy Powaaaa !!!! :) :) :)
Guest
9th September 2002, 03:56
Attached is a new version that is much more usable. When show=true it now prints the metrics (and other information when copy=true) right on the frame itself. This allows you to more easily set your desired difference percentage for declaring a duplicate. Nice big easy-to-read type in sensible English. :) I got the code for the text overlay from that Japanese fellow's IT code, which he just released.
@Dark-Cracker
Mine is not yet at all optimized! It uses floats. :) Patience, my son.
I have an AMD Palamino XP1900+. AMD does floats much better than Intel.
Marc should fix the bug. I can give him a clip that crashes it. If he wants me to look at it, he'll have to publish complete source code. I will be releasing my source very soon.
Guest
9th September 2002, 06:12
I forgot to mention... In this new version, the threshold is a float so you can specify fractional percentages, e.g., Dup(threshold=2.5).
Marc FD
9th September 2002, 14:18
Originally posted by neuron2
Guys, please stay on topic. See that "New Thread" button? :) Thank you.
My tests show Dup() slightly faster than CopySame() 1.1b. CopySame() crashes on several of my clips. The smallest one is 74MB. I can make it available if wanted.
When I can run CopySame() without crashes I can test it properly. I've asked Marc for all source needed to build it (the distribution is not buildable due to missing files), so I can fix the crashing bug.
Dup is faster on my XP 1600+ too.
BTW AMD fp is _worse_ than Intel's.
i hope the bug you are speaking of is fixed in v1.2
if not, i would check the files for the dumb errors i do too often :rolleyes:
for the build files, see your PMs.
Guest
9th September 2002, 14:33
OK, where do I get version 1.2? Thank you.
Marc FD
9th September 2002, 15:00
it's a beta. i attached it in the CopySame thread.
Guest
9th September 2002, 18:02
Thank you. That seems to fix the crashing. So why have you left the broken one as the only downloadable one at your web site???
Marc FD
9th September 2002, 18:10
i thinked it was more stable.:rolleyes:
Guest
12th September 2002, 03:34
Please find attached Dup() version 1.1. The changes are as follows:
* Fixed problems finding changes near the edges of the frame.
* Increased speed.
* Shortened text overlay strings so they won't wrap on half-sized frames.
* Improved detection algorithm.
The algorithm in this version will be going into Decimate() unless I receive negative feedback. So please have a good look at it!
http://shelob.mordor.net/dgraft/dup/dup11.zip
HarryM
12th September 2002, 12:01
Originally posted by neuron2
Please find attached Dup() version 1.1. The changes are as follows:
* Fixed problems finding changes near the edges of the frame.
* Increased speed.
* Shortened text overlay strings so they won't wrap on half-sized frames.
* Improved detection algorithm.
The algorithm in this version will be going into Decimate() unless I receive negative feedback. So please have a good look at it!
http://shelob.mordor.net/dgraft/dup/dup11.zip
Can I user-define, which frame from identical sequence I want to use for duplication?
First or last?
Guest
12th September 2002, 12:38
@HarryM
Justify your request, please. The more convincing you are, the more likely it will be done. :)
HarryM
12th September 2002, 14:46
Originally posted by neuron2
@HarryM
Justify your request, please. The more convincing you are, the more likely it will be done. :)
For example, I have this sequence of frames:
a b c d e f g h i j k...
Frames 'c', 'd', 'e' and 'f' are near-identical.
Finally I have
a b c c c c g h i j k... (alternative A)
or
a b f f f f g h i j k...? (alternative B)
I think, alternative B is better. If I use temporal filter, then the 'c' frame is depreciated by ghosting effect from previous (different) frame...
Belgabor
12th September 2002, 14:59
Wouldn't then be a b d d d d g h i j k (or with e) better? f might suffer ghosting from g (but if you have ghosting in this case, you'll have it elsewhere as well where it cant be avoided with duplication). But theres another pro for taking a middle frame. Those should have benefited the most from temporal cleaning. (Temporal filtering in AviSynth is bidirectional, isnt it?)
Cheers
Belgabor
HarryM
12th September 2002, 15:13
Originally posted by Belgabor
Wouldn't then be a b d d d d g h i j k (or with e) better? f might suffer ghosting from g (but if you have ghosting in this case, you'll have it elsewhere as well where it cant be avoided with duplication). But theres another pro for taking a middle frame. Those should have benefited the most from temporal cleaning. (Temporal filtering in AviSynth is bidirectional, isnt it?)
Cheers
Belgabor
Right! The middle frame is the best...
Dark-Cracker
12th September 2002, 16:04
hi,
i have test your filter on an another computer (win98,P3 , 256 MO) and i have an error "Avisynth : stack overflow" i have tested with the avisynth version 2.05 / 2.04 / 1.0b7d and i have the same error msg , i have also tested with the dup version 1.0b1/b2 / and 1.1
have u an idear about this problem ?
Ps: i have also tested with the "SetMemoryMax (40)" at the start of the .avs file.
bye
Defiler
12th September 2002, 16:24
Originally posted by neuron2
@HarryM
Justify your request, please. The more convincing you are, the more likely it will be done. :) I also believe this is a good idea. I could provide a short clip to illustrate this, if you are interested. DivX 3.11 encoding artifacts often take the form of evil blocks that appear in the first frame, and then vanish in subsequent frames. When you are taking such clips as input, it's helpful to copy the last frame of a duplicate sequence onto the first.
Before CopySame added this functionality, I just put a "reverse()" statement on either side of it.
Guest
12th September 2002, 17:31
@Dark-Cracker
What is your script and does it fail only when Dup() is present? Does it fail on all clips or just one?
Guest
12th September 2002, 17:55
Here's my take on it: the first frame c would already have benefited from temporal smoothing. Given this and the fact that to take the last one I would have to read ahead by the maxcopies number, makes me conclude that it is not worth it for this reason alone. Defiler's reason is more persuasive, but he has a workaround. :-)
Dup() was really just a quick testbed for my new duplicate detection code targeted at Decomb(). When I complete the next release of Decomb() I will revisit this issue for Dup().
Dark-Cracker
12th September 2002, 18:06
hi,
i have tested with different script but even with a basic script i have this error.
LoadPlugin("D:\AVSFILE\MPEG2DEC.DLL")
LoadPlugin("D:\AVSFILE\Dup.DLL")
Mpeg2Source("c:\TEST\PROJECT0.d2v")
Dup(5,false,true,10,false)
i have tested to with dup() and with AVIsource instead of Mpeg2source but i have still this error.
Guest
12th September 2002, 18:47
@Dark-Cracker
Try the attached version 1.11 and let me know.
Guest
12th September 2002, 18:50
@dividee
How big is Avisynth's stack?
Dark-Cracker
12th September 2002, 18:58
@neuron2
:) :) :) :)
with the version 1.11 the problem was solved :) i have tested with avisynth v2.04 and v2.05 and it work like a charm, thank u very much.
Guest
12th September 2002, 19:05
I declared data on the stack. I need to move it into a malloc. Temporarily, I just decreased the maximum array size. The Avisynth stack appears to be very small. :(
Dark-Cracker
12th September 2002, 19:26
hi,
strange it was the first time a have a problem with a filter and the avisynth stack.
>Temporarily, I just decreased the maximum array size.
it was a temporaly manipulation because this slowdown the encoding process ?
Guest
12th September 2002, 19:28
It was temporary because I could do it in 5 minutes during my lunch hour. :)
To convert to malloc takes a little time for a 2-dimensional array. I'll fix it properly later.
Marc FD
12th September 2002, 20:45
Hi :)
I worked a lot on new algos the past week, and i'm finally running out of ideas. I couldn't see the difference between dup and copysame 1.2, and after many tries i only get small improvements with my last algo.
I'm not really sure if i should implement it seriously.
in a hand, it's not bad, on the other hand, the dup filter seems enough for all users...
and i've got too much homework :(
but maybe it would be interessing to compare my cheap engine against dup. to know wich one is better.
I really don't know what to do (and i'm very lazy since i'm back too shool....)
Suikun
12th September 2002, 22:33
@neuron2
In the readme of Dup you state that it's working with 32*32 windows.
Sometimes in animes it happens to happen that only a very small part of the video is moving or changing, like a mouth or eyes. So would it be possible to copy all other 32*32 blocks except the ones with the actual movement in it?
[Edit]
Justification for this (as you always ask for them :P):
When I let ffdshow show the motion vectors I often notice motion in apparently still areas. Local copys of previous frames might help there.
cult
13th September 2002, 01:41
hope that u forgive my ignorance but is this filter supposed to work with normal movie?I tried in a movie with dup()and dup(copy=true),and I could see some jerkiness in the movement.For example in the start credits the letters wouldnt fade out properly but rather disseaper if u know what I mean...Same goes for some other frames too when the camera was moving slowly.I tried the same movie wihout the filter and the effect was gone.Any ideas?Maybe wrong settings?
Belgabor
13th September 2002, 02:01
Originally posted by cult
hope that u forgive my ignorance but is this filter supposed to work with normal movie?I tried in a movie with dup()and dup(copy=true),and I could see some jerkiness in the movement.For example in the start credits the letters wouldnt fade out properly but rather disseaper if u know what I mean...Same goes for some other frames too when the camera was moving slowly.I tried the same movie wihout the filter and the effect was gone.Any ideas?Maybe wrong settings?
No, in a normal case its not. It's made for animation and the detection of 'true' duplicates, aka frames which should be the same but aren't because of noise. This ususally doesn't occur in natural movies. But if you set the thresholds right, normal movies should work too, just you wont have any benefit because of the lacking duplicates.
Cheers
Belgabor
Dark-Cracker
13th September 2002, 02:03
hi,
dup it's an filter for the anime in anime there is a lot of same frame and this filter detect these duplicate frame.
it not really destined to be used with the movies (i think i am right). it for that u obtain a crap result.
++
Guest
13th September 2002, 04:50
@cult
We forgive your ignorance. :) :)
Belgabor and Dark-Cracker said it all.
Guest
13th September 2002, 12:17
Here is Dup() version 1.2, which properly fixes the Avisynth stack overflow problem.
@Suikun
When I complete the release of Decomb 4.0, I will consider your suggestion.
Dark-Cracker
13th September 2002, 12:42
hi,
just a little question, to obtain the best result where in the avs script should i use dup ? at the end of the script (after the crop resize,denoise,smooth,sharp..etc....) or just after the resize ?
thank u, bye.
Defiler
13th September 2002, 13:36
It seems to me that you'd want to use dup() as early as possible.. right after the deinterlacing? That way temporal filters that you run later in the script won't be making changes based on data that clearly wasn't worth keeping. Also, if you run dup() after smoothing, adjacent frames that are similar, but not identical, will be even more similar. (Because smoothing discards data, they will have more bits in common.)
Am I wrong?
vidiot
13th September 2002, 14:33
Fast changes aroud here...
I could have put my tests into this thread (must have been blind that day...)
@neuron2:
You leave the noise parameter out since V1.1,
i know you suggested not to change it anyway, but...(why)?
@MarcFD:
Even with lot of homework to do - just stay here and improve your filter plugins. ;)
I know that for example CNR2() was not you idea from the ground,
but with your input it really rocks (speed depending)!
Why not putting some more effort in copysame?
Your ideas are great! And that is what counts.
With a little more debugging and the better "readme´s"
you recently startet with - your plugins were killers.
Ask neuron2 how much time he spent with decomb!
This plugin alone kept me capturing from tv - otherwise I would have given up, because of the time it needs to process.
Thankyou for all those plugins!
Harald
Guest
13th September 2002, 16:02
@vidiot
With the revision to the algorithm the nr parameter is no longer required. My theoretical considerations as well as my testing confirms it.
stickboy
13th September 2002, 18:19
Originally posted by Defiler
It seems to me that you'd want to use dup() as early as possible.. right after the deinterlacing? That way temporal filters that you run later in the script won't be making changes based on data that clearly wasn't worth keeping.If you run a temporal smoother after dup, wouldn't that introduce differences to duplicate frames and prevent them from being perfectly identical?
ronnylov
13th September 2002, 19:37
I have been playing around with Layer to average two captures to decrease noise and now I wonder if this method could be used on "identical" frames? What I mean is not only duplicate the frames but before duplicate them make an average of all frames that are "identical" (the noise is not identical and averaging them should decrease the noise).
Maybe this is done with temporalsoften with low thresholds already?
Defiler
13th September 2002, 20:52
Originally posted by stickboy
If you run a temporal smoother after dup, wouldn't that introduce differences to duplicate frames and prevent them from being perfectly identical? Not unless the temporal smoother is broken, because there should be exactly zero temporal changes between those frames.
stickboy
14th September 2002, 06:08
Originally posted by Defiler
Not unless the temporal smoother is broken, because there should be exactly zero temporal changes between those frames. But couldn't they be smoothed with the frames around them? Let's say you have a sequence of frames A B1 B2 C, where B1 and B2 are identical. After temporal smoothing, couldn't A affect B1 and C affect B2?
Defiler
14th September 2002, 07:11
OK.. Run it at the beginning and end of your script, then. :)
ronnylov
14th September 2002, 07:38
Originally posted by stickboy
But couldn't they be smoothed with the frames around them? Let's say you have a sequence of frames A B1 B2 C, where B1 and B2 are identical. After temporal smoothing, couldn't A affect B1 and C affect B2?
Yes, and what I meant was that I was looking for a smoother that averages the pixels of frames B1 and B2 only (which are identical except for the noise) and then make new duplicates of the averaged frames.
stickboy
14th September 2002, 07:48
Originally posted by ronnylov
Yes, and what I meant was that I was looking for a smoother that averages the pixels of frames B1 and B2 only (which are identical except for the noise) and then make new duplicates of the averaged frames. I'd like to see this behavior too. (I'm still waiting for a similar feature to Decimate...)
Dark-Cracker
14th September 2002, 08:19
hi,
to sum up it was better to use dup after the temporal smoother and after the temporal soften, just put the dup filter at the end :) i am right ? (sorry to ask u again this question but my english was very poor and i don't have understand fully the 3 previous post :) )
thank u.
Bye
meleth
14th September 2002, 14:05
I was thinking, wouldn't it be great if dup() had it's own noise cleaner? Or if this strategy was implemented into a noise filter. It just strikes me that it would be more time efficient if the filter cleans the frame before copying it, instead of another filter cleaning it twice.
Also, i got a question. Where in the filter chain would be the best place for dup? Before or after noisecleaning, cropping, ivtc, resize, sharpening etc.?
I'm currently using this order: Ivtc, dup, crop, sharpen, noise, resize, anti-rainbow.
Guest
14th September 2002, 15:37
@meleth
I am currently preparing a new Decomb release. I will actively return to Dup() and this thread when it is done.
meleth
14th September 2002, 15:56
alright cool, i'll stay tuned then :p
Belgabor
15th September 2002, 15:59
You shouldnt use any frame duplicator (be it Dup or CopySame) before temporal noise reduction. You siply loose the benefit of the noise reduction on copied frames, which is in fact where it could have its best benefit.
Cheers
Belgabor
Neoze
23rd October 2002, 00:39
I use the dup() filter in an other way:
to calibrate the filter and their parameter:
The idea is to use dup() beetween to frames: the original and the filtered.
s=ImageSequence("Image%d.jpg",0,7,25).converttoyuy2()
d=s.filter (parameter)
i1=trim(s,1,1)
i2=trim(s,2,2)
../..
j1=trim(d,1,1)
j2=trim(d,2,2)
../..
video=i1+j1+i2+j2 ...
dup(video,threshold=5,show=true,debug=true)
(full post here: http://forum.doom9.org/showthread.php?s=&postid=199123)
That way dup() give you a statistic beetwen the 2 picture and focus on the main difference.
But in this usage It will be more convenient if dup() display more than one area where it find the bigger difference.
That is my request: displaying a parametic number of areas with a color scale.
trbarry
23rd October 2002, 01:45
I have been playing around with Layer to average two captures to decrease noise and now I wonder if this method could be used on "identical" frames? What I mean is not only duplicate the frames but before duplicate them make an average of all frames that are "identical" (the noise is not identical and averaging them should decrease the noise).
I have been scrolling through 4 pages of this thread (I haven't been following) to see if someone would propose that. It seems like it would be a usefull idea, but more work.
- Tom
WarpEnterprises
26th October 2002, 22:55
Has somebody else encountered problems with DUP and dark parts / fadings?
There it seems to copy frames too readily.
But maybe this is a principal problem because in a fade the pictures are the same except their luminance.
Nevertheless: How to handle this?
And of course I'm pleading for a "blend" instead of "copy", too.
Marc FD
26th October 2002, 23:14
IMO, bframes achives almost the same result than any dup or copysame in terms of compressibility. That's why i've stopped devellopement on CopySame. And trust me, i've tested and tweaked both a lot, they failed in the same scenes and when i saw the results, i've immediatly removed CopySame of my site. I think CopySame is a bad thing. I feel like a crazy scientist when i think i've invented it. it's way too destructive.
Dup was created to improve Decimate of Decomb. and Decimate is very accurate now. i think it's the only good use of this type of filter.
i know some users don't care at all or don't trust me, but i want to say the users of Copysame, that i strongly recommend NOT to use this filter. because it could create problems they won't notice first, but would be very unpleasant to eye when they would watch it later.
the same goes with dup. but i've too much respect for Donald Graft to ask not to use his filter.
I'm really sorry for any image degradation Copysame could have created, and i feel the need to apologise for this.
MarcFD
Xenoproctologist
26th October 2002, 23:51
Originally posted by Marc FD
i know some users don't care at all or don't trust me, but i want to say the users of Copysame, that i strongly recommend NOT to use this filter. because it could create problems they won't notice first, but would be very unpleasant to eye when they would watch it later.
the same goes with dup. but i've too much respect for Donald Graft to ask not to use his filter.
I'm really sorry for any image degradation Copysame could have created, and i feel the need to apologise for this.
MarcFD
The trick to not getting image degredation (e.g. sudden "pops" when the image exceeds the set threshold; or decimation of slow pans/zooms) is to use extremely low threshold values. I've found 0.5% to be the threshold just below the point where the "pops" become noticable in low-noise source. Above 0.8%, the aforementioned pan/zoom decimation starts to occur.
Dup is useful--you just can't wield it like a sledgehammer.
Marc FD
26th October 2002, 23:59
the gain in compressibility with 0.5% would be so ridiculous, that i don't deserve the additionnal processing time and the risk (even very low threshold can copy slow fades and make ugly results)
if you really want to gain compressibility, use the Temporal Cleaner that vlad is going to port to avisynth. i think it's exactly what you need. a pixel locker would improve more compressibility, but would be risk free.
when i've created CopySame, i wanted to create N_vops with XviD. with some tweaking in XviD, i could do it, and have a real boost in compressibility. but without that, the gain is really poor.
Defiler
27th October 2002, 00:05
I always assumed that CopySame was just a testbed to perfect the process by which frames would be marked as "zero frames" in XviD. Was I wrong?
It still seems to me that zero-frames in XviD will be very useful.
Will this functionality be included in XviD directly, or will we still need things like CopySame?
Marc FD
27th October 2002, 00:26
>I always assumed that CopySame was just a testbed to perfect the process >by which frames would be marked as "zero frames" in XviD. Was I wrong?
in fact copysame was a proof of concept.
>It still seems to me that zero-frames in XviD will be very useful.
>Will this functionality be included in XviD directly, or will we still >need things like CopySame?
I've tested the whole thing a lot before saying it's crap. A bframe, even with the same quant, would be much better than a zero-frame. it would be a bit bigger, but would be 100% accurate. in fact zero-frames have no interest as soon as you use bframes. it's why the gain of Copysame with DivX 5.02 pro was so ridiculous. because DivX was already using bframes on potential zero-frames.
if XviD with bframes encounters a real or potential zero-frame, it would create a incredibly small bframe. on my anime encodes, i saw bframes who are 1 byte big ! a zero-frame would never be better.
in short, zero-frames are history. bframes rules. syskin's dynamic bframes detection rules. XviD rules.
Xenoproctologist
27th October 2002, 01:05
Originally posted by Marc FD
the gain in compressibility with 0.5% would be so ridiculous, that i don't deserve the additionnal processing time and the risk (even very low threshold can copy slow fades and make ugly results)
if you really want to gain compressibility, use the Temporal Cleaner that vlad is going to port to avisynth. i think it's exactly what you need. a pixel locker would improve more compressibility, but would be risk free.
I care less about compressability than visual quality. If Dup is taken to the next logical step in its evolution--averaging sequences of duplicate frames--it could do wonders for cleaning low-budget anime with high frame-repeat counts.
And as to Temporal Cleaner, I stopped using it a long time ago because it had a tendency to cause really nasty temporal artifacts--most noticably during slow fades.
Zarxrax
27th October 2002, 02:02
You were likely using too high values in it then. If you use values of 5 for blending threshold and 3 for pixel lock, I doubt you would ever see any artifacts.
Guest
27th October 2002, 04:48
I'd like to point out that I have achieved 40% savings on some clips using Dup().
When Suikun's idea above of copying on a per-block basis is implemented, I think nobody will doubt the utility of the idea. Blending, too, will increase the utility of the filter.
WarpEnterprises
27th October 2002, 21:40
@neuron2: sorry for being repetitive but what about my problem with fades?
ErMaC
28th October 2002, 00:49
I think in order to really get the most out of Dup you have to be willing to tweak it on a scene for scene basis like so:
function yes(clip)
{
return clip.Dup(copy=true,threshold=2)
}
function no(clip)
{
return clip.Dup(copy=false,threshold=4)
}
s=AVISource(blah)
v1=s.Trim(0,116).yes()
v2=s.Trim(117,433).no()
v3=s.Trim(434,554).yes()
...etc,,,
What I would do is encode the entire movie with Dup at the desired threshold I want, and whenever problems arise in a section, I tweak that specific segment in my AVS file. It's feasible when you're only encoding <6 min long clips, but definately would be way too much work when encoding, say, an entire 25 minutes episode.
I think what Dup could really benefit from is a more advanced detection engine which would not classify dupes on pans and fades. If safeguards could be implemented to catch these two cases, then I think that would make the filter far more easy to use as those are the two cases where the problem arises the most.
Just thinking off the top of my head (I am not an expert here, so it's entirely possible this won't work), you could implement a comparison between potential "copy" frames to check for pans or fades. For pans, check to see if there's an almost uniform % change amongst all the blocks analyzed or maybe use a motion detection algorithm to see if every block's image is moving at the same vector. For fade detection, just check to see if there's a uniform change in Luma across every single block. Crossfades would be more difficult to detect but I think because you're not fading to black the chances of detecting a duplicate there are lesser.
Quick question: Does Dup analyze the chroma channels at all, or does it analyze the Y channel only? Could a chroma=true argument be implemented like in Telecide that would give better, but possibly slower, results on certain sources?
Edit: Oh and I may have found a possible bug... When I set MAXCOPIES to 1, I don't think the behavior is what it's supposed to be. What I would expect is that the maximum # of frame copies to be created is one, so for instance on 12fps footage from a 24fps stream I would ensure that I never accidentally copy a new frame. However, setting MAXCOPIES to 1 does not seem to achieve this behavior and instead seems to copy EVERY frame (or so the show=true says) from the previous one and basically phase shifts the entire video stream one frame forward. Is this the designed behavior? Am I understanding the information it's giving me incorrectly?
High Speed Dubb
28th October 2002, 05:27
In the case of fades, I think block-based motion detection could be something of a liability. The blocks are giving greater power to detect motion which occurs in a small part of the screen. But when the motion is slow and occurs throughout the screen, using only the block with the greatest change is ignoring much of the available information.
JuanC
19th November 2002, 08:14
I use "dup" a lot when encoding animes. It's a great tool. I normally "fine tune" the threshold by selecting problematic scenes where some of the not-to-be-copied frames are being copied. So typically I end up using real numbers (not integer). That's when I get problems:
If I use a float for threshold combined with the "show" option, With some of my AVS scripts VirtualDub will eventually stop displaying the video, and will show a message in the status bar like this: "AviSynth read error: AviSynth: caught an access violation at 0x01eb0894, attempting to write to 0x82128033". The good part is that there are no problems when I finally use any float for threshold but I use the "copy" option instead of the "Show" one.
The workaround: I noticed this NEVER happens with the show option when I use the closest integer!! to my preferred float threshold.
Thanks Donald :) :J
FYI: This has happened with AVIsynth 2.06 and more recent cvs snapshots (12-nov). I am encoding to DivX502 some animes I captured from live tv broadcasts. Before dup I use decomb (ivtc), resize to 368x208 (16:9) and use _2dCleanYUY2 to filter some noise.
May be the size (h&v) must be module 32?? Here's one of my scripts
VIDEO=mpeg2source("D:\Paulita\HB24.d2v")
audio=WAVSource("D:\Paulita\HB24.wav")
AudioDub(video, audio)
Telecide(guide=1,gthresh=10,blend=false)
Decimate(mode=0,cycle=5,quality=3)
crop(0,60,640,360)
BiLINEARResize(368,208)
_2DCleanYUY2(0,6,2,2,0,4,4)
Dup(threshold=2,show=true)
ErMaC
19th November 2002, 13:45
Actually I reported this bug along with a slight behavioral modification suggested to Don a few days ago - he's got a fix worked out that should be released soon (v1.4 I believe he told me) but he asked me not to give out the DLL until his official release.
Apparently what was causing that problem was that if show=true, and your resolutions aren't mod32, if the "box" that has the largest change is outside of the frame it wasn't catching that and so essentially drawing the box outside of the video which was throwing the exception. He just added some bounds checking so it doesn't draw outside the frame anymore.
Guest
19th November 2002, 13:54
ErMaC is quite right. Thanks to both of you for bringing this to my attention. I have attached the fixed version Dup 1.4.
ErMaC
19th November 2002, 14:06
Wow less than 10 minutes after I make my post :D
Thanks again Don, and I hope once you get the new Decomb YV12 stuff worked out you can return to working on this filter cause I think it's really nifty.
BTW for everyone else, since it seems like it's not pointed out in the readme that comes with Dup there, the other change in the release is the behavior after MAXCOPIES is reached.
Before when the MAXCOPIES # of dups was reached, the next frame was compared against the previous original (so in a string of dups with MAXCOPIES=4, frame 6 would be compared against the original frame 5 and would then copy it). The only difference now is that instead of being compared, frame 6 is just passed through as is. This most of the time won't make too much of a difference, except when you use very low MAXCOPIES numbers like 1 or 2.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.