Coder Social home page Coder Social logo

Comments (6)

stapelberg avatar stapelberg commented on June 1, 2024

https://github.com/libjpeg-turbo/libjpeg-turbo uses NEON on ARM, so that part seems to be feasible.

I’ll need to profile the g3 compression to see how to make it faster.

from scan2drive.

stapelberg avatar stapelberg commented on June 1, 2024

Commit 2f7d475 brings down the rotation + g3 compression to 5s on the Raspberry Pi 3. The longest step now definitely is the JPEG encoding.

from scan2drive.

stapelberg avatar stapelberg commented on June 1, 2024

I got a proof-of-concept which uses a port of libjpeg-turbo’s NEON assembler functions. It completes JPEG encoding within 2.5s of wall-clock time.

I’ll look into whether we can run the processing in parallel to reading data from the scanner. That way, we might be able to pull off scanning in almost real-time, i.e. with minimal wait after each page :).

from scan2drive.

stapelberg avatar stapelberg commented on June 1, 2024

Next steps for cleaning up the optimized JPEG encoder (scan2drive/internal/neonjpeg):

  • create separate git repository (for the cleanup only)
  • remove magic numbers
  • add assertions about image/buffer size
  • remove comments
  • clean up assembler files (indentation, attribution)

from scan2drive.

stapelberg avatar stapelberg commented on June 1, 2024

This is the current processing time for each piece of paper after scanning finished:

  • 1s JPEG encoding (most of the processing happens in parallel with scanning)
  • 3s G3 encoding
  • 12s thumbnail PNG encoding

I looked into encoding the G3-encoded image data into a TIFF file (which works), but it turns out that neither Chrome nor Firefox support TIFF. All javascript-based TIFF/PDF viewers and extensions are super slow.

from scan2drive.

stapelberg avatar stapelberg commented on June 1, 2024

Created issue #15 for speeding up the thumbnail creation. Closing this issue as we’re now using NEON code for jpeg compression.

from scan2drive.

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.