Also unify incrementing the variable containing the pointer to the currently used HRIR data.
Unified · Split
| @@ -163,19 +163,18 @@ static int headphone_convolute(AVFilterContext *ctx, void *arg, int jobnr, int n · 162 unmodified lines | ||
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | for (i = 0; i < in->nb_samples; i++) { |
| 166 | − const float *temp_ir = ir; | |
| 166 | + const float *cur_ir = ir; | |
| 167 | 167 | |
| 168 | 168 | *dst = 0; |
| 169 | 169 | for (l = 0; l < in_channels; l++) { |
| 170 | 170 | *(buffer[l] + wr) = src[l]; |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | − for (l = 0; l < in_channels; l++) { | |
| 173 | + for (l = 0; l < in_channels; cur_ir += air_len, l++) { | |
| 174 | 174 | const float *const bptr = buffer[l]; |
| 175 | 175 | |
| 176 | 176 | if (l == s->lfe_channel) { |
| 177 | 177 | *dst += *(buffer[s->lfe_channel] + wr) * s->gain_lfe; |
| 178 | − temp_ir += air_len; | |
| 179 | 178 | continue; |
| 180 | 179 | } |
| 181 | 180 | |
| @@ -190,8 +189,7 @@ static int headphone_convolute(AVFilterContext *ctx, void *arg, int jobnr, int n · 8 unmodified lines | ||
| 190 | 189 | memcpy(temp_src + len, bptr, (air_len - len) * sizeof(*temp_src)); |
| 191 | 190 | } |
| 192 | 191 | |
| 193 | − dst[0] += s->scalarproduct_float(temp_ir, temp_src, FFALIGN(ir_len, 32)); | |
| 194 | − temp_ir += air_len; | |
| 192 | + dst[0] += s->scalarproduct_float(cur_ir, temp_src, FFALIGN(ir_len, 32)); | |
| 195 | 193 | } |
| 196 | 194 | |
| 197 | 195 | if (fabsf(dst[0]) > 1) |