diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-01-29 03:04:24 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-02-02 23:53:30 +0100 |
commit | ba874ad904042d0f90e392f45560b170e05512a6 (patch) | |
tree | fd870b52145f4e424f89c4fd928fccaa5e3e044f /libavfilter/ebur128.c | |
parent | a40c158edac80396fbcd5f3e1fe195bf15eeec9c (diff) | |
download | ffmpeg-ba874ad904042d0f90e392f45560b170e05512a6.tar.gz |
avfilter/ebur128: Remove unused functions
Also make a function only used here static.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavfilter/ebur128.c')
-rw-r--r-- | libavfilter/ebur128.c | 54 |
1 files changed, 4 insertions, 50 deletions
diff --git a/libavfilter/ebur128.c b/libavfilter/ebur128.c index 2e86974eba..d93500ef3e 100644 --- a/libavfilter/ebur128.c +++ b/libavfilter/ebur128.c @@ -362,9 +362,6 @@ static void ebur128_filter_##type(FFEBUR128State* st, const type** srcs, st->d->v[ci][1] = fabs(st->d->v[ci][1]) < DBL_MIN ? 0.0 : st->d->v[ci][1]; \ } \ } -EBUR128_FILTER(short, -((double)SHRT_MIN)) -EBUR128_FILTER(int, -((double)INT_MIN)) -EBUR128_FILTER(float, 1.0) EBUR128_FILTER(double, 1.0) static double ebur128_energy_to_loudness(double energy) @@ -459,8 +456,8 @@ int ff_ebur128_set_channel(FFEBUR128State * st, } static int ebur128_energy_shortterm(FFEBUR128State * st, double *out); -#define FF_EBUR128_ADD_FRAMES_PLANAR(type) \ -void ff_ebur128_add_frames_planar_##type(FFEBUR128State* st, const type** srcs, \ +#define EBUR128_ADD_FRAMES_PLANAR(type) \ +static void ebur128_add_frames_planar_##type(FFEBUR128State* st, const type** srcs, \ size_t frames, int stride) { \ size_t src_index = 0; \ while (frames > 0) { \ @@ -502,10 +499,7 @@ void ff_ebur128_add_frames_planar_##type(FFEBUR128State* st, const type** srcs, } \ } \ } -FF_EBUR128_ADD_FRAMES_PLANAR(short) -FF_EBUR128_ADD_FRAMES_PLANAR(int) -FF_EBUR128_ADD_FRAMES_PLANAR(float) -FF_EBUR128_ADD_FRAMES_PLANAR(double) +EBUR128_ADD_FRAMES_PLANAR(double) #define FF_EBUR128_ADD_FRAMES(type) \ void ff_ebur128_add_frames_##type(FFEBUR128State* st, const type* src, \ size_t frames) { \ @@ -513,11 +507,8 @@ void ff_ebur128_add_frames_##type(FFEBUR128State* st, const type* src, \ const type **buf = (const type**)st->d->data_ptrs; \ for (i = 0; i < st->channels; i++) \ buf[i] = src + i; \ - ff_ebur128_add_frames_planar_##type(st, buf, frames, st->channels); \ + ebur128_add_frames_planar_##type(st, buf, frames, st->channels); \ } -FF_EBUR128_ADD_FRAMES(short) -FF_EBUR128_ADD_FRAMES(int) -FF_EBUR128_ADD_FRAMES(float) FF_EBUR128_ADD_FRAMES(double) static int ebur128_calc_relative_threshold(FFEBUR128State **sts, size_t size, @@ -606,12 +597,6 @@ int ff_ebur128_loudness_global(FFEBUR128State * st, double *out) return ebur128_gated_loudness(&st, 1, out); } -int ff_ebur128_loudness_global_multiple(FFEBUR128State ** sts, size_t size, - double *out) -{ - return ebur128_gated_loudness(sts, size, out); -} - static int ebur128_energy_in_interval(FFEBUR128State * st, size_t interval_frames, double *out) { @@ -628,21 +613,6 @@ static int ebur128_energy_shortterm(FFEBUR128State * st, double *out) out); } -int ff_ebur128_loudness_momentary(FFEBUR128State * st, double *out) -{ - double energy; - int error = ebur128_energy_in_interval(st, st->d->samples_in_100ms * 4, - &energy); - if (error) { - return error; - } else if (energy <= 0.0) { - *out = -HUGE_VAL; - return 0; - } - *out = ebur128_energy_to_loudness(energy); - return 0; -} - int ff_ebur128_loudness_shortterm(FFEBUR128State * st, double *out) { double energy; @@ -657,22 +627,6 @@ int ff_ebur128_loudness_shortterm(FFEBUR128State * st, double *out) return 0; } -int ff_ebur128_loudness_window(FFEBUR128State * st, - unsigned long window, double *out) -{ - double energy; - size_t interval_frames = st->samplerate * window / 1000; - int error = ebur128_energy_in_interval(st, interval_frames, &energy); - if (error) { - return error; - } else if (energy <= 0.0) { - *out = -HUGE_VAL; - return 0; - } - *out = ebur128_energy_to_loudness(energy); - return 0; -} - /* EBU - TECH 3342 */ int ff_ebur128_loudness_range_multiple(FFEBUR128State ** sts, size_t size, double *out) |