View Full Version : Filter Idea: HQ2x
BeNooL
13th December 2003, 16:46
Recently a lot of emulators (ZSNES, VBA) are using the HQ2x, HQ3x or even HQ4x algorithm to interpolate the original graphics to PC's high resolution. The results are quite impressive:
original (well resized to 640x480 prolly with bilinear):
http://benool.free.fr/nothing640.jpg
HQ2x filtered:
http://benool.free.fr/hq2x640.jpg
My idea would be to turn this into an Avisynth plugin, and somehow associate it to supersampling and then sharp resizing.
Could turn out to give nice results, don't you think ?
Just an idea...
lamer_de
13th December 2003, 18:56
Nice idea :) That would be incredibly helpfull if you have some low res material like VCDs. As most of the emus are GPL'ed, I guess the source codes for these techniques should be aviable.
CU,
lamer_de
BeNooL
13th December 2003, 19:48
yes source code is available so it shouldn't be too much trouble for a talented coder to adapt.
And I forgot to say that, as it's used in emus, it runs in real time at least at 50/60fps on a decent machine so it would be pretty fast as well.
morsa
14th December 2003, 00:37
Here is a link with source code.
http://www.hiend3d.com/hq2x.html
Richard Berg
14th December 2003, 10:30
When I popped into this thread I expected to say it was impossible, since emulators have access to effectively infinite resolution (vector representation) before they rasterize but we don't. I still think that kind of supersampling would be better (though harder, since you're modifying "hardware" internals) if I were writing an emu, but the approach of inferring vectors from a raster is a potentially good one. I think it would work very well on some anime and poorly on live video.
Note that using a lookup table like they do means the output resolution is fixed: there may be a way to work around this, but it would be a lot slower and harder. Better would be to use the highest-quality one (4X) and then use ordinary bicubic to downsize to the final res.
mf
14th December 2003, 13:23
I've tried these things too, but they don't work on antialiased edges. Scale2X even passes antialiased edges through untouched. TomsMoComp's -1 mode does about the same, but works on any material. Usage:
TomsMoComp(0, -1, 0)
TurnLeft()
TomsMoComp(0, -1, 0)
TurnRight()
Didée
14th December 2003, 16:07
TomsMoComp(0,-2,0) :cool:
mf
14th December 2003, 17:08
Originally posted by Didée
TomsMoComp(0,-2,0) :cool:
Evil! That's not in my version :D.
sh0dan
17th December 2003, 22:28
Just looked a bit at the source.
Source size doesn't seem to matter. However - pixel precision is reduced to 16 bpp (in RGB-mode) for speed reasons, so it's unuseable for video in it's current form.
Aiorus
18th December 2003, 21:21
I think it's in 16 bpp since it's for SNES and comparables emulators (remember 16 bit consoles). I this concept as a filter in YV12 would be awesome
morsa
19th December 2003, 09:10
Cant it be used only on luma or only on colors?(I mean in YUV colorspace)
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.