Opened 6 years ago

Closed 10 months ago

#5583 closed enhancement (wontfix)

support for openmp of soxr

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

Description

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 (4)

comment:1 by Michael Niedermayer, 6 years ago

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

comment:2 by Michael Niedermayer, 6 years ago

Cc: Michael Niedermayer added

comment:3 by Elon Musk, 5 years ago

Component: undeterminedswresample
Priority: normalwish
Type: defectenhancement

comment:4 by Elon Musk, 10 months ago

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.