Commit 0a19538b authored by Paul B Mahol's avatar Paul B Mahol

avfilter: add SOFAlizer audio filter

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 69e80d6c
...@@ -44,6 +44,7 @@ version <next>: ...@@ -44,6 +44,7 @@ version <next>:
- mips32r5 option has been removed - mips32r5 option has been removed
- mips64r6 option has been removed - mips64r6 option has been removed
- DXVA2-accelerated VP9 decoding - DXVA2-accelerated VP9 decoding
- SOFAlizer: virtual binaural acoustics filter
version 2.8: version 2.8:
......
...@@ -279,6 +279,7 @@ External library support: ...@@ -279,6 +279,7 @@ External library support:
--disable-lzma disable lzma [autodetect] --disable-lzma disable lzma [autodetect]
--enable-decklink enable Blackmagic DeckLink I/O support [no] --enable-decklink enable Blackmagic DeckLink I/O support [no]
--enable-mmal enable decoding via MMAL [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-nvenc enable NVIDIA NVENC support [no]
--enable-openal enable OpenAL 1.1 capture support [no] --enable-openal enable OpenAL 1.1 capture support [no]
--enable-opencl enable OpenCL code --enable-opencl enable OpenCL code
...@@ -1503,6 +1504,7 @@ EXTERNAL_LIBRARY_LIST=" ...@@ -1503,6 +1504,7 @@ EXTERNAL_LIBRARY_LIST="
libzvbi libzvbi
lzma lzma
mmal mmal
netcdf
nvenc nvenc
openal openal
opencl opencl
...@@ -2890,6 +2892,7 @@ showfreqs_filter_deps="avcodec" ...@@ -2890,6 +2892,7 @@ showfreqs_filter_deps="avcodec"
showfreqs_filter_select="fft" showfreqs_filter_select="fft"
showspectrum_filter_deps="avcodec" showspectrum_filter_deps="avcodec"
showspectrum_filter_select="rdft" showspectrum_filter_select="rdft"
sofalizer_filter_deps="netcdf"
spp_filter_deps="gpl avcodec" spp_filter_deps="gpl avcodec"
spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp" spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp"
stereo3d_filter_deps="gpl" stereo3d_filter_deps="gpl"
...@@ -5494,6 +5497,7 @@ enabled mmal && { check_lib interface/mmal/mmal.h mmal_port_connect ...@@ -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 ; }
check_lib interface/mmal/mmal.h mmal_port_connect ; } || check_lib interface/mmal/mmal.h mmal_port_connect ; } ||
die "ERROR: mmal not found"; } 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."; } && enabled nvenc && { check_header nvEncodeAPI.h || die "ERROR: nvEncodeAPI.h not found."; } &&
{ check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" || { check_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 5" ||
die "ERROR: NVENC API version 4 or older is not supported"; } && die "ERROR: NVENC API version 4 or older is not supported"; } &&
......
...@@ -2889,6 +2889,35 @@ silenceremove=1:5:0.02 ...@@ -2889,6 +2889,35 @@ silenceremove=1:5:0.02
@end example @end example
@end itemize @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 @section stereotools
This filter has some handy utilities to manage stereo signals, for converting This filter has some handy utilities to manage stereo signals, for converting
......
...@@ -87,6 +87,7 @@ OBJS-$(CONFIG_SIDECHAINCOMPRESS_FILTER) += af_sidechaincompress.o ...@@ -87,6 +87,7 @@ OBJS-$(CONFIG_SIDECHAINCOMPRESS_FILTER) += af_sidechaincompress.o
OBJS-$(CONFIG_SIDECHAINGATE_FILTER) += af_agate.o OBJS-$(CONFIG_SIDECHAINGATE_FILTER) += af_agate.o
OBJS-$(CONFIG_SILENCEDETECT_FILTER) += af_silencedetect.o OBJS-$(CONFIG_SILENCEDETECT_FILTER) += af_silencedetect.o
OBJS-$(CONFIG_SILENCEREMOVE_FILTER) += af_silenceremove.o OBJS-$(CONFIG_SILENCEREMOVE_FILTER) += af_silenceremove.o
OBJS-$(CONFIG_SOFALIZER_FILTER) += af_sofalizer.o
OBJS-$(CONFIG_STEREOTOOLS_FILTER) += af_stereotools.o OBJS-$(CONFIG_STEREOTOOLS_FILTER) += af_stereotools.o
OBJS-$(CONFIG_STEREOWIDEN_FILTER) += af_stereowiden.o OBJS-$(CONFIG_STEREOWIDEN_FILTER) += af_stereowiden.o
OBJS-$(CONFIG_TREBLE_FILTER) += af_biquads.o OBJS-$(CONFIG_TREBLE_FILTER) += af_biquads.o
......
This diff is collapsed.
...@@ -109,6 +109,7 @@ void avfilter_register_all(void) ...@@ -109,6 +109,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(SIDECHAINGATE, sidechaingate, af); REGISTER_FILTER(SIDECHAINGATE, sidechaingate, af);
REGISTER_FILTER(SILENCEDETECT, silencedetect, af); REGISTER_FILTER(SILENCEDETECT, silencedetect, af);
REGISTER_FILTER(SILENCEREMOVE, silenceremove, af); REGISTER_FILTER(SILENCEREMOVE, silenceremove, af);
REGISTER_FILTER(SOFALIZER, sofalizer, af);
REGISTER_FILTER(STEREOTOOLS, stereotools, af); REGISTER_FILTER(STEREOTOOLS, stereotools, af);
REGISTER_FILTER(STEREOWIDEN, stereowiden, af); REGISTER_FILTER(STEREOWIDEN, stereowiden, af);
REGISTER_FILTER(TREBLE, treble, af); REGISTER_FILTER(TREBLE, treble, af);
......
...@@ -289,6 +289,17 @@ AVFilterFormats *ff_make_format_list(const int *fmts) ...@@ -289,6 +289,17 @@ AVFilterFormats *ff_make_format_list(const int *fmts)
return formats; 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) AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts)
{ {
MAKE_FORMAT_LIST(AVFilterChannelLayouts, MAKE_FORMAT_LIST(AVFilterChannelLayouts,
......
...@@ -141,6 +141,9 @@ AVFilterChannelLayouts *ff_all_channel_counts(void); ...@@ -141,6 +141,9 @@ AVFilterChannelLayouts *ff_all_channel_counts(void);
av_warn_unused_result av_warn_unused_result
AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts); 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 * A helper for query_formats() which sets all links to the same list of channel
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
#include "libavutil/version.h" #include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 6 #define LIBAVFILTER_VERSION_MAJOR 6
#define LIBAVFILTER_VERSION_MINOR 20 #define LIBAVFILTER_VERSION_MINOR 21
#define LIBAVFILTER_VERSION_MICRO 100 #define LIBAVFILTER_VERSION_MICRO 100
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment