volume: remove ref functions

This commit is contained in:
Wim Taymans 2009-08-14 15:48:10 +02:00
parent f24c24c14b
commit 591baacba5
2 changed files with 0 additions and 446 deletions

View file

@ -35,71 +35,6 @@
#include "sample-util.h"
#include "endianmacros.h"
#if 0
static void
pa_volume_u8_mmx (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length)
{
unsigned channel;
for (channel = 0; length; length--) {
int32_t t, hi, lo;
hi = volumes[channel] >> 16;
lo = volumes[channel] & 0xFFFF;
t = (int32_t) *samples - 0x80;
t = ((t * lo) >> 16) + (t * hi);
t = PA_CLAMP_UNLIKELY(t, -0x80, 0x7F);
*samples++ = (uint8_t) (t + 0x80);
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
static void
pa_volume_alaw_mmx (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length)
{
unsigned channel;
for (channel = 0; length; length--) {
int32_t t, hi, lo;
hi = volumes[channel] >> 16;
lo = volumes[channel] & 0xFFFF;
t = (int32_t) st_alaw2linear16(*samples);
t = ((t * lo) >> 16) + (t * hi);
t = PA_CLAMP_UNLIKELY(t, -0x8000, 0x7FFF);
*samples++ = (uint8_t) st_13linear2alaw((int16_t) t >> 3);
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
static void
pa_volume_ulaw_mmx (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length)
{
unsigned channel;
for (channel = 0; length; length--) {
int32_t t, hi, lo;
hi = volumes[channel] >> 16;
lo = volumes[channel] & 0xFFFF;
t = (int32_t) st_ulaw2linear16(*samples);
t = ((t * lo) >> 16) + (t * hi);
t = PA_CLAMP_UNLIKELY(t, -0x8000, 0x7FFF);
*samples++ = (uint8_t) st_14linear2ulaw((int16_t) t >> 2);
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
#endif
/* in s: 2 int16_t samples
* in v: 2 int32_t volumes, fixed point 16:16
* out s: contains scaled and clamped int16_t samples.
@ -304,164 +239,6 @@ pa_volume_s16re_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi
);
}
#if 0
static void
pa_volume_float32ne_mmx (float *samples, float *volumes, unsigned channels, unsigned length)
{
unsigned channel;
length /= sizeof (float);
for (channel = 0; length; length--) {
*samples++ *= volumes[channel];
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
static void
pa_volume_float32re_mmx (float *samples, float *volumes, unsigned channels, unsigned length)
{
unsigned channel;
length /= sizeof (float);
for (channel = 0; length; length--) {
float t;
t = PA_FLOAT32_SWAP(*samples);
t *= volumes[channel];
*samples++ = PA_FLOAT32_SWAP(t);
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
static void
pa_volume_s32ne_mmx (int32_t *samples, int32_t *volumes, unsigned channels, unsigned length)
{
unsigned channel;
length /= sizeof (int32_t);
for (channel = 0; length; length--) {
int64_t t;
t = (int64_t)(*samples);
t = (t * volumes[channel]) >> 16;
t = PA_CLAMP_UNLIKELY(t, -0x80000000LL, 0x7FFFFFFFLL);
*samples++ = (int32_t) t;
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
static void
pa_volume_s32re_mmx (int32_t *samples, int32_t *volumes, unsigned channels, unsigned length)
{
unsigned channel;
length /= sizeof (int32_t);
for (channel = 0; length; length--) {
int64_t t;
t = (int64_t) PA_INT32_SWAP(*samples);
t = (t * volumes[channel]) >> 16;
t = PA_CLAMP_UNLIKELY(t, -0x80000000LL, 0x7FFFFFFFLL);
*samples++ = PA_INT32_SWAP((int32_t) t);
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
static void
pa_volume_s24ne_mmx (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length)
{
unsigned channel;
uint8_t *e;
e = samples + length;
for (channel = 0; samples < e; samples += 3) {
int64_t t;
t = (int64_t)((int32_t) (PA_READ24NE(samples) << 8));
t = (t * volumes[channel]) >> 16;
t = PA_CLAMP_UNLIKELY(t, -0x80000000LL, 0x7FFFFFFFLL);
PA_WRITE24NE(samples, ((uint32_t) (int32_t) t) >> 8);
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
static void
pa_volume_s24re_mmx (uint8_t *samples, int32_t *volumes, unsigned channels, unsigned length)
{
unsigned channel;
uint8_t *e;
e = samples + length;
for (channel = 0; samples < e; samples += 3) {
int64_t t;
t = (int64_t)((int32_t) (PA_READ24RE(samples) << 8));
t = (t * volumes[channel]) >> 16;
t = PA_CLAMP_UNLIKELY(t, -0x80000000LL, 0x7FFFFFFFLL);
PA_WRITE24RE(samples, ((uint32_t) (int32_t) t) >> 8);
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
static void
pa_volume_s24_32ne_mmx (uint32_t *samples, int32_t *volumes, unsigned channels, unsigned length)
{
unsigned channel;
length /= sizeof (uint32_t);
for (channel = 0; length; length--) {
int64_t t;
t = (int64_t) ((int32_t) (*samples << 8));
t = (t * volumes[channel]) >> 16;
t = PA_CLAMP_UNLIKELY(t, -0x80000000LL, 0x7FFFFFFFLL);
*samples++ = ((uint32_t) ((int32_t) t)) >> 8;
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
static void
pa_volume_s24_32re_mmx (uint32_t *samples, int32_t *volumes, unsigned channels, unsigned length)
{
unsigned channel;
length /= sizeof (uint32_t);
for (channel = 0; length; length--) {
int64_t t;
t = (int64_t) ((int32_t) (PA_UINT32_SWAP(*samples) << 8));
t = (t * volumes[channel]) >> 16;
t = PA_CLAMP_UNLIKELY(t, -0x80000000LL, 0x7FFFFFFFLL);
*samples++ = PA_UINT32_SWAP(((uint32_t) ((int32_t) t)) >> 8);
if (PA_UNLIKELY(++channel >= channels))
channel = 0;
}
}
#endif
#undef RUN_TEST
#ifdef RUN_TEST