Lines Matching refs:phase_count

145 static int build_filter(ResampleContext *c, void *filter, double factor, int tap_count, int alloc, int phase_count, int scale,
148 int ph_nb = phase_count % 2 ? phase_count : phase_count / 2 + 1;
167 sin_lut[ph] = sin(M_PI * ph / phase_count) * (center & 1 ? 1 : -1);
172 x = M_PI * ((double)(i - center) - (double)ph / phase_count) * factor;
181 x = fabs(((double)(i - center) - (double)ph / phase_count) * factor);
209 if (phase_count % 2) break;
211 ((int16_t*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((int16_t*)filter)[ph * alloc + i];
216 if (phase_count % 2) break;
218 ((int32_t*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((int32_t*)filter)[ph * alloc + i];
223 if (phase_count % 2) break;
225 ((float*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((float*)filter)[ph * alloc + i];
230 if (phase_count % 2) break;
232 ((double*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((double*)filter)[ph * alloc + i];
294 int phase_count= 1<<phase_shift;
295 int phase_count_compensation = phase_count;
305 if (phase_count_exact <= phase_count) {
306 phase_count_compensation = phase_count_exact * (phase_count / phase_count_exact);
307 phase_count = phase_count_exact;
311 if (!c || c->phase_count != phase_count || c->linear!=linear || c->factor != factor
344 c->phase_count = phase_count;
349 c->filter_bank = av_calloc(c->filter_alloc, (phase_count+1)*c->felem_size);
355 if (build_filter(c, (void*)c->filter_bank, factor, c->filter_length, c->filter_alloc, phase_count, 1<<c->filter_shift, filter_type, kaiser_beta))
357 memcpy(c->filter_bank + (c->filter_alloc*phase_count+1)*c->felem_size, c->filter_bank, (c->filter_alloc-1)*c->felem_size);
358 memcpy(c->filter_bank + (c->filter_alloc*phase_count )*c->felem_size, c->filter_bank + (c->filter_alloc - 1)*c->felem_size, c->felem_size);
362 if(!av_reduce(&c->src_incr, &c->dst_incr, out_rate, in_rate * (int64_t)phase_count, INT32_MAX/2))
372 c->index= -phase_count*((c->filter_length-1)/2);
388 int phase_count = c->phase_count_compensation;
391 if (phase_count == c->phase_count)
396 new_filter_bank = av_calloc(c->filter_alloc, (phase_count + 1) * c->felem_size);
401 phase_count, 1 << c->filter_shift, c->filter_type, c->kaiser_beta);
406 memcpy(new_filter_bank + (c->filter_alloc*phase_count+1)*c->felem_size, new_filter_bank, (c->filter_alloc-1)*c->felem_size);
407 memcpy(new_filter_bank + (c->filter_alloc*phase_count )*c->felem_size, new_filter_bank + (c->filter_alloc - 1)*c->felem_size, c->felem_size);
410 c->dst_incr * (int64_t)(phase_count/c->phase_count), INT32_MAX/2))
425 c->index *= phase_count / c->phase_count;
426 c->phase_count = phase_count;
455 int64_t max_src_size = (INT64_MAX/2 / c->phase_count) / c->src_incr;
463 if (c->filter_length == 1 && c->phase_count == 1) {
483 int64_t end_index = (1LL + src_size - c->filter_length) * c->phase_count;
515 num *= c->phase_count;
519 return av_rescale(num, base, s->in_sample_rate*(int64_t)c->src_incr * c->phase_count);
528 num *= c->phase_count;
530 num = av_rescale_rnd(num, s->out_sample_rate, ((int64_t)s->in_sample_rate) * c->phase_count, AV_ROUND_UP) + 2;
600 c->index += c->phase_count;