]> code.delx.au - pulseaudio/commitdiff
remap: fix check when to apply specialized code path
authorPeter Meerwald <p.meerwald@bct-electronic.com>
Thu, 28 Mar 2013 13:46:49 +0000 (14:46 +0100)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 29 Mar 2013 08:48:26 +0000 (10:48 +0200)
the specialized code path just duplicate samples, so are only
applicable if the volume in map_table is == 1.0 (or == 0x10000);
don't use them for volumes >= 1.0

compare the integer version of the volume stored in map_table;
comparing floats is ugly (als leads to compiler warnings)

Signed-off-by: Peter Meerwald <p.meerwald@bct-electronic.com>
src/pulsecore/remap.c
src/pulsecore/remap_mmx.c
src/pulsecore/remap_sse.c

index b831f78c6c3cad35c9c22a707d07e7163aca7912..5d0cd62cf8d9603f50514ff49dc7a901b394e17f 100644 (file)
@@ -27,6 +27,7 @@
 #include <string.h>
 
 #include <pulse/sample.h>
+#include <pulse/volume.h>
 #include <pulsecore/log.h>
 #include <pulsecore/macro.h>
 
@@ -168,7 +169,7 @@ static void init_remap_c(pa_remap_t *m) {
 
     /* find some common channel remappings, fall back to full matrix operation. */
     if (n_ic == 1 && n_oc == 2 &&
-            m->map_table_f[0][0] >= 1.0 && m->map_table_f[1][0] >= 1.0) {
+            m->map_table_i[0][0] == PA_VOLUME_NORM && m->map_table_i[1][0] == PA_VOLUME_NORM) {
         m->do_remap = (pa_do_remap_func_t) remap_mono_to_stereo_c;
         pa_log_info("Using mono to stereo remapping");
     } else {
index 9a69ada44e0b1381cd1203a0cd213d99f970d397..5b3f0f9c3e5a8264c110696a7d8e159b92a9db94 100644 (file)
@@ -25,6 +25,7 @@
 #endif
 
 #include <pulse/sample.h>
+#include <pulse/volume.h>
 #include <pulsecore/log.h>
 #include <pulsecore/macro.h>
 
@@ -139,7 +140,7 @@ static void init_remap_mmx(pa_remap_t *m) {
 
     /* find some common channel remappings, fall back to full matrix operation. */
     if (n_ic == 1 && n_oc == 2 &&
-            m->map_table_f[0][0] >= 1.0 && m->map_table_f[1][0] >= 1.0) {
+            m->map_table_i[0][0] == PA_VOLUME_NORM && m->map_table_i[1][0] == PA_VOLUME_NORM) {
         m->do_remap = (pa_do_remap_func_t) remap_mono_to_stereo_mmx;
         pa_log_info("Using MMX mono to stereo remapping");
     }
index dd49eb672b3c0750e8f07ae3764bbe36a2ae0b75..883172351f219b8ee01ba7d2519994f7886b3a43 100644 (file)
@@ -25,6 +25,7 @@
 #endif
 
 #include <pulse/sample.h>
+#include <pulse/volume.h>
 #include <pulsecore/log.h>
 #include <pulsecore/macro.h>
 
@@ -138,7 +139,7 @@ static void init_remap_sse2(pa_remap_t *m) {
 
     /* find some common channel remappings, fall back to full matrix operation. */
     if (n_ic == 1 && n_oc == 2 &&
-            m->map_table_f[0][0] >= 1.0 && m->map_table_f[1][0] >= 1.0) {
+            m->map_table_i[0][0] == PA_VOLUME_NORM && m->map_table_i[1][0] == PA_VOLUME_NORM) {
         m->do_remap = (pa_do_remap_func_t) remap_mono_to_stereo_sse2;
         pa_log_info("Using SSE2 mono to stereo remapping");
     }