History

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.

Sebastian Dröge committed 6 years ago

Commit ed3da721 parent 9ce7de91 file · +2 −3Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/af_loudnorm.c+2−3
@@ -453,10 +453,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) · 452 unmodified lines
453 true_peak = tmp;453 true_peak = tmp;
454 }454 }
455 455
456 offset = s->target_i - global;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->offset = pow(10., s->offset / 20.);
460 s->frame_type = LINEAR_MODE;459 s->frame_type = LINEAR_MODE;
461 }460 }
462 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