[FFmpeg-cvslog] avfilter/af_headphone: Use more appropriate variable name

Andreas Rheinhardt git at videolan.org
Wed Sep 9 16:00:23 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Wed Aug 26 09:14:53 2020 +0200| [8dda0d601becf19e6cdf350e2fe82b4db7339bd1] | committer: Andreas Rheinhardt

avfilter/af_headphone: Use more appropriate variable name

Also unify incrementing the variable containing the pointer
to the currently used HRIR data.

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

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

 libavfilter/af_headphone.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavfilter/af_headphone.c b/libavfilter/af_headphone.c
index 8b0a431c45..8db546adbf 100644
--- a/libavfilter/af_headphone.c
+++ b/libavfilter/af_headphone.c
@@ -163,19 +163,18 @@ static int headphone_convolute(AVFilterContext *ctx, void *arg, int jobnr, int n
     }
 
     for (i = 0; i < in->nb_samples; i++) {
-        const float *temp_ir = ir;
+        const float *cur_ir = ir;
 
         *dst = 0;
         for (l = 0; l < in_channels; l++) {
             *(buffer[l] + wr) = src[l];
         }
 
-        for (l = 0; l < in_channels; l++) {
+        for (l = 0; l < in_channels; cur_ir += air_len, l++) {
             const float *const bptr = buffer[l];
 
             if (l == s->lfe_channel) {
                 *dst += *(buffer[s->lfe_channel] + wr) * s->gain_lfe;
-                temp_ir += air_len;
                 continue;
             }
 
@@ -190,8 +189,7 @@ static int headphone_convolute(AVFilterContext *ctx, void *arg, int jobnr, int n
                 memcpy(temp_src + len, bptr, (air_len - len) * sizeof(*temp_src));
             }
 
-            dst[0] += s->scalarproduct_float(temp_ir, temp_src, FFALIGN(ir_len, 32));
-            temp_ir += air_len;
+            dst[0] += s->scalarproduct_float(cur_ir, temp_src, FFALIGN(ir_len, 32));
         }
 
         if (fabsf(dst[0]) > 1)



More information about the ffmpeg-cvslog mailing list