Motion adaptive filtering now possible?
Source: http://forum.doom9.org/showthread.php?s=&threadid=52989
All I can say is 8O Has anyone here seen this yet? I'm currently working with this script to try to figure out just exactly how it works, but it looks pretty good. Could motion adaptive filtering be the next step in the evolution of KVCD? From the NoMoSmooth README: Quote:
Ideas, anyone? |
This is an excelent idea :!: We can have control, and maybe even using heavy filtering on high motion parts by adding stronger filters on action parts. Even increasing the mergeluma value on motion, because on motion there's not much detail visible anyway, we can blur much stronger :idea:
Even the actual "current script" can be used in two parts or three parts. I mean a low to medium action bracket values and a medium to high action bracket values :idea: Actually, if it's possible, the best (and ideal!) way would be to change the filter values dynamically on a scale, where the higher the action, the higher the filter values are automatically applied :idea: This way we get a dynamic range of values applied to the movie being encoded automatically :idea: :idea: :wink: -kwag |
Well, it's still a very cool filter, but there are some downsides..... :?
As near as I can tell, it depends on the new conditional filter function in the latest AVISynth 2.51 binaries, which according to sh0dan... Quote:
It requires YV12 input, which I suppose is OK if you're ripping DVDs and aren't attached to any old YUY2 filters like dust. But I do mostly analog captures, which means that I capture in HuffYUV and that dust is pretty much a requirement for me, so I'm looking at a lot of ugly colorspace conversions. HuffYUV -> YV12 -> Filter_Motion function -> YUY2 -> Dust -> YV12. :roll: The script seems to work great as long as you use it as-is with all YV12 filters. But for some reason the colorspace conversions (or dust, or both) are introducing some REALLY weird stuff. Every few seconds it will insert one or two frames from a previous scene and then return to the proper point in the sequence. :? I also get VDub crashes if I use anything other than 0 for the cropping values. I've been looking at it all day, and I'm only now beginning to understand what it does a little bit. If this turns out to be the Next Big Thing(TM), it pretty much means a wholesale move to 2.51 and pure YV12 for everybody, and I don't think we're ready for that until some filter developers get on the ball with YV12 support. [edit] I figured it out. I was using Pixiedust for high motion and FaeryDust for low and medium motion. There can only be 1 instance of dust in a script, and apparently the 3 functions were treating it like 3 instances of dust. So I guess dust can't be one of the conditional filters. And moving it up to the main script cut out a lot of those conversions. |
I'm still keeping away from avisynth 2.5x :!:
It's just not stable enough :? I would really like to see this filter working with the "current script", which is just mergechroma and mergeluma. Simply applying a higher value on mergeluma on high action scenes. This will lower the file size because it will really blurr the image, but the image wouldn't have any detail anyway on a high speed scene :!: So maybe the script simplified a little, might just get us started playing with this :D -kwag |
@ KWAG !
I just found this article . Sounds very promissing , hah... Did u tryed it already. If u tryed what was a result ? Is it working as have to ??? I'll try it when I'll come back from work until then whanted some more info if it's possible :wink: bman |
Quote:
Until I see less problem reports on newer versions, I'll stick to the tried and tested 2.08 :!: -kwag |
Guys !
We have new challenge in here ! Who is running Avisynth 2.5 ? Could u try this script and see if it's working as promissed ? Cuz there is french forum http://atlas2.tgv.net/~media-video/f...pic.php?t=2267 and there is ( I don't speack French but assume ) more advanced script that looks interesting too . Someone with AVS v2.5 :!: :?: :!: bman |
Ok, I have tried it with dust and C3D on analog captures, and it seems to work exactly as advertised.
However, I'm having some trouble implementing the KVCD script because 2.5 stmedianfilter has different paramaters than the 2.0x version, there is no temporal smoother in 2.5, and I can't get the syntax right to put mergechroma and mergeluma in the functions. If you guys will help me get the YV12 equivalent of the current script, I will be the guinea pig. :lol: This is what I'm using right now: Quote:
Medium = mergechroma(Medium, blur(Medium, 1.50)) Medium = mergechroma(blur(Medium, 1.50)) So what's wrong with my mergeluma and mergechroma functions? |
Hi sbin,
Maybe you have to change all the functions to read like this: Code:
### High motion filtering -kwag |
Oh yeah... I guess I should have mentioned that was the first way I tried it. :oops:
No matter how I set it, I get Quote:
Man, where is sh0dan when you need him. :wink: I think I will post this over at Doom9 since most of the heavy-duty AVIsynth people are there. I just registered an account, but I have to wait 3 days to post. :twisted: |
Quote:
-kwag |
After analyzing this filtering logic, this is going to be a SLOOOOOOOOOOOOOOOWWWWW process :!:
This scheme works on a frame-by-frame basis, and in theory it will work, but it's going the slowest encode of all times :!: I'm not so sure if it's worth it :roll: -kwag |
I had thought so too, but it's actually surprisingly quick. Just for comparison purposes, I did a little test with Planet of the Apes TV series at 544x480 full frame. I created an intermediate AVI file with VDub using fast recompress to HuffYUV just to see how fast the script is. When I comment out the line
clip = Filter_Motion( clip, Width, Height, threshold_sm, threshold_hm) in the main script above and use no conditional filtering at all, it runs at about 19/20 fps on my Athlon T-bird 1.3. For the conditional filtering test, since I can't get the blurring syntax right, I substituted the C3D values given in the script posted at Doom9. I figure C3D is a reasonably fair comparison for speed purposes. With conditional C3D filtering, it runs at 13/14 fps. Using conditional filtering with empty motion filter functions, it runs at about 17fps. So the actual conditional filtering hit appears to be pretty small. Using dust in an old-style script gives me about 5/6 fps. So I think this is certainly within the realm of acceptability. At least for me. :lol: |
Quote:
Similar to the xDust filters. I guess I should read more on the AviSynth's web site :wink: I guess it all boils down to the function family "XDifferenceFromPrevious" that is available on AviSynth 2.5x :!: If it was available on 2.0x, we could use it just by adding it to the current script. I guess I'll take a look at this today, by switching to avisynth 2.51 and trying this out. This really opens up a world of possibilities :idea: Just like I had conditional filter strength calculated for BlockBuster filter depending on the resolution to be used, this could also be automated to apply BlockBuster "noise" to low lit scenes, but lower the noise value if there's movement :idea:. Really a "Dynamic" avisynth script :D -kwag |
Quote:
That's the spirit and bacause of that we are here master KWAG ! :D :D bman |
Ok, gang. After a false start earlier today, I now have a working script that does motion adaptive luma and chroma blurring and some preliminary results to report. It's not the prettiest script, but it does work.
Quote:
Then I removed luma and chroma blurring from the main script and used motion adaptive luma and chroma filtering with the current script values for all three levels to test that the script still worked exactly the same. It did. File size was 15,217k. So I know the script is right and it works properly. Time to play with the values. Going with Kwag's suggestion earlier, the only value I changed was luma blurring. At high .40, medium .30, and low .20, the file size was 14,979k. Not spectatular, but at least it establishes that it does work. At higher values of high .60, medium .40, and low .20, file size was 14,808k. Again, not spectacular, but significant. All samples are visually indistinguishable to my eye. 8) |
Quote:
Now try a value for luma of 0.2 for LOW, 0.75 for MEDIUM, and 1.5 for HIGH. See how the file shrinks 8) -kwag |
Well, I changed some values in my script and a couple of minor things in TMPGEng, so I can't compare these samples to the ones I did earlier. I changed from Lanczos to Bilinear, did some different cropping, and used a different GOP (I was inadvertently using the KDVD template before).
The control sample with current script values was 13,406k. The sample with your suggested values was 12,651k. 8) |
Thanks sbin :)
Here's a cleaned up (with more to be cleaned!) working script, with the suggested values. Code:
LoadPlugin("C:\Filters_avisynth25\MPEG2Dec.dll") Now I'm going to optimize this thing, and see how to automate the blur strength in a linear fashion, instead of three steps (Low, Medium, High). This way, there won't be sharp cut-off transitions between the three areas being worked on. So the "blur" value will work on a linear range between 0.2 to 1.50, depending on the frame activity :D Edit: This was tested with AviSynth version 2.51 Build May 15, 2003 -kwag |
Quote:
|
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.