Git Product home page Git Product logo

Comments (1)

saucecontrol avatar saucecontrol commented on May 30, 2024 1

Howdy! Thanks for the kind words!

It's always nice to encounter someone with an interest in imaging algorithms and performance. I've set up a gitter channel and just haven't added it to the readme yet. Feel free to hop on there if you want to discuss possible work in that area.

As far as I understand, you are using an AoS algorithm, working directly on the 4, 3 or 1 channel color structs, duplicating the kernel weights to that dimension

That's correct, mostly. The majority use case for resizing in MagicScaler is JPEG in planar Y'CbCr format, so most of the work it does (in pure numbers of pixels processed) is SoA layout. It may be possible to get some further gains by using SoA on BGR and BGRA data, however I have attempted to keep the algorithms working mostly the same between .NET Core and .NET Framework targets, and since there are no shuffle operations available on Framework, it's not practical to implement SoA. And I'm actually quite pleased with the performance I've achieved using AoS with duplicated kernel weights. The kernel weights are re-used, keeping them in CPU cache, so there probably isn't much to be gained once you factor in the cost of reorganizing the data before and after convolution.

Furthermore, I think bandwidth could be decreased by working on 16-bit floats as input, but at first sight .NET SIMD doesn't support that yet. Maybe 16-bit integers would also work...

16-bit floats are a no-go for now, but you'll see I've implemented the pure scalar convolution in 16-bit integer for .NET Framework 32-bit targets, where legacy JIT doesn't support SIMD in any fashion and where floating-point math uses slow x87 instructions. The same algorithms could be expanded to true SIMD, but again this would lead to less sharing between .NET Core and .NET Framework targets where SIMD is supported. It's on my list for future exploration.

Other thinks I would like to experiment with are streaming writes, more cache friendly image transposition, …

Again, please stop by the gitter channel if you'd like to chat about any possible improvements or are interested in contributing. I'm always on the lookout for ideas :)

from photosauce.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.