Lines Matching +full:no +full:- +full:1 +full:- +full:8 +full:- +full:v
4 * Copyright (c) 2004-2005 Vassili Karpov (malc)
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27 #include "qemu/error-report.h"
33 /* 8 bit */
35 #define ENDIAN_CONVERT(v) (v) argument
37 /* Signed 8 bit */
38 #define BSIZE 8
43 #define SHIFT 8
52 /* Unsigned 8 bit */
53 #define BSIZE 8
57 #define SHIFT 8
76 #define ENDIAN_CONVERT(v) (v) argument
81 #define ENDIAN_CONVERT(v) bswap16 (v) argument
99 #define ENDIAN_CONVERT(v) (v) argument
104 #define ENDIAN_CONVERT(v) bswap16 (v) argument
122 #define ENDIAN_CONVERT(v) (v) argument
127 #define ENDIAN_CONVERT(v) bswap32 (v) argument
145 #define ENDIAN_CONVERT(v) (v) argument
150 #define ENDIAN_CONVERT(v) bswap32 (v) argument
274 /* macros to map [-1.f, 1.f] <-> [INT32_MIN, INT32_MAX + 1] */
275 static const float float_scale = (int64_t)INT32_MAX + 1;
279 static const float float_scale_reciprocal = 1.f / ((int64_t)INT32_MAX + 1);
291 while (samples--) { in conv_natural_float_to_mono()
292 dst->r = dst->l = CONV_NATURAL_FLOAT(*in++); in conv_natural_float_to_mono()
302 while (samples--) { in conv_natural_float_to_stereo()
303 dst->l = CONV_NATURAL_FLOAT(*in++); in conv_natural_float_to_stereo()
304 dst->r = CONV_NATURAL_FLOAT(*in++); in conv_natural_float_to_stereo()
319 while (samples--) { in clip_natural_float_from_mono()
320 *out++ = CLIP_NATURAL_FLOAT(src->l + src->r); in clip_natural_float_from_mono()
330 while (samples--) { in clip_natural_float_from_stereo()
331 *out++ = CLIP_NATURAL_FLOAT(src->l); in clip_natural_float_from_stereo()
332 *out++ = CLIP_NATURAL_FLOAT(src->r); in clip_natural_float_from_stereo()
352 *left = sample->l; in audio_sample_to_uint64()
353 *right = sample->r; in audio_sample_to_uint64()
367 sample->l = left; in audio_sample_from_uint64()
368 sample->r = right; in audio_sample_from_uint64()
391 * The use of fractional increment allows us to use no buffer. It
398 * introduced. Limited to processing 32-bit count worth of samples.
400 * 1 << FRAC_BITS evaluating to zero in several places. Changed with
401 * an (unsigned long) cast to make it safe. MarkMLl 2/1/99
417 struct rate *rate = g_new0(struct rate, 1); in st_rate_start()
419 rate->opos = 0; in st_rate_start()
422 rate->opos_inc = ((uint64_t) inrate << 32) / outrate; in st_rate_start()
424 rate->ipos = 0; in st_rate_start()
425 rate->ilast.l = 0; in st_rate_start()
426 rate->ilast.r = 0; in st_rate_start()
444 * st_rate_frames_out() - returns the number of frames the resampling code
461 if (rate->opos_inc == 1ULL << 32) { in st_rate_frames_out()
465 /* no output frame without at least one input frame */ in st_rate_frames_out()
470 /* last frame read was at rate->ipos - 1 */ in st_rate_frames_out()
471 ipos_end = rate->ipos - 1 + frames_in; in st_rate_frames_out()
474 /* last frame written was at rate->opos - rate->opos_inc */ in st_rate_frames_out()
475 if (opos_end + rate->opos_inc <= rate->opos) { in st_rate_frames_out()
478 opos_delta = opos_end - rate->opos + rate->opos_inc; in st_rate_frames_out()
479 frames_out = opos_delta / rate->opos_inc; in st_rate_frames_out()
481 return opos_delta % rate->opos_inc ? frames_out : frames_out - 1; in st_rate_frames_out()
485 * st_rate_frames_in() - returns the number of frames needed to
500 if (rate->opos_inc == 1ULL << 32) { in st_rate_frames_in()
505 opos_start = rate->opos; in st_rate_frames_in()
506 ipos_start = rate->ipos; in st_rate_frames_in()
511 offset = (rate->opos_inc + (1ULL << 32) - 1) & ~((1ULL << 32) - 1); in st_rate_frames_in()
512 opos_start = rate->opos + offset; in st_rate_frames_in()
513 ipos_start = rate->ipos + (offset >> 32); in st_rate_frames_in()
515 /* last frame written was at opos_start - rate->opos_inc */ in st_rate_frames_in()
516 opos_end = opos_start - rate->opos_inc + rate->opos_inc * frames_out; in st_rate_frames_in()
517 ipos_end = (opos_end >> 32) + 1; in st_rate_frames_in()
519 /* last frame read was at ipos_start - 1 */ in st_rate_frames_in()
520 return ipos_end + 1 > ipos_start ? ipos_end + 1 - ipos_start : 0; in st_rate_frames_in()
530 if (vol->mute) { in mixeng_volume()
535 while (len--) { in mixeng_volume()
537 buf->l = buf->l * vol->l; in mixeng_volume()
538 buf->r = buf->r * vol->r; in mixeng_volume()
540 buf->l = (buf->l * vol->l) >> 32; in mixeng_volume()
541 buf->r = (buf->r * vol->r) >> 32; in mixeng_volume()
543 buf += 1; in mixeng_volume()