View Full Version : could someone make a plug-in of this algorithm?
E-Male
12th February 2004, 23:52
http://www.hiend3d.com/hq3x.html
on this site you find the hq3x algorithm, as well as hq2x and hq4x
i think it shouldn't be hard for one of our programmers around here to make an avisynth plug-in of them (giving the commands hq3x, hq2x and hq4x, each without parameters, or one command with the parameters 2, 3 and 4)
:thanks: in advance
you may wonder: what the %&$%§$ does he need magnification filters for in avisynth
but i think combined with another idea of mine, which i hope to be able to prgram myself soon, this might become a very intersting project
cu
e-male
killerhis
13th February 2004, 00:07
This indead looks awsome. I made something like that a while ago, its a avs files (written in avs). It basicly made the resolution like 3x bigger, then I used severals smoothing and sharping filters to level out the blocks and then resize it back to its original format. The results where a more smoothed, better looking clip.
However, the link you showed me looks better then then the filter I made and it would be indeed interesting if someone made a compiled filter for avs, especially for more speed!
I couldn't find the avs anymore I made(got to many avs files ^_^) but when I find it, I'll edit this post!
Nic
13th February 2004, 10:33
What's the upside of this filter compared to simply doing a bicubic resize to a higher resolution? Is it better quality?
Also the code expects RGB, which doesn't make it so easy to port to our beloved YV12 (although the code does use YUV to difference comparison of two pixels, but haven't looked into it closely)
@E-Male: You might want to say what you plan to do with it, rather than keep it a mysterious secret...might motivate others to port it :)
-Nic
Richard Berg
13th February 2004, 11:23
What's the upside of this filter compared to simply doing a bicubic resize to a higher resolution? Is it better quality?
If I recall from last time I saw their tech demoed, the algorithm looks for vector components and then tries to rasterize them at a different resolution (supersampling). Obviously that will only work for videos with lots of straight lines and block fills, but we do have an anime contingent here apparently willing to try it.
Potential users: why not export some frames with ImageWriter, run the image tool in batch, and reconstruct the video? Not as a practical measure, but as a test to see whether further development is worth it.
mf
13th February 2004, 14:13
Coincidence or cause and effect? I posted the same thing earlier yesterday in another post (http://forum.doom9.org/showthread.php?s=&threadid=69052). My idea is to use it for antialiasing of hard edges, like VobSub DVD subpictures.
E-Male
13th February 2004, 19:22
ok, i'll try to explain my project, i hope i can get it across in english:
it's all just for simpsons-style material
before encoding my planed filter(s) would be used
it'll make sure all the edges are perfectly black and the rest (which is just fill color) will be blurred to eliminate noise
the result will be encoded at low resolution, giving small files
then the hq3x (2x, 4x, whatever) filter comes into play
if it runs in avisynth in real-time it could be used while playback
giving a watchable picture from the low-resolution file
ok, that was teh short version, but i hope it's understandable
it's still a lil half-way-thought, and much non-tested, but i think it's a good start, and could become a good simpsons(&anime) encoding/playback system
Kentamanos
24th February 2004, 07:57
It seems like a pretty good idea, but it would seem that your plugin would have to run fast enough to play back the stream in realtime (since you're talking about a playback filter).
If you can find an executable that implements this filter (which I think you could from that webpage), you should test it out to see if creating a plugin would give you the effect you want.
You should try setting up some sort of batch that pulls single frames from a compressed AVI and then outputs each single frame. Then create an uncompressed AVI of the new hqx3'd frames and see if it looks as good as you think it would.
If it does, then it's worth working on a plugin for this effect.
Does that approach make sense?
morsa
24th February 2004, 08:08
Why don't you try my scale2X plug in and tell me what happens?
At this moment it only works in RGB24 because I have really big problems dealing with YV12.
E-Male
24th February 2004, 18:11
when i have some time after my next exams i'll go on testing stuff for this project
as soon as i can proof it worth the time i'll post here again
BlindWanderer
25th February 2004, 12:10
just a thought i had... if had the filter look at multiple frames to see if the vector was in them (motion vectors for the vectors?) it would reduce vector noise during the resize. I'm so glad that's easier said then done.
morsa
25th February 2004, 12:31
It would be easier to to implement Xin Li algorithm (already done for Virtualdub).
Backwoods
26th February 2004, 06:53
Originally posted by mf
My idea is to use it for antialiasing of hard edges, like VobSub DVD subpictures.
That's a very nice idea, also this would be great for upsizing Flash animations or GIFs.
BlindWanderer
27th February 2004, 12:10
why are the fractal video compression techniques coming to mind? oh well.
mf
27th February 2004, 13:52
Originally posted by Backwoods
That's a very nice idea, also this would be great for upsizing Flash animations or GIFs.
News flash: Flash animations are already vectors, and don't have any hard edges (unless you set quality to "Low").
bill_baroud
27th February 2004, 16:38
if it runs in avisynth in real-time it could be used while playback
quoted from the website :
It was also designed to be fast enough to process 256x256 images in real-time.
btw, i'm trying to put it in an avisynth filter, but i'm n00b at writing such video filter.
well, at the moment it's only doing things like that :
http://breizhbill.baroud.free.fr/test_out.JPG :D
you can call it UltraSlowGarbage() ;)
Kentamanos
27th February 2004, 20:22
Originally posted by bill_baroud
quoted from the website :
btw, i'm trying to put it in an avisynth filter, but i'm n00b at writing such video filter.
well, at the moment it's only doing things like that :
http://breizhbill.baroud.free.fr/test_out.JPG :D
you can call it UltraSlowGarbage() ;)
Now matter how hard I crossed my eyes, nothing 3-D ever popped out!
:(
;)
bill_baroud
28th February 2004, 19:49
too bad ... i got the filter working, but my f***ing floppy is crap and i can't read it :mad:
for speed issue, it's encoding at about 3fps (640x480 > 1280x960) on my laptop (1800+). BicubicResize seems to perform at about the same speed.
Well it's pure C version, i didn't try the asm version, and it's very badly programmed (from my side :o ) with a lot of data copying.
(each picture is copied into a CImage, processed and then copied back to dst).
I'll try with another floppy tomorrow >_<
bill_baroud
29th February 2004, 13:37
ok, here the plugin (http://breizhbill.baroud.free.fr/SimpleSampleDbg.rar)
usage :
SimpleSample()
(hmm no wonder where i started ;) )
take RGB32 on input (the algo do some step in yuv but the main process is rgb16>rgb32 :/ )
If it seems to work as you wanted, i'll try to develop it further :)
mf
29th February 2004, 14:56
My AVISynth (http://sourceforge.net/project/shownotes.php?release_id=210082) can't load the plugin.
E-Male
29th February 2004, 17:48
can cause a crash when input is not rgb32
but
-----------------
loadplugin("c:\hq3x\simplesampledbg.dll")
version
converttorgb32
simplesample
-----------------
works fine
could some people make some full-resolution screenshots of dvds with simpsons, futurama and some animes, so i can start testing this filter combined with my other ideas? (i think that is ok law-wise)
bill_baroud
29th February 2004, 22:36
mf : well i'm waiting for more input from e-male (or other) to develop it further .... it's somehow a pain in the a** to work on some code you don't understand :o
The version here is just the first version which worked and it wasn't really tested (cause it's not that easy on my laptop).
mf
29th February 2004, 23:23
AVISynth wasn't really verbose either, it just said "Can't load plugin".
E-Male
29th February 2004, 23:41
what version of avisynth do you use?
it worked fine on my avisynth 2.54 (when using converttorgb32 before it)
morsa
1st March 2004, 00:03
@bill_baroud
I've been testing it and it works fine.
On Cartoon material it performs very well, on natural mine (scale2x) performs better in most cases, scale tends to blur much less (not to mention when you apply yours or mine twice).
HQ2x has a problem with colors I guess, check it against Lanczos.
Send me a PM with your e-mail and I'll send you my source code.
E-Male
1st March 2004, 00:15
i don't think i'll be much of a help with teh sourcecode of this filter
but i hope i'll be able to use it with some other stuff i work on
timecop
1st March 2004, 03:49
where is teh source?
The reason half hte people cant load hte plugin is because he compiled a vc6 debug version and linked with debug dll version of CRT, which makes it rather hard for peopel without VC6 installed to use.
anyway, where is the source getting posted?
E-Male
1st March 2004, 04:03
the original source can be found here
http://www.hiend3d.com/hq3x.html
for the 3x version, for 2x and 4x see navigation
timecop
1st March 2004, 04:04
yeah I mean for the plugin.
obivously the original source link got pasted everyhwere.
morsa
1st March 2004, 05:25
get on topic guys, please....
timecop
1st March 2004, 05:36
are you referring to me?
I asked *WHERE THE SOURCE IS* for the sample plugin
that was posted using the requested source from the first post,
and also explained the reason why users cannot load the debug version
of SimpleSampleDbg.dll.
How can I be any more on-topic, sir?
morsa
1st March 2004, 06:33
This is the last time I respond to something you wrote.
This is not about the source code but testing the plug-in.
Understood?
It is a nonsense to fill this thread with this stupidities (I mean this reply too, yes I'm guilty!)
Please, any moderator, remove this and any other useless post.
Richard Berg
1st March 2004, 06:43
No, timecop is correct. The source code is necessary for both the execution of the plugin (for those without the debug runtimes), and for licensing purposes (there are binaries of GPL-derived software posted in this thread).
morsa
1st March 2004, 08:03
Correct, I believed source code wasn't important at this moment.
My filter's source code here (it is an implementation halfwat between Scale2 and Scale2X):
http://www.geocities.com/morsa20002000/morsafilter.html?1077427198530
bill_baroud
1st March 2004, 15:06
yeah i didn't post the source, because i want to clean it up a bit before release it under the gpl (the code used is gpl in anyway).
The filter need RGB16 in input, do some conversion to YUV for the thresholding, and then compute pixel from RGB16 to RGB32 :o ... i want to find something a little better.
And timecop is right, it's compiled with debug information.
@morsa : well thanks for the offer to study your filter, but i'm not very good with the internals of video processing. Like i said, i don't really understand how the algorithm i implemented works ^^;
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.