FFmpeg
Loading...
Searching...
No Matches
f_ebur128.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012 Clément Bœsch
3 * Copyright (c) 2025 Niklas Haas
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#ifndef AVFILTER_F_EBUR128_H
23#define AVFILTER_F_EBUR128_H
24
25#include <assert.h>
26#include <stddef.h>
27
28typedef struct EBUR128Biquad {
29 double b0, b1, b2;
30 double a1, a2;
32
33typedef struct EBUR128DSPContext {
34 /* Filter data */
37
38 /* Cache of 3 samples for each channel */
39 double *y; /* after pre-filter */
40 double *z; /* after RLB-filter */
41
42 /* DSP functions */
43 void (*filter_channels)(const struct EBUR128DSPContext *dsp,
44 const double *samples,
45 double *cache_400, double *cache_3000,
46 double *sum_400, double *sum_3000,
47 int nb_channels);
48
49 /* Updates ch_peaks[] and returns maximum from all channels */
50 double (*find_peak)(double *ch_peaks, int nb_channels,
51 const double *samples, int nb_samples);
53
54static_assert(offsetof(EBUR128DSPContext, pre) == 0, "struct layout mismatch");
55static_assert(offsetof(EBUR128DSPContext, rlb) == 5 * sizeof(double), "struct layout mismatch");
56static_assert(offsetof(EBUR128DSPContext, y) == 10 * sizeof(double), "struct layout mismatch");
57
58void ff_ebur128_init_x86(EBUR128DSPContext *dsp, int nb_channels);
59
61 double *, double *, double *, double *, int);
62
63double ff_ebur128_find_peak_c(double *, int, const double *, int);
64
65#endif /* AVFILTER_F_EBUR128_H */
void ff_ebur128_init_x86(EBUR128DSPContext *dsp, int nb_channels)
double ff_ebur128_find_peak_c(double *, int, const double *, int)
void ff_ebur128_filter_channels_c(const EBUR128DSPContext *, const double *, double *, double *, double *, double *, int)
double(* find_peak)(double *ch_peaks, int nb_channels, const double *samples, int nb_samples)
Definition f_ebur128.h:50
void(* filter_channels)(const struct EBUR128DSPContext *dsp, const double *samples, double *cache_400, double *cache_3000, double *sum_400, double *sum_3000, int nb_channels)
Definition f_ebur128.h:43
EBUR128Biquad pre
Definition f_ebur128.h:35
EBUR128Biquad rlb
Definition f_ebur128.h:36