[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v0.9.19-582-g4d84a00

Colin Guthrie gitmailer-noreply at 0pointer.de
Wed Oct 13 06:52:18 PDT 2010


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  489f50e2f4160f1368df38657bb91e77fd52c861 (commit)

- Log -----------------------------------------------------------------
4d84a00 SSE/MMX/ARM: Fix high frequency noise with unusual number of channels
-----------------------------------------------------------------------

Summary of changes:
 src/pulsecore/svolume_arm.c |    5 ++++-
 src/pulsecore/svolume_mmx.c |   14 ++++++++------
 src/pulsecore/svolume_sse.c |   19 +++++++++++++------
 3 files changed, 25 insertions(+), 13 deletions(-)

-----------------------------------------------------------------------

commit 4d84a00b495c44a9e348534bf754ace823c9abe8
Author: David Henningsson <david.henningsson at canonical.com>
Date:   Fri Oct 8 18:47:00 2010 +0200

    SSE/MMX/ARM: Fix high frequency noise with unusual number of channels
    
    In the assembly optimized versions of SSE, a noise could occur when the
    number of channels were 3,5,6 or 7. For MMX and ARM, this could occur
    when the number of channels were 3.
    
    Signed-off-by: David Henningsson <david.henningsson at canonical.com>

diff --git a/src/pulsecore/svolume_arm.c b/src/pulsecore/svolume_arm.c
index 5bd1448..fdd8f09 100644
--- a/src/pulsecore/svolume_arm.c
+++ b/src/pulsecore/svolume_arm.c
@@ -47,7 +47,10 @@ pa_volume_s16ne_arm (int16_t *samples, int32_t *volumes, unsigned channels, unsi
 {
     int32_t *ve;
 
-    channels = PA_MAX (4U, channels);
+    /* Channels must be at least 4, and always a multiple of the original number.
+     * This is also the max amount we overread the volume array, which should
+     * have enough padding. */
+    channels = channels == 3 ? 6 : PA_MAX (4U, channels);
     ve = volumes + channels;
 
     __asm__ __volatile__ (
diff --git a/src/pulsecore/svolume_mmx.c b/src/pulsecore/svolume_mmx.c
index 0e222cd..3e2992a 100644
--- a/src/pulsecore/svolume_mmx.c
+++ b/src/pulsecore/svolume_mmx.c
@@ -100,9 +100,10 @@ pa_volume_s16ne_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi
 {
     pa_reg_x86 channel, temp;
 
-    /* the max number of samples we process at a time, this is also the max amount
-     * we overread the volume array, which should have enough padding. */
-    channels = PA_MAX (4U, channels);
+    /* Channels must be at least 4, and always a multiple of the original number.
+     * This is also the max amount we overread the volume array, which should
+     * have enough padding. */
+    channels = channels == 3 ? 6 : PA_MAX (4U, channels);
 
     __asm__ __volatile__ (
         " xor %3, %3                    \n\t"
@@ -166,9 +167,10 @@ pa_volume_s16re_mmx (int16_t *samples, int32_t *volumes, unsigned channels, unsi
 {
     pa_reg_x86 channel, temp;
 
-    /* the max number of samples we process at a time, this is also the max amount
-     * we overread the volume array, which should have enough padding. */
-    channels = PA_MAX (4U, channels);
+    /* Channels must be at least 4, and always a multiple of the original number.
+     * This is also the max amount we overread the volume array, which should
+     * have enough padding. */
+    channels = channels == 3 ? 6 : PA_MAX (4U, channels);
 
     __asm__ __volatile__ (
         " xor %3, %3                    \n\t"
diff --git a/src/pulsecore/svolume_sse.c b/src/pulsecore/svolume_sse.c
index 620524f..200482e 100644
--- a/src/pulsecore/svolume_sse.c
+++ b/src/pulsecore/svolume_sse.c
@@ -76,14 +76,19 @@
       " por %%xmm4, "#s1"            \n\t" /* .. |  l  h |  */ \
       " por %%xmm5, "#s2"            \n\t"
 
+
+static int channel_overread_table[8] = {8,8,8,12,8,10,12,14};
+
 static void
 pa_volume_s16ne_sse2 (int16_t *samples, int32_t *volumes, unsigned channels, unsigned length)
 {
     pa_reg_x86 channel, temp;
 
-    /* the max number of samples we process at a time, this is also the max amount
-     * we overread the volume array, which should have enough padding. */
-    channels = PA_MAX (8U, channels);
+    /* Channels must be at least 8 and always a multiple of the original number.
+     * This is also the max amount we overread the volume array, which should
+     * have enough padding. */
+    if (channels < 8)
+        channels = channel_overread_table[channels];
 
     __asm__ __volatile__ (
         " xor %3, %3                    \n\t"
@@ -161,9 +166,11 @@ pa_volume_s16re_sse2 (int16_t *samples, int32_t *volumes, unsigned channels, uns
 {
     pa_reg_x86 channel, temp;
 
-    /* the max number of samples we process at a time, this is also the max amount
-     * we overread the volume array, which should have enough padding. */
-    channels = PA_MAX (8U, channels);
+    /* Channels must be at least 8 and always a multiple of the original number.
+     * This is also the max amount we overread the volume array, which should
+     * have enough padding. */
+    if (channels < 8)
+        channels = channel_overread_table[channels];
 
     __asm__ __volatile__ (
         " xor %3, %3                    \n\t"

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list