Commit 5d2cc00d authored by Paul B Mahol's avatar Paul B Mahol

avfilter: add audio emphasis filter

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 7234e04e
...@@ -40,6 +40,7 @@ version <next>: ...@@ -40,6 +40,7 @@ version <next>:
- apulsator filter - apulsator filter
- sidechaingate audio filter - sidechaingate audio filter
- mipsdspr1 option has been renamed to mipsdsp - mipsdspr1 option has been renamed to mipsdsp
- aemphasis filter
version 2.8: version 2.8:
......
...@@ -1051,6 +1051,21 @@ int main(void){ $func(); } ...@@ -1051,6 +1051,21 @@ int main(void){ $func(); }
EOF EOF
} }
check_complexfunc(){
log check_complexfunc "$@"
func=$1
narg=$2
shift 2
test $narg = 2 && args="f, g" || args="f * I"
disable $func
check_ld "cc" "$@" <<EOF && enable $func
#include <complex.h>
#include <math.h>
float foo(complex float f, complex float g) { return $func($args); }
int main(void){ return (int) foo; }
EOF
}
check_mathfunc(){ check_mathfunc(){
log check_mathfunc "$@" log check_mathfunc "$@"
func=$1 func=$1
...@@ -1768,6 +1783,11 @@ INTRINSICS_LIST=" ...@@ -1768,6 +1783,11 @@ INTRINSICS_LIST="
intrinsics_neon intrinsics_neon
" "
COMPLEX_FUNCS="
cabs
cexp
"
MATH_FUNCS=" MATH_FUNCS="
atanf atanf
atan2f atan2f
...@@ -1903,6 +1923,7 @@ HAVE_LIST=" ...@@ -1903,6 +1923,7 @@ HAVE_LIST="
$ARCH_FEATURES $ARCH_FEATURES
$ATOMICS_LIST $ATOMICS_LIST
$BUILTIN_LIST $BUILTIN_LIST
$COMPLEX_FUNCS
$HAVE_LIST_CMDLINE $HAVE_LIST_CMDLINE
$HAVE_LIST_PUB $HAVE_LIST_PUB
$HEADERS_LIST $HEADERS_LIST
...@@ -2785,6 +2806,7 @@ unix_protocol_deps="sys_un_h" ...@@ -2785,6 +2806,7 @@ unix_protocol_deps="sys_un_h"
unix_protocol_select="network" unix_protocol_select="network"
# filters # filters
aemphasis_filter_deps="cabs cexp"
amovie_filter_deps="avcodec avformat" amovie_filter_deps="avcodec avformat"
aresample_filter_deps="swresample" aresample_filter_deps="swresample"
ass_filter_deps="libass" ass_filter_deps="libass"
...@@ -5324,6 +5346,10 @@ for func in $MATH_FUNCS; do ...@@ -5324,6 +5346,10 @@ for func in $MATH_FUNCS; do
eval check_mathfunc $func \${${func}_args:-1} eval check_mathfunc $func \${${func}_args:-1}
done done
for func in $COMPLEX_FUNCS; do
eval check_complexfunc $func \${${func}_args:-1}
done
# these are off by default, so fail if requested and not available # these are off by default, so fail if requested and not available
enabled avfoundation_indev && { check_header_oc AVFoundation/AVFoundation.h || disable avfoundation_indev; } enabled avfoundation_indev && { check_header_oc AVFoundation/AVFoundation.h || disable avfoundation_indev; }
enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics || enabled avfoundation_indev && { check_lib2 CoreGraphics/CoreGraphics.h CGGetActiveDisplayList -framework CoreGraphics ||
......
...@@ -528,6 +528,52 @@ aecho=0.8:0.9:1000|1800:0.3|0.25 ...@@ -528,6 +528,52 @@ aecho=0.8:0.9:1000|1800:0.3|0.25
@end example @end example
@end itemize @end itemize
@section aemphasis
Audio emphasis filter creates or restores material directly taken from LPs or
emphased CDs with different filter curves. E.g. to store music on vinyl the
signal has to be altered by a filter first to even out the disadvantages of
this recording medium.
Once the material is played back the inverse filter has to be applied to
restore the distortion of the frequency response.
The filter accepts the following options:
@table @option
@item level_in
Set input gain.
@item level_out
Set output gain.
@item mode
Set filter mode. For restoring material use @code{reproduction} mode, otherwise
use @code{production} mode. Default is @code{reproduction} mode.
@item type
Set filter type. Selects medium. Can be one of the following:
@table @option
@item col
select Columbia.
@item emi
select EMI.
@item bsi
select BSI (78RPM).
@item riaa
select RIAA.
@item cd
select Compact Disc (CD).
@item 50fm
select 50µs (FM).
@item 75fm
select 75µs (FM).
@item 50kf
select 50µs (FM-KF).
@item 75kf
select 75µs (FM-KF).
@end table
@end table
@section aeval @section aeval
Modify an audio signal according to the specified expressions. Modify an audio signal according to the specified expressions.
......
...@@ -27,6 +27,7 @@ OBJS-$(CONFIG_ACOMPRESSOR_FILTER) += af_sidechaincompress.o ...@@ -27,6 +27,7 @@ OBJS-$(CONFIG_ACOMPRESSOR_FILTER) += af_sidechaincompress.o
OBJS-$(CONFIG_ACROSSFADE_FILTER) += af_afade.o OBJS-$(CONFIG_ACROSSFADE_FILTER) += af_afade.o
OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o OBJS-$(CONFIG_ADELAY_FILTER) += af_adelay.o
OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o OBJS-$(CONFIG_AECHO_FILTER) += af_aecho.o
OBJS-$(CONFIG_AEMPHASIS_FILTER) += af_aemphasis.o
OBJS-$(CONFIG_AEVAL_FILTER) += aeval.o OBJS-$(CONFIG_AEVAL_FILTER) += aeval.o
OBJS-$(CONFIG_AFADE_FILTER) += af_afade.o OBJS-$(CONFIG_AFADE_FILTER) += af_afade.o
OBJS-$(CONFIG_AFORMAT_FILTER) += af_aformat.o OBJS-$(CONFIG_AFORMAT_FILTER) += af_aformat.o
......
This diff is collapsed.
...@@ -49,6 +49,7 @@ void avfilter_register_all(void) ...@@ -49,6 +49,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(ACROSSFADE, acrossfade, af); REGISTER_FILTER(ACROSSFADE, acrossfade, af);
REGISTER_FILTER(ADELAY, adelay, af); REGISTER_FILTER(ADELAY, adelay, af);
REGISTER_FILTER(AECHO, aecho, af); REGISTER_FILTER(AECHO, aecho, af);
REGISTER_FILTER(AEMPHASIS, aemphasis, af);
REGISTER_FILTER(AEVAL, aeval, af); REGISTER_FILTER(AEVAL, aeval, af);
REGISTER_FILTER(AFADE, afade, af); REGISTER_FILTER(AFADE, afade, af);
REGISTER_FILTER(AFORMAT, aformat, af); REGISTER_FILTER(AFORMAT, aformat, af);
......
...@@ -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 19 #define LIBAVFILTER_VERSION_MINOR 20
#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