View Full Version : new deblocker filter: SmoothD
708145
24th October 2004, 14:46
Hi there,
this is a preview release of my new filter. Several things are still not working but it should work alright without weird behaviour or crashes.
The filter is supposed to deblock frames while keeping high frequency detail. Version 0.1 is expected to be the first working version.
Please tell me if you find any bugs other than already mentioned in the attached html.
You can get it at
project home (http://www.funknmary.de/bergdichter/projekte/SmoothD/)
bis besser,
T0B1A5
Mug Funky
24th October 2004, 15:47
well.. it didn't crash VDM.
apart from that it doesn't really do anything (though that's explained in the docs).
good idea though. i tried to knock one of these up with DCTfilter and a bunch of yv12lut's, but obviously it wasn't an ideal solution :)
can't wait to see it with DCT alive and well.
MfA
24th October 2004, 17:56
You are aware that spp in mplayer/ffdshow does exactly what you want to do I assume?
708145
24th October 2004, 18:44
> You are aware that spp in mplayer/ffdshow does exactly what you want to do I assume?
Yep, but they keep very close to the paper. I'm gonna use adaptive_shifts and other shift patterns.
Also, using the same matrix as in the source helps for PSNR but is not the best choice for deblocking and other HVS considerations.
bis besser,
Tobias
Leak
24th October 2004, 19:18
Originally posted by MfA
You are aware that spp in mplayer/ffdshow does exactly what you want to do I assume?
Then again, using ffdshow as a pre-processor in AviSynth isn't exactly easy - I'd rather keep using MPEG2Source than use DirectShowSource if I can avoid it... :)
And yes, I like the results SPP deblocking in ffdshow produces, so I'd be happy to have an AviSynth filter that does something similar.
Oh, and don't try calling 708145 (your phone no.? ;)) - his phone ain't plugged in (http://www.nichtlustig.de/toondb/040520.html)... :D
np: Bola - GLiNK (Soup)
708145
25th October 2004, 01:58
Then again, using ffdshow as a pre-processor in AviSynth isn't exactly easy - I'd rather keep using MPEG2Source than use DirectShowSource if I can avoid it... :)
And yes, I like the results SPP deblocking in ffdshow produces, so I'd be happy to have an AviSynth filter that does something similar.
The remaining problem will be to speed it up to realtime speeds. Should be possible but requires a lot of assembler skills.
Starting with V0.1 I will include the source (GPL) so others can contribute and speed-up. Many things are written very inefficiently.
Oh, and don't try calling 708145 (your phone no.? ;)) - his phone ain't plugged in (http://www.nichtlustig.de/toondb/040520.html)... :D
:scared: Oh my god, you found out that I'm a professional lemming.
But it's not my phone number. See below for another hint.
bis besser,
T0B1A5
Leak
25th October 2004, 07:18
Originally posted by 708145
:scared: Oh my god, you found out that I'm a professional lemming.
But it's not my phone number. See below for another hint.
Okay, I see I wasn't thinking 1337 enough... ;)
np: nix
708145
27th October 2004, 00:46
A new version is up!
It contains all code for V0.1 but does not compile :(
Maybe someone VC6 savvy can help me with this?
Futher steps are
1) speed optimizations (some are really easy and obvious)
2) test with all those different settings and
3) maybe even different matrices.
The final goal still is realtime! Maybe on sth like current 3GHz rigs. *hope*
bis besser,
T0B1A5
krieger2005
27th October 2004, 13:02
Hi,
i tried your filter in the previous version. I had a movie where big areas were flat (big areas with the same color and the same brightness). You can imagine that faces are very ugly when they have no contrast...
After using your filter i get on some these flat areas some points (little areas with different brightness). This is good because the flat areas are not sooo flat.
But i have now a question. Should i use the filter with an interlaced source:
- before deinterlacing
- before deinterlacing but with SeparateFields/Weave
- after deinterlacing
i tried to see the difference with the first and third point (before and after deinterlacing) and does not see any differences.
Well thanks for your filter
708145
27th October 2004, 13:18
Originally posted by krieger2005
Hi,
i tried your filter in the previous version. I had a movie where big areas were flat (big areas with the same color and the same brightness). You can imagine that faces are very ugly when they have no contrast...
After using your filter i get on some these flat areas some points (little areas with different brightness). This is good because the flat areas are not sooo flat.
Seems more like an error to me. But if you like this behaviour and it is not present in the final version anymore... well maybe I should offer a noDCT option (since V0.0.7 doesn't use DCT)
But i have now a question. Should i use the filter with an interlaced source:
- before deinterlacing
- before deinterlacing but with SeparateFields/Weave
- after deinterlacing
i tried to see the difference with the first and third point (before and after deinterlacing) and does not see any differences.
Well thanks for your filter
After deinterlacing is fine.
With separatefields it depends on what the filter sees: If it's twice the amount of frames but with half the vertical resolution then it should be OK.
But you shouldn't continue testing with V0.0.7! It really does not behave as intended, IOW too many things broken.
bis besser,
Tobias
708145
27th October 2004, 17:07
Well, V0.0.8 is up.
It
a) uses the Flat8 matrix instead of 6-of-9 and
b) doen't process U and V plane => still blocking!
enjoy und bis besser,
Tobias
typo fixed
Mug Funky
28th October 2004, 06:48
hooray! it's nice.
i assume you've noticed, but num_shift wont go above 8, though adaptive shift will try to make it do so when quant is high enough.
also, if possible, DCT precision might need to be increased - there's some posterization happening (maybe changing the matrix would fix this too?)
708145
28th October 2004, 16:35
Originally posted by Mug Funky
hooray! it's nice.
i assume you've noticed, but num_shift wont go above 8, though adaptive shift will try to make it do so when quant is high enough.
:eek: The current formula for adaptiveshift is just an example. It will take some experience and testing with the filter and its behaviour to find out a good formula.
Anyways, I cannot spot a mistake about the range here:
num_shift=2+quant/5;
Thus even for quant 31 it should yield 8.2 which is 8 in (int).
also, if possible, DCT precision might need to be increased - there's some posterization happening (maybe changing the matrix would fix this too?)
I will exchange my own quant code with XviD's. Solving two problems in one turn:
a) bugs (XviD is well tested)
b) speed (it's faster than my code)
bis besser,
Tobias
Dali Lama
28th October 2004, 18:36
Hi,
I haven't had time to test this filter (or anything lately), but wouldn't it be excellent as a post-processor during playback? Especially since we would know what matrix and quant used during encoding?
-Dali
708145
28th October 2004, 18:55
Originally posted by Dali Lama
Hi,
I haven't had time to test this filter (or anything lately), but wouldn't it be excellent as a post-processor during playback? Especially since we would know what matrix and quant used during encoding?
-Dali
Sure :D Actually I'd love to use it as a pp. But even spp - which is much more optimized - is too slow for most resolutions/computers.
The idea behind the fact that I dubbed (or will dub, actually) the semi-final feature-complete version V0.1 is that it is about a factor of 10 apart from a V1.0 performance wise!
V1.0 is supposed to process the video in real-time. Everyone is invited to help optimizing of course. :p
bis besser,
Tobias
AS
30th October 2004, 22:59
While spp might be too intensive for real time pp purpose, any chance of getting it as an avisynth filter, or as an addition to core smoothD function?
Leak
30th October 2004, 23:57
Originally posted by AS
While spp might be too intensive for real time pp purpose, any chance of getting it as an avisynth filter, or as an addition to core smoothD function?
Well, when SmoothD is feature complete it's meant to do exactly what SPP does...
np: Triola - Distel (Im Fünftonraum)
708145
5th November 2004, 02:05
A new preview version is up: V0.0.9pre
Source only again since I need help with compiling.
Please PM me for ideas/solutions. Thank you.
bis besser,
Tobias
morsa
7th November 2004, 02:30
Are there any image samples available?
708145
7th November 2004, 18:32
Originally posted by morsa
Are there any image samples available?
Well, take the following examples with a grain of salt since they were produced with the "reference software" provided by A. Nosratinia.
original (http://www.funknmary.de/data/August_original50_noop.png)
processed (http://www.funknmary.de/data/August_original50_full.png)
bis besser,
Tobias
P.S.: Thanks for the input on my compiler problems. If I'm lucky it'll work today.
morsa
7th November 2004, 21:56
well, thank you.
The example after the filtering looks much better, although a lot of distorted blocks on the tree leaves are still present.
Anyway, as you said, they are old...
Thanks indeed..
BigDid
2nd June 2005, 05:01
Hello Tobias,
Any new rev in process?
Just stumble on a blocky mpeg capture and appreciate testing your Smoothd;
Tried the 0.0.9 pre2 and went back to 0.0.8
Will try the 2 4 0 3 params,
Will use extra speed if any in new rev.
Thanks
Did
708145
2nd June 2005, 12:57
Hello Tobias,
Any new rev in process?
Just stumble on a blocky mpeg capture and appreciate testing your Smoothd;
Tried the 0.0.9 pre2 and went back to 0.0.8
Will try the 2 4 0 3 params,
Will use extra speed if any in new rev.
Thanks
Did
As I finish ELDER this week I can get my hands dirty with SmoothD again. So: Yeah! A new release is coming in the next weeks.
P.S.: I don't understand why you all seem to like 0.0.8 (you're not the only one)? It so broken in my view.
bis besser,
Tobias
BigDid
3rd June 2005, 02:07
Hello Tobias,
Dunno what you mean by broken, new to filtering and params thingie. Finished toying with my source, some infos, hope it may be useful.
Source: Air analog capt, big macroblocks in moving scenes, due ( I believe) to poor quality and/or too strong compression, capt in mpeg2 8500kb/ps
Output: Xvid quant2 1 pass
Ref with no smoothd 96588k
Params tested:
1 4 0 1 -> 77262k
2 4 0 4 -> 76924k
3 4 0 5 -> 76252k
Wanted to test the params for approx same level of details in the end. I prefer 3 4 0 5 a little smoother than the 2 other but nearly no difference regarding the blocks processed.
Wanted to use 2 4 1 1 (75658k) adaptative? but got small blocks replacing big ones: posterization? :mad:
Will now try 3 4 0 5 on the whole movie instead of the small clip.
Did
708145
11th July 2005, 18:05
Hello Tobias,
Dunno what you mean by broken, new to filtering and params thingie. Finished toying with my source, some infos, hope it may be useful.
Source: Air analog capt, big macroblocks in moving scenes, due ( I believe) to poor quality and/or too strong compression, capt in mpeg2 8500kb/ps
Output: Xvid quant2 1 pass
Ref with no smoothd 96588k
Params tested:
1 4 0 1 -> 77262k
2 4 0 4 -> 76924k
3 4 0 5 -> 76252k
Wanted to test the params for approx same level of details in the end. I prefer 3 4 0 5 a little smoother than the 2 other but nearly no difference regarding the blocks processed.
Wanted to use 2 4 1 1 (75658k) adaptative? but got small blocks replacing big ones: posterization? :mad:
Will now try 3 4 0 5 on the whole movie instead of the small clip.
Did
Hmm. It really seems to work for you :)
I released ELDERchap last week and am currently porting it to Windows. It's hell!
After that I'll do SmoothD 0.1, promise.
bis besser,
Tobias
BigDid
11th July 2005, 20:29
Hmm. It really seems to work for you :)
I released ELDERchap last week and am currently porting it to Windows. It's hell!
After that I'll do SmoothD 0.1, promise.
bis besser,
Tobias
I sure can understand the 64 multicore/multithread/multi whatsoever enthousiasm ;)
But my purse is still flat and the prices are not really falling. When possible I will equip with a 754/low end mobo and a 2800 or 3000 depending on prices
In the meanwhile, good news for the 0.1 realease, keep going :)
Did
708145
12th July 2005, 17:18
I sure can understand the 64 multicore/multithread/multi whatsoever enthousiasm ;)
But my purse is still flat and the prices are not really falling. When possible I will equip with a 754/low end mobo and a 2800 or 3000 depending on prices
In the meanwhile, good news for the 0.1 realease, keep going :)
Did
About the broken issue: I mistook 0.0.8 for 0.0.7 :rolleyes:
V0.0.8 should work but is not feature complete (Flat quant 8, no UV, adaptive)
Did anyone find a setting which is good for macro blocks and doesn't smooth details much?
Maybe "2 4 0 2" or "3 4 0 2"?
bis besser,
Tobias
708145
13th October 2005, 14:08
Just to keep you updated on the progress: there is none.
But the good news is: It's not forgotten.
I currently spend all my hobby-computer-spare-time on ELDER, a parallel encoder for xvid (and x264 later on).
http://forum.doom9.org/showthread.php?t=100766
bis besser,
Tobias
redfordxx
19th November 2005, 21:42
Hi,
I try to use this filter, however I noticed it shifts color little bit. So I made shis script. Can be improved and tuned but is not bad IMO. Check it if you like.
LoadPlugin("mt_MaskTools.dll")
LoadPlugin("SmoothD.dll")
orig=AviSource("blocks.avi")
U_channel=orig.UtoY.SmoothD(2,8,0,1)
V_channel=orig.VtoY.SmoothD(2,8,0,1)
deblock_1=YtoUV(U_channel,V_channel,orig.SmoothD(1,8,0,1))
diff_1=Subtract(orig,deblock_1).ColorYUV(off_y=2)
smooth=diff_1.mt_Convolution(horizontal="1 1 1 2 2 2 1 1 1", vertical="1 1 1 2 2 2 1 1 1", y=3, u=3, v=3)
diff_2=Subtract(diff_1,smooth)
deblock_2=Subtract(orig,diff_2)
deblock_2
708145
19th November 2005, 22:19
I try to use this filter, however I noticed it shifts color little bit. So I made shis script. Can be improved and tuned but is not bad IMO. Check it if you like.
Thank you :)
But I guess I'll redo SmoothD from scratch anyway once I return to the project (and optimize for quality and speed from the beginning).
I had some ideas how to avoid too much blur and color shift while speeding the whole thing up :D
bis besser,
T0B1A5
redfordxx
20th November 2005, 06:13
once I return to the project
Hmm...
Revgen
20th November 2005, 06:45
He's working on ELDER (http://forum.doom9.org/showthread.php?t=102119) right now.
BigDid
2nd January 2006, 21:21
Thank you :)
But I guess I'll redo SmoothD from scratch anyway once I return to the project (and optimize for quality and speed from the beginning).
I had some ideas how to avoid too much blur and color shift while speeding the whole thing up :D
bis besser,
T0B1A5
May 2006 gives Tobias the ubiquitious mode or better the replicate mode so that all his projects and specially smoothd can live and grow :D
Beside that a happy new year and best wishes of health (good for coding) happyness (good for efficiency) and prosperity (good for motivation) :)
Did
708145
3rd January 2006, 11:05
May 2006 gives Tobias the ubiquitious mode or better the replicate mode so that all his projects and specially smoothd can live and grow :D
Beside that a happy new year and best wishes of health (good for coding) happyness (good for efficiency) and prosperity (good for motivation) :)
Thank you very much, that's very kind. I feel much more motivated now :D
But as job and other real-life gets higher priority all these fun coding gets only idle prio :)
bis besser,
T0B1A5
buzzqw
3rd January 2006, 13:09
i have the much respect for idle priority :)
BHH
redfordxx
17th May 2006, 17:59
@Tobias
Hi,
pls can you tell me, which are the 8 shifts you used in SmoothD.
I don't see any symetric 8 shifts... and I think it should be symetric...
redford
708145
17th May 2006, 23:36
@Tobias
Hi,
pls can you tell me, which are the 8 shifts you used in SmoothD.
I don't see any symetric 8 shifts... and I think it should be symetric...
redford
the shifts aren't symmetric but balanced in a way that the resulting vector is (0,0). I get away with less shifts for the same visual impression that way. Just alter the code if you feel bad about this and want symmetric shifts :)
bis besser,
Tobias
redfordxx
18th May 2006, 00:31
Hehe, I won't alter anything;-)
I don't speak C or whatever you use.
But I am working on similar principle directly in AviSynth scripting, so I was curious.
First I will implement 3 shifts, but I am interested to maybe make more.
If you remember it, could you give me example of the 8shifts vectors?
Tnx
R
708145
18th May 2006, 12:42
Hehe, I won't alter anything;-)
I don't speak C or whatever you use.
But I am working on similar principle directly in AviSynth scripting, so I was curious.
First I will implement 3 shifts, but I am interested to maybe make more.
If you remember it, could you give me example of the 8shifts vectors?
Tnx
R
according to this comment I use the following shift "vectors":
xshifts: 408263715
yshifts: 517362804
#1: 4,5
#2: 0,1
#3: 8,7
#4: 2,3
...
I was halfway doing an avs script based version as well... if I find it again I'll paste my code.
bis besser,
T0B1A5
redfordxx
18th May 2006, 15:41
A see...
I am doing now covering the grid of 4 pixels with 4^1 shifts which would be
0044
0404
where on 0,0 is not aplied DCT...
the next option I see was covering the grid of 2 with 4^2 shifts, and thats quite lot..;-)
708145
18th May 2006, 17:35
the next option I see was covering the grid of 2 with 4^2 shifts, and thats quite lot..;-)
That's the approach of the original paper ;)
My balanced approach works a lot better at same number of shifts but I don't want to stop you...
bis besser,
Tobias
redfordxx
18th May 2006, 18:15
That's the approach of the original paperWell I knew that I am discovering America
My balanced approach works a lot better at same number of shiftsOK, when you say so, maybe I adapt it a little...
...later.
redfordxx
18th May 2006, 18:43
My balanced approach works a lot better at same number of shiftsI looked on your vectors, you are followin the diag only...I try to cover the full quadrant...
Moreover, I wanna weight the clips later but at first try I was unable to find normalized weight mask. Normalized=sum of shifted instances of that mask is 255 everywhere
redfordxx
29th May 2006, 12:49
Hi,
Tobias, can you pls take look at the this thread (http://forum.doom9.org/showthread.php?t=111526)? That's the script I am working on... as you dealt with the topic, maybe you can have some ideas for adaptive merging. I got little stuck...
Of course, anybody else's advice also appreciated.
R.
halsboss
28th January 2007, 06:32
Hi, 708145 web page for SmoothD is http://www.funknmary.de/bergdichter/projekte/video/SmoothD/ version
Version 0.0.9pre2 November 8th, 2004
Copyright (C) 2004 Tobias Bergmann.
contact: tobias.bergmann at bergdichter.de
... fairly old ... is there new version or is this the last, and is there a prospect for a new one ?
708145
28th January 2007, 22:41
0.0.9pre2 ... fairly old ... is there new version or is this the last, and is there a prospect for a new one ?
0.0.9pre2 really is the latest version. I planned to get back to this project a lot of times but there were always more interesting things :)
Don't wait for a new release but I can't rule out that I will finally produce a 0.1 sometime.
But there are a few follow-up projects that use similar deblocking techniques and are much further progressed.
bis besser,
T0B1A5
Tanma
20th May 2007, 22:57
I had used the default values, the filter really worked, but the loss of details was too high. It simply smoothed the video to the death, removing the sharpness. Which values are good to not lose much details?
708145
22nd May 2007, 12:39
I had used the default values, the filter really worked, but the loss of details was too high. It simply smoothed the video to the death, removing the sharpness. Which values are good to not lose much details?
'quant' is the main parameter which influences the smoothing. Use smaller values for less smooth results.
jeffy
27th December 2007, 10:12
according to this comment I use the following shift "vectors":
xshifts: 408263715
yshifts: 517362804
#1: 4,5
#2: 0,1
#3: 8,7
#4: 2,3
...
I was halfway doing an avs script based version as well... if I find it again I'll paste my code.
bis besser,
T0B1A5
Did you find the script? If so, could you please post it? Thank you and all the best in 2008!
708145
10th January 2008, 14:12
Did you find the script? If so, could you please post it? Thank you and all the best in 2008!
Actually I guess it is hidden on one of my many backup DVDs. It is not hard to do so I suggest you better start from scratch.
I'm a bit sad that I don't do video related coding anymore but there are just too many other things to do. I do stay on the forums to give the occasional remark nonetheless ;)
Best wishes for further development,
T0B1A5
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.