[FFmpeg-cvslog] lavfi: EBU R.128 irregular time

sedacca@comcast.net git at videolan.org
Sat Jan 19 03:47:57 CET 2013


ffmpeg | branch: master | sedacca at comcast.net <sedacca at comcast.net> | Fri Jan 18 05:13:10 2013 +0000| [24c47f00fead6ea9512e7b4f63a54068dd5efeb9] | committer: Michael Niedermayer

lavfi: EBU R.128 irregular time

Correct the time interval between logged data rows to the expected
value of 100 milliseconds by naming a new loop counter variable
to be distinct from loop counters for inner loops that
inadvertently change the outer loop operation.

This suggested patch is 1 of 3 for Ticket #2144 "libavfilter ebur128
loudness inaccuracy, irregular time interval, LFE interference".
This suggested patch supersedes the contribution of January 15, 2013
in the thread “[PATCH] lavfi: EBU R.128 irreg time, ch weights, skip
LFE” which combined multiple fixes in one patch.

Reviewed-by: Clément Bœsch <ubitux at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=24c47f00fead6ea9512e7b4f63a54068dd5efeb9
---

 libavfilter/f_ebur128.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c
index f9da80d..85fddad 100644
--- a/libavfilter/f_ebur128.c
+++ b/libavfilter/f_ebur128.c
@@ -438,7 +438,7 @@ static int gate_update(struct integrator *integ, double power,
 
 static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
 {
-    int i, ch;
+    int i, ch, idx_insample;
     AVFilterContext *ctx = inlink->dst;
     EBUR128Context *ebur128 = ctx->priv;
     const int nb_channels = ebur128->nb_channels;
@@ -446,7 +446,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
     const double *samples = (double *)insamples->data[0];
     AVFilterBufferRef *pic = ebur128->outpicref;
 
-    for (i = 0; i < nb_samples; i++) {
+    for (idx_insample = 0; idx_insample < nb_samples; idx_insample++) {
         const int bin_id_400  = ebur128->i400.cache_pos;
         const int bin_id_3000 = ebur128->i3000.cache_pos;
 
@@ -505,7 +505,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
             double power_400 = 1e-12, power_3000 = 1e-12;
             AVFilterLink *outlink = ctx->outputs[0];
             const int64_t pts = insamples->pts +
-                av_rescale_q(i, (AVRational){ 1, inlink->sample_rate },
+                av_rescale_q(idx_insample, (AVRational){ 1, inlink->sample_rate },
                              outlink->time_base);
 
             ebur128->sample_count = 0;



More information about the ffmpeg-cvslog mailing list