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. |
22nd February 2004, 06:33 | #1 | Link |
the dumbest
Join Date: Oct 2002
Location: Malvinas
Posts: 494
|
Scale2X for Avisynth (Source available)
Well, here is my first filter.It isn´t an incredible thing and is slow as hell cause I've no idea about how to optimize it or port the mmx version of it.
It works nice for me with video images, didn't test it with anime (hope mf will do it). By now it only works in RGB (24 or 32). It gives better results when used with msharpen first. Usage : NoName() (sorry no params). That's all. Ahh, please do not link directly to the file cause it's just a geocities page. http://www.geocities.com/morsa200020...?1077427198530 P.S: In fact it is not meant to give a 2X image but to antialias the original resolution.For example you take a 640x480 image apply it 2 times and then resize it again to 640x480 with the resizer you like. Feedback welcome... Last edited by morsa; 1st March 2004 at 10:23. |
22nd February 2004, 18:42 | #3 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Now, that was not really the question to become "senior member", hanfrunz
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
22nd February 2004, 19:56 | #5 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Oooops ... take my apologies, hanfrunz.
I only say the filter's name and packed it on HD without trying it out immediately ... When I read "HQ2X" and morsa's comment about resolution antialiasing, I understood it would do some calculations to interpolate at the upscaled resolution. Now I tried it, and it seems it is indeed a resolution doubler "only". (Well, I myself could not even code that...) Hmmm... subtracting a NoName'd from a pointresize'd clip shows big differences, but side-by-side they look just the same. Welcome to the seniors, hanfrunz morsa? - Didée
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
22nd February 2004, 20:46 | #6 | Link |
the dumbest
Join Date: Oct 2002
Location: Malvinas
Posts: 494
|
Well, it isn't supposed to be the same as Pointresize.
May be I did something wrong. It has the effect of of affecting the strong edges of the image giving a kind of antialiasing effect. Did anyone tried NoName twice and then downsample again to original resolution.Does it do the same as using Pointresize all the way?. Today I'm going to try shifting the matrix to work only with the corners instead of left, wright, top and bottom pixels. I tested it with a Monty Python episode which has subtitles and the subtitles really became better than the original ones. |
22nd February 2004, 21:36 | #7 | Link |
Registered User
Join Date: Mar 2002
Posts: 1,075
|
Is this the same algorithm as the Scale2X used in emulators? As was said before, it will only work well on palletized pixel art ... which would explain why it works on subtitles Ill agree with mf here, you should really use hq2x instead if you want that kind of effect ... because of the thresholded difference comparison instead of the is-equal testing it will be more robust.
Last edited by MfA; 22nd February 2004 at 21:40. |
22nd February 2004, 22:01 | #8 | Link |
the dumbest
Join Date: Oct 2002
Location: Malvinas
Posts: 494
|
Exactly, It Is the Scale2X.I chose it because HQ2X tends to blur too much the rest of the image that is not an edge.
I saw the comparison between both and I liked Scale more. But, because this is just testing to get feedback from you (all) to see if this is worth the effort I will continue with this thing till it gets exhausted. |
22nd February 2004, 23:39 | #10 | Link |
the dumbest
Join Date: Oct 2002
Location: Malvinas
Posts: 494
|
Suggestions welcome. (if someone has an idea how is the HQ2X implementation in C++ please explain it to me cause I can't understand exactly what it does.)
Last edited by morsa; 24th February 2004 at 01:26. |
23rd February 2004, 01:19 | #11 | Link |
Registered User
Join Date: Mar 2002
Posts: 1,075
|
You could also try this algorithm ... although I would try 75:25 averaging for the first 3 mixing options.
Little harder (only a very little though) in YV12 instead of RGB space, except for the difference which you can just compute using luminance only, because of the subsampled chrominance planes ... but that is left as an excercise to the reader. Or dont ... I was planning on trying it myself eventually, so ... |
23rd February 2004, 10:02 | #12 | Link |
the dumbest
Join Date: Oct 2002
Location: Malvinas
Posts: 494
|
Hurray, THX to MfA!!!!!!!!!!!
It's done. After reading the link carefully I noticed that I was just halfway to it.The problem with the first version was that (I'm really newbie about programming and I don't know most of the common operations with pixels, you know?) ,although I was using a diagonal way to read the pixels ,I wasn't taking their distance from the source pixel to accurately select the correct ones. New version, faaaaarrrrrrrr better, although it only supports RGB24 and it doesn't interpolate but copy pixels following the rules of Scale2. If anybody wants to test it go for it, if not wait for a better version coming soon..... Bye! My script for a source of 480x368: ConvertToRGB24 sharpen(0.3,0.3) NoName() Lanczosresize(720,576) Last edited by morsa; 23rd February 2004 at 10:38. |
24th February 2004, 12:32 | #15 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 5,391
|
Ah - now it looks like something!
Gave it a short try on some Window$ screenshots. Yummy! No chance to get something similar with (lanczos/bicubic)resize and/or Xsharpen and/or Warpsharp. One thing I noticed: The placement of the image in the upsized frame is different between RGB and YV12 - and both are different from normal resize's placement. And: when feeding an RGB with odd framewidth, then noname().noname() will crash. Good work so far, thanks! - Didée
__________________
- We´re at the beginning of the end of mankind´s childhood - My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!) |
24th February 2004, 15:54 | #16 | Link |
the dumbest
Join Date: Oct 2002
Location: Malvinas
Posts: 494
|
Thank you Didée!
Good feedback. I know about the displacement of the image.It is a problem I got because it is still very beta but I wanted to release it to see if it is of use or not. Those corrections will be made when I finish YUY2 support.I'm planning to add a deinterlacer mode, an enhanced source matrix , an antialiasing mode (no resize) and may be a 3X mode. By now I'm thinking about using LUTs (HQ2X style).Suggestions? P.S. Why do you want to use an odd frame width? Another question: How fast is it? (mean fps) Last edited by morsa; 24th February 2004 at 16:04. |
24th February 2004, 18:38 | #17 | Link |
·
Join Date: Jan 2002
Posts: 1,729
|
*chemicals mix inside of mf's brain*
*smokey explosion from the chemical reaction* OO, IDEA! OptimalResize() - discriminating image types (natural, soft computer gfx, hard computer gfx) within single frames, and applying edge-directed, directional rounding, or hq2x interpolation, or an optional mix when unsure . That'd be fun . |
|
|