summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Wischer <twischer@de.adit-jv.com>2018-11-20 15:40:26 +0100
committerFilipe Coelho <falktx@falktx.com>2019-01-17 00:56:39 +0100
commit244fc27e29d8523acbd6a166a8a11bab969a84b7 (patch)
tree53ea60e0b020ff4ff5acdb0687bd9a81c7976b7c
parent4455fe020ca890d8c6b24f89a7bf91f9044b9d33 (diff)
downloadjack2-244fc27e29d8523acbd6a166a8a11bab969a84b7.tar.gz
memops: Provide function for S32 to float conversion
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
-rw-r--r--common/memops.c13
-rw-r--r--common/memops.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/common/memops.c b/common/memops.c
index 17a2e5e0..290449b2 100644
--- a/common/memops.c
+++ b/common/memops.c
@@ -73,6 +73,7 @@
So, for now (October 2008) we use 2^(N-1)-1 as the scaling factor.
*/
+#define SAMPLE_32BIT_SCALING 0x7FFFFFFF
#define SAMPLE_24BIT_SCALING 8388607
#define SAMPLE_16BIT_SCALING 32767
@@ -240,6 +241,8 @@ void sample_move_dS_floatLE (char *dst, jack_default_audio_sample_t *src, unsign
S - sample is a jack_default_audio_sample_t, currently (October 2008) a 32 bit floating point value
Ss - like S but reverse endian from the host CPU
+ 32 - sample is an signed 32 bit integer value
+ 32s - like 32 but reverse endian from the host CPU
32u24 - sample is an signed 32 bit integer value, but data is in lower 24 bits only
32u24s - like 32u24 but reverse endian from the host CPU
24 - sample is an signed 24 bit integer value
@@ -308,6 +311,11 @@ void sample_move_d32u24_sSs (char *dst, jack_default_audio_sample_t *src, unsign
sample_move_d32scal_sSs (dst, src, nsamples, dst_skip, state, SAMPLE_24BIT_SCALING);
}
+void sample_move_d32_sSs (char *dst, jack_default_audio_sample_t *src, unsigned long nsamples, unsigned long dst_skip, dither_state_t *state)
+{
+ sample_move_d32scal_sSs (dst, src, nsamples, dst_skip, state, SAMPLE_32BIT_SCALING);
+}
+
static inline void sample_move_d32scal_sS (char *dst, jack_default_audio_sample_t *src, unsigned long nsamples, unsigned long dst_skip, dither_state_t *state, const int32_t scaling)
{
@@ -398,6 +406,11 @@ void sample_move_d32u24_sS (char *dst, jack_default_audio_sample_t *src, unsigne
sample_move_d32scal_sS (dst, src, nsamples, dst_skip, state, SAMPLE_24BIT_SCALING);
}
+void sample_move_d32_sS (char *dst, jack_default_audio_sample_t *src, unsigned long nsamples, unsigned long dst_skip, dither_state_t *state)
+{
+ sample_move_d32scal_sS (dst, src, nsamples, dst_skip, state, SAMPLE_32BIT_SCALING);
+}
+
void sample_move_dS_s32u24s (jack_default_audio_sample_t *dst, char *src, unsigned long nsamples, unsigned long src_skip)
{
diff --git a/common/memops.h b/common/memops.h
index c027e4d6..93a619af 100644
--- a/common/memops.h
+++ b/common/memops.h
@@ -53,6 +53,8 @@ void sample_move_floatLE_sSs (jack_default_audio_sample_t *dst, char *src, unsig
void sample_move_dS_floatLE (char *dst, jack_default_audio_sample_t *src, unsigned long nsamples, unsigned long dst_skip, dither_state_t *state);
/* integer functions */
+void sample_move_d32_sSs (char *dst, jack_default_audio_sample_t *src, unsigned long nsamples, unsigned long dst_skip, dither_state_t *state);
+void sample_move_d32_sS (char *dst, jack_default_audio_sample_t *src, unsigned long nsamples, unsigned long dst_skip, dither_state_t *state);
void sample_move_d32u24_sSs (char *dst, jack_default_audio_sample_t *src, unsigned long nsamples, unsigned long dst_skip, dither_state_t *state);
void sample_move_d32u24_sS (char *dst, jack_default_audio_sample_t *src, unsigned long nsamples, unsigned long dst_skip, dither_state_t *state);
void sample_move_d24_sSs (char *dst, jack_default_audio_sample_t *src, unsigned long nsamples, unsigned long dst_skip, dither_state_t *state);