Browse Source

s->target_i and global are in dB but s->target_tp and true_peak are

linear. Instead of mixing these in the calculations, convert the former
first to have all following calculations in the same unit.

Signed-off-by: Kyle Swanson <k@ylo.ph>
tags/n4.3
Sebastian Dröge Kyle Swanson 5 years ago
parent
commit
ed3da72583
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      libavfilter/af_loudnorm.c

+ 2
- 3
libavfilter/af_loudnorm.c View File

@@ -453,10 +453,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
true_peak = tmp;
}

offset = s->target_i - global;
offset_tp = true_peak + offset;
offset = pow(10., (s->target_i - global) / 20.);
offset_tp = true_peak * offset;
s->offset = offset_tp < s->target_tp ? offset : s->target_tp - true_peak;
s->offset = pow(10., s->offset / 20.);
s->frame_type = LINEAR_MODE;
}



Loading…
Cancel
Save