Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2022-02-24 12:04:43 +0300
committerPaul B Mahol <onemda@gmail.com>2022-02-24 13:15:28 +0300
commitd5ad1d7847ebfa4da1f1476c4af18fa2701e4d24 (patch)
treefc52e31cc6447adb53364b69fce16bce4f176bd3 /libavfilter/f_ebur128.c
parentb0f8dbb0cacc45a19f18c043afc706d7d26bef74 (diff)
avfilter/f_ebur128: use unsigned for hist_entry.count
Also when summing multiple hist_entry.count use uint64_t for accumulator.
Diffstat (limited to 'libavfilter/f_ebur128.c')
-rw-r--r--libavfilter/f_ebur128.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c
index 0c635f3d36..d5ffab7ca1 100644
--- a/libavfilter/f_ebur128.c
+++ b/libavfilter/f_ebur128.c
@@ -55,7 +55,7 @@
* infinitely over the time and is thus more scalable.
*/
struct hist_entry {
- int count; ///< how many times the corresponding value occurred
+ unsigned count; ///< how many times the corresponding value occurred
double energy; ///< E = 10^((L + 0.691) / 10)
double loudness; ///< L = -0.691 + 10 * log10(E)
};
@@ -722,15 +722,15 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
#define I_GATE_THRES -10 // initially defined to -8 LU in the first EBU standard
if (loudness_400 >= ABS_THRES) {
- double integrated_sum = 0;
- int nb_integrated = 0;
+ double integrated_sum = 0.0;
+ uint64_t nb_integrated = 0;
int gate_hist_pos = gate_update(&ebur128->i400, power_400,
loudness_400, I_GATE_THRES);
/* compute integrated loudness by summing the histogram values
* above the relative threshold */
for (i = gate_hist_pos; i < HIST_SIZE; i++) {
- const int nb_v = ebur128->i400.histogram[i].count;
+ const unsigned nb_v = ebur128->i400.histogram[i].count;
nb_integrated += nb_v;
integrated_sum += nb_v * ebur128->i400.histogram[i].energy;
}
@@ -751,14 +751,14 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *insamples)
/* XXX: example code in EBU 3342 is ">=" but formula in BS.1770
* specs is ">" */
if (loudness_3000 >= ABS_THRES) {
- int nb_powers = 0;
+ uint64_t nb_powers = 0;
int gate_hist_pos = gate_update(&ebur128->i3000, power_3000,
loudness_3000, LRA_GATE_THRES);
for (i = gate_hist_pos; i < HIST_SIZE; i++)
nb_powers += ebur128->i3000.histogram[i].count;
if (nb_powers) {
- int n, nb_pow;
+ uint64_t n, nb_pow;
/* get lower loudness to consider */
n = 0;