[FFmpeg-devel] [PATCH] avfilter: add audio emphasis filter

Hendrik Leppkes h.leppkes at gmail.com
Fri Dec 4 10:10:52 CET 2015


On Fri, Dec 4, 2015 at 1:47 AM, Ganesh Ajjanagadde <gajjanag at mit.edu> wrote:
> On Thu, Dec 3, 2015 at 5:52 PM, Paul B Mahol <onemda at gmail.com> wrote:
>> Signed-off-by: Paul B Mahol <onemda at gmail.com>
>> ---
>>  Changelog                  |   1 +
>>  configure                  |  26 ++++
>>  doc/filters.texi           |  46 ++++++
>>  libavfilter/Makefile       |   1 +
>>  libavfilter/af_aemphasis.c | 370 +++++++++++++++++++++++++++++++++++++++++++++
>>  libavfilter/allfilters.c   |   1 +
>>  libavfilter/version.h      |   2 +-
>>  7 files changed, 446 insertions(+), 1 deletion(-)
>>  create mode 100644 libavfilter/af_aemphasis.c
>>
>> diff --git a/Changelog b/Changelog
>> index 2d2a92b..552fab1 100644
>> --- a/Changelog
>> +++ b/Changelog
>> @@ -39,6 +39,7 @@ version <next>:
>>  - support encoding 16-bit RLE SGI images
>>  - apulsator filter
>>  - sidechaingate audio filter
>> +- aemphasis filter
>>
>>
>>  version 2.8:
>> diff --git a/configure b/configure
>> index a30d831..10631e8 100755
>> --- a/configure
>> +++ b/configure
>> @@ -1051,6 +1051,21 @@ int main(void){ $func(); }
>>  EOF
>>  }
>>
>> +check_complexfunc(){
>> +    log check_complexfunc "$@"
>> +    func=$1
>> +    narg=$2
>> +    shift 2
>> +    test $narg = 2 && args="f, g" || args="f"
>> +    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(){
>>      log check_mathfunc "$@"
>>      func=$1
>> @@ -1768,6 +1783,11 @@ INTRINSICS_LIST="
>>      intrinsics_neon
>>  "
>>
>> +COMPLEX_FUNCS="
>> +    cabs
>> +    cexp
>> +"
>> +
>
> These are not inherently needed, cabs and cexp can be easily
> implemented using hypot and sin, cos, etc. See e.g the mandelbrot
> filter; the filter mathematically operates on complex numbers, but one
> can always use the real value variants with a trivial amount of work.
>
> Don't know and it is unlikely that all our platforms have them - a
> platform which refuses to implement simple things like llrint would
> most likely not bother with this stuff. If you really want to use
> complex numbers (though above demonstrates there is no inherent
> reason), you should add the relevant compat hacks.
>

If its limited to a single filter, and the functionality is properly
checked in configure first, there is no reason to insist on compat
hacks - especially if its a new filter.
If someone on such a platform without complex.h wants this filter to
work, they could in theory work on providing the compat layer.

This way builds will not fail, the filter will just not be available.

- Hendrik


More information about the ffmpeg-devel mailing list