Also unify incrementing the variable containing the pointer to the currently used HRIR data.
Showing the changes to libavfilter (1 of 1 file). Show all
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 | for (i = 0; i < in->nb_samples; i++) { | 165 | for (i = 0; i < in->nb_samples; i++) { |
| 166 | const float *temp_ir = ir; | 166 | const float *cur_ir = ir; |
| 167 | 167 | ||
| 168 | *dst = 0; | 168 | *dst = 0; |
| 169 | for (l = 0; l < in_channels; l++) { | 169 | for (l = 0; l < in_channels; l++) { |
| 170 | *(buffer[l] + wr) = src[l]; | 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 | const float *const bptr = buffer[l]; | 174 | const float *const bptr = buffer[l]; |
| 175 | 175 | ||
| 176 | if (l == s->lfe_channel) { | 176 | if (l == s->lfe_channel) { |
| 177 | *dst += *(buffer[s->lfe_channel] + wr) * s->gain_lfe; | 177 | *dst += *(buffer[s->lfe_channel] + wr) * s->gain_lfe; |
| 178 | temp_ir += air_len; | ||
| 179 | continue; | 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 | memcpy(temp_src + len, bptr, (air_len - len) * sizeof(*temp_src)); | 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)); | 192 | dst[0] += s->scalarproduct_float(cur_ir, temp_src, FFALIGN(ir_len, 32)); |
| 194 | temp_ir += air_len; | ||
| 195 | } | 193 | } |
| 196 | 194 | ||
| 197 | if (fabsf(dst[0]) > 1) | 195 | if (fabsf(dst[0]) > 1) |