Skip to content

Commit

Permalink
PascalCase function name. Fix abs etc problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
msg7086 committed Oct 15, 2014
1 parent aeef5eb commit e6a15aa
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#----------------------------------------------------------------------------
# Makefile for d2vsource
# Makefile for vs_it, modified based on d2vsource/GNUmakefile
#----------------------------------------------------------------------------

include config.mak
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# VapourSynth-IT

VS_IT.dll v0103.1.1 Copyright(C) 2002 thejam79, 2003 minamina, 2014 msg7086
VS_IT.dll v0103.1.2 Copyright(C) 2002 thejam79, 2003 minamina, 2014 msg7086

VapourSynth Plugin - Inverse Telecine (YV12 Only, IT-0051 base, IT_YV12-0103 base)

Expand Down Expand Up @@ -28,7 +28,7 @@ VapourSynth Plugin - Inverse Telecine (YV12 Only, IT-0051 base, IT_YV12-0103 bas

## Usage

core.it.it(clip clip, int fps = 24, int threshold = 20, int pthreshold = 75)
core.it.IT(clip clip, int fps = 24, int threshold = 20, int pthreshold = 75)

clip - clip to be processed. Width < 8192 and YV12 only
fps - 24: IVTC; 30: frame-matching only
Expand All @@ -41,7 +41,7 @@ VapourSynth Plugin - Inverse Telecine (YV12 Only, IT-0051 base, IT_YV12-0103 bas

```python
v = core.std.BlankClip(format=vs.YUV420P8, color=[40,60,240], fpsnum=30000, fpsden=1001)
v = core.it.it(v)
v = core.it.IT(v)
```

## Caution
Expand All @@ -67,6 +67,7 @@ You are welcome to send PR if you can help to improve the code quality.

## ChangeLog

- v1.2 14/10/15 Change function name to PascalCase.
- v1.1 14/10/08 Move 2 thread variables back to object to improve speed. Now we support compiling under Linux using g++ and clang++. Clang version appears to be faster but YMMV.
- v1.0 14/10/06 All inline asm code has been translated to pure C and SSE2 intrinsics. SSE2 comes with 30% speed up compared to original MMX code.
- v0.4 14/10/04 Code cleanup. Special thanks to macromizer for cleaning up macros.
Expand Down
4 changes: 2 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ cc_check()
fi
echo "int main(void){$4 return 0;}" >> config.log
echo "int main(void){$4 return 0;}" >> conftest.cpp
echo $CXX conftest.cpp -o conftest $1 $2 >> config.log
$CXX conftest.cpp -o conftest $1 $2 2>> config.log
echo $CXX conftest.cpp -Werror -o conftest $1 $2 >> config.log
$CXX conftest.cpp -Werror -o conftest $1 $2 2>> config.log
ret=$?
echo $ret >> config.log
rm -f conftest*
Expand Down
4 changes: 2 additions & 2 deletions src/vs_it_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,15 @@ static void VS_CC itCreate(const VSMap * in, VSMap * out, void * userData, VSCor

INSTANCE * d = new INSTANCE(new VSVideoInfo(*vi), node, fps, threshold, pthreshold, vsapi);

vsapi->createFilter(in, out, "it", itInit, itGetFrame, itFree, fmParallel, 0, d, core);
vsapi->createFilter(in, out, "IT", itInit, itGetFrame, itFree, fmParallel, 0, d, core);
return;
}

VS_EXTERNAL_API(void) VapourSynthPluginInit(VSConfigPlugin configFunc, VSRegisterFunction registerFunc, VSPlugin * plugin) {
configFunc("in.7086.it", "it",
"VapourSynth IVTC Filter v" IT_VERSION,
VAPOURSYNTH_API_VERSION, 1, plugin);
registerFunc("it",
registerFunc("IT",
"clip:clip;fps:int:opt;threshold:int:opt;pthreshold:int:opt;",
itCreate, nullptr, plugin);
}
6 changes: 3 additions & 3 deletions src/vs_it_process.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,12 +345,12 @@ bool IT::CompCP(IScriptEnvironment * env) {
//1773
int thcomb = AdjPara(20);
if (n != 0) {
if ((env->m_iSumC < thcomb && env->m_iSumP < thcomb) || abs(env->m_iSumC - env->m_iSumP) * 10 < env->m_iSumC + env->m_iSumP) {
if (abs(env->m_iSumC - env->m_iSumP) > AdjPara(8)) {
if ((env->m_iSumC < thcomb && env->m_iSumP < thcomb) || labs(env->m_iSumC - env->m_iSumP) * 10 < env->m_iSumC + env->m_iSumP) {
if (labs(env->m_iSumC - env->m_iSumP) > AdjPara(8)) {
env->m_iUseFrame = env->m_iSumP >= env->m_iSumC ? 'c' : 'p';
return true;
}
if (abs(env->m_iSumPC - env->m_iSumPP) > AdjPara(10)) {
if (labs(env->m_iSumPC - env->m_iSumPP) > AdjPara(10)) {
env->m_iUseFrame = env->m_iSumPP >= env->m_iSumPC ? 'c' : 'p';
return true;
}
Expand Down

0 comments on commit e6a15aa

Please sign in to comment.