Browse Source

avfilter: add SOFAlizer audio filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
tags/n3.0
Paul B Mahol 10 years ago
parent
commit
0a19538bcf
9 changed files with 1069 additions and 1 deletions
  1. +1
    -0
      Changelog
  2. +4
    -0
      configure
  3. +29
    -0
      doc/filters.texi
  4. +1
    -0
      libavfilter/Makefile
  5. +1018
    -0
      libavfilter/af_sofalizer.c
  6. +1
    -0
      libavfilter/allfilters.c
  7. +11
    -0
      libavfilter/formats.c
  8. +3
    -0
      libavfilter/formats.h
  9. +1
    -1
      libavfilter/version.h

+ 1
- 0
Changelog View File

@@ -44,6 +44,7 @@ version <next>:
- mips32r5 option has been removed
- mips64r6 option has been removed
- DXVA2-accelerated VP9 decoding
- SOFAlizer: virtual binaural acoustics filter


version 2.8:


+ 4
- 0
configure View File

@@ -279,6 +279,7 @@ External library support:
--disable-lzma disable lzma [autodetect]
--enable-decklink enable Blackmagic DeckLink I/O support [no]
--enable-mmal enable decoding via MMAL [no]
--enable-netcdf enable NetCDF, needed for sofalizer filter [no]
--enable-nvenc enable NVIDIA NVENC support [no]
--enable-openal enable OpenAL 1.1 capture support [no]
--enable-opencl enable OpenCL code
@@ -1503,6 +1504,7 @@ EXTERNAL_LIBRARY_LIST="
libzvbi
lzma
mmal
netcdf
nvenc
openal
opencl
@@ -2890,6 +2892,7 @@ showfreqs_filter_deps="avcodec"
showfreqs_filter_select="fft"
showspectrum_filter_deps="avcodec"
showspectrum_filter_select="rdft"
sofalizer_filter_deps="netcdf"
spp_filter_deps="gpl avcodec"
spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
stereo3d_filter_deps="gpl"
@@ -5494,6 +5497,7 @@ enabled mmal && { check_lib interface/mmal/mmal.h mmal_port_connect
check_lib interface/mmal/mmal.h mmal_port_connect ; }
check_lib interface/mmal/mmal.h mmal_port_connect ; } ||
die "ERROR: mmal not found"; }
enabled netcdf && require_pkg_config netcdf netcdf.h nc_inq_libvers
enabled nvenc && { check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."; } &&
{ check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" ||
die "ERROR: NVENC API version 4 or older is not supported"; } &&


+ 29
- 0
doc/filters.texi View File

@@ -2889,6 +2889,35 @@ silenceremove=1:5:0.02
@end example
@end itemize

@section sofalizer

SOFAlizer uses head-related transfer functions (HRTFs) to create virtual
loudspeakers around the user for binaural listening via headphones (audio
formats up to 9 channels supported).
The HRTFs are stored in SOFA files (see www.sofacoustics.org for a database).
SOFAlizer is developed at the Acoustics Research Institute (ARI) of the
Austrian Academy of Sciences.

The filter accepts the following options:

@table @option
@item sofa
Set the SOFA file used for rendering.

@item gain
Set gain applied to audio. Value is in dB. Default is 0.

@item rotation
Set rotation of virtual loudspeakers in deg. Default is 0.

@item elevation
Set elevation of virtual speakers in deg. Default is 0.

@item radius
Set distance in meters between loudspeakers and the listener with near-field
HRTFs. Default is 1.
@end table

@section stereotools

This filter has some handy utilities to manage stereo signals, for converting


+ 1
- 0
libavfilter/Makefile View File

@@ -87,6 +87,7 @@ OBJS-$(CONFIG_SIDECHAINCOMPRESS_FILTER) += af_sidechaincompress.o
OBJS-$(CONFIG_SIDECHAINGATE_FILTER) += af_agate.o
OBJS-$(CONFIG_SILENCEDETECT_FILTER) += af_silencedetect.o
OBJS-$(CONFIG_SILENCEREMOVE_FILTER) += af_silenceremove.o
OBJS-$(CONFIG_SOFALIZER_FILTER) += af_sofalizer.o
OBJS-$(CONFIG_STEREOTOOLS_FILTER) += af_stereotools.o
OBJS-$(CONFIG_STEREOWIDEN_FILTER) += af_stereowiden.o
OBJS-$(CONFIG_TREBLE_FILTER) += af_biquads.o


+ 1018
- 0
libavfilter/af_sofalizer.c
File diff suppressed because it is too large
View File


+ 1
- 0
libavfilter/allfilters.c View File

@@ -109,6 +109,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(SIDECHAINGATE, sidechaingate, af);
REGISTER_FILTER(SILENCEDETECT, silencedetect, af);
REGISTER_FILTER(SILENCEREMOVE, silenceremove, af);
REGISTER_FILTER(SOFALIZER, sofalizer, af);
REGISTER_FILTER(STEREOTOOLS, stereotools, af);
REGISTER_FILTER(STEREOWIDEN, stereowiden, af);
REGISTER_FILTER(TREBLE, treble, af);


+ 11
- 0
libavfilter/formats.c View File

@@ -289,6 +289,17 @@ AVFilterFormats *ff_make_format_list(const int *fmts)
return formats;
}

AVFilterChannelLayouts *ff_make_formatu64_list(const uint64_t *fmts)
{
MAKE_FORMAT_LIST(AVFilterChannelLayouts,
channel_layouts, nb_channel_layouts);
if (count)
memcpy(formats->channel_layouts, fmts,
sizeof(*formats->channel_layouts) * count);

return formats;
}

AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts)
{
MAKE_FORMAT_LIST(AVFilterChannelLayouts,


+ 3
- 0
libavfilter/formats.h View File

@@ -141,6 +141,9 @@ AVFilterChannelLayouts *ff_all_channel_counts(void);
av_warn_unused_result
AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts);

av_warn_unused_result
AVFilterChannelLayouts *ff_make_formatu64_list(const uint64_t *fmts);


/**
* A helper for query_formats() which sets all links to the same list of channel


+ 1
- 1
libavfilter/version.h View File

@@ -30,7 +30,7 @@
#include "libavutil/version.h"

#define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 20
#define LIBAVFILTER_VERSION_MINOR 21
#define LIBAVFILTER_VERSION_MICRO 100

#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \


Loading…
Cancel
Save