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 29th January 2017, 15:40   #41  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 448
nope
https://sl1pkn07.wtf/paste/view/b2ac319f

let me time to test with yasm, idk how manage it
__________________
[AUR] Vapoursynth Stuff
sl1pkn07 is offline   Reply With Quote
Old 29th January 2017, 15:56   #42  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,122
that's weird...
please modify the source code manually and report back..
line 139:
replace
Code:
_mm256_store_ps(reinterpret_cast<float *>(&YMMField), _mm256_add_ps(reinterpret_cast<const __m256 &>(srcp[y][x]), YMMField));
with
Code:
_mm256_store_ps(reinterpret_cast<float *>(&YMMField), _mm256_add_ps(*reinterpret_cast<const __m256 *>(&srcp[y][x]), YMMField));
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 29th January 2017, 16:08   #43  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 448
https://sl1pkn07.wtf/paste/view/883d7e05
__________________
[AUR] Vapoursynth Stuff
sl1pkn07 is offline   Reply With Quote
Old 29th January 2017, 17:28   #44  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,122
Quote:
Originally Posted by sl1pkn07 View Post
I googled that error and apparently the source code was not what caused it.

there's something wrong with your compiling settings
Quote:
That's the usual message for intrinsics that you haven't told the compiler the target supports.
see: http://stackoverflow.com/questions/3...-epi32-m128i-t

damn, now I get how nice that Visual Studio compiler is (from the user's point of view), I never had any sort of shit like this with Visual Studio...
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated

Last edited by feisty2; 29th January 2017 at 17:30.
feisty2 is offline   Reply With Quote
Old 29th January 2017, 17:31   #45  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 448
maybe is because my processor don't have AVX/FMA3 (Xeon x5650)
__________________
[AUR] Vapoursynth Stuff

Last edited by sl1pkn07; 30th January 2017 at 14:09.
sl1pkn07 is offline   Reply With Quote
Old 29th January 2017, 17:36   #46  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,122
Quote:
Originally Posted by sl1pkn07 View Post
maybe is because my processor dont have AVX/AVX2? (Xeon x5650)
you could try with "-march=haswell" and see if it does the trick
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 29th January 2017, 17:37   #47  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 448
my processor is westmere/ep (+/- nehalem)

with -msse4.1

https://sl1pkn07.wtf/paste/view/9516661b

EDIT: with -march=haswell build ok. but i think is incompatible with my processor
__________________
[AUR] Vapoursynth Stuff

Last edited by sl1pkn07; 29th January 2017 at 17:40.
sl1pkn07 is offline   Reply With Quote
Old 29th January 2017, 17:45   #48  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,122
Quote:
Originally Posted by sl1pkn07 View Post
my processor is westmere/ep (+/- nehalem)

with -msse4.1

https://sl1pkn07.wtf/paste/view/9516661b

EDIT: with -march=haswell build ok. but i think is incompatible with my processor
doesn't matter, it will call the C++ functions automatically if the AVX functions fail.
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 29th January 2017, 17:46   #49  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 448
is not better use "if detect, compile it" instead of force compiling?
__________________
[AUR] Vapoursynth Stuff

Last edited by sl1pkn07; 29th January 2017 at 17:48.
sl1pkn07 is offline   Reply With Quote
Old 29th January 2017, 17:53   #50  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,122
Quote:
Originally Posted by sl1pkn07 View Post
is not better use "if detect, compile it" instead of force compiling?
unfortunately, I don't know how to "if detect, compile it"...
is the forcibly-compiled binary running ok on your computer since there's the C++ function backup?
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 29th January 2017, 17:59   #51  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 448
Quote:
Originally Posted by feisty2 View Post
unfortunately, I don't know how to "if detect, compile it"...
something like:

Code:
#ifdef VAPOURSYNTH_H
static void VS_CC VapourSynthPluginViInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core,
    const VSAPI *vsapi) {

    NLMVapoursynth *d = (NLMVapoursynth*) * instanceData;
    vsapi->setVideoInfo(d->vi, 1, node);
}
#endif //__VAPOURSYNTH_H__
(taken from knlmeans code)

but with CPU capabilities

EDIT: better example
EDIT: that is called conditionals? (sorry, im not coder, idk what is a real name of this)
__________________
[AUR] Vapoursynth Stuff

Last edited by sl1pkn07; 29th January 2017 at 20:28.
sl1pkn07 is offline   Reply With Quote
Old 29th January 2017, 18:21   #52  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,122
Quote:
Originally Posted by sl1pkn07 View Post
something like:

Code:
#ifdef VAPOURSYNTH_H
static void VS_CC VapourSynthPluginViInit(VSMap *in, VSMap *out, void **instanceData, VSNode *node, VSCore *core,
    const VSAPI *vsapi) {

    NLMVapoursynth *d = (NLMVapoursynth*) * instanceData;
    vsapi->setVideoInfo(d->vi, 1, node);
}
#endif //__VAPOURSYNTH_H__
(taked from knlmeans code)

but with CPU capabilities

EDIT: better example
EDIT: that is called conditionals? (sorry, im not coder, idk what is a real name of this)
The past tense of "take" is "took", perfect tense "taken"
Anyways, it's called conditional compilation and I know how to do it theoretically but still can't do it, because it involves whole lot of compiler-specific macros that are not part of the C++ standard...

And since your compilation worked, I assume you figured out how to get yasm to work?
And does the compiled binary run correctly? (Checking if the "opt" parameter actually works)
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 29th January 2017, 18:48   #53  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 448
about yasm

something like this?

Code:
diff --git a/Source.cpp b/Source.cpp
index 5409d6e..3dbd174 100644
--- a/Source.cpp
+++ b/Source.cpp
@@ -1,12 +1,13 @@
-#include "VapourSynth.h"
-#include "VSHelper.h"
-#include "cpufeatures.hpp"
+#include <VapourSynth.h>
+#include <VSHelper.h>
 #include <cmath>
 #include <cstring>
 #include <algorithm>
 #include <immintrin.h>
 #include <malloc.h>
 
+extern "C++" int CPUFeatures();
+
 struct FixFadesData final {
 	const VSAPI *vsapi = nullptr;
 	VSNodeRef *node = nullptr;
(you can avoid the first change)

but i get https://sl1pkn07.wtf/paste/view/f32ca689

(takEN (XD) from https://github.com/vapoursynth/vapou...ore/x86utils.h (with this help http://wiki.osdev.org/C%2B%2B_to_ASM_linkage_in_GCC)

about of test, give me time
__________________
[AUR] Vapoursynth Stuff
sl1pkn07 is offline   Reply With Quote
Old 29th January 2017, 18:54   #54  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,122
Include "cpufeatures_gnu.hpp" and remove that "extern "C++" int CPUFeatures();" thing
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 29th January 2017, 19:00   #55  |  Link
sl1pkn07
Pajas Mentales...
 
Join Date: Dec 2004
Location: Spanishtán
Posts: 448
em, is the same as i tried before (only work with -march=haswell)(?)

or you mean convert the cpu.asm to object with yasm* and include it in the linker step?

*
Code:
yasm -f elf -m ${_m} -DARCH_X86_64=${_darch} -o cpu.o cpu.asm
can you share a clip/video sample? or how doing it with blankclip()
__________________
[AUR] Vapoursynth Stuff

Last edited by sl1pkn07; 29th January 2017 at 20:11.
sl1pkn07 is offline   Reply With Quote
Old 29th January 2017, 22:31   #56  |  Link
JoeyMonco
Registered User
 
Join Date: Jan 2017
Posts: 24
Quote:
Originally Posted by feisty2 View Post
Anyways, it's called conditional compilation and I know how to do it theoretically but still can't do it, because it involves whole lot of compiler-specific macros that are not part of the C++ standard...
But compiler-specific cpuid functions are part of standard? Since when?
JoeyMonco is offline   Reply With Quote
Old 29th January 2017, 23:02   #57  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Ikea Chair
Posts: 1,959
Now you see why asm is kinda your friend.

There's a pile of pitfalls here you missed. And some you found.

1. You compile the whole file with avx2/whatever instrction set you selected. That means avx2 instructions may be emitted for you plain C++ code too. Solve it by placing the avx2 code in a separate file and use different compiler settings.

2. You can't put sse and avx intrinsics in the same file either. For example subps can get turned into vsubps to reduce register copies. So then the sse path needs avx too...

3. Cpuid is horrible in intrinsics, that's why I use asm. Lrn2yasm. Or write code that requires gcc or clang where convenient intrinsics are available. Clang is even available as a simple dropin for visual studio nowadays.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 30th January 2017, 04:19   #58  |  Link
Mystery Keeper
Beyond Kawaii
 
Mystery Keeper's Avatar
 
Join Date: Feb 2008
Location: Russia
Posts: 711
Why do conditional compilation at all when you can compile function for every instruction set and use CPU information to select the proper function in runtime?
__________________
...desu!
Mystery Keeper is offline   Reply With Quote
Old 30th January 2017, 04:40   #59  |  Link
feisty2
I'm Siri
 
feisty2's Avatar
 
Join Date: Oct 2012
Location: Los Angeles, California
Posts: 2,122
Quote:
Originally Posted by sl1pkn07 View Post
or you mean convert the cpu.asm to object with yasm* and include it in the linker step?
yeah

Quote:
Originally Posted by sl1pkn07 View Post
can you share a clip/video sample? or how doing it with blankclip()
blankclip is okay, long as it's not crashing.

Quote:
Originally Posted by JoeyMonco View Post
But compiler-specific cpuid functions are part of standard? Since when?
no they are not, but I can google this individual function and learn to use it, I can't however google thousands of compiler-specific macros and memorize them all.
__________________
If I got new ideas, will post here: https://github.com/IFeelBloated
feisty2 is offline   Reply With Quote
Old 30th January 2017, 04:59   #60  |  Link
JoeyMonco
Registered User
 
Join Date: Jan 2017
Posts: 24
Quote:
Originally Posted by feisty2 View Post
yeah


blankclip is okay, long as it's not crashing.


no they are not, but I can google this individual function and learn to use it, I can't however google thousands of compiler-specific macros and memorize them all.
Thousands? Uhh no. There is __GNUC__ and __clang__ and _MSC_VER_.

http://stackoverflow.com/questions/2...ang-with-macro

That was the first link in googling "how to detect gcc vs msvc"
JoeyMonco is offline   Reply With Quote
Reply

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 04:19.


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