Lines Matching full:rate
449 * Sound Tools rate change effect file.
468 struct rate { struct
480 struct rate *rate = g_new0(struct rate, 1); in st_rate_start() argument
482 rate->opos = 0; in st_rate_start()
485 rate->opos_inc = ((uint64_t) inrate << 32) / outrate; in st_rate_start()
487 rate->ipos = 0; in st_rate_start()
488 rate->ilast.l = 0; in st_rate_start()
489 rate->ilast.r = 0; in st_rate_start()
490 return rate; in st_rate_start()
510 * @opaque: pointer to struct rate
519 struct rate *rate = opaque; in st_rate_frames_out() local
524 if (rate->opos_inc == 1ULL << 32) { in st_rate_frames_out()
533 /* last frame read was at rate->ipos - 1 */ in st_rate_frames_out()
534 ipos_end = rate->ipos - 1 + frames_in; in st_rate_frames_out()
537 /* last frame written was at rate->opos - rate->opos_inc */ in st_rate_frames_out()
538 if (opos_end + rate->opos_inc <= rate->opos) { in st_rate_frames_out()
541 opos_delta = opos_end - rate->opos + rate->opos_inc; in st_rate_frames_out()
542 frames_out = opos_delta / rate->opos_inc; in st_rate_frames_out()
544 return opos_delta % rate->opos_inc ? frames_out : frames_out - 1; in st_rate_frames_out()
551 * @opaque: pointer to struct rate
559 struct rate *rate = opaque; in st_rate_frames_in() local
563 if (rate->opos_inc == 1ULL << 32) { in st_rate_frames_in()
568 opos_start = rate->opos; in st_rate_frames_in()
569 ipos_start = rate->ipos; in st_rate_frames_in()
574 offset = (rate->opos_inc + (1ULL << 32) - 1) & ~((1ULL << 32) - 1); in st_rate_frames_in()
575 opos_start = rate->opos + offset; in st_rate_frames_in()
576 ipos_start = rate->ipos + (offset >> 32); in st_rate_frames_in()
578 /* last frame written was at opos_start - rate->opos_inc */ in st_rate_frames_in()
579 opos_end = opos_start - rate->opos_inc + rate->opos_inc * frames_out; in st_rate_frames_in()