[pulseaudio-commits] 4 commits - src/.gitignore src/Makefile.am src/modules src/pulsecore src/tests

Arun Raghavan arun at kemper.freedesktop.org
Sun Nov 13 21:37:46 PST 2011


 src/.gitignore                               |    1 
 src/Makefile.am                              |   10 --
 src/modules/echo-cancel/module-echo-cancel.c |    7 +
 src/modules/module-equalizer-sink.c          |    4 -
 src/modules/oss/oss-util.c                   |   19 +----
 src/pulsecore/vector.h                       |   98 ---------------------------
 src/tests/vector-test.c                      |   83 ----------------------
 7 files changed, 12 insertions(+), 210 deletions(-)

New commits:
commit c2976b1f872a989365171c6229d44cba1df4277e
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Wed Nov 2 21:54:15 2011 +0100

    oss: Use log2 function from core-util instead of own implementation

diff --git a/src/modules/oss/oss-util.c b/src/modules/oss/oss-util.c
index 04899af..9412a87 100644
--- a/src/modules/oss/oss-util.c
+++ b/src/modules/oss/oss-util.c
@@ -231,23 +231,14 @@ int pa_oss_auto_format(int fd, pa_sample_spec *ss) {
     return 0;
 }
 
-static int simple_log2(int v) {
-    int k = 0;
-
-    for (;;) {
-        v >>= 1;
-        if (!v) break;
-        k++;
-    }
-
-    return k;
-}
-
 int pa_oss_set_fragments(int fd, int nfrags, int frag_size) {
     int arg;
-    arg = ((int) nfrags << 16) | simple_log2(frag_size);
 
-    pa_log_debug("Asking for %i fragments of size %i (requested %i)", nfrags, 1 << simple_log2(frag_size), frag_size);
+    pa_assert(frag_size >= 0);
+
+    arg = ((int) nfrags << 16) | pa_ulog2(frag_size);
+
+    pa_log_debug("Asking for %i fragments of size %i (requested %i)", nfrags, 1 << pa_ulog2(frag_size), frag_size);
 
     if (ioctl(fd, SNDCTL_DSP_SETFRAGMENT, &arg) < 0) {
         pa_log("SNDCTL_DSP_SETFRAGMENT: %s", pa_cstrerror(errno));

commit 93f46b92c78a1e1a62738eaccb115ab9c9114d11
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Wed Nov 2 21:54:14 2011 +0100

    Squash unused variable compiler warning

diff --git a/src/modules/echo-cancel/module-echo-cancel.c b/src/modules/echo-cancel/module-echo-cancel.c
index c72c217..7db2cba 100644
--- a/src/modules/echo-cancel/module-echo-cancel.c
+++ b/src/modules/echo-cancel/module-echo-cancel.c
@@ -693,7 +693,7 @@ static void do_push_drift_comp(struct userdata *u) {
     pa_memchunk rchunk, pchunk, cchunk;
     uint8_t *rdata, *pdata, *cdata;
     float drift;
-    int unused;
+    int unused PA_GCC_UNUSED;
 
     rlen = pa_memblockq_get_length(u->source_memblockq);
     plen = pa_memblockq_get_length(u->sink_memblockq);
@@ -785,7 +785,7 @@ static void do_push(struct userdata *u) {
     size_t rlen, plen;
     pa_memchunk rchunk, pchunk, cchunk;
     uint8_t *rdata, *pdata, *cdata;
-    int unused;
+    int unused PA_GCC_UNUSED;
 
     rlen = pa_memblockq_get_length(u->source_memblockq);
     plen = pa_memblockq_get_length(u->sink_memblockq);
@@ -2017,7 +2017,8 @@ int main(int argc, char* argv[]) {
     pa_channel_map source_map, sink_map;
     pa_modargs *ma = NULL;
     uint8_t *rdata = NULL, *pdata = NULL, *cdata = NULL;
-    int ret = 0, unused, i;
+    int unused PA_GCC_UNUSED;
+    int ret = 0, i;
     char c;
     float drift;
 
diff --git a/src/modules/module-equalizer-sink.c b/src/modules/module-equalizer-sink.c
index 46bd0d7..e83a41d 100644
--- a/src/modules/module-equalizer-sink.c
+++ b/src/modules/module-equalizer-sink.c
@@ -1081,7 +1081,7 @@ int pa__init(pa_module*m) {
     pa_sink *master;
     pa_sink_input_new_data sink_input_data;
     pa_sink_new_data sink_data;
-    size_t fs, i;
+    size_t i;
     unsigned c;
     float *H;
     unsigned a_i;
@@ -1107,7 +1107,7 @@ int pa__init(pa_module*m) {
         goto fail;
     }
 
-    fs = pa_frame_size(&ss);
+    //fs = pa_frame_size(&ss);
 
     if (pa_modargs_get_value_boolean(ma, "use_volume_sharing", &use_volume_sharing) < 0) {
         pa_log("use_volume_sharing= expects a boolean argument");

commit df5483f6149bebffae37ab9a481ed2e190bf1aba
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Wed Nov 2 21:54:12 2011 +0100

    Remove vector.h and vector-test
    
    This code was never used and vectorization is handled by Orc anyway.

diff --git a/src/.gitignore b/src/.gitignore
index e7e5880..4a66969 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -69,5 +69,4 @@ thread-mainloop-test
 thread-test
 usergroup-test
 utf8-test
-vector-test
 volume-test
diff --git a/src/Makefile.am b/src/Makefile.am
index c23b8b4..5d63aec 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -219,7 +219,6 @@ TESTS_default = \
 		mainloop-test \
 		strlist-test \
 		close-test \
-		vector-test \
 		memblockq-test \
 		channelmap-test \
 		thread-mainloop-test \
@@ -414,11 +413,6 @@ volume_test_CFLAGS = $(AM_CFLAGS)
 volume_test_LDADD = $(AM_LDADD) libpulse.la libpulsecommon- at PA_MAJORMINOR@.la
 volume_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
 
-vector_test_SOURCES = tests/vector-test.c
-vector_test_CFLAGS = $(AM_CFLAGS)
-vector_test_LDADD = $(AM_LDADD) libpulsecore- at PA_MAJORMINOR@.la libpulse.la libpulsecommon- at PA_MAJORMINOR@.la
-vector_test_LDFLAGS = $(AM_LDFLAGS) $(BINLDFLAGS)
-
 channelmap_test_SOURCES = tests/channelmap-test.c
 channelmap_test_CFLAGS = $(AM_CFLAGS)
 channelmap_test_LDADD = $(AM_LDADD) libpulse.la libpulsecommon- at PA_MAJORMINOR@.la
@@ -577,7 +571,7 @@ libpulsecommon_ at PA_MAJORMINOR@_la_SOURCES = \
 		pulsecore/lock-autospawn.c pulsecore/lock-autospawn.h \
 		pulsecore/log.c pulsecore/log.h \
 		pulsecore/ratelimit.c pulsecore/ratelimit.h \
-		pulsecore/macro.h pulsecore/vector.h \
+		pulsecore/macro.h \
 		pulsecore/mcalign.c pulsecore/mcalign.h \
 		pulsecore/memblock.c pulsecore/memblock.h \
 		pulsecore/memblockq.c pulsecore/memblockq.h \
diff --git a/src/pulsecore/vector.h b/src/pulsecore/vector.h
deleted file mode 100644
index 2af79ec..0000000
--- a/src/pulsecore/vector.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/***
-  This file is part of PulseAudio.
-
-  Copyright 2004-2006 Lennart Poettering
-  Copyright 2006 Pierre Ossman <ossman at cendio.se> for Cendio AB
-
-  PulseAudio is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as published
-  by the Free Software Foundation; either version 2.1 of the License,
-  or (at your option) any later version.
-
-  PulseAudio is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with PulseAudio; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-  USA.
-***/
-
-#include <inttypes.h>
-
-/* First, define HAVE_VECTOR if we have the gcc vector extensions at all */
-#if defined(__SSE2__)
-    /* || defined(__ALTIVEC__)*/
-#define HAVE_VECTOR
-
-
-/* This is supposed to be portable to different SIMD instruction
- * sets. We define vector types for different base types: uint8_t,
- * int16_t, int32_t, float. The vector type is a union. The fields .i,
- * .u, .f are arrays for accessing the separate elements of a
- * vector. .v is a gcc vector type of the right format. .m is the
- * vector in the type the SIMD extension specific intrinsic API
- * expects. PA_xxx_VECTOR_SIZE is the size of the
- * entries. PA_xxxx_VECTOR_MAKE constructs a gcc vector variable with
- * the same value in all elements. */
-
-#ifdef __SSE2__
-
-#include <xmmintrin.h>
-#include <emmintrin.h>
-
-#define PA_UINT8_VECTOR_SIZE 16
-#define PA_INT16_VECTOR_SIZE 8
-#define PA_INT32_VECTOR_SIZE 4
-#define PA_FLOAT_VECTOR_SIZE 4
-
-#define PA_UINT8_VECTOR_MAKE(x) (pa_v16qi) { x, x, x, x, x, x, x, x, x, x, x, x, x, x, x, x }
-#define PA_INT16_VECTOR_MAKE(x) (pa_v8hi) { x, x, x, x, x, x, x, x }
-#define PA_INT32_VECTOR_MAKE(x) (pa_v4si) { x, x, x, x }
-#define PA_FLOAT_VECTOR_MAKE(x) (pa_v4fi) { x, x, x, x }
-
-#endif
-
-/* uint8_t vector */
-typedef uint8_t pa_v16qi __attribute__ ((vector_size (PA_UINT8_VECTOR_SIZE * sizeof(uint8_t))));
-typedef union pa_uint8_vector {
-    uint8_t u[PA_UINT8_VECTOR_SIZE];
-    pa_v16qi v;
-#ifdef __SSE2__
-    __m128i m;
-#endif
-} pa_uint8_vector_t;
-
-/* int16_t vector*/
-typedef int16_t pa_v8hi __attribute__ ((vector_size (PA_INT16_VECTOR_SIZE * sizeof(int16_t))));
-typedef union pa_int16_vector {
-    int16_t i[PA_INT16_VECTOR_SIZE];
-    pa_v8hi v;
-#ifdef __SSE2__
-    __m128i m;
-#endif
-} pa_int16_vector_t;
-
-/* int32_t vector */
-typedef int32_t pa_v4si __attribute__ ((vector_size (PA_INT32_VECTOR_SIZE * sizeof(int32_t))));
-typedef union pa_int32_vector {
-    int32_t i[PA_INT32_VECTOR_SIZE];
-    pa_v4si v;
-#ifdef __SSE2__
-    __m128i m;
-#endif
-} pa_int32_vector_t;
-
-/* float vector */
-typedef float pa_v4sf __attribute__ ((vector_size (PA_FLOAT_VECTOR_SIZE * sizeof(float))));
-typedef union pa_float_vector {
-    float f[PA_FLOAT_VECTOR_SIZE];
-    pa_v4sf v;
-#ifdef __SSE2__
-    __m128 m;
-#endif
-} pa_float_vector_t;
-
-#endif
diff --git a/src/tests/vector-test.c b/src/tests/vector-test.c
deleted file mode 100644
index 7494348..0000000
--- a/src/tests/vector-test.c
+++ /dev/null
@@ -1,83 +0,0 @@
-/***
-  This file is part of PulseAudio.
-
-  Copyright 2009 Lennart Poettering
-
-  PulseAudio is free software; you can redistribute it and/or modify
-  it under the terms of the GNU Lesser General Public License as
-  published by the Free Software Foundation; either version 2.1 of the
-  License, or (at your option) any later version.
-
-  PulseAudio is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public
-  License along with PulseAudio; if not, write to the Free Software
-  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
-  USA.
-***/
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <pulsecore/vector.h>
-#include <pulsecore/log.h>
-
-int main(int argc, char *argv[]) {
-
-#ifdef __SSE2__
-    pa_int16_vector_t input, zero;
-    pa_int32_vector_t unpacked1, unpacked2;
-    pa_int32_vector_t volume1, volume2, volume1_hi, volume1_lo, volume2_hi, volume2_lo, reduce, mask;
-    pa_int16_vector_t output;
-
-    unsigned u;
-
-    zero.v = PA_INT16_VECTOR_MAKE(0);
-    reduce.v = PA_INT32_VECTOR_MAKE(0x10000);
-    volume1.v = volume2.v = PA_INT32_VECTOR_MAKE(0x10000*2+7);
-    mask.v = PA_INT32_VECTOR_MAKE(0xFFFF);
-
-    volume1_lo.m = _mm_and_si128(volume1.m, mask.m);
-    volume2_lo.m = _mm_and_si128(volume2.m, mask.m);
-    volume1_hi.m = _mm_srli_epi32(volume1.m, 16);
-    volume2_hi.m = _mm_srli_epi32(volume2.m, 16);
-
-    input.v = PA_INT16_VECTOR_MAKE(32000);
-
-    for (u = 0; u < PA_INT16_VECTOR_SIZE; u++)
-        pa_log("input=%i\n", input.i[u]);
-
-    unpacked1.m = _mm_unpackhi_epi16(zero.m, input.m);
-    unpacked2.m = _mm_unpacklo_epi16(zero.m, input.m);
-
-    for (u = 0; u < PA_INT32_VECTOR_SIZE; u++)
-        pa_log("unpacked1=%i\n", unpacked1.i[u]);
-
-    unpacked1.v /= reduce.v;
-    unpacked2.v /= reduce.v;
-
-    for (u = 0; u < PA_INT32_VECTOR_SIZE; u++)
-        pa_log("unpacked1=%i\n", unpacked1.i[u]);
-
-    for (u = 0; u < PA_INT32_VECTOR_SIZE; u++)
-        pa_log("volume1=%i\n", volume1.i[u]);
-
-    unpacked1.v = (unpacked1.v * volume1_lo.v) / reduce.v + unpacked1.v * volume1_hi.v;
-    unpacked2.v = (unpacked2.v * volume2_lo.v) / reduce.v + unpacked2.v * volume2_hi.v;
-
-    for (u = 0; u < PA_INT32_VECTOR_SIZE; u++)
-        pa_log("unpacked1=%i\n", unpacked1.i[u]);
-
-    output.m = _mm_packs_epi32(unpacked1.m, unpacked2.m);
-
-    for (u = 0; u < PA_INT16_VECTOR_SIZE; u++)
-        pa_log("output=%i\n", output.i[u]);
-
-#endif
-
-    return 0;
-}

commit ebd6aa594e4523d68d64552fd34e750a1ba61166
Author: Maarten Bosmans <mkbosmans at gmail.com>
Date:   Wed Oct 19 14:10:13 2011 +0200

    build-sys: Remove time-smoother and shm from libpulsecore
    
    As they are already included in libpulsecommon.

diff --git a/src/Makefile.am b/src/Makefile.am
index b4930d4..c23b8b4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -830,7 +830,6 @@ libpulsecore_ at PA_MAJORMINOR@_la_SOURCES = \
 		pulsecore/sconv_sse.c \
 		pulsecore/sconv.c pulsecore/sconv.h \
 		pulsecore/shared.c pulsecore/shared.h \
-		pulsecore/shm.c pulsecore/shm.h \
 		pulsecore/sink-input.c pulsecore/sink-input.h \
 		pulsecore/sink.c pulsecore/sink.h \
 		pulsecore/sioman.c pulsecore/sioman.h \
@@ -840,7 +839,6 @@ libpulsecore_ at PA_MAJORMINOR@_la_SOURCES = \
 		pulsecore/source.c pulsecore/source.h \
 		pulsecore/start-child.c pulsecore/start-child.h \
 		pulsecore/thread-mq.c pulsecore/thread-mq.h \
-		pulsecore/time-smoother.c pulsecore/time-smoother.h \
 		pulsecore/database.h
 
 libpulsecore_ at PA_MAJORMINOR@_la_CFLAGS = $(AM_CFLAGS) $(SERVER_CFLAGS) $(LIBSAMPLERATE_CFLAGS) $(LIBSPEEX_CFLAGS) $(LIBSNDFILE_CFLAGS) $(WINSOCK_CFLAGS)



More information about the pulseaudio-commits mailing list