/*
* QEMU Mixing engine
*
* Copyright (c) 2004-2005 Vassili Karpov (malc)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/*
* Tusen tack till Mike Nordell
* dec++'ified by Dscho
*/
#ifndef SIGNED
#endif
#ifdef NOVOL
#define VOL(a, b) a
#else
#ifdef VBOX
#else /* !VBOX */
#ifdef FLOAT_MIXENG
#define VOL(a, b) ((a) * (b))
#else
#endif
#endif
#endif /* !VBOX */
#ifdef FLOAT_MIXENG
{
#ifdef RECIPROCAL
#ifdef SIGNED
#else
#endif
#else /* !RECIPROCAL */
#ifdef SIGNED
#else
#endif
#endif
}
{
if (v >= 0.5) {
return IN_MAX;
}
else if (v < -0.5) {
return IN_MIN;
}
#ifdef SIGNED
#else
#endif
}
#else /* !FLOAT_MIXENG */
{
#ifdef SIGNED
#else
#endif
}
{
if (v >= 0x7f000000) {
return IN_MAX;
}
else if (v < -2147483648LL) {
return IN_MIN;
}
#ifdef SIGNED
#else
#endif
}
#endif
#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
#else
#endif
{
#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
#else
#endif
#ifndef NOVOL
return;
}
#else
(void) vol;
#endif
while (samples--) {
#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
#else
#endif
out += 1;
}
}
#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
#else
#endif
{
#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
#else
#endif
#ifndef NOVOL
return;
}
#else
(void) vol;
#endif
while (samples--) {
#ifdef VBOX_WITH_PDM_AUDIO_DRIVER
#else
#endif
out += 1;
in += 1;
}
}
{
while (samples--) {
in += 1;
}
}
{
while (samples--) {
in += 1;
}
}