Go to the source code of this file.
|
#define | MAX_CHANNELS 63 |
|
#define | PRE_B0 1.53512485958697 |
|
#define | PRE_B1 -2.69169618940638 |
|
#define | PRE_B2 1.19839281085285 |
|
#define | PRE_A1 -1.69065929318241 |
|
#define | PRE_A2 0.73248077421585 |
|
#define | RLB_B0 1.0 |
|
#define | RLB_B1 -2.0 |
|
#define | RLB_B2 1.0 |
|
#define | RLB_A1 -1.99004745483398 |
|
#define | RLB_A2 0.99007225036621 |
|
#define | ABS_THRES -70 |
| silence gate: we discard anything below this absolute (LUFS) threshold More...
|
|
#define | ABS_UP_THRES 10 |
| upper loud limit to consider (ABS_THRES being the minimum) More...
|
|
#define | HIST_GRAIN 100 |
| defines histogram precision More...
|
|
#define | HIST_SIZE ((ABS_UP_THRES - ABS_THRES) * HIST_GRAIN + 1) |
|
#define | I400_BINS (48000 * 4 / 10) |
|
#define | I3000_BINS (48000 * 3) |
|
#define | OFFSET(x) offsetof(EBUR128Context, x) |
|
#define | A AV_OPT_FLAG_AUDIO_PARAM |
|
#define | V AV_OPT_FLAG_VIDEO_PARAM |
|
#define | F AV_OPT_FLAG_FILTERING_PARAM |
|
#define | FONT8 0 |
|
#define | FONT16 1 |
|
#define | PAD 8 |
|
#define | DRAW_RECT(r) |
|
#define | BACK_MASK |
|
#define | ENERGY(loudness) (ff_exp10(((loudness) + 0.691) / 10.)) |
|
#define | LOUDNESS(energy) (-0.691 + 10 * log10(energy)) |
|
#define | DBFS(energy) (20 * log10(energy)) |
|
#define | HIST_POS(power) (int)(((power) - ABS_THRES) * HIST_GRAIN) |
|
#define | MOVE_TO_NEXT_CACHED_ENTRY(time) |
|
#define | FILTER(Y, X, name) |
|
#define | COMPUTE_LOUDNESS(m, time) |
|
#define | I_GATE_THRES -10 |
|
#define | LRA_GATE_THRES -20 |
|
#define | LRA_LOWER_PRC 10 |
|
#define | LRA_HIGHER_PRC 95 |
|
#define | LOG_FMT "TARGET:%d LUFS M:%6.1f S:%6.1f I:%6.1f %s LRA:%6.1f LU" |
|
#define | META_PREFIX "lavfi.r128." |
|
#define | SET_META(name, var) |
|
#define | SET_META_PEAK(name, ptype) |
|
#define | PRINT_PEAKS(str, sp, ptype) |
|
#define | PRINT_PEAK_SUMMARY(str, sp, ptype) |
|
|
| AVFILTER_DEFINE_CLASS (ebur128) |
|
static const uint8_t * | get_graph_color (const EBUR128Context *ebur128, int v, int y) |
|
static int | lu_to_y (const EBUR128Context *ebur128, double v) |
|
static void | drawtext (AVFrame *pic, int x, int y, int ftid, const uint8_t *color, const char *fmt,...) |
|
static void | drawline (AVFrame *pic, int x, int y, int len, int step) |
|
static int | config_video_output (AVFilterLink *outlink) |
|
static int | config_audio_input (AVFilterLink *inlink) |
|
static int | config_audio_output (AVFilterLink *outlink) |
|
static struct hist_entry * | get_histogram (void) |
|
static av_cold int | init (AVFilterContext *ctx) |
|
static int | gate_update (struct integrator *integ, double power, double loudness, int gate_thres) |
|
static int | filter_frame (AVFilterLink *inlink, AVFrame *insamples) |
|
static int | query_formats (AVFilterContext *ctx) |
|
static av_cold void | uninit (AVFilterContext *ctx) |
|
EBU R.128 implementation
- See also
- http://tech.ebu.ch/loudness
-
https://www.youtube.com/watch?v=iuEtQqC-Sqo "EBU R128 Introduction - Florian Camerer"
- Todo:
implement start/stop/reset through filter command injection
support other frequencies to avoid resampling
Definition in file f_ebur128.c.
◆ MAX_CHANNELS
◆ PRE_B0
#define PRE_B0 1.53512485958697 |
◆ PRE_B1
#define PRE_B1 -2.69169618940638 |
◆ PRE_B2
#define PRE_B2 1.19839281085285 |
◆ PRE_A1
#define PRE_A1 -1.69065929318241 |
◆ PRE_A2
#define PRE_A2 0.73248077421585 |
◆ RLB_B0
◆ RLB_B1
◆ RLB_B2
◆ RLB_A1
#define RLB_A1 -1.99004745483398 |
◆ RLB_A2
#define RLB_A2 0.99007225036621 |
◆ ABS_THRES
silence gate: we discard anything below this absolute (LUFS) threshold
Definition at line 62 of file f_ebur128.c.
◆ ABS_UP_THRES
upper loud limit to consider (ABS_THRES being the minimum)
Definition at line 63 of file f_ebur128.c.
◆ HIST_GRAIN
defines histogram precision
Definition at line 64 of file f_ebur128.c.
◆ HIST_SIZE
◆ I400_BINS
#define I400_BINS (48000 * 4 / 10) |
◆ I3000_BINS
#define I3000_BINS (48000 * 3) |
◆ OFFSET
◆ FONT8
◆ FONT16
◆ PAD
◆ DRAW_RECT
Value: do { \
drawline(outpicref,
r.x,
r.y - 1,
r.w, 3); \
drawline(outpicref,
r.x,
r.y +
r.h,
r.w, 3); \
drawline(outpicref,
r.x - 1,
r.y,
r.h, outpicref->linesize[0]); \
drawline(outpicref,
r.x +
r.w,
r.y,
r.h, outpicref->linesize[0]); \
} while (0)
◆ BACK_MASK
◆ ENERGY
#define ENERGY |
( |
|
loudness | ) |
(ff_exp10(((loudness) + 0.691) / 10.)) |
◆ LOUDNESS
#define LOUDNESS |
( |
|
energy | ) |
(-0.691 + 10 * log10(energy)) |
◆ DBFS
#define DBFS |
( |
|
energy | ) |
(20 * log10(energy)) |
◆ HIST_POS
◆ MOVE_TO_NEXT_CACHED_ENTRY
#define MOVE_TO_NEXT_CACHED_ENTRY |
( |
|
time | ) |
|
Value: do { \
ebur128->i##time.cache_pos++; \
if (ebur128->i##time.cache_pos == I##time##_BINS) { \
ebur128->i##time.filled = 1; \
ebur128->i##time.cache_pos = 0; \
} \
} while (0)
◆ FILTER
Value: do { \
double *dst = ebur128->Y + ch*3; \
double *
src = ebur128->X + ch*3; \
dst[2] = dst[1]; \
dst[1] = dst[0]; \
- dst[1]*
name##_A1 - dst[2]*
name##_A2; \
} while (0)
◆ COMPUTE_LOUDNESS
#define COMPUTE_LOUDNESS |
( |
|
m, |
|
|
|
time |
|
) |
| |
Value: do { \
if (ebur128->i##time.filled) { \
\
power_##time += ebur128->ch_weighting[ch] * ebur128->i##time.sum[ch]; \
power_##time /= I##time##_BINS; \
} \
loudness_##time =
LOUDNESS(power_##time); \
} while (0)
◆ I_GATE_THRES
◆ LRA_GATE_THRES
#define LRA_GATE_THRES -20 |
◆ LRA_LOWER_PRC
◆ LRA_HIGHER_PRC
#define LRA_HIGHER_PRC 95 |
◆ LOG_FMT
#define LOG_FMT "TARGET:%d LUFS M:%6.1f S:%6.1f I:%6.1f %s LRA:%6.1f LU" |
◆ META_PREFIX
#define META_PREFIX "lavfi.r128." |
◆ SET_META
#define SET_META |
( |
|
name, |
|
|
|
var |
|
) |
| |
Value: do { \
snprintf(metabuf, sizeof(metabuf), "%.3f", var); \
av_dict_set(&insamples->metadata,
name, metabuf, 0); \
} while (0)
◆ SET_META_PEAK
#define SET_META_PEAK |
( |
|
name, |
|
|
|
ptype |
|
) |
| |
Value: do { \
if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \
SET_META(
key, ebur128->name##_peaks[ch]); \
} \
} \
} while (0)
◆ PRINT_PEAKS
#define PRINT_PEAKS |
( |
|
str, |
|
|
|
sp, |
|
|
|
ptype |
|
) |
| |
Value: do { \
if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \
av_log(
ctx, ebur128->loglevel,
" " str ":"); \
av_log(
ctx, ebur128->loglevel,
" dBFS"); \
} \
} while (0)
◆ PRINT_PEAK_SUMMARY
#define PRINT_PEAK_SUMMARY |
( |
|
str, |
|
|
|
sp, |
|
|
|
ptype |
|
) |
| |
Value: do { \
int ch; \
double maxpeak; \
maxpeak = 0.0; \
if (ebur128->peak_mode & PEAK_MODE_ ## ptype ## _PEAKS) { \
for (ch = 0; ch < ebur128->nb_channels; ch++) \
maxpeak =
FFMAX(maxpeak,
sp[ch]); \
" Peak: %5.1f dBFS", \
} \
} while (0)
◆ anonymous enum
Enumerator |
---|
PEAK_MODE_NONE | |
PEAK_MODE_SAMPLES_PEAKS | |
PEAK_MODE_TRUE_PEAKS | |
Definition at line 152 of file f_ebur128.c.
◆ anonymous enum
Enumerator |
---|
GAUGE_TYPE_MOMENTARY | |
GAUGE_TYPE_SHORTTERM | |
Definition at line 158 of file f_ebur128.c.
◆ anonymous enum
Enumerator |
---|
SCALE_TYPE_ABSOLUTE | |
SCALE_TYPE_RELATIVE | |
Definition at line 163 of file f_ebur128.c.
◆ AVFILTER_DEFINE_CLASS()
AVFILTER_DEFINE_CLASS |
( |
ebur128 |
| ) |
|
◆ get_graph_color()
◆ lu_to_y()
◆ drawtext()
◆ drawline()
◆ config_video_output()
◆ config_audio_input()
◆ config_audio_output()
◆ get_histogram()
◆ init()
◆ gate_update()
static int gate_update |
( |
struct integrator * |
integ, |
|
|
double |
power, |
|
|
double |
loudness, |
|
|
int |
gate_thres |
|
) |
| |
|
static |
◆ filter_frame()
◆ query_formats()
◆ uninit()
◆ ebur128_options
Initial value:= {
{
"framelog",
"force frame logging level",
OFFSET(loglevel),
AV_OPT_TYPE_INT, {.i64 = -1}, INT_MIN, INT_MAX,
A|
V|
F,
"level" },
{
"panlaw",
"set a specific pan law for dual-mono files",
OFFSET(pan_law),
AV_OPT_TYPE_DOUBLE, {.dbl = -3.01029995663978}, -10.0, 0.0,
A|
F },
{
"target",
"set a specific target level in LUFS (-23 to 0)",
OFFSET(target),
AV_OPT_TYPE_INT, {.i64 = -23}, -23, 0,
V|
F },
}
Definition at line 172 of file f_ebur128.c.
◆ graph_colors
Initial value:= {
0xdd, 0x66, 0x66,
0x66, 0x66, 0xdd,
0x96, 0x33, 0x33,
0x33, 0x33, 0x96,
0xdd, 0x96, 0x96,
0x96, 0x96, 0xdd,
0xdd, 0x33, 0x33,
0x33, 0x33, 0xdd,
0xdd, 0x66, 0x66,
0x66, 0xdd, 0x66,
0x96, 0x33, 0x33,
0x33, 0x96, 0x33,
0xdd, 0x96, 0x96,
0x96, 0xdd, 0x96,
0xdd, 0x33, 0x33,
0x33, 0xdd, 0x33,
}
Definition at line 202 of file f_ebur128.c.
Referenced by get_graph_color().
◆ font_colors
◆ ebur128_inputs
Initial value:= {
{
.name = "default",
},
}
Definition at line 992 of file f_ebur128.c.
◆ ff_af_ebur128
Initial value:= {
.name = "ebur128",
.priv_class = &ebur128_class,
}
Definition at line 1002 of file f_ebur128.c.