Log in

View Full Version : Plugins projects


Marc FD
7th August 2002, 18:10
Hi.

We are several avisynth coders, and we work on various projects.
I expose here some ideas i have because i'm sure there are at least one of them who is already implemented or being implemented or in the way of being implemented (well, you get it :) )

1) A postprocessor for MPEG(1,2,4) video
i think of something who'll try to get rid of most of the compression artifacts (blocks, smearing, and some exotic things) whithout washing and blurring all the details.
Some filters like smootherhiq can already handle that pretty well but i think a "specialized" filter can do a better job. since time is not an issue we can do a better filtering than the filters used in video playback.
It would be usefull for reencoding without loosing too much quality

2) A preprocessor for video codecs.
I dunno exactly how this can be done. it needs lots of testing...
maybe it cannot be done by an avisynth filter ?? (if so knows..)
the general idea is to blur/simplify/change the image before encoding and to restore it at decoding time. There would be a decoding-time critical mode (for direct playback) and a archiving mode (you will need to expand the file before seeing it)
is it a totally dumb (and impossible) idea ??

3) an anime-dedied general filter
This filter would be specialized for anime. It would (try) to recognise degrades gradients/textures/edges/shapes to use better denoising and edge enhancement...

Yes, i don't have very clear ideas, because they are just projects, but if anyone don't do it before, i would implement them someday.
but not in a short term because i'm already coding several filters...

If someone is already working on something like that, could he post a little something ?? i would of course like to help him :)

poptones
7th August 2002, 20:40
The MPEG postprocessor, as I've said before, is one of the reasons I put together layer. I know it sounds odd, but I wanted to take it one step at a time. A long time ago I put together an idea for one based on old telecide code neuron shared with me. It worked pretty well and it did what it did by selectively blurring individual frames corresponding to how many vertical edges it found in the frame.

If you take any given MPEG video and subtract it with a version of itself shifted one pixel diagonally, you can easily pick out the artifacts because they will appear as high intensity lines. If you create an algorithm that looks for these lines exactly 8 pixels displaced from one another, you can get a very accurate count of the number of "blocks" visible in the scene. By keeping a weighted total of the average intensity, you can guage their visibility of those block. And because they only appear every eight pixels (at most) once you find a single edge you can do all this without having to look at every single pixel.

That's how my prototype worked. It created a report of its own that had a line for every frame where it found artifacts, but as I said it was just a prototype. In the real deal it would be a simpler matter to have it create a blur matrix on the fly based on this data.

BTW it worked really well. A heavily blurred frame looks much more natural than a heavily pixelated frame - it looks like an effect instead of a defect.

And this algorithm can also be used as a preprocessor. If you heavily blur the frames in the heaviest motion scenes (like where frames are alternately very bright and very dark) then you not only save bandwidth, you also get a much more attractive finished product.

Guest
7th August 2002, 21:47
@poptones

Did you consider blurring just the detected edge areas themselves instead of the entire frame?

bb
8th August 2002, 11:22
@neuron2:
Funny that you mention that. That's exactly the topic of my thread a few days ago, but I didn't get much support:

http://forum.doom9.org/showthread.php?s=&threadid=30344

bb

Guest
11th August 2002, 05:19
@bb

The difference is that you did not restrict the edges to be the edges of the macroblock artifacts.

poptones
11th August 2002, 10:13
Did you consider blurring just the detected edge areas themselves instead of the entire frame?

That will not really fix a badly macroblocked frame. If you want to do something like that on original material before it's compressed you could probably come out well. But I am trying to take already encoded MPEG2 streams and make it not only look better, but compress better. All those macroblocks have to be recompressed, so if you don't have a tool to detect and fix them you ironically end up with video that not only looks worse, but also gets BIGGER on every recompression.

BTW, you probably don't realize how badly a lot of stuff is until you look for it. Video that looks perfectly fine can reveal a LOT of artifacts when you apply the proper matrix operations to it.

bb, I just didn't see your message. I would certainly have replied if I had.

kyousuke
11th August 2002, 18:37
great, it's very interesting.

i've a lot of anime raws (if you know that), very good for testing the performance of a supposed good filter.

good luck
see ya

Marc FD
18th August 2002, 10:56
I've tons of raws myself too :)

the bad thing is that i can't resolve to encode them definitively because i think there would be alot of improvements in encoding in the next weeks ....

the pb actually is that i don't have time enough to code all my ideas :(

kyousuke
19th August 2002, 03:05
t'as des raws! huhuhu, bon faut kon cause j'en ai des tas aussi LOL

i'm going to re-encode them too, but i just wait a little for the b-frame and some new/improved avs filters which will come.

nb: faut kon se voit sur un irc, ça serait plus sympa ^^

Marc FD
19th August 2002, 09:03
Originally posted by kyousuke
i just wait a little for the b-frame and some new/improved avs filters which will come.

that was what i was thinking of :)
PS : I'm not awaiting much from B-frames in XviD. an improved EPZS would make us gain far more ! (and DivX B-frames are useless when you use copysame : you gain NO-TH-ING !!)

kyousuke
19th August 2002, 23:45
si j'utilise copysame ?
oulà explique moi, je te suis pas là mais ça m'interess vachement :)

i'm going to read your doc right now, and try to understand :p !!!

kyousuke
20th August 2002, 00:12
huhu you're sure that no important frames are losed ?

i'll try this on raw already ivtc(ed) and on an anime dvd.

about your anime-dedied general filter, i would like a great edge enhancement (like warpsharp) and a supa denoiser LOL

thks marc :D

nb: j'ai hate de tester ton copysame :p
faut le mettre aprés decomb nan ?

Marc FD
20th August 2002, 01:35
When i say B-frames are useless, it's a bit extreme.
(and I said DivX bframes, who are crap wherever you use movie or anime)
But the gain in anime with Bframes would almost be in still frames, and CopySame already handles that.

Yes, it needs a progressive source !!

and the anime dedied filter is still a long-term project ....
maybe i could adapt existing filter to anime ??

PS : I'll release CopySame v1.1 very soon (demain ?)
(and there are tons of modifications and improvements)

kyousuke
20th August 2002, 01:45
i had a problem with mam this night, so haven't the time to test copysame, i'll wait your v1.1 in the case ;)

for adapting existing filter, why not but filtering an anime is hard (i guess about my raws ^^)... i think about a filter, but i don't use it cause of the output is really unstable.
it's Area Smoother, and i think this filter is REALLY very intesting for re-colorise (ONLY uniformly colored area) the color like a celluloid (yes my english sux ;) but the detection is too hazardous and it's not an anime dedied filter at the beginning i think...

if you haven't, i'll attach it

Marc FD
20th August 2002, 02:00
I never used this one, (only tried on some cowboy bepob material)
but it seems really bad !!
i had pbs with an hellsing trailer encoded using this one, it looked horrible (because you the color areas where almost like artifacts ! )
A much better algo would be with alpha masked areas :)
(i took a look in the source 3 weeks ago, but it wasn't very interessing...)

maybe it would worth i try ...
(...i'm going to fall asleep on my keyboard...)

kyousuke
20th August 2002, 02:05
me too i sleep on my keyboard... i think ill go to too........ =)

zzzzZZZzzzz