PDA

View Full Version : vcmove a plugin for vapoursynth


vcmohan
22nd November 2014, 13:02
vcmove is a plugin developed for vapoursynth, by modifying and improving plugins originally developed for avisynth. This plugin moves pixels as per requirement. Useful for correcting certain distortions or tilt or for transitions. The functions included in this are:

1.Rotate
2.DeBarrel
3.Quad2Rect
4.Rect2Quad

A full description of this plugin is at vcmove (http://www.avisynth.nl/users/vcmohan/vcmove/vcmove.html)
Works for windows. Comments, suggestions are welcome.

sl1pkn07
22nd November 2014, 17:23
any plan to share the code?

to try to build for linux

greetings

PS: also vcfreq and vcmod

vcmohan
23rd November 2014, 10:55
Certainly. I am waiting for a few error reports or comments or suggestions. Then I will tidy up and make the code available. If in the present condition itself I should do that, in a few days it will be done.

Myrsloik
23rd November 2014, 12:46
You'll make 64bit compiles for windows too, right?

vcmohan
23rd November 2014, 13:20
I wish to. In my VC++ compiler some one mentioned that I have to add "windows 64" or I am not sure, whether it will accept. I do wish to know exactly what I need to add.

Efenstor
31st March 2016, 09:44
I am struggling to compile vcmove under Linux (x64), but as there's no Makefile I don't know where to start.

P.S.: by the way, vcmohan did not provide a link to the vcmove source code on the site, so I needed to figure it out by analogy with the other links: http://www.avisynth.nl/users/vcmohan/vcmove/vcmove_src.7z

Are_
1st April 2016, 12:15
mv ReformHelper.cpp reformHelper.cpp
gcc -fPIC -shared -std=c++11 vcmove.cpp -o libvcmove.so

vcmohan
1st April 2016, 12:36
Sorry for the missing link. Now it is included.

Efenstor
1st April 2016, 18:14
mv ReformHelper.cpp reformHelper.cpp
gcc -fPIC -shared -std=c++11 vcmove.cpp -o libvcmove.so

Thanks a lot!!! And thanks to you, mr. Mohan!

Efenstor
6th April 2016, 20:26
DeBarrel produces weird banding artifacts, which are most noticeable on the sky. For a test, I have debarrelled a simple white clip (see the attachment). I had implemented Lanczos interpolation many years ago when I was into programming, and remember that the code included some "equalization" technique, without which the image contained somewhat noticable "pits". I wonder may it be the case with vcmove? No equalization I mean. Please, can you fix this, as barrel correction may be the main reason I has gotten into the VapourSynth stuff.

Efenstor
6th April 2016, 20:33
I've remembered! When I did my coding, I didn't implement Lanczos from scratch, but instead adopted and modified the image resize function from ImageMagick. Can this be of any help?

vcmohan
8th April 2016, 07:15
Thanks for pointing out. While the formulation for avisynth was integer maths, for vapoursynth I had to change it to floating point. I have now included some checks in the Lanczos interpolation and uploaded. I still see even though much reduced a greenish hue when I use white blank clip. Please check it. I will try with bicubic or use integers float hybrid to make it better. May take a few days.

Efenstor
8th April 2016, 15:22
Thanks for pointing out. While the formulation for avisynth was integer maths, for vapoursynth I had to change it to floating point. I have now included some checks in the Lanczos interpolation and uploaded. I still see even though much reduced a greenish hue when I use white blank clip. Please check it. I will try with bicubic or use integers float hybrid to make it better. May take a few days.

Thank you! But I still see the moiré pattern. Interestingly enough, I don't see any greenish hue you mentioned, and analysing a screenshot in Gimp shows that the RGB values are identical (although all lesser than 255,255,255).

Here is my test script, in case you need it:
import vapoursynth as vs
core = vs.get_core()

clip = core.std.BlankClip(width=1920, height=1080, length=100, color=(255,255,255))
clip = core.vcmove.DeBarrel(clip=clip, a=0.005, b=0.009, c=0.085)
clip = core.resize.Bilinear(clip=clip, format=vs.YUV420P8, matrix_s="709")
clip.set_output()

Efenstor
8th April 2016, 15:36
I have just checked: there is the greenish cast indeed, but only in the YUV444 colorspace. In RGB24 it's all okay.

vcmohan
9th April 2016, 13:31
I have modified code. Hopefully it should work now. Please check the new update.

Efenstor
9th April 2016, 16:28
I have modified code. Hopefully it should work now. Please check the new update.

That's it: no moiree, no greenish cast! It's all cool now! :thanks:

vcmohan
10th April 2016, 05:47
Made a very small change. May not be visible in results most of the time. But uses a better approximation. Sorry for trouble. But pl use the newest.

Efenstor
12th April 2016, 15:03
Made a very small change. May not be visible in results most of the time. But uses a better approximation. Sorry for trouble. But pl use the newest.

Trouble??? Every little line of useful code added to the world of libre software is worth more than gold. :D

sl1pkn07
21st April 2017, 14:36
Hi.

the sources on http://www.avisynth.nl/users/vcmohan/vcmove/vcmove_src.7z is changes/updates recently? the SHA256 of the older file downloaded in 09-04-2016 and the new file downloaded today is different


┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/aplicaciones/vapoursynth-plugin-vcmove]|
└───╼ ls *7z*
-rw-r--r-- 1 sl1pkn07 users 23017 abr 21 15:31 vcmove-src.7z
-rw-r--r-- 1 sl1pkn07 users 22858 abr 9 2016 vcmove-src.7z.
┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/aplicaciones/vapoursynth-plugin-vcmove]|
└───╼ sha256sums *7z*
bash: sha256sums: no se encontró la orden
┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~/aplicaciones/vapoursynth-plugin-vcmove]|
└───╼ sha256sum *7z*
18d99e51d0d2ebf12274a23c92977ee11e1427dded1875390709e8203c7af0ec vcmove-src.7z
63c425d67a839c8993a6e52a778b6bfe42c38cb4ad472fbab3e8661a90d3b8ef vcmove-src.7z.



greetings

Are_
21st April 2017, 14:51
Somewhat:

$ for i in $(ls -1); do echo $i && diff $i ../vcmove_src/$i ; done
Clamp.h
11c11,12
< return val < min ? min : val > max - 0.5f ? max : val;
---
> val += 0.5f;
> return val < min ? min : val > max ? max : val;
CubicIntCoeff.cpp
CubicIntCoeff.h
LaQuantileInterpolate.cpp
LanczosCoefficients.cpp
LinearIntCoeff.cpp
ReformHelper.cpp
UnitSq2Quad_matrix.cpp
VSHelper.h
VapourSynth.h
moveDeBarrel.cpp
moveQuad2Rect.cpp
moveRect2Quad.cpp
moveRotate.cpp
vcmove.cpp

sl1pkn07
21st April 2017, 14:54
EDIT: bah. found it

lansing
29th March 2019, 23:11
Trying out the rotate function on my 1400x2000 image, it doesn't rotate it and I got these weird black boxes


image = core.imwrif.Read(file)

rotate = core.vcmove.Rotate(image, image, angle=45)



https://i.imgur.com/166Ft2Z.png

While it does work on video with smaller resolution, it only rotate the frame within the original resolution. It should have option to rotate without this restraint, and change the output resolution if needed.

lansing
30th March 2019, 01:04
I found a bug on the rotate function of not releasing memory after finished.

clip = core.ffms2.Source(video_file)
rotate = core.vcmove.Rotate(clip, clip, angle=45)
rotate.set_output()

got this message when closing the preview window in vs editor
Core freed but 4838400 bytes still allocated in framebuffers