aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/af_asdr.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2023-08-14 01:36:34 +0200
committerPaul B Mahol <onemda@gmail.com>2023-08-14 11:19:56 +0200
commit24c013369dee69b87b517d6a7d71644d094a4e46 (patch)
tree3db6f746192b3caad1293007718d1f3c4aa6b129 /libavfilter/af_asdr.c
parent10110a30b54c161fd267bb53b424b12aabdfcf70 (diff)
downloadffmpeg-24c013369dee69b87b517d6a7d71644d094a4e46.tar.gz
avfilter/af_asdr: remove wrong scaling from sdr, and fix sisdr formula
Diffstat (limited to 'libavfilter/af_asdr.c')
-rw-r--r--libavfilter/af_asdr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavfilter/af_asdr.c b/libavfilter/af_asdr.c
index dbbb7e3419..3942f48053 100644
--- a/libavfilter/af_asdr.c
+++ b/libavfilter/af_asdr.c
@@ -225,11 +225,11 @@ static av_cold void uninit(AVFilterContext *ctx)
if (!strcmp(ctx->filter->name, "asdr")) {
for (int ch = 0; ch < s->channels; ch++)
- av_log(ctx, AV_LOG_INFO, "SDR ch%d: %g dB\n", ch, 20. * log10(s->chs[ch].u / s->chs[ch].uv));
+ av_log(ctx, AV_LOG_INFO, "SDR ch%d: %g dB\n", ch, 10. * log10(s->chs[ch].u / s->chs[ch].uv));
} else if (!strcmp(ctx->filter->name, "asisdr")) {
for (int ch = 0; ch < s->channels; ch++) {
double scale = s->chs[ch].uv / s->chs[ch].v;
- double sisdr = s->chs[ch].u / fmax(0., s->chs[ch].u + scale*scale*s->chs[ch].v - 2.0*scale*s->chs[ch].uv);
+ double sisdr = scale * scale * s->chs[ch].v / fmax(0., s->chs[ch].u + scale*scale*s->chs[ch].v - 2.0*scale*s->chs[ch].uv);
av_log(ctx, AV_LOG_INFO, "SI-SDR ch%d: %g dB\n", ch, 10. * log10(sisdr));
}