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
768 768
769 /* get lower loudness to consider */769 /* get lower loudness to consider */
770 n = 0;770 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;
772 for (i = gate_hist_pos; i < HIST_SIZE; i++) {772 for (i = gate_hist_pos; i < HIST_SIZE; i++) {
773 n += ebur128->i3000.histogram[i].count;773 n += ebur128->i3000.histogram[i].count;
774 if (n >= nb_pow) {774 if (n >= nb_pow) {
@@ -779,7 +779,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples) · 4 unmodified lines
779 779
780 /* get higher loudness to consider */780 /* get higher loudness to consider */
781 n = nb_powers;781 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;
783 for (i = HIST_SIZE - 1; i >= 0; i--) {783 for (i = HIST_SIZE - 1; i >= 0; i--) {
784 n -= FFMIN(n, ebur128->i3000.histogram[i].count);784 n -= FFMIN(n, ebur128->i3000.histogram[i].count);
785 if (n < nb_pow) {785 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