Lines Matching +full:left +full:- +full:shift

4  * Copyright (c) 2004-2005 Vassili Karpov (malc)
27 #include "qemu/error-report.h"
43 #define SHIFT 8 macro
50 #undef SHIFT
57 #define SHIFT 8 macro
63 #undef SHIFT
74 #define SHIFT 16 macro
90 #undef SHIFT
97 #define SHIFT 16 macro
112 #undef SHIFT
120 #define SHIFT 32 macro
136 #undef SHIFT
143 #define SHIFT 32 macro
158 #undef SHIFT
274 /* macros to map [-1.f, 1.f] <-> [INT32_MIN, INT32_MAX + 1] */
296 while (samples--) { in conv_natural_float_to_mono()
297 dst->r = dst->l = CONV_NATURAL_FLOAT(*in++); in conv_natural_float_to_mono()
307 while (samples--) { in conv_swap_float_to_mono()
308 dst->r = dst->l = CONV_NATURAL_FLOAT(F32S_TO_F32(*in_f32s++)); in conv_swap_float_to_mono()
318 while (samples--) { in conv_natural_float_to_stereo()
319 dst->l = CONV_NATURAL_FLOAT(*in++); in conv_natural_float_to_stereo()
320 dst->r = CONV_NATURAL_FLOAT(*in++); in conv_natural_float_to_stereo()
330 while (samples--) { in conv_swap_float_to_stereo()
331 dst->l = CONV_NATURAL_FLOAT(F32S_TO_F32(*in_f32s++)); in conv_swap_float_to_stereo()
332 dst->r = CONV_NATURAL_FLOAT(F32S_TO_F32(*in_f32s++)); in conv_swap_float_to_stereo()
353 while (samples--) { in clip_natural_float_from_mono()
354 *out++ = CLIP_NATURAL_FLOAT(src->l + src->r); in clip_natural_float_from_mono()
364 while (samples--) { in clip_swap_float_from_mono()
365 *out_f32s++ = F32_TO_F32S(CLIP_NATURAL_FLOAT(src->l + src->r)); in clip_swap_float_from_mono()
375 while (samples--) { in clip_natural_float_from_stereo()
376 *out++ = CLIP_NATURAL_FLOAT(src->l); in clip_natural_float_from_stereo()
377 *out++ = CLIP_NATURAL_FLOAT(src->r); in clip_natural_float_from_stereo()
387 while (samples--) { in clip_swap_float_from_stereo()
388 *out_f32s++ = F32_TO_F32S(CLIP_NATURAL_FLOAT(src->l)); in clip_swap_float_from_stereo()
389 *out_f32s++ = F32_TO_F32S(CLIP_NATURAL_FLOAT(src->r)); in clip_swap_float_from_stereo()
406 uint64_t *left, uint64_t *right) in audio_sample_to_uint64() argument
415 *left = sample->l; in audio_sample_to_uint64()
416 *right = sample->r; in audio_sample_to_uint64()
421 uint64_t left, uint64_t right) in audio_sample_from_uint64() argument
430 sample->l = left; in audio_sample_from_uint64()
431 sample->r = right; in audio_sample_from_uint64()
461 * introduced. Limited to processing 32-bit count worth of samples.
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()
507 * st_rate_frames_out() - returns the number of frames the resampling code
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()
548 * st_rate_frames_in() - returns the number of frames needed to
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()
582 /* last frame read was at ipos_start - 1 */ in st_rate_frames_in()
583 return ipos_end + 1 > ipos_start ? ipos_end + 1 - ipos_start : 0; in st_rate_frames_in()
593 if (vol->mute) { in mixeng_volume()
598 while (len--) { in mixeng_volume()
600 buf->l = buf->l * vol->l; in mixeng_volume()
601 buf->r = buf->r * vol->r; in mixeng_volume()
603 buf->l = (buf->l * vol->l) >> 32; in mixeng_volume()
604 buf->r = (buf->r * vol->r) >> 32; in mixeng_volume()