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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd October 2014, 08:51   #1  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 871
IT 1.2 (ported)

https://github.com/msg7086/VapourSynth-IT

Latest: v1.2

Ported from original IT filter.

It did a very good job and is my favorite ivtc filter. So I did a copy-and-paste style partial porting.

8K width is supported thanks to a patch.

Now support Linux. Clang versions appear to be faster.

Last edited by MeteorRain; 15th October 2014 at 09:11. Reason: v1.2
MeteorRain is offline   Reply With Quote
Old 2nd October 2014, 22:55   #2  |  Link
turbojet
Registered User
 
Join Date: May 2008
Posts: 1,840
Interesting blast from the past, this used to be my favorite ivtc too but then I noticed in some videos there was issues with scene changes, tivtc and decomb handle these same videos fine. Could the thread-safe fix this? I don't have any samples to test anymore but it happened on a substantial amount of dvd's.
__________________
PC: FX-8320 GTS250 HTPC: G1610 GTX650
PotPlayer/MPC-BE LAVFilters MadVR-Bicubic75AR/Lanczos4AR/Lanczos4AR LumaSharpen -Strength0.9-Pattern3-Clamp0.1-OffsetBias2.0
turbojet is offline   Reply With Quote
Old 2nd October 2014, 23:14   #3  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 871
TBH I never observed such problems under linear seeking condition. If someone can find such samples....
MeteorRain is offline   Reply With Quote
Old 3rd October 2014, 09:26   #4  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,254
You should change all lines like this in the code:
Code:
(int)vsapi->propGetInt(in, "fps", 0, &err); => int64ToIntS(vsapi->propGetInt(in, "fps", 0, &err));
I see this is one of the hopeless filters with no C code at all in many places... Will you try to remove all the inline asm as well? I see that most places at least have comments saying what the asm is supposed to be doing (which of course isn't always true).
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 3rd October 2014, 11:52   #5  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 871
Quote:
Originally Posted by Myrsloik View Post
You should change all lines like this in the code:
Code:
(int)vsapi->propGetInt(in, "fps", 0, &err); => int64ToIntS(vsapi->propGetInt(in, "fps", 0, &err));
I did a quick Google only to find this post itself. Any hints?

Quote:
Originally Posted by Myrsloik View Post
I see this is one of the hopeless filters with no C code at all in many places... Will you try to remove all the inline asm as well? I see that most places at least have comments saying what the asm is supposed to be doing (which of course isn't always true).
I tried to rewrite some inline asm into intrinsics, but it appears to be slower. Mixing SSE with MMX might be the cause. Maybe I'll look into that later. That's a large code base to me and I'm not that familiar with C/C++, and even ASM, and image processing, and etc..
MeteorRain is offline   Reply With Quote
Old 3rd October 2014, 17:53   #6  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,101
Quote:
Originally Posted by MeteorRain View Post
I did a quick Google only to find this post itself. Any hints?
http://www.vapoursynth.com/doc/api/v...ml#int64toints

Avoid plain old C casts if possible, especially if they actually change the data (like in this case, an integer width reduction). In general in C++ if you really really do need to cast you should probably use static_cast<typename>(), reinterpret_cast<typename>() and friends instead. See http://stackoverflow.com/questions/1...nstead-of-intx and http://stackoverflow.com/questions/3...t-cast-be-used

Last edited by TheFluff; 3rd October 2014 at 17:56.
TheFluff is offline   Reply With Quote
Old 3rd October 2014, 18:35   #7  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 2,254
The main problem is that all of these simply truncate the value. If someone passes 0x100000000 it will appear to be 0. Obviously no one really expects this behavior which is why int64ToIntS is provided to provide saturated values. (as in, return the closest value representable by an int instead of the usually 32 lowest bits)
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 4th October 2014, 02:02   #8  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 871
Nice guide, thanks @TheFluff! I'm quite new to the plusplus world.

@Myrsloik Thanks for letting me know. I will try to improve the code.

=====

And I have uploaded v0.3.

Last edited by MeteorRain; 4th October 2014 at 03:21.
MeteorRain is offline   Reply With Quote
Old 4th October 2014, 05:38   #9  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 871
So I'm experimenting on the asm code.

===
nvm

Last edited by MeteorRain; 6th October 2014 at 07:50. Reason: nvm
MeteorRain is offline   Reply With Quote
Old 4th October 2014, 15:33   #10  |  Link
macromizer
Registered User
 
Join Date: Apr 2014
Posts: 15
What version of the IT source code did you base your port off of? Just so I can have a reference.

If you want, I can try to help you fix up and clean up your port so it compiles outside of VC++. I will start by getting rid of all your macros and reimplementations of Avisynth interfaces to make your code look less awkward. Then before trying to recreate the assembly, the focus should be on just getting plain C code for everything then try to optimize with assembly intrinsics from there after doing some profiling.

Last edited by macromizer; 4th October 2014 at 21:24.
macromizer is offline   Reply With Quote
Old 6th October 2014, 10:09   #11  |  Link
MeteorRain
結城有紀
 
Join Date: Dec 2003
Location: NJ; OR; Shanghai
Posts: 871
I have rewritten all inline asm code into both C and SSE intrinsics. I have carefully compared the results to ensure they are binary identical translation.
MeteorRain is offline   Reply With Quote
Old 7th August 2016, 10:41   #12  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,171
doesn't work at all in 64bit for me
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..

Last edited by Selur; 7th August 2016 at 13:12.
Selur is offline   Reply With Quote
Reply

Tags
ivtc, vapoursynth

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:25.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.