Log in

View Full Version : JincResize - Jinc (EWA Lanczos) Resampler


Sakura
8th May 2020, 12:37
Port jinc-resize (https://github.com/AviSynth/jinc-resize) to VapourSynth (cpu optimizations only have AVX2), some codes references to EWA-Resampling-VS (https://github.com/Lypheo/EWA-Resampling-VS).

Github: https://github.com/Kiyamou/VapourSynth-JincResize

Usage
core.jinc.JincResize(clip clip, int width, int height[, int tap, float src_left, float src_top,
float src_width, float src_height, int quant_x, int quant_y, float blur])

My test

720p -> 1080p tap=3

16bit (i5-4260U 1.4Ghz 2 Core)
GCC pure c 10.328 FPS
GCC avx2 9.949 FPS

32bit (i5-4260U 1.4Ghz 2 Core)
GCC pure c 10.998 FPS
GCC avx2 10.499 FPS

16bit (2700x 3.7Ghz 8 Core)
GCC pure c 72.287 FPS
GCC avx2 69.891 FPS

Thanks to everyone who helped me!

ChaosKing
8th May 2020, 13:19
Added to vsrepo: vsrepo install jinc

Myrsloik
8th May 2020, 14:31
1. Why do you even bother with an avx2 version if it's slower? Just let the compiler optimize things.

2. This line looks very suspicious:
https://github.com/Kiyamou/VapourSynth-JincResize/blob/master/include/EWAResizer.hpp#L327

You're loading integer types as float if I'm not mistaken. Didn't actually try it to verify.

Sakura
8th May 2020, 15:38
1. Why do you even bother with an avx2 version if it's slower? Just let the compiler optimize things.

2. This line looks very suspicious:
https://github.com/Kiyamou/VapourSynth-JincResize/blob/master/include/EWAResizer.hpp#L327

You're loading integer types as float if I'm not mistaken. Didn't actually try it to verify.

1. At the beginning, I use avx2 to calculate Lut (https://github.com/Kiyamou/VapourSynth-JincResize/blob/master/include/Lut.hpp#L37), which is faster a little (for old version). So I try to use avx2 for convolution, too. I agree it is not a good idea.
I cancel the macro definition for using avx2. Do not use avx2 by default.

2. There is indeed a problem with this line. I give up this function now, until I come up with a suitable method.

Thanks.