History

avfilter/af_loudnorm: fix incorrect gain when audio is shorter than 3s

The input data is multiplied by `s->offset` to get normalized output. `s->target_tp` and `true_peak` is not in dB, so `s->offset` should be calculated by division instead of subtraction.

Rui Zhu committed 4 years ago

Commit 36572a01 parent 86157f51 file · +1 −1Browse files

Unified · Split

libavfilter/af_loudnorm.c+1−1
@@ -455,7 +455,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 454 unmodified lines
455 455
456 offset = pow(10., (s->target_i - global) / 20.);456 offset = pow(10., (s->target_i - global) / 20.);
457 offset_tp = true_peak * offset;457 offset_tp = true_peak * offset;
458 s->offset = offset_tp < s->target_tp ? offset : s->target_tp - true_peak;458 s->offset = offset_tp < s->target_tp ? offset : s->target_tp / true_peak;
459 s->frame_type = LINEAR_MODE;459 s->frame_type = LINEAR_MODE;
460 }460 }
461 461

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t