Lines Matching refs:phase_count
144 …ampleContext *c, void *filter, double factor, int tap_count, int alloc, int phase_count, int scale, in build_filter() argument
147 int ph_nb = phase_count % 2 ? phase_count : phase_count / 2 + 1; in build_filter()
166 sin_lut[ph] = sin(M_PI * ph / phase_count) * (center & 1 ? 1 : -1); in build_filter()
171 x = M_PI * ((double)(i - center) - (double)ph / phase_count) * factor; in build_filter()
180 x = fabs(((double)(i - center) - (double)ph / phase_count) * factor); in build_filter()
208 if (phase_count % 2) break; in build_filter()
210 … ((int16_t*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((int16_t*)filter)[ph * alloc + i]; in build_filter()
215 if (phase_count % 2) break; in build_filter()
217 … ((int32_t*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((int32_t*)filter)[ph * alloc + i]; in build_filter()
222 if (phase_count % 2) break; in build_filter()
224 … ((float*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((float*)filter)[ph * alloc + i]; in build_filter()
229 if (phase_count % 2) break; in build_filter()
231 … ((double*)filter)[(phase_count-ph) * alloc + tap_count-1-i] = ((double*)filter)[ph * alloc + i]; in build_filter()
293 int phase_count= 1<<phase_shift; in resample_init() local
294 int phase_count_compensation = phase_count; in resample_init()
304 if (phase_count_exact <= phase_count) { in resample_init()
305 phase_count_compensation = phase_count_exact * (phase_count / phase_count_exact); in resample_init()
306 phase_count = phase_count_exact; in resample_init()
310 if (!c || c->phase_count != phase_count || c->linear!=linear || c->factor != factor in resample_init()
343 c->phase_count = phase_count; in resample_init()
348 c->filter_bank = av_calloc(c->filter_alloc, (phase_count+1)*c->felem_size); in resample_init()
354 …r(c, (void*)c->filter_bank, factor, c->filter_length, c->filter_alloc, phase_count, 1<<c->filter_s… in resample_init()
356 …memcpy(c->filter_bank + (c->filter_alloc*phase_count+1)*c->felem_size, c->filter_bank, (c->filter_… in resample_init()
357 …memcpy(c->filter_bank + (c->filter_alloc*phase_count )*c->felem_size, c->filter_bank + (c->filter… in resample_init()
361 … if(!av_reduce(&c->src_incr, &c->dst_incr, out_rate, in_rate * (int64_t)phase_count, INT32_MAX/2)) in resample_init()
371 c->index= -phase_count*((c->filter_length-1)/2); in resample_init()
387 int phase_count = c->phase_count_compensation; in rebuild_filter_bank_with_compensation() local
390 if (phase_count == c->phase_count) in rebuild_filter_bank_with_compensation()
395 new_filter_bank = av_calloc(c->filter_alloc, (phase_count + 1) * c->felem_size); in rebuild_filter_bank_with_compensation()
400 phase_count, 1 << c->filter_shift, c->filter_type, c->kaiser_beta); in rebuild_filter_bank_with_compensation()
405 …memcpy(new_filter_bank + (c->filter_alloc*phase_count+1)*c->felem_size, new_filter_bank, (c->filte… in rebuild_filter_bank_with_compensation()
406 …memcpy(new_filter_bank + (c->filter_alloc*phase_count )*c->felem_size, new_filter_bank + (c->filt… in rebuild_filter_bank_with_compensation()
409 c->dst_incr * (int64_t)(phase_count/c->phase_count), INT32_MAX/2)) in rebuild_filter_bank_with_compensation()
424 c->index *= phase_count / c->phase_count; in rebuild_filter_bank_with_compensation()
425 c->phase_count = phase_count; in rebuild_filter_bank_with_compensation()
457 int64_t max_src_size = (INT64_MAX/2 / c->phase_count) / c->src_incr; in multiple_resample()
465 if (c->filter_length == 1 && c->phase_count == 1) { in multiple_resample()
485 int64_t end_index = (1LL + src_size - c->filter_length) * c->phase_count; in multiple_resample()
520 num *= c->phase_count; in get_delay()
524 return av_rescale(num, base, s->in_sample_rate*(int64_t)c->src_incr * c->phase_count); in get_delay()
533 num *= c->phase_count; in get_out_samples()
535 …num = av_rescale_rnd(num, s->out_sample_rate, ((int64_t)s->in_sample_rate) * c->phase_count, AV_RO… in get_out_samples()
605 c->index += c->phase_count; in invert_initial_buffer()