Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th February 2007, 21:26   #21  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
I did put up a version of dctfilter that allows you to choose dct, if you want to compare: fdct=1/3, idct=1/2/3, 1=mmx, 2=isse, 3=sse2, 0=int but I'm still trying to get that one to work. The 16-bit int method is going to be excruciatingly slow, though.

I have no idea if the simd versions really differ, but it can't hurt to be sure. The math and assembly hurts my head.

Edit: Made another change, doesn't seem to have affected allocation strategies at all, still searching.

Ah, it does seem that the pointresize is where all the memory is getting sucked into now, I guess you'd need a custom avisynth. Actually, I guess a dll with just a custom version of that would work.

Last edited by foxyshadis; 11th February 2007 at 04:54.
foxyshadis is offline   Reply With Quote
Old 11th February 2007, 15:04   #22  |  Link
CAFxX
Stray Developer
 
CAFxX's Avatar
 
Join Date: Mar 2003
Location: Italy
Posts: 82
I rewrote the code of the filter in order to use the IPPs.
It's nowhere near being optimized (nor cpu-wise, nor memory-wise) or easily usable (only "multiplicative" upsizing ATM).
As far as the name is concerned, it will probably change in future.

sincresize(clip, int factor, int window)
clip - input clip: planar, mod 2^window
factor - scaling parameter: >= 2
window - size of first DCT: >= 2

the filter works like this:
for every (square) block of size 2^window of the source frame
- perform a forward DCT
- pad the above DCT in an empty block of size (2^window)*factor
- perform the inverse DCT on the padded block
- extract from the middle of the block a window of size (2^window)*factor/2 and copy it to the destination frame (this is done to avoid blocking)
notes:IPP DFT works on single precision floating point values, near-border regions are handled by replicating the border values.

Download (uncommented source + MSVC binary): http://cafxx.strayorange.com/SincResize.7z
(development and testing platform: Athlon64 3200+, 1GB DDR400, XP SP2, AviSynth 2.57, MSVC8, IPP5.1)
__________________
CAFxXcrossway, a collection of my projects
CAFxX@strayorange, my blog

Last edited by CAFxX; 11th February 2007 at 15:16.
CAFxX is offline   Reply With Quote
Old 11th February 2007, 16:03   #23  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
@CAFxXI got this error when I tried to use your plugin. I think when I was testing dctlimit I might have gotten a few bad sectors from heavy disk usage, so I'll run a chkdsk and report back if that changes anything.

@foxyshadis The problem with point resize is that it doesn't unallocate memory after processing?
*.mp4 guy is offline   Reply With Quote
Old 11th February 2007, 16:09   #24  |  Link
CAFxX
Stray Developer
 
CAFxX's Avatar
 
Join Date: Mar 2003
Location: Italy
Posts: 82
Quote:
Originally Posted by *.mp4 guy View Post
@CAFxXI got this error when I tried to use your plugin. I think when I was testing dctlimit I might have gotten a few bad sectors from heavy disk usage, so I'll run a chkdsk and report back if that changes anything.
I swear I don't know what is going on there... someone else has that problem?
BTW, i forgot to mention that now the filter also processes the chroma planes.

edit: I also forgot to mention that i haven't added yet the support for named parameters... invoke it like this: sincresize(<factor>, <window>)
in your case would be sincresize(2,2). i'll do that soon, anyway.
__________________
CAFxXcrossway, a collection of my projects
CAFxX@strayorange, my blog

Last edited by CAFxX; 11th February 2007 at 16:13.
CAFxX is offline   Reply With Quote
Old 11th February 2007, 17:16   #25  |  Link
niiyan
Registered User
 
Join Date: Sep 2002
Posts: 88
@foxyshadis
I downloaded DctFilter from http://forum.doom9.org/showthread.ph...432#post951432, but I can't extract it.
The error message of the extractor says the archive is broken.
Could you check if DctFilter.zip is OK or upload DctFilter.zip again?
niiyan is offline   Reply With Quote
Old 11th February 2007, 19:34   #26  |  Link
CAFxX
Stray Developer
 
CAFxX's Avatar
 
Join Date: Mar 2003
Location: Italy
Posts: 82
I packaged a second version of sincresize:
- now accepts named parameters
- parameters default are factor(2) and window(3)
- enabled multi-threading via openmp (I don't have a multicore processor, so actually I can't test if it works)
- removed a couple of useless comments from the sources

download: http://cafxx.strayorange.com/SincResize2.7z
__________________
CAFxXcrossway, a collection of my projects
CAFxX@strayorange, my blog

Last edited by CAFxX; 11th February 2007 at 19:40.
CAFxX is offline   Reply With Quote
Old 12th February 2007, 02:53   #27  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
I ran chkdsk and I've still got the problem, even after re-downloading the plugin, are you using a non-english characterset in the plugin, that might be what is causing the problems.
*.mp4 guy is offline   Reply With Quote
Old 12th February 2007, 04:24   #28  |  Link
Adub
Fighting spam with a fish
 
Adub's Avatar
 
Join Date: Sep 2005
Posts: 2,698
@niiyan
Try downloading it again. Sometimes the servers cut things off in the middle of a download so you don't actually finish the entire file.
__________________
FAQs:Bond's AVC/H.264 FAQ
Site:Adubvideo
Adub is offline   Reply With Quote
Old 12th February 2007, 05:17   #29  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
I think it was my FTP client, actually, which likes to "resume" new uploads at random. I've been uploading new versions (some of which don't crash!) over the course of the day as I'm in and out.

It has an offset codepath right now, that's going to help a lot once it works - no more need for pointresize at all! - but right now it just crashes a lot. I also found out that the original simd dcts are 16-bit, so that makes the 16-bit I was trying to hack in there pretty pointless, meh. Still haven't found any double version, if it's important I can try again some other time.

I guess this is what I get for not understanding much assembly.

Edit: Looking at the co-efficients in the debugger, I see a very easy way to increase the precision by 4 bits, just multiply everything by 16; there's a lot of unused extra precision here, probably at least 6 bits, but definitely 4.

Last edited by foxyshadis; 12th February 2007 at 07:47.
foxyshadis is offline   Reply With Quote
Old 12th February 2007, 06:35   #30  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
On a test image it looks like only 2 more bits of precision are needed to avoid any artifacts using an 8x8dct->16x16idct method, but using the current pointresize then lowpass method it could take up to 7 more bits of precision to avoid errors caused by rounding during frequency scaling =/ I know dgindex has some very precise idcts, but I don't know of any precise dcts. Version 3 of fftw has a dft equivelent to both the dct and idct, and they support variable sizes, but I don't know how precise they are, or if they are fast enough, since performing a dct using a dft is supposed to be slower then using a specialised dct algorithm. I wish I could figure out how to cludge something together in c, but most of dctfilter and sincresize are still unreadable to me.

Also IEEE explore (and all the other ones like them) are annoying, they have 90% of the papers on the dct, the hct, even the klt. meh. From googling it looks like there has been a lot of research on this topic, I can't figure out why there aren't any other implementations.

Last edited by *.mp4 guy; 12th February 2007 at 07:00.
*.mp4 guy is offline   Reply With Quote
Old 12th February 2007, 08:19   #31  |  Link
CAFxX
Stray Developer
 
CAFxX's Avatar
 
Join Date: Mar 2003
Location: Italy
Posts: 82
Quote:
Originally Posted by *.mp4 guy View Post
I ran chkdsk and I've still got the problem, even after re-downloading the plugin, are you using a non-english characterset in the plugin, that might be what is causing the problems.
I don't think... in the source file, only pure ASCII chars are used... and all the strings are in english...
Will someone else please confirm wheter the binary is broken or not?
BTW, I had a look at the sources of DGIndex, but I (obviously) found just a 8x8 iDCT: ideally I'd need a 8x8 DCT and 16x16, 32x32 (maybe even 64x64) iDCTs (if downscaling is also needed, then the full array of DCTs and iDCTs is required).
Eventually, if someone can point out a promising book on the matter, I may try to go grab it from one of the libraries of my university.
As a footnote, I found mentions of a former sourceforge project called mmxdct: unfortunately, it looks like it is not available anymore. If you happen to stumble upon a mirror, a cached version, or anything please post the address here.
__________________
CAFxXcrossway, a collection of my projects
CAFxX@strayorange, my blog
CAFxX is offline   Reply With Quote
Old 12th February 2007, 08:38   #32  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
Ehm what I meant, is what charset are you compiling it with, ASCI, Unicode? I"m guessing its a charset problem becuase of the grarbled error avisynth returned, that shouldn't happen for anything but a problem with the charset. I'll let you know if I find any good dct routines.

[edit] this might be what your looking for.

Last edited by *.mp4 guy; 12th February 2007 at 08:41.
*.mp4 guy is offline   Reply With Quote
Old 12th February 2007, 08:49   #33  |  Link
CAFxX
Stray Developer
 
CAFxX's Avatar
 
Join Date: Mar 2003
Location: Italy
Posts: 82
I did not force Unicode in the MSVC project properties, and in fact if you open the dll with a hex editor and scroll down to the strings you'll see that the chars are not 16bit wide.
Anyway I'll test the dll on another computer. Maybe it's just a missing/wrong version library kind of problem.
__________________
CAFxXcrossway, a collection of my projects
CAFxX@strayorange, my blog
CAFxX is offline   Reply With Quote
Old 12th February 2007, 09:48   #34  |  Link
CAFxX
Stray Developer
 
CAFxX's Avatar
 
Join Date: Mar 2003
Location: Italy
Posts: 82
Quote:
Originally Posted by *.mp4 guy View Post
[edit] this might be what your looking for.
Those are plain C double precision floating point routines...
__________________
CAFxXcrossway, a collection of my projects
CAFxX@strayorange, my blog
CAFxX is offline   Reply With Quote
Old 12th February 2007, 10:12   #35  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
Well, they are the only variable size dcts I found, and you aren't doing any overlapping so it shouldn't be that slow. Have you found any other non-mod-8 dct code?
*.mp4 guy is offline   Reply With Quote
Old 12th February 2007, 10:20   #36  |  Link
CAFxX
Stray Developer
 
CAFxX's Avatar
 
Join Date: Mar 2003
Location: Italy
Posts: 82
uhm... yes and no
IPP can do variable size DCT as well (actually the function is the same... you pass the dimensions of the DCT as parameters), and actually my filter does overlapping...
Quote:
the filter works like this:
for every (square) block of size 2^window of the source frame
- perform a forward DCT
- pad the above DCT in an empty block of size (2^window)*factor
- perform the inverse DCT on the padded block
- extract from the middle of the block a window of size (2^window)*factor/2 and copy it to the destination frame (this is done to avoid blocking)
maybe it was not that clear, or maybe this is not the kind of overlapping you expected, but it definitely works (precision issues aside)
(anyway, thank you for your interest!)
__________________
CAFxXcrossway, a collection of my projects
CAFxX@strayorange, my blog

Last edited by CAFxX; 12th February 2007 at 10:23.
CAFxX is offline   Reply With Quote
Old 12th February 2007, 10:51   #37  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,556
I really need to keep better track of my mental notes, it would save me so much time debugging later on. So anyway, I got you a version that'll do offsets, but unfortunately several attempts to get higher precision out of it failed. I'm going to have to ask someone who knows mmx/sse to find out why, because there's so much wasted extra room. But at least it takes less memory to do its thing:

Plugin

Code:
function dctlimit(clip c, float "dct2", float "dct3", float "dct4", float "dct5", float "dct6", float "dct7", float "dct8", float "dc", bool "use8dct", bool "use32dct", bool "use64dct", bool "use4dct"){

	dc = default(dc, 1)
	dct2 = default(dct2, 1)
	dct3 = default(dct3, 1)
	dct4 = default(dct4, 1)
	dct5 = default(dct5, 0)
	dct6 = default(dct6, 0)
	dct7 = default(dct7, 0)
	dct8 = default(dct8, 0)

	use4dct = default(use4dct, false)
	use8dct = default(use8dct, true)
	use32dct = default(use32dct, false)
	use64dct = default(use64dct, false)

	w = c.width
	h = c.height

	sourcey = c
	source = sourcey
	cropc = sourcey
	#crop0 = sourcey.dctfilter(dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8,chroma=-1)

	##################################################################-dct16-1
	align1 =  source.dfilter( 1,  0, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align2 =  source.dfilter( 1,  1, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align3 =  source.dfilter( 1,  2, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align4 =  source.dfilter( 1,  3, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align5 =  source.dfilter( 1,  4, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align6 =  source.dfilter( 1,  5, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align7 =  source.dfilter( 1,  6, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align8 =  source.dfilter( 1,  7, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align9 =  source.dfilter( 2,  0, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align10 = source.dfilter( 2,  1, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align11 = source.dfilter( 2,  2, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align12 = source.dfilter( 2,  3, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align13 = source.dfilter( 2,  4, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align14 = source.dfilter( 2,  5, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align15 = source.dfilter( 2,  6, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align16 = source.dfilter( 2,  7, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)

	################################################################## dct32 2
	align17 = source.dfilter( 3,  0, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align18 = source.dfilter( 3,  1, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align19 = source.dfilter( 3,  2, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align20 = source.dfilter( 3,  3, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align21 = source.dfilter( 3,  4, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align22 = source.dfilter( 3,  5, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align23 = source.dfilter( 3,  6, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align24 = source.dfilter( 3,  7, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align25 = source.dfilter( 4,  0, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align26 = source.dfilter( 4,  1, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align27 = source.dfilter( 4,  2, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align28 = source.dfilter( 4,  3, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align29 = source.dfilter( 4,  4, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align30 = source.dfilter( 4,  5, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align31 = source.dfilter( 4,  6, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align32 = source.dfilter( 4,  7, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)

	################################################################## dct48 3
	align33 = source.dfilter( 5,  0, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align34 = source.dfilter( 5,  1, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align35 = source.dfilter( 5,  2, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align36 = source.dfilter( 5,  3, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align37 = source.dfilter( 5,  4, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align38 = source.dfilter( 5,  5, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align39 = source.dfilter( 5,  6, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align40 = source.dfilter( 5,  7, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align41 = source.dfilter( 4,  0, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align42 = source.dfilter( 6,  1, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align43 = source.dfilter( 6,  2, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align44 = source.dfilter( 6,  3, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align45 = source.dfilter( 6,  4, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align46 = source.dfilter( 6,  5, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align47 = source.dfilter( 6,  6, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align48 = source.dfilter( 6,  7, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)

	################################################################## dct64 4
	align49 = source.dfilter( 7,  0, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align50 = source.dfilter( 7,  1, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align51 = source.dfilter( 7,  2, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align52 = source.dfilter( 7,  3, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align53 = source.dfilter( 7,  4, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align54 = source.dfilter( 7,  5, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align55 = source.dfilter( 7,  6, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align56 = source.dfilter( 7,  7, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align57 = source.dfilter( 0,  0, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align58 = source.dfilter( 0,  1, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align59 = source.dfilter( 0,  2, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align60 = source.dfilter( 0,  3, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align61 = source.dfilter( 0,  4, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align62 = source.dfilter( 0,  5, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align63 = source.dfilter( 0,  6, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)
	align64 = source.dfilter( 0,  7, dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8)

	dct4_1 = average(align56, 0.25, align38, 0.25, align20, 0.25, align2, 0.25)
	dct8_1 = average(align57, 0.125, align56, 0.125, align38, 0.125, align47, 0.125, align20, 0.125, align29, 0.125, align2, 0.125, align11, 0.125)
	dct16_1 = average(align1, 0.0625, align2, 0.0625, align3, 0.0625, align4, 0.0625, align5, 0.0625, align6, 0.0625, align7, 0.0625, align8, 0.0625, align9, 0.0625, align10, 0.0625, align11, 0.0625, align12, 0.0625, align13, 0.0625, align14, 0.0625, align15, 0.0625, align16, 0.0625)
	dct32_2 = average(align17, 0.0625, align18, 0.0625, align19, 0.0625, align20, 0.0625, align21, 0.0625, align22, 0.0625, align23, 0.0625, align24, 0.0625, align25, 0.0625, align26, 0.0625, align27, 0.0625, align28, 0.0625, align29, 0.0625, align30, 0.0625, align31, 0.0625, align32, 0.0625)
	dct48_3 = average(align33, 0.0625, align34, 0.0625, align35, 0.0625, align36, 0.0625, align37, 0.0625, align38, 0.0625, align39, 0.0625, align40, 0.0625, align41, 0.0625, align42, 0.0625, align43, 0.0625, align44, 0.0625, align45, 0.0625, align46, 0.0625, align47, 0.0625, align48, 0.0625)
	dct64_4 = average(align49, 0.0625, align50, 0.0625, align51, 0.0625, align52, 0.0625, align53, 0.0625, align54, 0.0625, align55, 0.0625, align56, 0.0625, align57, 0.0625, align58, 0.0625, align59, 0.0625, align60, 0.0625, align61, 0.0625, align62, 0.0625, align63, 0.0625, align64, 0.0625)

	align57
	use4dct ? dct4_1 : last
	use8dct ? dct8_1 : last
	use32dct ? average(dct16_1, 0.5, dct32_2, 0.5) : last
	use64dct ? average(dct16_1, 0.25, dct48_3, 0.25, dct32_2, 0.25, dct64_4, 0.25) : last
	mergechroma(source, 1)

	return(last)
}

function dfilter(clip c, int offx, int offy, float dc, float dct2, float dct3, float dct4, float dct5, float dct6, float dct7, float dct8) {
	#c.PointResize(c.width,c.height,offx,offy,c.width,c.height).dctfilter(dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8,chroma=0,offx=offx,offy=offy).PointResize(c.width,c.height,-offx,-offy,c.width,c.height)
	c.dctfilter(dc,dct2,dct3,dct4,dct5,dct6,dct7,dct8,chroma=0,offx=offx,offy=offy)
}
(The dctlimit stuff is something I should have done the first time I cleaned it up, didn't affect anything.)

Nonetheless, I think I'm going to look at CAFxX's filter for now, unless I have any sudden insights on how to make this more efficient.

I think the current version leans too heavily on warpsharp, it really has a rather dull and hollow look at 4x, very much like EKG - toning it down looks rather nicer imho. Still, I'm having a hard time choosing between this and Photozoom2, my other current favorite. PZ2 has much more deviation in line thickness that is very pleasant, but way too much contrast, where WD retains an enormous amount of detail, but somehow or another, those thick lines could really use some help. I only wish I knew how to get that effect.

Last edited by foxyshadis; 12th February 2007 at 11:41.
foxyshadis is offline   Reply With Quote
Old 12th February 2007, 14:56   #38  |  Link
niiyan
Registered User
 
Join Date: Sep 2002
Posts: 88
@Merlin7777
I have already downloaded a few times via IE6 and Firefox, after removing those browsers' cache.
But I couldn't extact it.
Anyway, thank you for your reply.

@foxyshadis
I downloaded a new version (DctFilter.zip 12-Feb-2007 04:46 224k).
It was successfully decompressed.
Thanks.
niiyan is offline   Reply With Quote
Old 12th February 2007, 23:02   #39  |  Link
*.mp4 guy
Registered User
 
*.mp4 guy's Avatar
 
Join Date: Feb 2004
Posts: 1,348
I've been finding what settings work the best, and the new defaults should perform a lot better then the old ones, tell me if it helps with the lines. The new defaults are also a lot faster. I was having trouble with chroma upsizing, so wdresize is now just luma, while wdresizeC is luma+chroma. The thickened lines where a result of a few things (mostly dehaloing), so it should be less of an issue now, since dehaloing isn't as important as I thought it was.

Code:
Function DCTus(clip clp, float "sharpness", bool "u64dct"){
	OX = m(16,Clp.Width)
	OY = m(16,Clp.Height)
	dx = ox - clp.width
	dy = oy - clp.height
	sharpness = default(sharpness, 2)
	u64dct = default(u64dct, false)
	clp.pointresize(Clp.Width*4,Clp.Height*4)
	(dx+dy >=1) ? addborders(dx*4, dy*4, 0, 0) : last
	clpcc = last
	last.dctlimit(dct2=sharpness, dct3=0, dct4=0, dct5=0, use64dct=u64dct, use8dct=true)
	(dx>=1) ? last.crop(dx*4, 0, 0, 0) : last
	(dy>=1) ? last.crop(0, dy*4, 0, 0) : last
	luma = last
	#lanczosresize(clpcc,Clpcc.Width*4 ,Clpcc.Height*4)
	#(dx>=1) ? last.crop(dx*4, 0, 0, 0) : last
	#(dy>=1) ? last.crop(0, dy*4, 0, 0) : last	
	#chroma = last
	#mergechroma(luma, chroma, 1)
return(luma)}

Function DCTds(clip clp,int destx, int desty){
		clp
	(desty*destx >= clp.width*clp.height/4) ? clp.spline36resize(m(32,(desty*2)), m(32,(desty*2))) : clp
	(desty*destx >= clp.width*clp.height/4) ? dctlimit(use64dct=true, dct2=1, dct3=1, dct4=1, dct5=0, dct6=0, dct7=0, dct8=0) : clp
	(desty*destx >= clp.width*clp.height/4) ? pointresize(destx, desty).mergechroma(spline36resize(clp, destx, desty), 1) : last

	(desty*destx >= clp.width*clp.height/3.75) ? clp.spline36resize(m(32,(desty*1.875)), m(32,(desty*1.875))) : last
	(desty*destx >= clp.width*clp.height/3.75) ? dctlimit(use64dct=true, dct2=1, dct3=1, dct4=1, dct5=1, dct6=0, dct7=0, dct8=0) : last
	(desty*destx >= clp.width*clp.height/3.75) ? spline36resize(destx, desty).mergechroma(spline36resize(clp, destx, desty), 1) : last

	(desty*destx >= clp.width*clp.height/3.5) ? clp.spline36resize(m(32,(desty*1.75)), m(32,(desty*1.75))) : last
	(desty*destx >= clp.width*clp.height/3.5) ? dctlimit(use64dct=true, dct2=1, dct3=1, dct4=1, dct5=1, dct6=1, dct7=0, dct8=0) : last
	(desty*destx >= clp.width*clp.height/3.5) ? spline36resize(destx, desty).mergechroma(spline36resize(clp, destx, desty), 1) : last

	(desty*destx >= clp.width*clp.height/3.25) ? clp.spline36resize(m(32,(desty*1.625)), m(32,(desty*1.625))) : last
	(desty*destx >= clp.width*clp.height/3.25) ? dctlimit(use64dct=true, dct2=1, dct3=1, dct4=1, dct5=1, dct6=1, dct7=1, dct8=0) : last
	(desty*destx >= clp.width*clp.height/3.25) ? spline36resize(destx, desty).mergechroma(spline36resize(clp, destx, desty), 1) : last
return last}

function wdresize(clip clp, float "sharpness", bool "u64dct", int "warp", int "thresh", int "rep", int "antihalo", int "taps", int "dehalo", float "sharpness2"){
	sharpness = default(sharpness, 1.625)
	u64dct = default(u64dct, true)
	warp = default(warp, 0)
	thresh = default(thresh, 50)
	rep = default(rep, 1)
	antihalo = default(antihalo, 0)
	taps = default(taps, 4)
	dehalo = default(dehalo, 0)
	sharpness2 = default(sharpness2, 1.126)

	cw = clp.width
	ch = clp.height
	clp
	(taps <=3) ? clp.dctus(sharpness=sharpness, u64dct=u64dct) : last

	(taps >=3) ? clp.pointresize(cw*2, ch*2) : last
	w = last.width
	h = last.height
	(taps <=3) ? pointresize(w/2, h/2) : last

	OX = m(16,last.Width)
	OY = m(16,last.Height)
	dx = ox - last.width
	dy = oy - last.height
	(dx+dy >=1) ? addborders(dx*4, dy*4, 0, 0) : last
	
	clpcc = last
	clpcc
	
	(taps <=3) ? last.DeHalo_alpha(ss=1, lowsens=antihalo, highsens=antihalo, rx=2, ry=2) : last
	
	(taps >=3) ? last.dctlimit(use64dct=u64dct, dct2=1+(sharpness/11.6), dct3=1+(sharpness/8.1), dct4=sharpness, dct5=sharpness2/8.1, dct6=sharpness2/11.6, dct7=sharpness2/16.1, dct8=sharpness2/23.1) : last
	
	(dehalo >=1) ? last.DeHalo_alpha(ss=1, lowsens=round((antihalo/2)*3), highsens=round((antihalo/2)*3), rx=2, ry=2) : last



	#(dx+dy >=1) ? addborders(dx*4, dy*4, 0, 0) : last

	(rep>=2) ? last.dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=0.5, dct5=sharpness, dct6=sharpness2/8).dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=sharpness, dct5=sharpness2/8) : last
	(dehalo >=2) ? last.DeHalo_alpha(ss=1, lowsens=antihalo, highsens=antihalo, rx=2, ry=2) : last

	(rep>=3) ? last.dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=0.5, dct5=sharpness, dct6=sharpness2/8).dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=sharpness, dct5=sharpness2/8) : last
	(dehalo >=3) ? last.DeHalo_alpha(ss=1, lowsens=round((antihalo/2)*3), highsens=round((antihalo/2)*3), rx=2, ry=2) : last

	(rep>=4) ? last.dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=0.5, dct5=sharpness, dct6=sharpness2/8).dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=sharpness, dct5=sharpness2/8) : last
	(dehalo >=4) ? last.DeHalo_alpha(ss=1, lowsens=round((antihalo/2)*3), highsens=round((antihalo/2)*3), rx=2, ry=2) : last

	(rep>=5) ? last.dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=0.5, dct5=sharpness, dct6=sharpness2/8).dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=sharpness, dct5=sharpness2/8) : last
	(dehalo >=5) ? last.DeHalo_alpha(ss=1, lowsens=round((antihalo/2)*3), highsens=round((antihalo/2)*3), rx=2, ry=2) : last

	(rep>=6) ? last.dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=0.5, dct5=sharpness, dct6=sharpness2/8).dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=sharpness, dct5=sharpness2/8) : last
	(dehalo >=6) ? last.DeHalo_alpha(ss=1, lowsens=round((antihalo/2)*3), highsens=round((antihalo/2)*3), rx=2, ry=2) : last
	
	(rep>=7) ? last.dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=0.5, dct5=sharpness, dct6=sharpness2/8).dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=sharpness, dct5=sharpness2/8) : last
	(dehalo >=7) ? last.DeHalo_alpha(ss=1, lowsens=round((antihalo/2)*3), highsens=round((antihalo/2)*3), rx=2, ry=2) : last
	
	(rep>=8) ? last.dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=0.5, dct5=sharpness, dct6=sharpness2/8).dctlimit(use64dct=u64dct, dct2=1, dct3=1, dct4=sharpness, dct5=sharpness2/8) : last
	(dehalo >=8) ? last.DeHalo_alpha(ss=1, lowsens=round((antihalo/2)*3), highsens=round((antihalo/2)*3), rx=2, ry=2) : last
	
	awarpsharp(depth=warp, cm=0, blurlevel=1)
	awarpsharp(depth=warp, cm=0, blurlevel=1)
	awarpsharp(depth=warp, cm=0, blurlevel=1)
	awarpsharp(depth=warp, cm=0, blurlevel=1)
	
	(dx>=1) ? last.crop(dx*4, 0, 0, 0) : last
	(dy>=1) ? last.crop(0, dy*4, 0, 0) : last
return(last)}

function wdresizec(clip clp, float "sharpness", bool "u64dct", int "warp", int "thresh", int "rep", int "antihalo", int "taps", int "dehalo", float "sharpness2"){
	sharpness = default(sharpness, 1.6)
	u64dct = default(u64dct, true)
	warp = default(warp, 0)
	thresh = default(thresh, 50)
	rep = default(rep, 1)
	antihalo = default(antihalo, 0)
	taps = default(taps, 4)
	dehalo = default(dehalo, 0)
	sharpness2 = default(sharpness2, 1.126)
	clp
	wdresize(sharpness=sharpness,u64dct=u64dct,warp=warp,thresh=thresh,rep=rep,antihalo=antihalo,taps=taps,dehalo=dehalo, sharpness2=sharpness2)
	mergechroma(lanczos4resize(clp, clp.width*2, clp.height*2), 1)
return(last)}
dctds works now, but only gives good results when downsizing a mod 32 source by a factor of 2.

@CAFxX I would like to test your filter, tell me if you find out what went wrong on my system, I'll keep looking for the problem.
[edit] It looks like avsp screwed up the formatting, I'll see what I can do about it. [edit] fixed

Last edited by *.mp4 guy; 13th February 2007 at 00:27.
*.mp4 guy is offline   Reply With Quote
Old 13th February 2007, 00:28   #40  |  Link
CAFxX
Stray Developer
 
CAFxX's Avatar
 
Join Date: Mar 2003
Location: Italy
Posts: 82
@*.mp4 guy
Tomorrow I hope I'll have some time to try it on my second computer. I'll let you know if it worked ASAP.

BTW, those are a few other ss:
Original
Spline36
SincResize

and, just to remember everyone that every rose has its thorn:
Artifacts
(4x enlargment, top: SincResize(4,6), bottom:Spline36())
__________________
CAFxXcrossway, a collection of my projects
CAFxX@strayorange, my blog
CAFxX is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:30.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.