[FFmpeg-devel] [FFmpeg-cvslog] avfilter/af_adynamicequalizer: simplify calculations

James Almer jamrial at gmail.com
Sun Jul 9 18:24:37 EEST 2023


> ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com  <https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog>> | Thu Jul  6 16:47:02 2023 +0200| [889c2529cc6ef65bb4c4f10aa79ca7ca0070a1aa] | committer: Paul B Mahol
>
> avfilter/af_adynamicequalizer: simplify calculations
>
> >/http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=889c2529cc6ef65bb4c4f10aa79ca7ca0070a1aa 
> /---
>
>   libavfilter/adynamicequalizer_template.c | 16 ++++++++++------
>   libavfilter/af_adynamicequalizer.c       |  2 +-
>   2 files changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/libavfilter/adynamicequalizer_template.c b/libavfilter/adynamicequalizer_template.c
> index 4f7d58c939..ee9f4a1d5f 100644
> --- a/libavfilter/adynamicequalizer_template.c
> +++ b/libavfilter/adynamicequalizer_template.c
> @@ -26,6 +26,7 @@
>   #undef FMIN
>   #undef CLIP
>   #undef SAMPLE_FORMAT
> +#undef EPSILON
>   #undef FABS
>   #if DEPTH == 32
>   #define SAMPLE_FORMAT float
> @@ -39,6 +40,7 @@
>   #define CLIP av_clipf
>   #define FABS fabsf
>   #define ftype float
> +#define EPSILON (1.f / (1 << 22))
>   #else
>   #define SAMPLE_FORMAT double
>   #define SQRT sqrt
> @@ -51,6 +53,7 @@
>   #define CLIP av_clipd
>   #define FABS fabs
>   #define ftype double
> +#define EPSILON (1.0 / (1LL << 51))
>   #endif

You have FLT_EPSILON and DBL_EPSILON for this.



More information about the ffmpeg-devel mailing list