Log in

View Full Version : PixieDust and pink bars


PiXuS
9th October 2004, 15:33
I found this thread (http://forum.doom9.org/showthread.php?s=&threadid=64253&highlight=pixiedust+pink) where there is mention of the problem I am facing right now.

Here is a screenshot of the problem in static action:

http://img39.exs.cx/img39/4210/pink_shit.th.png (http://img39.exs.cx/my.php?loc=img39&image=pink_shit.png)

I tried to remove PixieDust from my script and it fixed the problem. Though, reading the thread I point to, it seems the problem is really about the color conversion neeeded to use the plugin.

Wilbert was proposing to use a mod4 cropping. I already do that (my crop params are 22,70,664,344). But using Lanczos4Resize the alternative way (with the cropping, i.e. Lanczos4Resize(800x336,22,70,664,344)) fixed the problem.

I guess that is because in my script, the Lanczos call is after the color conversion.

So.. am I stuck with this problem? I will need to apply the cropping after PixieDust is called? Big loss? Should I hang myself?

PiXuS

EDIT: Well, it IS PixieDust that cause the problem. I tried the following combinations:


Crop()
ConvertToYUY()
PixieDust()
ConvertToYV12()
Lanczos4Resize()


Generates pink bars. Proves there is a problem. ;)


Crop()
ConvertToYUY()
#PixieDust()
ConvertToYV12()
Lanczos4Resize()


No pink bars. Proves the color conversion is safe.


ConvertToYUY()
PixieDust()
ConvertToYV12()
Crop()
Lanczos4Resize()


No pink bars. Proves PixieDust can be used IF cropping is done after PixieDust.

Gaw.

PiXuS

pelle412
9th October 2004, 17:48
PixieDust before crop or after resize, not inbetween unless you can get a proper mod-X? resolution. I think mod-4 may not be enough.

PiXuS
9th October 2004, 17:59
@pelle412

Thanks for the reply. I know using a noise filter after a resize isn't wise if you want to keep as much picture quality as possible. I aim for picture quality over encoding speed so denoising after resizing is not an option. I guess I will have to denoise before cropping. I guess it doesn't make too much of a difference (I will have to check that).

Again, thanks!

PiXuS

Chainmax
9th October 2004, 21:46
Yeah, the Dust filters require MOD16 width and height or the pink bars appear.

PiXuS
9th October 2004, 21:52
@Chainmax

Hmmm... 800x336 is Mod32 x Mod16 are there were pink bars.

PiXuS

pelle412
10th October 2004, 00:47
If you crop 22,70,664,344 you no longer have mod16 resolution.

PiXuS
10th October 2004, 01:38
@pelle412 & @Chainmax

Damn true! Thanks!

PiXuS

Didée
10th October 2004, 10:16
May I point you to this thread (http://forum.doom9.org/showthread.php?s=&threadid=78959&highlight=dust2).

There it is stated that Dust needs to work on frames with a horizontal res that's mod16 and a vertical res of mod8.

And you'll also find a wrapper script called "Dust2" that allows to feed a clip of arbitrary resolution into Dust, without cracking one's brain about the actual MODs of the resolution.
It's in this (http://forum.doom9.org/showthread.php?s=&postid=519170#post519170) post.

PiXuS
10th October 2004, 17:00
@Didée

I am overloaded with information right now. ;-) I will have to stop to say THANK YOU everytime you give precious information because people will say I am one of your groupies. ;-)

I read the whole thread you pointed to. I found your function PixieDust2


function PixieDust2( clip clp, int "limit" )
{
lim = default(limit, 5)
ox = clp.width
oy = clp.height
xcorr = int( 16. - ox%16 - 4. )
ycorr = int( 8. - oy%8 - 4. )
top = clp.crop( 0, 0,-0, 4).flipvertical()
bot = ycorr > 0
\ ? clp.crop( 0,oy-ycorr,-0,-0).flipvertical()
\ : top
ycorr > 0 ? stackvertical( top, clp, bot)
\ : stackvertical( top, clp)
left = last.crop(0, 0, 4,-0).fliphorizontal()
right = xcorr > 0
\ ? last.crop(ox-xcorr,0,-0,-0).fliphorizontal()
\ : left
xcorr > 0 ? stackhorizontal(left,last,right)
\ : stackhorizontal(left,last)

clp.isYV12() ? ConvertToYUY2() : NOP
PixieDust(lim)
clp.isYV12() ? ConvertToYV12() : NOP
crop(4,4,-xcorr,-ycorr)
return last
}


BTW.. I think there is a mistake with the color conversions. Should the line after the call to PixieDust be


clp.isYUY2() ? ConvertToYV12() : NOP


instead of


clp.isYV12() ? ConvertToYV12() : NOP


?

I will test your function, but I also read this post (http://forum.doom9.org/showthread.php?s=&postid=519731#post519731) where you talk about applying Dust on offsetted versions of the video and then merging the whole (maybe I missed the concept). Did you ever produced a wrapped function of this idea? If not, I will try to figure out what you meant and modify PixieDust2 with it (and then share it of course).

Thanks ! (yeah.. I'm a groupie. ;) )

PiXuS

Manao
10th October 2004, 17:35
There are no mistakes. If clp was in YV12 in the first place, it will stays YV12 during the whole execution of the function. "ConvertTOYUY2()" doesn't convert clp, it does a copy of clp and then converts it ( and stores it in a variable called "last" )