Opened 4 years ago

Last modified 3 years ago

#5583 new enhancement

support for openmp of soxr

Reported by: ponpon Owned by:
Priority: wish Component: swresample
Version: unspecified Keywords:
Cc: michael Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


i requests support for openmp of soxr.

i did some tests. from it, it doesn't seem that ffmpeg suppors openmp of soxr, though ffmpeg might support the multithreads of soxr with override.

i exchanged e-mail with the developerof soxr, Rob. he said that

soxr threading is based on the number of audio channels being processed, i.e. one thread can be assigned to each channel.  However, soxr threading is not enabled in ffmpeg. 

With the latest soxr in git, it is possible to override runtime parameters set by the application, e.g.

export SOXR_NUM_THREADS=0  # 0 means automatic: under control of OpenMP
export OMP_NUM_THREADS=2 # For stereo audio.

However, this does not work well with ffmpeg.  I guess that the reason for this is that ffmpeg tries to minimise latency by using small buffer sizes, and small buffer sizes give a large overhead when multi-threading.  I don't know if ffmpeg buffer size (for audio) can be adjusted.

Using an application with larger buffers (e.g. the soxr examples, with input + output buffer sizes = 15k samples/channel), I find that 2 openmp threads (on 2 cores, not 2 x86 hyperthreads on one core) will reduce processing time for stereo audio to about 66% (x86), 54% (ARM).

and, moreover, that

SIMD improvements for both single and double precision are coming soon!

i believe that combination ffmpeg and soxr with the openmp and new simd is useful for many users.

Change History (3)

comment:1 Changed 4 years ago by michael

if the soxr warper doesnt return any data until it has a large enough amount then it should get larger buffers

comment:2 Changed 4 years ago by michael

  • Cc michael added

comment:3 Changed 3 years ago by richardpl

  • Component changed from undetermined to swresample
  • Priority changed from normal to wish
  • Type changed from defect to enhancement
Note: See TracTickets for help on using tickets.