Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multithreading in encoder #1248

Merged
merged 2 commits into from
Oct 9, 2020

Commits on May 20, 2020

  1. Add multithreading support in the T1 (entropy phase) encoder

    - API wise, opj_codec_set_threads() can be used on the encoding side
    - opj_compress has a -threads switch similar to opj_uncompress
    rouault committed May 20, 2020
    Configuration menu
    Copy the full SHA
    97eb7e0 View commit details
    Browse the repository at this point in the history
  2. Add multithreaded support in the DWT encoder.

    Update the bench_dwt utility to have a -decode/-encode switch
    
    Measured performance gains for DWT encoder on a
    Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (4 cores, hyper threaded)
    
    Encoding time:
    $ ./bin/bench_dwt -encode -num_threads 1
    time for dwt_encode: total = 8.348 s, wallclock = 8.352 s
    
    $ ./bin/bench_dwt -encode -num_threads 2
    time for dwt_encode: total = 9.776 s, wallclock = 4.904 s
    
    $ ./bin/bench_dwt -encode -num_threads 4
    time for dwt_encode: total = 13.188 s, wallclock = 3.310 s
    
    $ ./bin/bench_dwt -encode -num_threads 8
    time for dwt_encode: total = 30.024 s, wallclock = 4.064 s
    
    Scaling is probably limited by memory access patterns causing
    memory access to be the bottleneck.
    The slightly worse results with threads==8 than with thread==4
    is due to hyperthreading being not appropriate here.
    rouault committed May 20, 2020
    Configuration menu
    Copy the full SHA
    07d1f77 View commit details
    Browse the repository at this point in the history