[FFmpeg-devel] [PATCH] [RFC] libavfilter HRTF/room acoustics filter [1/2]

Paul B Mahol onemda at gmail.com
Tue Aug 2 18:40:51 EEST 2016


Wow!

On 8/2/16, Yue Shi Lai <ylai at users.sourceforge.net> wrote:
> Dear all,
>
> The following proposed filter is a follow up from an inquiry I received
> now almost 3 years ago, to relicense MPlayer's HRTF filter
> (libaf/af_hrtf) for FFmpeg. In the mean time, I have developed a much
> improved version that somehow never got followed up on the MPlayer dev
> list, which I would like to submit to the perhaps more active FFmpeg list.
>
> The main features in version, which I believe is still unique at the
> moment among FOSS implementations:
>
> - Uses IIR filterbank (partially due to the fact many years ago, there
> was no FFT in FFmpeg/MPlayer), where the HRTF is encoded in 8 1/1 octave
> filter impulse amplitude/delays, taking a cue from CELP codecs.
>
> - Properly equalized, a major problem when directly applying HRTF
>
> - Simulates not just HRTF, but reflection off the wall of a room (and
> contains a small library of acoustically optimized rooms)
>
> - Also has late reverberation, that approximates the tail of the 3D
> ray-traced early reflection, when the latter becomes too computationally
> expensive
>
> Attached is a first attempt to port this filter to FFmpeg, potentially
> with many coding inconsistencies to be addressed - given the large code
> size. To keep the patch size down, I removed two features vs. the
> version I posted on the MPlayer-dev-eng list:
>
> - 2nd order coefficients (will quadruple the size of the patch to ~ 4 MB)
>
> - integrated matrix decoder (probably better suited as a separate filter)

This one does what?

>
> I would be grateful for vigorous tests, and any feedback/criticism
> regarding both the coding and acoustics.

There is already function that does accumulated multiplication IIRC no
need to use intrinsic,
i think is called fdsp->vector_fmac_scalar so use that instead of your
scale_accumulate.
See how its called in sofalizer filter: libavfilter/af_sofalizer.c

Similar to pthread usage there is internal wrapper which should be used.

Can't filter be made so it load kemar data from file instead hardcoded
into lavfi?
Similar how its done in sofalizer?

I will test and report my findings later.

>
> Best wishes,
>
> Yue Shi Lai
>
>


More information about the ffmpeg-devel mailing list