History

avfilter/f_ebur128: multiply in integer first, before dividing in float

Restores the order of operations from before 15a1104, which reduces errors from floating point calculations, and fixes FATE on mingw64.

Hendrik Leppkes committed 4 years ago

Commit cd962111 parent 607ecc21 file · +2 −2Browse files

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

Unified · Split

libavfilter/f_ebur128.c+2−2
@@ -768,7 +768,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) · 767 unmodified lines
768768
769769 /* get lower loudness to consider */
770770 n = 0;
771− nb_pow = LRA_LOWER_PRC * 0.01 * nb_powers + 0.5;
771+ nb_pow = LRA_LOWER_PRC * nb_powers * 0.01 + 0.5;
772772 for (i = gate_hist_pos; i < HIST_SIZE; i++) {
773773 n += ebur128->i3000.histogram[i].count;
774774 if (n >= nb_pow) {
@@ -779,7 +779,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) · 4 unmodified lines
779779
780780 /* get higher loudness to consider */
781781 n = nb_powers;
782− nb_pow = LRA_HIGHER_PRC * 0.01 * nb_powers + 0.5;
782+ nb_pow = LRA_HIGHER_PRC * nb_powers * 0.01 + 0.5;
783783 for (i = HIST_SIZE - 1; i >= 0; i--) {
784784 n -= FFMIN(n, ebur128->i3000.histogram[i].count);
785785 if (n < nb_pow) {

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