digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: New Avisynth DCT-based filter (http://www.digitalfaq.com/archives/avisynth/1705-avisynth-avisynth-dct.html)

SansGrip 11-25-2002 05:30 PM

New Avisynth DCT-based filter
 
Tom Barry just released an experimental version of a filter that does a discrete cosine transform on the data before filtering. This should allow smoothing to be done only in certain frequency ranges.

Sounds very promising -- take a look at this Doom9 thread.

@kwag:

Theoretically this could target mosquito noise fairly precisely. Edit: Though possibly not as precisely as a full-blown FFT.

black prince 11-25-2002 08:14 PM

Hi SansGrip,

SansGrip wrote:
Quote:

Tom Barry just released an experimental version of a filter that does a discrete cosine transform on the data before filtering. This should allow smoothing to be done only in certain frequency ranges.

Sounds very promising -- take a look at this Doom9 thread.

@kwag:

Theoretically this could target mosquito noise fairly precisely. Edit: Though possibly not as precisely as a full-blown FFT.
I saw this post earlier and found it interesting and realized you
were still working wavelets (GFR). This could further the knowledge
to solve Gibbs effect. This filter is written using avisynth 2.5 experimental.
There is nothing available for avisynth 2.07. I don't know whether both
avisynths will work loaded at the same time. If these test filters were
being created for avisynth 2.07, more testers could evaluation them.

-black prince

SansGrip 11-25-2002 08:50 PM

Quote:

Originally Posted by black prince
I saw this post earlier and found it interesting and realized you were still working wavelets (GFR). This could further the knowledge to solve Gibbs effect.

They're really very similar concepts -- Tom's filter transforms the spatial data into the frequency domain, whereas a wavelet filter would transform it into the wavelet domain. Both approaches allow modification of the data in ways impossible (or exceptionally difficult) simply through manipulation of pixel values.

Quote:

Originally Posted by black prince
This filter is written using avisynth 2.5 experimental. There is nothing available for avisynth 2.07.

I know Tom used the DCT/iDCT code from XViD, which means the transformation is probably done in YV12 space. It would be very hard to convert that part of the code to YUY2.

Quote:

Originally Posted by black prince
I don't know whether both avisynths will work loaded at the same time.

They sure will. Simply download 2.5 and install it into a directory somewhere. DO NOT copy the new DLL into your system folder or you will overwrite 2.07.

Get hold of the 2.5 filters you want to use, and copy those DLLs into the same directory that Avisynth 2.5 is in. Any .avs scripts you make IN THAT FOLDER will use 2.5 and the 2.5 filters instead of 2.07 and the 2.07 filters.

You can then use a script like:

Code:

LoadPlugin("mpeg2dec3.dll")
LoadPlugin("dctfilter.dll")
# load other 2.5 dlls
Mpeg2Source("path\to\d2v")
# other filters
DctFilter(...)

If you're sending this into XViD or DivX 5 via VirtualDub you can get specially modified versions of XViD and VirtualDub that will work with YV12 data. If you're not, you'll need to add a ConvertToYUY2() as the last line of the script. If you normally convert to RGB at the end, you'll need to do that AFTER the ConvertToYUY2() line, because currently ConvertToRGB() will not work with YV12 data.

It's not an ideal setup, but at least you can play with the new filters without harming your existing install :).

kwag 11-25-2002 10:00 PM

Re: New Avisynth DCT-based filter
 
Quote:

Originally Posted by SansGrip

@kwag:

Theoretically this could target mosquito noise fairly precisely. Edit: Though possibly not as precisely as a full-blown FFT.

This looks good. Took a look at your sample .jpeg at doom9, and looks better than the original. BTW: Where's the link to AviSynth 2.5 ??

-kwag

KingTuk 11-26-2002 09:02 AM

AviSynth 2.5
 
here is AviSynth 2.5

http://cultact-server.novi.dk/kpo/av...nth_alpha.html

kwag 11-26-2002 09:18 AM

Re: AviSynth 2.5
 
Quote:

Originally Posted by KingTuk

Thanks KingTuk :D

-kwag

SansGrip 11-26-2002 10:17 AM

Re: New Avisynth DCT-based filter
 
Quote:

Originally Posted by kwag
This looks good. Took a look at your sample .jpeg at doom9, and looks better than the original.

If you read further into the thread you'll see that in 2.5 StackVertical -- for whatever reason -- reverses the order of the clips. What I thought was the sharpened, better-looking version is actually the original, and the blurred version is after DctFilter.

That said, iago is reporting compressibility gains of up to 30% without very noticible degredation in picture quality!

kwag 11-26-2002 11:37 AM

Re: New Avisynth DCT-based filter
 
Quote:

Originally Posted by SansGrip
Quote:

Originally Posted by kwag
This looks good. Took a look at your sample .jpeg at doom9, and looks better than the original.

If you read further into the thread you'll see that in 2.5 StackVertical -- for whatever reason -- reverses the order of the clips. What I thought was the sharpened, better-looking version is actually the original, and the blurred version is after DctFilter.

:cry: It was too good to be true :x
Quote:

That said, iago is reporting compressibility gains of up to 30% without very noticible degredation in picture quality!
Oh yeah! that sounds good, 234 minutes ( 180 + 30% ) on one CD-R (reduced quality) LBR and 156 minutes ( 120 + 30% ) for the regular 120 minute templates :D :lol: I have to do some test encodes 8)

-kwag

Boulder 11-26-2002 02:41 PM

I can't use v2.07 and 2.5a on the same computer. I did just as SansGrip said but no good. If 2.07 is in the system folder, it says "there's no function called ConvertToYV12" (I have to convert my YUY2 capture to YV12) .

Edit: and I can't seem to be able to open the avs script in TMPGEnc with 2.5a. Despite the line ConvertToRGB24(), TMPGEnc just crashes.

OS is WinXP, if this is of any use.

SansGrip 11-26-2002 03:24 PM

Quote:

Originally Posted by Boulder
I can't use v2.07 and 2.5a on the same computer. I did just as SansGrip said but no good. If 2.07 is in the system folder, it says "there's no function called ConvertToYV12" (I have to convert my YUY2 capture to YV12) .

When Windows looks for "avisynth.dll" it looks first in the current directory, only moving to other places (such as your system folder) if it doesn't find it. This means only avs scripts in the same folder as the 2.5 dll will use that version. All others will use 2.07.

Quote:

Originally Posted by Boulder
Edit: and I can't seem to be able to open the avs script in TMPGEnc with 2.5a. Despite the line ConvertToRGB24(), TMPGEnc just crashes.

You'll need to make sure that TMPGEnc is using the 2.5 directory as its working directory, otherwise it'll load the 2.07 dll and crash. To do this you could either copy TMPGEnc and all its files into that directory too, or you could make a new shortcut to it, and edit the working/current directory entry in the shortcut properties.

Boulder 11-26-2002 04:51 PM

Quote:

Originally Posted by SansGrip
When Windows looks for "avisynth.dll" it looks first in the current directory, only moving to other places (such as your system folder) if it doesn't find it. This means only avs scripts in the same folder as the 2.5 dll will use that version. All others will use 2.07.

You'll need to make sure that TMPGEnc is using the 2.5 directory as its working directory, otherwise it'll load the 2.07 dll and crash. To do this you could either copy TMPGEnc and all its files into that directory too, or you could make a new shortcut to it, and edit the working/current directory entry in the shortcut properties.

Thanks for the advice.

The script was in the same directory.. VDubMod should probably be pointing to the very same directory just as TMPGEnc. That would make some sense. I'll have to experiment with this as I think that most plugin authors will end up writing only 2.5 plugins - and I can't live without your latest plugins! :D

SansGrip 11-26-2002 05:42 PM

Quote:

Originally Posted by Boulder
The script was in the same directory..

That's strange, then. If the script is in the same directory as the 2.5 dll and the 2.5 filters you want to use, you should be able to double-click the script and watch it in WMP. If that doesn't work then something strange is going on.

Quote:

Originally Posted by Boulder
I'll have to experiment with this as I think that most plugin authors will end up writing only 2.5 plugins

It's not that there's much difference writing 2.5 filters as 2.07 filters, at least as far as YUY2 goes. In fact, pretty much all a plugin writer has to do is recompile the filter using the new 2.5 Avisynth header file.

The big difference is that 2.5 supports YV12, and it's generally much easier to make filters that operate on YV12 than on YUY2 (though there are some caveats). They also generally run faster, sometimes as much as 25-30%.

Since it was decided that supporting YV12 would be a good idea (and it is), I look forward to the day when everyone is using 2.5 and YV12 and I won't have to write two versions of everything, which is a major pain in the neck ;).

Boulder 11-27-2002 04:08 AM

Quote:

Originally Posted by SansGrip
Since it was decided that supporting YV12 would be a good idea (and it is), I look forward to the day when everyone is using 2.5 and YV12 and I won't have to write two versions of everything, which is a major pain in the neck ;).

I completely agree. As it's possible to use 2.5 with YUY2, there's really no need for the older one when 2.5 is considered non-alpha or -beta. The only thing that bugs me is that some 2.5 filters, for example Convolution3d, want YV12 data so I'll have to convert to YV12 if I want to use them.

SansGrip 11-27-2002 04:55 PM

A present
 
Here's a present for y'all ;).

SansGrip 11-29-2002 12:49 PM

What, no-one's tried it yet?? :D

Boulder 11-29-2002 01:22 PM

I experimented shortly with Tom's original AVS2.5 version. It seems that the filter messes up permanent subtitles quite easily. As we here in Finland have non-Finnish programs subtitled and I use permanent subs in VCDs, it is a problem I'll have to solve before taking it into everyday use. I could live without subtitles but my wife couldn't - now what can you say to that :lol:

Unfortunately I haven't had the time to experiment with different parms, but I think I'll try to do that tomorrow. If you happen to have any tips, I'm all ears.

Graal_CPM 12-02-2002 04:49 AM

Hi Boulder!

You can try to put permanent subs command at the very end of your avisynth script :wink: .

Thanx SansGrip's AviSynth 2.0.X version, I have done few testings with dctfilter myself and it is very promising. Right now, here is the kinda "production script", I use to encode in PAL 352x288 with KVCD LBR :

BilinearResize
FluxSmooth()
BB_Resolution = 352*288
BB_StrengthConstant = 352 * 240 * 20 # Base strength
StrengthValue = round(BB_StrengthConstant / BB_Resolution)
Blockbuster( method="noise", detail_min=1, detail_max=10, variance=1 )
Blockbuster( method="sharpen", detail_min=20, detail_max=90, strength=StrengthValue )
DctFilter(1,1,1,1,1,1,.5,0)
AddBorders
VobSub
LegalClip()

Quality is fine with Q around 35. I should try this with KVCDx3.
Comments and ideas are welcome.

Cheers.

Edit : maybe you were you talking about permanent subs *already* burned into the movie, like on some hudge trailers :roll: you can find around the internet?

Boulder 12-02-2002 06:16 AM

Thanks for the tip, Graal_CPM. I was just about to report that in the AVS2.0x version of the filter, the permanent subs are not affected!However, it could be that I've done something differently, so I'll have to test the AVS2.5 version again.

Compression seems to increase nicely without a loss of details with light settings :D

jp 12-06-2002 06:47 AM

I can't access www.jungleweb.net from Portugal.
Where else can I get the DCT filter 2.0x ?
I'm willing to try it because with the reduction of Max GOP in the last templates it's very dificult to put 1 film in 1 CD at 352*576.

JP

caldas_lopes@clix.pt

fozzieb 12-06-2002 08:52 AM

I cant access it either, it must be down


All times are GMT -5. The time now is 04:26 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.