[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 2/6] audio: change naming scheme of FLOAT_CONV macros
From: |
Gerd Hoffmann |
Subject: |
[PULL 2/6] audio: change naming scheme of FLOAT_CONV macros |
Date: |
Mon, 16 Mar 2020 12:30:11 +0100 |
From: Volker RĂ¼melin <address@hidden>
This patch changes the naming scheme of the FLOAT_CONV_TO and
FLOAT_CONV_FROM macros to the scheme used in mixeng_template.h.
Signed-off-by: Volker RĂ¼melin <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
audio/mixeng.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/audio/mixeng.c b/audio/mixeng.c
index c14b0d874ce5..b57fad83bf3b 100644
--- a/audio/mixeng.c
+++ b/audio/mixeng.c
@@ -268,17 +268,17 @@ f_sample *mixeng_clip[2][2][2][3] = {
};
#ifdef FLOAT_MIXENG
-#define FLOAT_CONV_TO(x) (x)
-#define FLOAT_CONV_FROM(x) (x)
+#define CONV_NATURAL_FLOAT(x) (x)
+#define CLIP_NATURAL_FLOAT(x) (x)
#else
static const float float_scale = UINT_MAX;
-#define FLOAT_CONV_TO(x) ((x) * float_scale)
+#define CONV_NATURAL_FLOAT(x) ((x) * float_scale)
#ifdef RECIPROCAL
static const float float_scale_reciprocal = 1.f / UINT_MAX;
-#define FLOAT_CONV_FROM(x) ((x) * float_scale_reciprocal)
+#define CLIP_NATURAL_FLOAT(x) ((x) * float_scale_reciprocal)
#else
-#define FLOAT_CONV_FROM(x) ((x) / float_scale)
+#define CLIP_NATURAL_FLOAT(x) ((x) / float_scale)
#endif
#endif
@@ -288,7 +288,7 @@ static void conv_natural_float_to_mono(struct st_sample
*dst, const void *src,
float *in = (float *)src;
while (samples--) {
- dst->r = dst->l = FLOAT_CONV_TO(*in++);
+ dst->r = dst->l = CONV_NATURAL_FLOAT(*in++);
dst++;
}
}
@@ -299,8 +299,8 @@ static void conv_natural_float_to_stereo(struct st_sample
*dst, const void *src,
float *in = (float *)src;
while (samples--) {
- dst->l = FLOAT_CONV_TO(*in++);
- dst->r = FLOAT_CONV_TO(*in++);
+ dst->l = CONV_NATURAL_FLOAT(*in++);
+ dst->r = CONV_NATURAL_FLOAT(*in++);
dst++;
}
}
@@ -316,7 +316,7 @@ static void clip_natural_float_from_mono(void *dst, const
struct st_sample *src,
float *out = (float *)dst;
while (samples--) {
- *out++ = FLOAT_CONV_FROM(src->l) + FLOAT_CONV_FROM(src->r);
+ *out++ = CLIP_NATURAL_FLOAT(src->l) + CLIP_NATURAL_FLOAT(src->r);
src++;
}
}
@@ -327,8 +327,8 @@ static void clip_natural_float_from_stereo(
float *out = (float *)dst;
while (samples--) {
- *out++ = FLOAT_CONV_FROM(src->l);
- *out++ = FLOAT_CONV_FROM(src->r);
+ *out++ = CLIP_NATURAL_FLOAT(src->l);
+ *out++ = CLIP_NATURAL_FLOAT(src->r);
src++;
}
}
--
2.18.2
- [PULL 0/6] Audio 20200316 patches, Gerd Hoffmann, 2020/03/16
- [PULL 1/6] qapi/audio: add documentation for AudioFormat, Gerd Hoffmann, 2020/03/16
- [PULL 4/6] audio: change mixing engine float range to [-1.f, 1.f], Gerd Hoffmann, 2020/03/16
- [PULL 3/6] audio: consistency changes, Gerd Hoffmann, 2020/03/16
- [PULL 6/6] audio: add audiodev format=f32 option documentation, Gerd Hoffmann, 2020/03/16
- [PULL 5/6] audio: fix saturation nonlinearity in clip_* functions, Gerd Hoffmann, 2020/03/16
- [PULL 2/6] audio: change naming scheme of FLOAT_CONV macros,
Gerd Hoffmann <=
- Re: [PULL 0/6] Audio 20200316 patches, Peter Maydell, 2020/03/16