Commit 5d166de2 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  lavfi: add compand audio filter

Conflicts:
	Changelog
	doc/filters.texi
	libavfilter/Makefile
	libavfilter/af_compand.c
	libavfilter/allfilters.c
	libavfilter/version.h

The filter is added as new one so as to ease clean merging of its changes
in debug-able steps
See: 6b68e2a4Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 96fc2908 738f8358
...@@ -1267,79 +1267,76 @@ side_right.wav ...@@ -1267,79 +1267,76 @@ side_right.wav
@end example @end example
@section compand @section compand
Compress or expand audio dynamic range. Compress or expand audio dynamic range.
A description of the accepted options follows. A description of the accepted options follows.
@table @option @table @option
@item attacks @item attacks
@item decays @item decays
Set list of times in seconds for each channel over which the instantaneous Set list of times in seconds for each channel over which the instantaneous level
level of the input signal is averaged to determine its volume. of the input signal is averaged to determine its volume. @var{attacks} refers to
@option{attacks} refers to increase of volume and @option{decays} refers increase of volume and @var{decays} refers to decrease of volume. For most
to decrease of volume. situations, the attack time (response to the audio getting louder) should be
For most situations, the attack time (response to the audio getting louder) shorter than the decay time because the human ear is more sensitive to sudden
should be shorter than the decay time because the human ear is more sensitive loud audio than sudden soft audio. A typical value for attack is 0.3 seconds and
to sudden loud audio than sudden soft audio. a typical value for decay is 0.8 seconds.
Typical value for attack is @code{0.3} seconds and for decay @code{0.8}
seconds.
@item points @item points
Set list of points for transfer function, specified in dB relative to maximum Set list of points for the transfer function, specified in dB relative to the
possible signal amplitude. maximum possible signal amplitude. Each key points list must be defined using
Each key points list need to be defined using the following syntax: the following syntax: @code{x0/y0|x1/y1|x2/y2|....} or
@code{x0/y0 x1/y1 x2/y2 ...}. @code{x0/y0 x1/y1 x2/y2 ....}
The input values must be in strictly increasing order but the transfer The input values must be in strictly increasing order but the transfer function
function does not have to be monotonically rising. does not have to be monotonically rising. The point @code{0/0} is assumed but
The point @code{0/0} is assumed but may be overridden (by @code{0/out-dBn}). may be overridden (by @code{0/out-dBn}). Typical values for the transfer
Typical values for the transfer function are @code{-70/-70 -60/-20}. function are @code{-70/-70|-60/-20}.
@item soft-knee @item soft-knee
Set amount for which the points at where adjacent line segments on the Set the curve radius in dB for all joints. Defaults to 0.01.
transfer function meet will be rounded. Defaults is @code{0.01}.
@item gain @item gain
Set additional gain in dB to be applied at all points on the transfer function Set additional gain in dB to be applied at all points on the transfer function.
and allows easy adjustment of the overall gain. This allows easy adjustment of the overall gain. Defaults to 0.
Default is @code{0}.
@item volume @item volume
Set initial volume in dB to be assumed for each channel when filtering starts. Set initial volume in dB to be assumed for each channel when filtering starts.
This permits the user to supply a nominal level initially, so that, This permits the user to supply a nominal level initially, so that, for
for example, a very large gain is not applied to initial signal levels before example, a very large gain is not applied to initial signal levels before the
the companding has begun to operate. A typical value for audio which is companding has begun to operate. A typical value for audio which is initially
initially quiet is -90 dB. Default is @code{0}. quiet is -90 dB. Defaults to 0.
@item delay @item delay
Set delay in seconds. Default is @code{0}. The input audio Set delay in seconds. The input audio is analyzed immediately, but audio is
is analysed immediately, but audio is delayed before being fed to the delayed before being fed to the volume adjuster. Specifying a delay
volume adjuster. Specifying a delay approximately equal to the attack/decay approximately equal to the attack/decay times allows the filter to effectively
times allows the filter to effectively operate in predictive rather than operate in predictive rather than reactive mode. Defaults to 0.
reactive mode.
@end table @end table
@subsection Examples @subsection Examples
@itemize @itemize
@item @item
Make music with both quiet and loud passages suitable for listening Make music with both quiet and loud passages suitable for listening in a noisy
in a noisy environment: environment:
@example @example
compand=.3 .3:1 1:-90/-60 -60/-40 -40/-30 -20/-20:6:0:-90:0.2 compand=.3|.3:1|1:-90/-60|-60/-40|-40/-30|-20/-20:6:0:-90:0.2
@end example @end example
@item @item
Noise-gate for when the noise is at a lower level than the signal: Noise gate for when the noise is at a lower level than the signal:
@example @example
compand=.1 .1:.2 .2:-900/-900 -50.1/-900 -50/-50:.01:0:-90:.1 compand=.1|.1:.2|.2:-900/-900|-50.1/-900|-50/-50:.01:0:-90:.1
@end example @end example
@item @item
Here is another noise-gate, this time for when the noise is at a higher level Here is another noise gate, this time for when the noise is at a higher level
than the signal (making it, in some ways, similar to squelch): than the signal (making it, in some ways, similar to squelch):
@example @example
compand=.1 .1:.1 .1:-45.1/-45.1 -45/-900 0/-900:.01:45:-90:.1 compand=.1|.1:.1|.1:-45.1/-45.1|-45/-900|0/-900:.01:45:-90:.1
@end example @end example
@end itemize @end itemize
......
...@@ -88,6 +88,7 @@ OBJS-$(CONFIG_BIQUAD_FILTER) += af_biquads.o ...@@ -88,6 +88,7 @@ OBJS-$(CONFIG_BIQUAD_FILTER) += af_biquads.o
OBJS-$(CONFIG_CHANNELMAP_FILTER) += af_channelmap.o OBJS-$(CONFIG_CHANNELMAP_FILTER) += af_channelmap.o
OBJS-$(CONFIG_CHANNELSPLIT_FILTER) += af_channelsplit.o OBJS-$(CONFIG_CHANNELSPLIT_FILTER) += af_channelsplit.o
OBJS-$(CONFIG_COMPAND_FILTER) += af_compand.o OBJS-$(CONFIG_COMPAND_FILTER) += af_compand.o
OBJS-$(CONFIG_COMPAND_FORK_FILTER) += af_compand_fork.o
OBJS-$(CONFIG_EARWAX_FILTER) += af_earwax.o OBJS-$(CONFIG_EARWAX_FILTER) += af_earwax.o
OBJS-$(CONFIG_EBUR128_FILTER) += f_ebur128.o OBJS-$(CONFIG_EBUR128_FILTER) += f_ebur128.o
OBJS-$(CONFIG_EQUALIZER_FILTER) += af_biquads.o OBJS-$(CONFIG_EQUALIZER_FILTER) += af_biquads.o
......
This diff is collapsed.
...@@ -83,6 +83,7 @@ void avfilter_register_all(void) ...@@ -83,6 +83,7 @@ void avfilter_register_all(void)
REGISTER_FILTER(CHANNELMAP, channelmap, af); REGISTER_FILTER(CHANNELMAP, channelmap, af);
REGISTER_FILTER(CHANNELSPLIT, channelsplit, af); REGISTER_FILTER(CHANNELSPLIT, channelsplit, af);
REGISTER_FILTER(COMPAND, compand, af); REGISTER_FILTER(COMPAND, compand, af);
REGISTER_FILTER(COMPAND_FORK, compand_fork, af);
REGISTER_FILTER(EARWAX, earwax, af); REGISTER_FILTER(EARWAX, earwax, af);
REGISTER_FILTER(EBUR128, ebur128, af); REGISTER_FILTER(EBUR128, ebur128, af);
REGISTER_FILTER(EQUALIZER, equalizer, af); REGISTER_FILTER(EQUALIZER, equalizer, af);
......
...@@ -30,8 +30,8 @@ ...@@ -30,8 +30,8 @@
#include "libavutil/version.h" #include "libavutil/version.h"
#define LIBAVFILTER_VERSION_MAJOR 4 #define LIBAVFILTER_VERSION_MAJOR 4
#define LIBAVFILTER_VERSION_MINOR 1 #define LIBAVFILTER_VERSION_MINOR 2
#define LIBAVFILTER_VERSION_MICRO 103 #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, \
LIBAVFILTER_VERSION_MINOR, \ LIBAVFILTER_VERSION_MINOR, \
......
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