Log in

View Full Version : Lanczos3 Filter Resize.


Pages : 1 [2] 3

Dark-Cracker
13th September 2002, 14:31
hi,

for those who are interested to make some tests u can find my tool (autodub) here : http://forum.doom9.org/showthread.php?s=&threadid=24678

test the v1.6 it come bundle with the lanczos filter and u can make a compressibility test of course it support the codec divx3/4/5 & xvid

bye.

Marc FD
13th September 2002, 16:21
Just a question :

- why do you all want to sharpen your image when you downsize ? :confused:

If i want the best image possible, i would keep 720x...

I don't see why you need to downsize if you want to achieve a bigger filesize.

I thinked the problem in ripping was to get a low enough file to put it on 1-2 CDs.

I think i've missed something.... let's re-read the whole doom9 forum....

drizztcanrender
13th September 2002, 16:34
Originally posted by Marc FD
Just a question :

- why do you all want to sharpen your image when you downsize ? :confused:

If i want the best image possible, i would keep 720x...

I don't see why you need to downsize if you want to achieve a bigger filesize.

I thinked the problem in ripping was to get a low enough file to put it on 1-2 CDs.

I think i've missed something.... let's re-read the whole doom9 forum....

Well in my encodes, lanczos3 doesn't increase the filesize,not more than sharp bicubic at least.And encodes on full resolutions are hard to make,even with 2 cds.At least for my eyes some resizing looks better than none...

Marc FD
13th September 2002, 17:12
for my eyes

That's the reason why RV9 as so many adepts.
It "looks" so good.

But i'm not a serial ripper.
pratically, you're right.
theorically, not.

drizztcanrender
13th September 2002, 18:30
A lot of stuff have a theoretical advantage but they don't have much practical significance.And the encoding procedure is indeed based on a theoretical background but it all comes down to practical results.So, imho,if it looks better then it is better.After all isn't that what we are trying to do?Make our film content look better?
The only problem of course would be the effect that lanczos3 resize would have in compressability and therefore in the final filesize.But, in my tests, lanczos resize and (even)sharp bicubic encodes have the same final filesize and display almost the same compressability and lanczos3 resize looks better,at least with divx5(it really needs the extra sharpening effect to diminish the blurring of divx5 encodes).

FuPP
13th September 2002, 19:57
@MARC :

Quote :
---------------------------------------------------------------------
- why do you all want to sharpen your image when you downsize ?

if i want the best image possible, i would keep 720x...

I don't see why you need to downsize if you want to achieve a bigger filesize.
---------------------------------------------------------------------

In some case, we HAVE to resize (cf svcd , vcd, cvd specifications...). We don't all encode with XVID :)

vlad59
13th September 2002, 21:50
@iago (= serial tester ;) )

Thanks a lot for the testing.
With your screenshots it's clear the Nic's filter provide sharper picture (IrfanView 300%) and also greater compressibility. I was right to be doubtful about my Lanczos implementation in avisynth (it was too easy).

I think I should remove the dll.

droolian01
14th September 2002, 15:09
Hi there.

I've been using the lanczos3 resise for my last few encodes and i like the results. Now i know there is a bicubic directshow filter for keeping sharper output during full screen playback, i wonder if it is possible to produce al anczos3 directshow filter.

OK - please please please can one of you brainy programmers do this, i think it would really improve fullscreen playback

Waiting with baited breath

Koepi
14th September 2002, 16:00
I'm mostly impressed by the nice color representation of lanczos3. Now it's really easy to beat some group releases as the filter is the right one :)
But "from hell" looks so nice now, I'm trying zoolander as well with it. I'm so glad that I stepped back from simple resize... I like the speed of it, but the resulting picture has too many downscaling artefacts (like aliasing from "thin lines" [ the bamboo-stick in rush hour 2 where chirs tucker and jacky chan are hanging on for example looks horrible with simpleresize])

To bad that compressability lowers about 10%-15%...

Best regards,
Koepi

int 21h
14th September 2002, 16:08
I've noticed also SimpleResize making jagged artifacts. I tried using it only once for a SVCD and the quality was horrible. My only guess is that it has issues doing very large downscaling.

MaTTeR
14th September 2002, 16:26
@int 21h

I too seen problems using SimpleResize with SVCD/XVCD/KVCD's but after using the nice FitCD app for my resizing the problem went away. You must have "macroblock aligned" turned on in FitCD and the jaggies mostly go away in my experience.

Lanczos3 looks very appealing from reading all the feedback. Time for some testing and finish my Convolution3D tests up too.

iago
15th September 2002, 00:56
Originally posted by Koepi
I'm mostly impressed by the nice color representation of lanczos3... To bad that compressability lowers about 10%-15%... Yep, Koepi. Unfortunately :(. 'Cause, it's really impressing imho too...

But I guess I'll still give Matrix a try with lanczos3, cutting down on audio, throwing some light convolution3d on it, beating the black-enemy-blocks with ColorYUY2, and aiming for 1XCD ;).

@MaTTeR

I'm impatiently waiting for your test results...

kindest regards,
iago

Metalazzo
15th September 2002, 23:42
I just try on 1 min of the movie "the game"
encoded with xvid at quant 2 to see how many Bytes i could save
I tryed :
-bicubic resize (bicubicresize(x,y)) (13MB)
-bicubic resize + convolution3D(0,4,4,4,4,3,0) (11.3MB)
-lanczos resize (15.2MB)
-lanczos resize + convolution3D(0,4,4,4,4,3,0) (13.3MB)

i am very surprised of the quality of the lanczos resize : the picture is very detailed :eek: but the clip is too big :(
with lanczos resize and conv3d the result is also quite good : I think it's sharper than bicubic alone

conclusion : convolution3d and lanczos resize match very well :)

for the pics it's here :
http://membres.lycos.fr/metalazzo/thegame.zip

ps : sorry for the copy paste :D
ps2 : sorry for the crappy english :p

MaTTeR
16th September 2002, 01:42
@Metalazzo

I've also decided to use the C3D and Lanczos for most of my rips now based on a few tests I've done on Salton Sea and Rose Red. What settings did you use for BicubicResizing tests? SoftBicubic?

Metalazzo
16th September 2002, 03:10
@MaTTeR

no, i used a "simple" bicubicresize without any parameters more than res x and res y (bicubicresize(x,y))
i'll try with a soft bicubic tomorrow (well that's this afternoon...damn already 4:12 am)

cdrips
16th September 2002, 04:23
I was testing this filter out. I watched the whole movie I encoded with it. The Ice Storm, XVID, h263 quants and this resize filter. No other filters. For 3 scenes of the movie, it gave me a blank screen with sound still going, then it corrected itself. Is it possible the filter did this? Or maybe something else. I've watched other movies I've encoded w/ bicubic. None have this problem, same methods. Is it just the dvd? Any suggestions of how to avoid this problem or check any other encodes for this problem (besides watching the whole movie).

ErMaC
17th September 2002, 01:20
Is this new resizing filter appropriate for both upsizing and downsizing of footage? Also, how does it perform on animated footage?

Koepi
17th September 2002, 08:39
@Ermac:

Yes, if you'd read this thread and followed the links you'd know it's not only for upscaling, but since you know the forum rules you already found that yourself and just asked to see if you understood it correctly, right?
And: just test it on anime to find out if it works for you.

@cdrips:

No, a RESIZE filter doesn't do that, you could guess that from the RESIZE functionality that in the RESIZE filter name.
Is ther eany ASYNC mode involved? No. It's something wrong with your setup and / or your rip.

sh0dan
17th September 2002, 11:27
I merged the algorithm into Avisynth (thanks to vlad) - it works fine, and at the exact same quality as Nic's filter, after I found a rounding bug also affecting Bicubic/Bilinear.

I called it LanczosResize - to avoid any conflicts.

Anyone interested can grab it at the cvs bin site (http://cultact-server.novi.dk/kpo/avisynth/avs_cvs.html)

iago
17th September 2002, 11:41
-> I merged the algorithm into Avisynth (thanks to vlad) - it works fine, and at the exact same quality as Nic's filter, after I found a rounding bug also affecting Bicubic/Bilinear... I called it LanczosResize - to avoid any conflicts.(sh0dan)

That's really great! Thanks a lot.

best regards,
iago

EDIT: And it seems it works faster now! (came right before I was starting a rip with Nic's lanczos3.dll ;))

sh0dan
17th September 2002, 11:57
I can confirm the speed increase - Nic's runs with 22-23fps and the internal filter runs with 24-25fps - great thing! :cool:

There should actually also be a speed increase in Bilinear/BicubicResize, so everyone seems to gain from this.

ErMaC
17th September 2002, 15:33
Koepi, yes I did read this whole thread and I just re-read it to make sure I wasn't going crazy. I followed the links and I never saw anyone mention explicitly whether it was good for both upsizing and downsizing (although I admit I only skimmed the autodub thread). The only hint that it might be good for upsizing was the superman image comparison, which was an upsize but on something of that size I have no idea if it would scale to larger images the same way. All the other posts have been concerning downsizing. Therefore, I asked the question. Please point out if I missed something but I honestly looked through the whole thread to see if anyone specifically pointed out an answer to my question.
And I asked about animation because I'm in the middle of packing to move and I'm currently stuck on a laptop so I couldn't test this stuff very easily anyway.

cdrips
17th September 2002, 22:43
Sorry, I just thought that if a resize like simpleresize with the green line if not div by 4 could mess with a picture, another resize filter could also. Maybe because of dvd decrypter?

trbarry
17th September 2002, 23:14
FWIW, if you still get the green line on SimpleResize you should download a newer one. That's been fixed for some time now.

- Tom

www.trbarry.com/SimpleResize.zip

cdrips
18th September 2002, 00:59
trbarry, thanks for the link, I didn't know you fixed it already. Could my problem be a result of the playback filter? For 3 moements, sound goes while picture replaced by blackness, then picture comes back.

Dark-Cracker
18th September 2002, 01:33
hi,

@ermac
if i am right ? (sorry my english was very poor and i don't have understand all your post) u want to know if this resize filter was good for anime ?
as koepi say u must do some test to see if this is good for you but the lanczos filter keep a lot of details because it was sharp this will of course increase noise and your movie will be less compressible and finaly this will increase your finale size.
i am not sure this filter was usefull for animations, but u can try with filters, simply make tests :) :) :)

Metalazzo
18th September 2002, 03:04
i agree with Dark-Cracker
lanczos resize will keep more noise than bicubic
i tested it on a movie with xvid (quant 2 to see the difference)
the file (1min) was 15MB instead of 13MB with bicubic
more details but....more noise also :(
maybe if your source is really really clean then you can try....i will try it with a gundam wing dvd (actually there is a lot of mosquito noise)
without noise remover only resize
maybe i will post some pics if ppl are interested

Didée
18th September 2002, 07:53
Originally posted by ErMaC
Is this new resizing filter appropriate for both upsizing and downsizing of footage? Also, how does it perform on animated footage?
Hint:
For upsizing more than a little bit, use Bicubic(x,y,0.333.0.333), perhaps even (x,y,0.5,0),
followed by - - Warpsharp!

(But don´t tell neuron2, for heaven´s sake)

Sorry, Donald ;)

Have a second look at the "superman-upscales": ALL of them are c-r-a-p.

[After some years of digital still image processing...]

Metalazzo
18th September 2002, 14:08
well just finished to encode a gundam ep
the video file size was the same (around 186MB) BUT the average quality was better with bicubic :(
lanczos resize keeping more details and more noise makes impossible to have lots of frames at drf 2 :(
so if for you file size is not a problem you should try....else stick with bicubic

kilg0r3
18th September 2002, 14:28
also made a short test yesterday. the difference in file size between sharp bicubic and lanczos was some 2 percent to the favour of lanczos. but a frame per frame comparison of the resized source material shows that the difference between the frames is very and i mean VERY small. the lanczos-resized images seem to have slightly more contrast.

i can provide screenshots if anybody is interested

JayCutler
20th September 2002, 01:04
i can provide screenshots if anybody is interested

Sure! If u can I'm really intersted.

-Jay

kilg0r3
20th September 2002, 08:35
http://www.netcologne.de/~nc-allgeife8/resize.rar is the url of the screen shots.

i compared them in acdsee at 200%, with zoom lock, switching with the mouse wheel between the different images. my monitor is a samsung 757dfx 17" monitor.


repeated with 300%

jarthel
20th September 2002, 17:12
I tried this (builtin lanczosresize in avisynth.dll) recently with record of lodoss war and Rurouni kenshin. It produces an error just before the credits. change lanczosresize to simpleresize and no more errors.

Here's the new script
-----
body=mpeg2source("d:\dvdrips\lodoss16\lodoss16.d2v").trim(0,38976).Telecide(Guide=1,Gthresh=40,Threshold=20,Chroma=True,dthreshold=10,Post=true).Decimate(cycle=5).crop(14,4,692,472).temporalsmoother(5).SmoothHiQ(5,50,50,175,3).simpleresize(640,480)


return body
-------------------

the old script just uses lanczosresize.

Jayel

vlad59
20th September 2002, 17:18
Can you try it with Bilinear or Bicubic resize.


Some code is shared between the resampler in Avisynth so if the Bilinear doesn't crash then it's really because of specific Lanczos3 code.

Thanks in advance.

jarthel
21st September 2002, 00:03
The same problem occurs when using Bilinear and bicubic. Only simpleresize works.

Jayel

vlad59
21st September 2002, 08:34
So that's maybe a problem with the latest Sh0dan optimizations.
Can you try with an old avisynth (~ beta6 from videotools.net for example) and see if it crash again.

Another thing you can also try to resize only horizontaly (the aspect ratio will be off but it's only a test) and after that only vertically. Because there is two resize code : one for H and one for V.

Thanks in advance for your help.

jarthel
21st September 2002, 17:26
I will try your suggestion after I'm done with my jobs in the queue. :)

Jayel

sh0dan
22nd September 2002, 13:16
Damn... I need some info:

CPU
Colorspace (YUY2 i presume)
Size before resize.
Size after resize.

Then I should be able to find it.

jarthel
22nd September 2002, 13:24
Originally posted by sh0dan
Damn... I need some info:

CPU
Colorspace (YUY2 i presume)
Size before resize.
Size after resize.

Then I should be able to find it.

If that's for the problem I discovered:

CPU: XP2200+ thoroughbred (can use SSE)
colorspace: YUV
size before resize after crop: 692 x 472
size after resize: 640 x 480

sh0dan
22nd September 2002, 15:28
Thanks for the info!

I'm not at work, so I can't test here,but thanks for the info. Could you test 2.05 (release), using Bicubic, so I can see when the bug was introduced.
Is the crash consistent, or does it happend at random?
Does the position of crop affect the crash?
Is it "Avisynth caugth an access violation at #####"

D*mn, I hate it, when I make these mistakes. :(

jarthel
22nd September 2002, 15:48
I can't test it right now. stil encoding but it's an access violation error.

sh0dan
22nd September 2002, 16:08
ok - thanks for the efford - I'll get on it :)

Koepi
30th September 2002, 11:00
@Ewi:

see this thread? A forum search DOES help.

Koepi

Prosper
30th September 2002, 22:13
I have been using lanczos interpolators in digital photo manipulation for quite some time, and I came across this site quite a while ago, it has some quality comparisons of different interpolators.
Complete version here: http://home.no.net/dmaurer/~dersch/interpolator/interpolator.html

Interesting snippets here:
Source image:http://home.no.net/dmaurer/~dersch/interpolator/z256.GIF
Photoshop's Bicubic Interpolater: http://home.no.net/dmaurer/~dersch/interpolator/PSbicubic_z256.GIF
Photoshop's Bilinear Interpolater:http://home.no.net/dmaurer/~dersch/interpolator/PSbilinear_z256.GIF
PT's sinc256(lanczos 16x16) interpolator:http://home.no.net/dmaurer/~dersch/interpolator/PT_sinc_z256.GIF

Defiler
1st October 2002, 03:41
Prosper: Ouch. That's quite a torture-test image there.

YUV 4 2 0
1st October 2002, 11:13
Some Tests with this strange Image and the LanczosResize/BicubicResize (b=0/c=0.75) Filters from AviSynth 2.06.

Original 256x256 Pixels:
http://home.no.net/dmaurer/~dersch/interpolator/z256.GIF (46 KB)

Original resized to 192x192 Pixels:
Bicubic (http://mitglied.lycos.de/yuv420/attachment/resize/S_bicubic.png) (46 KB)
Lanczos3 (http://mitglied.lycos.de/yuv420/attachment/resize/S_lanczos3.png) (46 KB)

Original resized to 320x320 Pixels:
Bicubic (http://mitglied.lycos.de/yuv420/attachment/resize/M_bicubic.png) (119 KB)
Lanczos3 (http://mitglied.lycos.de/yuv420/attachment/resize/M_lanczos3.png) (122 KB)

Original resized to 608x608 Pixels:
Bicubic (http://mitglied.lycos.de/yuv420/attachment/resize/L_bicubic.png) (362 KB)
Lanczos3 (http://mitglied.lycos.de/yuv420/attachment/resize/L_lanczos.png) (376 KB)

kilg0r3
1st October 2002, 11:45
well, lanczos may be good for multiple resize steps and images like that circle 'perversity' but for video resizing the very minor increase in quality does not justify the extra processing time. see my post above.

serbersan
2nd October 2002, 00:14
I'm totally agree with you kilg0r3¡¡¡

I've made some test with two movies... both with sharp bicubic and lanczos resize. I haven't found any difference in the first movie.

In the second I've made the same that you made: a comparasion with 200% zoom... only in two of the 5 images I've used to compare I've noticed a very little difference in favour of lanczos very subtle and only visible at 200% and with very good attention. By the other hand, although the movie is very compressible by default, sharp bicubic has retained more details in the black sweater of John Travolta and this difference it's visible without zoom, and simply watching the screen, and lanczos has a little more mosquito noise. The compressibility is very good a 2-3 quantizers and a quality similar to dvd in the sharp bic. encode.

Has anyone images where lanczos offers a visible better quality or at least it avoided artifacts that sharp bicubic could generate??

Didée
2nd October 2002, 09:29
serbersan,

when saying "sharp bicubic", I suppose you mean the go'old (x,y,0,0.75).

This particular one I don´t use for quite some time now. I produces noticeable EE (edge enhancement).

Once I found the hint that (for (x,y,a,b) in bicubic) the least error is obtained when 2*a+b=1, I stick to that.
I think sometimes I read something about negative values were not supported in AviSynth, but I can´t confirm that - works well for me.

So, in terms of sharpness, this is my personal list:
(top-down: increasing sharpness AND DEcreasing compressability)

1. BicubicResize( x, y, 0, 0.5)
2a. LanczosResize( x, y)
2b. BicubicResize( x, y, -0.2, 0.6)
3. BicubicResize( x, y, -0.333,0.666)
...and "-0.1,0.55" should be v-e-r-y similar to Lanczos.

I should mention, I often use kind of sophisticated filtering/denoising, so in many cases I can afford to use some sharper downscaling.
This is true in particular for my TV-caps. The raw caps are of good quality, but a tad too soft for my taste, so ...

Perhaps you may want to see my little "results table" on page 3 of this thread.

Marc FD
2nd October 2002, 12:54
Originally posted by Didée

1. BicubicResize( x, y, 0, 0.5)
2a. LanczosResize( x, y)
2b. BicubicResize( x, y, -0.2, 0.6)
3. BicubicResize( x, y, -0.333,0.666)



you use BicubicResize(x,y,b,c) with negatives numbers for b, right ?
I thought the Bicubic resampler ignores b<0 and uses b==0 instead.

EDIT : I'm really not sure of this...

Originally posted by Didée
...and "-0.1,0.55" should be v-e-r-y similar to Lanczos.


Maybe the result. But they're different :

Bilinear resize is a 2 points resampler using triangle interpolation,
Bicubic resize is a 4 points resampler using b-spline interpolation,
Avisynth Lanczos resize (Lanczos3 like) is a 6 points resampler using sinc interpolation,
Classic Lanczos resize is a 8 points resampler using sinc interpolation,
and sinc256 resize, HQ lanczos, is a 16 points resampler using sinc interpolation.

To difference in speed between these resamplers is only due to the number of points used for resampling.
It's why Bilinear is faster than Bicubic who is faster than 6-points Lanczos (Lanczos3)

BTW, Bilinear, Bicubic, Lanczos, or any other interpolation method, can be used for downscaling, upscaling, and for arbitrary rotation, or any other 3D transformation too.

Regards,
MarcFD

PS : correct me if i'm wrong :D