Log in

View Full Version : PixieDustPP by Didée (was: Dust and blocks, or making dust even slower)


Pages : 1 [2]

Soulhunter
10th July 2004, 03:50
Originally posted by Didée
My proposed method of averaging two offset'ed clips is "faster" (read: less slow) than your resize-method. :p
But visually as well... :confused:


Bye

Didée
23rd October 2005, 17:33
Wow, this thread has become old. Nonetheless, here is where the following belongs:

# ================================
# PixieDustPP v0.1 (21 Oct 2005)
# ================================
#
# A wrapper & postprocessing function for PixieDust. The aim is to reduce the blocking artefacts that PixieDust may produce
# on image areas it can't motion-compensate correctly.
# Moreover, PixieDust has a tendency to make the overall output a tad too soft, caused by its spatial processing [SpaceDust].
# Then, the additional Deblocking doesn't exactly help on that matter ... so there is also the possibility to apply some very
# slight sharpening, in order to compensate for this softening.
#
# It's not the ultimate solution. But it helps very noticeably.
#
# Required Plugins:
# - MaskTools (at least v1.5.6, v1.5.8 recommended)
# - DGDecode (a recent version containing the "Deblock()" h.264 deblocking routine)
# - RemoveGrain (the pre-1.0 version!)
#
#
# Fiddled together by Didée, for your pleasure.
#

Didée
23rd October 2005, 17:35
The script:

# ================================
# PixieDustPP v0.1 (21 Oct 2005)
# ================================
#
# A wrapper & postprocessing function for PixieDust. The aim is to reduce the blocking artefacts that PixieDust may produce
# on image areas it can't motion-compensate correctly.
# Moreover, PixieDust has a tendency to make the overall output a tad too soft, caused by its spatial processing [SpaceDust].
# Then, the additional Deblocking doesn't exactly help on that matter ... so there is also the possibility to apply some very
# slight sharpening, in order to compensate for this softening.
#
# It's not the ultimate solution. But it helps very noticeably.
#
# Required Plugins:
# - MaskTools (at least v1.5.6, v1.5.8 recommended)
# - DGDecode (a recent version containing the "Deblock()" h.264 deblocking routine)
# - RemoveGrain (the pre-1.0 version!)
#
#
# Fiddled together by Didée, for your pleasure.
#

function PixieDustPP(clip clp, int "limit", int "q", int "s", int "smode", int "smode2", int "fullDB", bool "reduce")
{
limit = default( limit, 3 ) # limiter value for PixieDust
q = default( q, 24 ) # quant to use for Deblocking (h.264 deblocking routine provided by recent DGDecode)
s = default( s, 1 ) # subliminal sharpening to combat dulling due to PixieDust and Deblocking:
# 0->no sharpening 1-> before PixieDust 2-> after Deblocking 3->both
smode = default( smode, 4 ) # RemoveGrain blurring mode to use for sharpening before PixieDust
smode2 = default( smode2,20 ) # same for 2nd sharpening
fullDB = default( fullDB,51 ) # 0 -> reduce only PixieDust's blocking 100 -> reduce Source & PixieDust blocking
reduce = default( reduce,false) # when true: at the very end, for every pixel reduce the achieved effect by 1
rg1str = (s==3) ? 0.333 : 0.5

SHRP1 = "x y - abs 2 "+string(limit/3.0)+" - < x y - abs 24 > ° x x y - abs 4 < x y - abs 11 > ° x 1 x y - x y - abs / * + x 2 x y - x y - abs / * + ? ?"
SHRP2 = "x y - abs 2 < x y - abs 24 > ° x x y - abs 4 < x y - abs 7 > ° x 1 x y - x y - abs / * + x 2 x y - x y - abs / * + ? ?"
REDUC = "x y - abs 2 < x x x y - abs 1 - x y - x y - abs / * - ?"
DBALT = "x 128 - y 128 - * 0 < x x 128 - "+string(fullDB)+" * 100 / 128 + ?"

clp2 = isyv12(clp) ? clp : clp.converttoyv12()
clp2

(s==1 || s==3) ? yv12lutxy(last,last.removegrain(smode,-1), yexpr=SHRP1,U=2,V=2) : last
(s==1 || s==3) ? mergeluma(removegrain(1,-1), rg1str) : last

converttoyuy2()

dusted = pixiedust(limit).converttoyv12()
dustdiff = yv12lutxy(clp2,dusted,"x y - 128 +","x y - 128 +","x y - 128 +",U=3,V=3)

deblocked = dusted.deblock(q)
deblockdiff = yv12lutxy(dusted,deblocked, "x y - 128 +", "x y - 128 +", "x y - 128 +", U=3,V=3)
deblockdiffnew = yv12lutxy(deblockdiff,dustdiff, DBALT, U=2,V=2)

yv12lutxy(dusted,deblockdiffnew, "x y 128 - -", "x y 128 - -", "x y 128 - -",U=3,V=3)

(s==2 || s==3) ? yv12lutxy(last, last.removegrain(smode2,-1), yexpr=SHRP2, U=2,V=2) : last
(s==2 || s==3) ? mergeluma(removegrain(1,-1), rg1str) : last

reduce ? yv12lutxy(clp,last, REDUC,"y","y", U=3,V=3) : last

isyv12(clp) ? last : isRGB(clp) ? last.converttoRGB() : last.converttoyuy2()

return( last )
}

mg262
23rd October 2005, 19:36
:) Since Dust filters are my first response to... well, most things, this is extremely welcome! :) Thank you, Didée.

(I shall set appropriate jobs to run overnight and tomorrow and then try to produce some intelligent feedback. Did I remember to say :) :) :) ?)

mg262
24th October 2005, 13:27
I took the liberty of updating the thread title -- hope that's okay, Didée.

MaskTools -- http://manao4.free.fr/
DGDecode -- http://www.neuron2.net/
RemoveGrain -- http://videoprocessing.11.forumer.com/viewtopic.php?t=9

Edit: Grrr... the thread title keeps reverting. Let me try again...
Edit: No luck. The first post is suitably altered, but it's not reflected in the AVISynth usage forum. :angry:

Wilbert
24th October 2005, 13:39
Edit: No luck. The first post is suitably altered, but it's not reflected in the AVISynth usage forum.
Here you go ;)

mg262
24th October 2005, 14:38
:thanks:

Didée
24th October 2005, 14:57
If you mean so, sure ... but you're shooting rather quickly, my friend. Until first feedback has come in, we're not even sure it isn't a hoax ;)
(Waiting for our famous block-spotter Soulhunter...)

Note the "v0.1" ... it's just "one try" of several possible. Following the same idea, things could be done in several slightly different ways - in the end, Dust's blocking issues are mostly a matter of pixel changes of +/-1 to +/-2. In this range, it's not trivially easy to seperate the good from the bad ...


And some mysterious oracling: PixieDustPP is a little child ... little childs love to ride a SeeSaw :)

mg262
24th October 2005, 16:48
Well, I was worried that it might slide away unseen... threads turn up in the AVISynth Usage forum so fast that I only read about half of them -- and I'm reasonably active. (And I unhelpfully made the presence of your post rather less visible by replying to it...) I hope you didn't mind.

Note the "v0.1" ... it's just "one try" of several possible. Following the same idea, things could be done in several slightly different waysDon't worry, I'm not expecting perfection on a first attempt... I'm just glad you've turned your attention to this problem.

In this range, it's not trivially easy to seperate the good from the bad ...And this is why I'm glad you've turned your attention to this problem ;) . My previous attempts would have been on the order of PixieDust.LtdSharpen (on my sources blurring is a problem much more often than blocks, though both do occur...)

Still testing... NB using limit > 5 causes black spots to appear all over the picture. (Wraparound?)

SeeSaw... makes me think of up and down...

Edit: The stuff my hard disk is full of doesn't seem to produce blocks in Dust... there is some loss of sharpness, and I think the script may help a little, but the effect is very subtle. (Look at the brown face on the second step up.)

http://people.pwf.cam.ac.uk/mg262/posts/pixiecomparison617.png

The material that spawned this thread is long gone from my HDD, but I'm hunting for something more suitable to test it with...

Edit: just noticed I typed DD instead of PP... subliminal associations :p

FlimsyFeet
24th October 2005, 21:32
Huffyuv cap from analogue source:

PixieDust(limit=5)
http://img419.imageshack.us/img419/4662/pixie0kp.png

PixieDustPP(limit=5, fullDB=0)
http://img419.imageshack.us/img419/9062/pixiepp3mp.png

Didée
25th October 2005, 12:07
Quite possible. On the other hand:

source:
http://img474.imageshack.us/img474/1595/28401source2qo.png

PixieDust():
http://img474.imageshack.us/img474/6974/28402pixie4gb.png

PixieDustPP(s=1,q=35,fullDB=49)
http://img474.imageshack.us/img474/2968/28403pixiepps1q35db490rh.png

Look at the background, on the right ...


edit: compared to a simple PixieDust().Deblock(quant=30):

http://img474.imageshack.us/img474/5324/28404pixiedeblock306kx.png

, which is obviously softer ... after compression, quite muddy.

Soulhunter
25th October 2005, 12:16
Waiting for our famous block-spotter Soulhunter...
Hehe, still have this Gladiator chapter on my HDD... ^^

If I find the time I post some samples in the course of the day, or night!?


Bye

Didée
25th October 2005, 14:11
Sure, Soulhunter, go on. Much appreciated. Only practice can (dis)prove theory ... ;)


Some notes for testing:

s=1 should be always good, against "PixieDust softness" (minor enhancement before PD, max. change is +/- 2).

s=2 (and 3, which is 1 + 2) is meant to combat "Deblocking softness" (small enhancement after deblocking, max. change is +/- 2). Seems not always that good, probably better to use it only when fullPP >= 51.

fullPP = 0 --> Only those pixel changes achieved by Deblock() are used that have different "sign" than the pixel changes achieved by PixieDust. Consequently, this will (should) do nothing to a frame except for reversing changes PixieDust has made. (Assuming that PixieDust has not left any noise that Deblock could reduce any further, it should only be blocking created by PixieDust that will be reverted, while the achieved noise reduction should be kept.)

when fullPP>0 then: all changes from Deblock() that would not be used with fullPP=0 (i.e. those changes having the same "sign" as PixieDust's changes) are applied with a percentage of [fullPP].

Since most changes of (reasonable) Deblocking will be very small (numerically), the rule of thumb is: (simple matter of rounding)

fullPP=100 -> full deblocking of PixieDust & Source (propably too blurry)

fullPP=49 -> full deblocking of PixieDust. Source deblocking results will be applied as 1->0, 2->1, 3->1, 4->2

fullPP=51 -> full deblocking of PixieDust. Source deblocking results will be applied as 1->1, 2->1, 3->2, 4->2


"reduce" parameter: probably not worth to use. (Perhaps on strong grained sources with fullPP=100.)

Soulhunter
25th October 2005, 18:28
Source
http://img485.imageshack.us/img485/4590/2984source5oh.jpg (http://imageshack.us)

PixieDust(5)
http://img110.imageshack.us/img110/7/2984pix50jo.jpg (http://imageshack.us)

PixieDustPP(Limit=5,FullDB=75)
http://img485.imageshack.us/img485/1812/2984pixiedustpplimit5fulldb755.jpg (http://imageshack.us)

Well, seems to work... ^^

Next I try to find a sharp scene with blocks!


Bye

Soulhunter
25th October 2005, 18:55
Source
http://img429.imageshack.us/img429/3897/1496source7eu.jpg (http://imageshack.us)

PixieDust(5)
http://img429.imageshack.us/img429/3759/1496pix52dk.jpg (http://imageshack.us)

PixieDustPP(Limit=5,S=2)
http://img448.imageshack.us/img448/4461/1496pixiedustpplimit5s22xz.jpg (http://imageshack.us)

Dallemon
19th January 2006, 05:16
ehm im getting some weird artefacts using this filter/script combo :/

AVS-script:
loadplugin("C:\Programmer\AviSynth 2.5\plugins\old\loadpluginex.dll")
loadplugin("C:\Programmer\AviSynth 2.5\plugins\old\dustv5.dll")
mpeg2source("d:\fc1080i.d2v",cpu=0,ipp=false)
crop(2,0,-0,-8,align=true)
lanczos4resize(1488,1080)
pixiedustpp(limit=5,s=3,smode=19,smode2=19,fulldb=0)
limitedsharpenfaster(dest_x=1280,dest_y=720)

Screenshot:
http://img483.imageshack.us/img483/9043/snapshot200601190502590oh.jpg (http://imageshack.us)

hartford
19th January 2006, 05:27
Pixie will do a "pre-ghost" frame at times; ie, it's temporal compensation will
show itself by "ghosting" in a "previous" frame.

I have seen it do this, but whenplayed on TV, it is not noticable. However, your requirements may differ.

I cannot say with certainty that the artifacts that you see are as a result of the way that the filter works without posting some "without Pixie" frame.

Dallemon
19th January 2006, 05:47
well i've also tried using iip for resizing and that gives the same result :/ (if i just use limitedsharpen then i dont get the lines)

EDIT: requirements are 1280x720 projector without scaling =)

Didée
19th January 2006, 09:10
PixieDust will start to behave strangely on big framesizes above a certain limit, and will totally b0ork out on even bigger framesizes.
I'm not sure anymore what the exact limits are, but IIRC it gets dangerous above 1024x1024.

BTW, although technologically absolutely different, FFT3DFilter is a (more than) adequate alternative to PixieDust.

zlab
25th March 2006, 15:41
Hi,
I hv a problem of loading dustv5.dll in the script, it response with ... not a avisynth 2.5 plugin, any solution? it there any possible link to dustv6.dll?
Thanks.

Didée
25th March 2006, 16:14
dustv6 does not exist. (Not that we knew of.)

dustv5 has to be loaded via LoadPluginEx or LoadPluginEx2.

zlab
25th March 2006, 16:26
Thanks a lot, now working like a fluid.

_leech_
23rd June 2006, 02:51
PixieDustPP works great, but not perfectly...

http://img58.imageshack.us/img58/2551/artifact3cf.jpg

:(

DeepDVD
23rd June 2006, 04:12
@ _ leech_

Look on upper side. There's a screenshot with the same problem.

PixieDust will start to behave strangely on big framesizes above a certain limit, and will totally b0ork out on even bigger framesizes.
I'm not sure anymore what the exact limits are, but IIRC it gets dangerous above 1024x1024.

jeffy
24th February 2008, 17:42
Correction for PixieDustPP (Division by zero):
http://forum.gleitz.info/showpost.php?p=329781&postcount=26

Amateur
3rd February 2011, 16:15
is pixiedust still a useful filter? has it been updated/improved? if so, what is its successor?