Log in

View Full Version : TDeintMod


HolyWu
15th October 2014, 17:38
https://github.com/HomeOfVapourSynthEvolution/VapourSynth-TDeintMod

It's a combination of TDeint + TMM port.

HolyWu
24th October 2014, 19:22
Update r3.

Add SIMD to motion mask related processing, speed up about 30~40%.
Add 'show' parameter to display the motion mask instead of the deinterlaced frame.

HolyWu
30th December 2014, 06:51
Update r5.

Add 9-16 bits support.
IsCombed's combed frame detection now works properly for different color spaces.

EDIT: I just ninja update the r5 archive to fix no frame returned at the end of processing bug, which only happen when mtql, mthl, mtqc, mthc are all set to -2 and show=True.

jackoneill
22nd April 2015, 20:50
Is it wise to read from getReadPtr()-1? It happens in the SIMD version of the threshMask function. I see that the value doesn't make its way into the output (I think?), but are you sure it will never crash?

Myrsloik
22nd April 2015, 21:12
It will probably overread the end if the width is mod32 too.

HolyWu
23rd April 2015, 17:44
Thanks. I didn't think about that carefully when I vectorized the function. Should have been fixed now.

HolyWu
14th May 2015, 11:33
Update r6.


TDeintMod now will use the field order specified in the source frames (_FieldBased frame property) and will only fall back to the specified order if not present.
The framerate and the frame duration are properly adjusted and normalized for double rate output.
Return an error if the returned clip is longer than INT_MAX.
Fix potential crash in threshMask's SIMD code.

HolyWu
13th May 2016, 14:56
Update r7.


Actually return an error when the value of the order, field, mode or metric parameter is out of range.
The output frame's _FieldBased property is now set to 0.
IsCombed: Actually return an error for unsupported chroma subsampling.
The parameter value is now scaled in a saner way.
Remove the upper bound of the length parameter.

kolak
27th October 2016, 17:50
Is this expected to compile on OSX?

HolyWu
1st May 2017, 09:21
Update r8.


Code refactoring and minor performance improvement.
Add AVX2 code path.
Add opt and planes parameters.

HolyWu
9th March 2018, 08:32
Update r9.


Change show parameter to display binary comb mask.
Add athresh, metric, expand and link parameters.


Someone requested for TCombMask a while ago, but we really don't need another filter for duplicate job.

Sparktank
9th March 2018, 11:18
Hmm... Every day, I think about learning VS.

So many more updates.
How is this compared to the AVS/AVS+ branches?

The only thing holding me back is not enough examples for VS usage.
I get it's python. But I don't even know python. I might as well learn Wookie.

But, I love seeing any update. Wether it be AVS+ or VS.
All updates just mean a step forward.

jackoneill
9th March 2018, 14:24
The only thing holding me back is not enough examples for VS usage.
I get it's python. But I don't even know python. I might as well learn Wookie.


Here is an example:

import vapoursynth as vs

core = vs.get_core()

clip = core.std.BlankClip(format=vs.YUV420P8)
clip = core.text.CoreInfo(clip)

clip.set_output()



vspipe blankclip.py - --y4m | x264.exe --demuxer y4m --crf 16 -o blankclip.mkv -

DJATOM
9th March 2018, 19:02
@Sparktank
VS is pretty good. I tried it this fall and now I'm using VS for almost all my releases. IVTC (tfm) stuff is done using AVS+, anything else with VS.

kgrabs
9th March 2018, 19:57
@Sparktank
VS is pretty good. I tried it this fall and now I'm using VS for almost all my releases. IVTC (tfm) stuff is done using AVS+, anything else with VS.

If/when you try switching to VIVTC, it might benefit you to know it doesn't remove the field-based prop, so if you try to crop to mod 2 you have to remove it first: https://pastebin.com/raw/eujeQxvb (https://pastebin.com/eujeQxvb)

jackoneill
9th March 2018, 21:59
If/when you try switching to VIVTC, it might benefit you to know it doesn't remove the field-based prop, so if you try to crop to mod 2 you have to remove it first: https://pastebin.com/raw/eujeQxvb (https://pastebin.com/eujeQxvb)

An easier way to remove a frame property:

src = c.std.SetFrameProp(src, "_FieldBased", delete=True)

http://www.vapoursynth.com/doc/functions/setframeprop.html

HolyWu
10th March 2018, 05:22
Update r10.


Fix link parameter not working in 9-16 bit depth.

DJATOM
10th March 2018, 08:07
If/when you try switching to VIVTC, it might benefit you to know it doesn't remove the field-based prop, so if you try to crop to mod 2 you have to remove it first: https://pastebin.com/raw/eujeQxvb (https://pastebin.com/eujeQxvb)

VIVTC can't perform 2 pass VFR, that's why I stick with tfm/tdecimate for that task.

l33tmeatwad
12th March 2018, 03:47
Both r9 and r10 fail to compile on OSX.
TDeintMod/TDeintMod_SSE2.cpp:270:43: error: use of overloaded operator '==' is
ambiguous (with operand types 'Vec16uc' and '__m128i' (vector of 2
'long long' values))
select(T2().load_a(srcp0 + x) == zero_128b() && T2().load_a(...
~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
TDeintMod/TDeintMod_SSE2.cpp:281:15: note: in instantiation of function template
specialization 'combineMasks_sse2<unsigned char, Vec16uc, 16>' requested
here
template void combineMasks_sse2<uint8_t, Vec16uc, 16>(const VSFrameRef *...
^
TDeintMod/vectorclass/vectori128.h:679:23: note: candidate function
static inline Vec16cb operator == (Vec16c const & a, Vec16c const & b) {
^
TDeintMod/TDeintMod_SSE2.cpp:270:43: note: built-in candidate
operator==(__attribute__((__vector_size__(2 * sizeof(long long)))) long
long, __attribute__((__vector_size__(2 * sizeof(long long)))) long long)
select(T2().load_a(srcp0 + x) == zero_128b() && T2().load_a(...
^
TDeintMod/TDeintMod_SSE2.cpp:270:43: error: use of overloaded operator '==' is
ambiguous (with operand types 'Vec8us' and '__m128i' (vector of 2
'long long' values))
select(T2().load_a(srcp0 + x) == zero_128b() && T2().load_a(...
~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
TDeintMod/TDeintMod_SSE2.cpp:282:15: note: in instantiation of function template
specialization 'combineMasks_sse2<unsigned short, Vec8us, 8>' requested
here
template void combineMasks_sse2<uint16_t, Vec8us, 8>(const VSFrameRef *...
^
TDeintMod/vectorclass/vectori128.h:1504:22: note: candidate function
static inline Vec8sb operator == (Vec8s const & a, Vec8s const & b) {
^
TDeintMod/TDeintMod_SSE2.cpp:270:43: note: built-in candidate
operator==(__attribute__((__vector_size__(2 * sizeof(long long)))) long
long, __attribute__((__vector_size__(2 * sizeof(long long)))) long long)
select(T2().load_a(srcp0 + x) == zero_128b() && T2().load_a(...
^
2 errors generated.
make: *** [TDeintMod/TDeintMod_SSE2.lo] Error 1

HolyWu
12th March 2018, 13:07
Both r9 and r10 fail to compile on OSX.

Fixed in the latest commit.