If you use Simd Library as DLL, then I want to notice that the library does not contain dll-exported function Simd::Sse2::ResizeBilinear(), only SimdResizeBilinear(). So if you try to call first one, then there will be an exception.
It is strongly recomended to use only function SimdResizeBilinear(), because it performs checking of CPU capabilities and minimal size of output image (SIMD version of the function can't resize very small images) and then calls the best available method.
If you anyway want to use Simd::Sse2::ResizeBilinear() directly, you have to compile Simd Library as static.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If I try with SimdResizeBilinear() in dll the compiler says:
error LNK2001: unresolved external symbol __imp__SimdResizeBilinear
If I add the SimdLib.cpp to the project, I get the same error but for 275 functions (!).
Should I add all the cpp files, even thow I only need a function?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't see any *.cpp files of Simd Library in your project.
It is not suprized that linker can't find implementation of SimdResizeBilinear - it is absent.
You have to add all *.cpp files of Simd Library to your project.
Last edit: Yermalayeu Ihar 2016-03-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So, now I have to edit each h and cpp file to remove the "Simd/" before the included header files (it doesn't accept the path in Windows).
about 250+ times (I solved a few till now).
And after compile all functions will be included in the dll although I only need a few.
Isn't there other way?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Don't change source of Simd Library!
Change "Additional Include Directories" in your project from: ..\..;..\..\libpng;..\..\zlib;Simd;
to: ..\..;..\..\libpng;..\..\zlib;.;
Last edit: Yermalayeu Ihar 2016-03-28
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Question: what kind of data requires the SimdResizeBilinear function for the src and dest parameters?
In my application I use the color of the pixels (BGR and BGRA) by default. The data is from the bottom of the bitmap to the top (line by line).
Do I need to change to DIB, RGBA or from the top to bottom...?
I ask because I get an access violation in SimdSse3ResizeBilinear >> template <size_t channelcount=""> void ResizeBilinear >> line 297..307 somewhere in this cycle:</size_t>
The library supposes that the image begins from left-top point.
Image data must be the one continuous bit array.
Note that srcStride and dstStride may be differ from srcWidth*channelCount and dstWidth*channelCount.
Last edit: Yermalayeu Ihar 2016-03-29
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The host application is in Delphi.
The bitmaps in Delphi are having data stored as a contiguous bit array, but from the begining of the last row to the end of the first row.
So I have to reverse the row order (twice), which will take some time and decrease the speed. And high speed is what I need...
And regarding srcStride and dstStride: what are they actually and where do I get them from the bitmap's characteristics?
I thought there are the length of a row. I'm using only 24 and 32 bit bitmaps so it was easy multiplying the width with 3 and 4.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It would be great if I wouldn't have to reverse the rows order :)
And your library would be more useful to Delphi programmers too.
If you intend to modify it thank you in advance.
Oh, do you think that modification would also solve the last problem I described about 6 posts ago?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If src points to image bottom (start of last row) and if you use positive stride then program will be crashed on first or second row because it goes out of range of array.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok then, thank you for the clarification.
I'll wait for the modification.
And, btw, if you need help with something/anything don't hesitate to ask me.
I will be glad to help you.
Oh, just so you can understand for what I need the bilinear resize function, here is a test application: https://drive.google.com/open?id=0ByKxAD_t9uvLVWZFYVlFQ1BzVlU
And a test file: https://drive.google.com/open?id=0ByKxAD_t9uvLZVRUa2tGZEYybGs
Start the exe, load the file with the load button from the middle of the form and then click on preview.
You can change the size of the result by using +/- or reset to default with 0.
Your function will be used to resize the frames in real time.
Right now I have a pretty good function (30 ms for a resize 768x768 to 700x700 on my 2 GHz processor). But it doesn't use MMX/SSE.
I'm hoping your function, because it's using SSE2/3 will be faster.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Hi,
I'm trying to compile a dll in Visual C++ 10 (W8.1) with the bilinear resize function (using the latest Simd version):
It compiles fine but I get an access violation in the host application when calling the exported function.
The other 4 exported functions work fine.
Is the declaration/usage of the resize function in dll ok?
Btw, I have a Intel Celeron CPU with MMX..SSE4.2
Thank you for your help.
Hello.
If you use Simd Library as DLL, then I want to notice that the library does not contain dll-exported function Simd::Sse2::ResizeBilinear(), only SimdResizeBilinear(). So if you try to call first one, then there will be an exception.
It is strongly recomended to use only function SimdResizeBilinear(), because it performs checking of CPU capabilities and minimal size of output image (SIMD version of the function can't resize very small images) and then calls the best available method.
If you anyway want to use Simd::Sse2::ResizeBilinear() directly, you have to compile Simd Library as static.
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Thank you.
If I try with SimdResizeBilinear() in dll the compiler says:
error LNK2001: unresolved external symbol __imp__SimdResizeBilinear
If I add the SimdLib.cpp to the project, I get the same error but for 275 functions (!).
Should I add all the cpp files, even thow I only need a function?
I'm sorry but I don't have Visual Studio 2010 to reproduce this bug.
Maybe you need add project dependencies?
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
It doesn't say it needs any.
Before adding Simd header files and the exported function it compiled fine.
Last edit: Anonymous 2016-03-28
Could you send me the project file?
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Sure.
I don't see any *.cpp files of Simd Library in your project.
It is not suprized that linker can't find implementation of SimdResizeBilinear - it is absent.
You have to add all *.cpp files of Simd Library to your project.
Last edit: Yermalayeu Ihar 2016-03-28
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
That's what I asked a few posts ago.
So, now I have to edit each h and cpp file to remove the "Simd/" before the included header files (it doesn't accept the path in Windows).
about 250+ times (I solved a few till now).
And after compile all functions will be included in the dll although I only need a few.
Isn't there other way?
Don't change source of Simd Library!
Change "Additional Include Directories" in your project from:
..\..;..\..\libpng;..\..\zlib;Simd;to:
..\..;..\..\libpng;..\..\zlib;.;Last edit: Yermalayeu Ihar 2016-03-28
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
How do I solve these problems from SimdSsse3ResizeBilinear.cpp (see screenshot).
You can change
to
The first one is supported by c++ 11 compilers.
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Thank you.
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Question: what kind of data requires the SimdResizeBilinear function for the src and dest parameters?
In my application I use the color of the pixels (BGR and BGRA) by default. The data is from the bottom of the bitmap to the top (line by line).
Do I need to change to DIB, RGBA or from the top to bottom...?
I ask because I get an access violation in SimdSse3ResizeBilinear >> template <size_t channelcount=""> void ResizeBilinear >> line 297..307 somewhere in this cycle:</size_t>
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Btw, it shows error in the second iteration of the cycle.
The library supposes that the image begins from left-top point.
Image data must be the one continuous bit array.
Note that
srcStrideanddstStridemay be differ fromsrcWidth*channelCountanddstWidth*channelCount.Last edit: Yermalayeu Ihar 2016-03-29
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
The host application is in Delphi.
The bitmaps in Delphi are having data stored as a contiguous bit array, but from the begining of the last row to the end of the first row.
So I have to reverse the row order (twice), which will take some time and decrease the speed. And high speed is what I need...
And regarding srcStride and dstStride: what are they actually and where do I get them from the bitmap's characteristics?
I thought there are the length of a row. I'm using only 24 and 32 bit bitmaps so it was easy multiplying the width with 3 and 4.
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Anyway, using 32 bit bitmaps and 4 * bitmap width for row width it still breaks but in another place: line 308..309
At about the 3rd iteration for the cycle
for(size_t yDst = 0; yDst < dstHeight; yDst++, dst += dstStride)
At line 279 to 213
Stride may be negative. It useful for vertical flipping of image. I think it is your case.
In Windows stride of Bitmap is always multiple of 4.
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Ok, it may be negative, but is it safe to use a negative value for a size_t parameter?
In most case it is safe (if algoritm only adds or substracts stride). But of course I need to change interface of Simd Library.
I checked - it works and for multiplication too.
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
It would be great if I wouldn't have to reverse the rows order :)
And your library would be more useful to Delphi programmers too.
If you intend to modify it thank you in advance.
Oh, do you think that modification would also solve the last problem I described about 6 posts ago?
If src points to image bottom (start of last row) and if you use positive stride then program will be crashed on first or second row because it goes out of range of array.
View and moderate all "English Common Forum" comments posted by this user
Mark all as spam, and block user from posting to "Discussion"
Ok then, thank you for the clarification.
I'll wait for the modification.
And, btw, if you need help with something/anything don't hesitate to ask me.
I will be glad to help you.
Oh, just so you can understand for what I need the bilinear resize function, here is a test application:
https://drive.google.com/open?id=0ByKxAD_t9uvLVWZFYVlFQ1BzVlU
And a test file:
https://drive.google.com/open?id=0ByKxAD_t9uvLZVRUa2tGZEYybGs
Start the exe, load the file with the load button from the middle of the form and then click on preview.
You can change the size of the result by using +/- or reset to default with 0.
Your function will be used to resize the frames in real time.
Right now I have a pretty good function (30 ms for a resize 768x768 to 700x700 on my 2 GHz processor). But it doesn't use MMX/SSE.
I'm hoping your function, because it's using SSE2/3 will be faster.