Menu

Feature request (RGB(A) to planar and back)

2016-09-12
2016-12-06
  • Nikolai Vorontsov

    Hello Ihar,

    could you please add SIMD accelearted functions to transform pixel format data (RGB, RGBA) to a plane-by-plane format (RRRRR.., GGGGG.., BBBBB.., etc)?

    What I found that some of functions in your library is 6x times slower in RGB mode than in single channel. So, I assume that in triple planar format I can get 2x times speed up (not taking into account convertion to/from planar type).

    Thanks in advance,
    Nikolai

     
  • Yermalayeu Ihar

    Yermalayeu Ihar - 2016-09-12

    Yes, I can do it. I will implement this functionality when I have enough free time.

     
  • Yermalayeu Ihar

    Yermalayeu Ihar - 2016-09-15

    I've implemented these functions (DeinterleaveBgr, DeinterleaveBgra, InterleaveBgr, InterleaveBgra).

     
  • Nikolai Vorontsov

    Hello Ihar,

    thank you. I'll check it in a new SIMD release.

    Nikolai

     
  • Nikolai Vorontsov

    Hello Ihar,

    thank you for implementing (de)interleaving functions, they are quite useful in some cases.

    Is it possible to use your library somehow to implement erode/dilate functions? Something similar to Blur3x3...

    Nikolai

     
  • Yermalayeu Ihar

    Yermalayeu Ihar - 2016-11-04

    Hello, Nikolai.

    Yes. I can implement erode/dilate algorithms. But there are many variations of these algorithms and possible parameters (positive and negative values in the mask, use or don't use diagonal values for erode/dilate and so on). Also it would be good if the algorithms were suitable for common using. So if you give me a basic implementation of the algorithms I will add them to the library and perform platform specific optimizations.

    Even better if you join to the project and add base implementation. If you agree I will add you to the list of developers of Simd LIbrary.

    Sincerely, Ihar.

     
  • Nikolai Vorontsov

    Hello Ihar,

    well right now I'm using implementation taken here http://blog.ostermiller.org/dilate-and-erode

    From a first glance it's possible to use SIMD to implement Manhattan oracle and a single step erode/dilate function.

    Give me some time to play a bit with it, before you make it yourself :-) If I get some results, I'll toss it to you to improve SIMD lib.

    Nikolai

     
  • Nikolai Vorontsov

    Ah, got it - you also need a plain c/c++ code. OK, let me brush up a bit what I have now and then I share it with you
    N.

     
  • Yermalayeu Ihar

    Yermalayeu Ihar - 2016-11-04

    Ok. I have looked the algorithms at your link. It looks like it is possible to implement with using of SIMD. I will wait your decision.

     
  • Nikolai Vorontsov

    Hello Ihar,

    sorry for delay, as usual when deadline approaches - less time for other tasks.

    Is everything OK with the latest release? I've downloaded (twice) simd.3.3.48.844.zip file, but was not able to decompress it :-(
    The simd.3.3.47.809.zip was downloaded and opened OK.

     
  • Yermalayeu Ihar

    Yermalayeu Ihar - 2016-12-06

    Thank you for bug report. Could you download the file again - I've just updated it?

     
  • Nikolai Vorontsov

    it works now, thanks!

     
  • Nikolai Vorontsov

    Ihar, I'm trying to compile it with VS2013 and it has some issues. Not 100% sure if VS2015 handles type matching better, but what I see in a new neural code is:

    1>....\src\Simd\SimdAvx2Neural.cpp(111): error C2872: 'F' : ambiguous symbol
    1> could be 'SIMD2\src\Simd/SimdConst.h(216) : const size_t Simd::Avx::F'
    1> or 'SIMD2\src\Simd/SimdConst.h(82) : const size_t Simd::Sse::F'
    1> ....\src\Simd\SimdAvx2Neural.cpp(133) : see reference to function template instantiation 'void Simd::Avx2::NeuralRoughSigmoid2<true>(const float ,size_t,const float ,float *)' being compiled

    As I see NeuralRoughSigmoid2 is in Avx2 namespace and F is in Avx and Sse namespaces.
    So, when it tries to compile:
    namespace Avx2 ....
    template <bool align=""> SIMD_INLINE void NeuralRoughSigmoid2(const float * src, size_t size, const float * slope, float * dst)
    {
    size_t partialAlignedSize = Simd::AlignLo(size, F);

    it doesn't match well between Avx::F and Sse::F.

    Does it work for you in VS2015?

     
  • Yermalayeu Ihar

    Yermalayeu Ihar - 2016-12-06

    It fine works in VS2015. I've fixed this bug for VS2013.

     
  • Nikolai Vorontsov

    just out of curiosity - how it decides what value (4 or 8) to select???

     
  • Yermalayeu Ihar

    Yermalayeu Ihar - 2016-12-06

    See file SimdConst.h :

    namespace Sse2
    {
        using namespace Sse;
    }
    

    ...

    namespace Avx2
    {
        using namespace Avx;
    }
    

    It fine works for VS2015 and GCC, but VS2013 can't resolve this situation.

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.