[pulseaudio-commits] r2040 - in /trunk/src: modules/module-ladspa-sink.c pulsecore/sample-util.c pulsecore/sconv.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Fri Nov 9 06:20:13 PST 2007


Author: lennart
Date: Fri Nov  9 15:20:12 2007
New Revision: 2040

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2040&root=pulseaudio&view=rev
Log:
replace a few CLAMPs by PA_CLAMP_UNLIKELY

Modified:
    trunk/src/modules/module-ladspa-sink.c
    trunk/src/pulsecore/sample-util.c
    trunk/src/pulsecore/sconv.c

Modified: trunk/src/modules/module-ladspa-sink.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/module-ladspa-sink.c?rev=2040&root=pulseaudio&r1=2039&r2=2040&view=diff
==============================================================================
--- trunk/src/modules/module-ladspa-sink.c (original)
+++ trunk/src/modules/module-ladspa-sink.c Fri Nov  9 15:20:12 2007
@@ -177,14 +177,14 @@
             p = src + c;
             q = u->input;
             for (j = 0; j < n; j++, p += u->channels, q++)
-                *q = CLAMP(*p, -1.0, 1.0);
+                *q = PA_CLAMP_UNLIKELY(*p, -1.0, 1.0);
 
             u->descriptor->run(u->handle[c], n);
 
             q = u->output;
             p = dst + c;
             for (j = 0; j < n; j++, q++, p += u->channels)
-                *p = CLAMP(*q, -1.0, 1.0);
+                *p = PA_CLAMP_UNLIKELY(*q, -1.0, 1.0);
         }
 
         pa_memblock_release(tchunk.memblock);

Modified: trunk/src/pulsecore/sample-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/sample-util.c?rev=2040&root=pulseaudio&r1=2039&r2=2040&view=diff
==============================================================================
--- trunk/src/pulsecore/sample-util.c (original)
+++ trunk/src/pulsecore/sample-util.c Fri Nov  9 15:20:12 2007
@@ -178,7 +178,7 @@
                     if (volume->values[channel] != PA_VOLUME_NORM)
                         sum = (int32_t) (sum * pa_sw_volume_to_linear(volume->values[channel]));
 
-                    sum = CLAMP(sum, -0x8000, 0x7FFF);
+                    sum = PA_CLAMP_UNLIKELY(sum, -0x8000, 0x7FFF);
                 }
 
                 *((int16_t*) data) = (int16_t) sum;
@@ -225,7 +225,7 @@
                     if (volume->values[channel] != PA_VOLUME_NORM)
                         sum = (int32_t) (sum * pa_sw_volume_to_linear(volume->values[channel]));
 
-                    sum = CLAMP(sum, -0x8000, 0x7FFF);
+                    sum = PA_CLAMP_UNLIKELY(sum, -0x8000, 0x7FFF);
                 }
 
                 *((int16_t*) data) = PA_INT16_SWAP((int16_t) sum);
@@ -272,7 +272,7 @@
                     if (volume->values[channel] != PA_VOLUME_NORM)
                         sum = (int32_t) (sum * pa_sw_volume_to_linear(volume->values[channel]));
 
-                    sum = CLAMP(sum, -0x80, 0x7F);
+                    sum = PA_CLAMP_UNLIKELY(sum, -0x80, 0x7F);
                 }
 
                 *((uint8_t*) data) = (uint8_t) (sum + 0x80);

Modified: trunk/src/pulsecore/sconv.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/sconv.c?rev=2040&root=pulseaudio&r1=2039&r2=2040&view=diff
==============================================================================
--- trunk/src/pulsecore/sconv.c (original)
+++ trunk/src/pulsecore/sconv.c Fri Nov  9 15:20:12 2007
@@ -130,7 +130,7 @@
 
     for (; n > 0; n--) {
         float v = *(a++);
-        v = CLAMP(v, -1, 1);
+        v = PA_CLAMP_UNLIKELY(v, -1, 1);
         v *= 0x1FFF;
         *(b++) = st_14linear2ulaw((int16_t) v);
     }
@@ -168,7 +168,7 @@
 
     for (; n > 0; n--, a++, b++) {
         float v = *a;
-        v = CLAMP(v, -1, 1);
+        v = PA_CLAMP_UNLIKELY(v, -1, 1);
         v *= 0xFFF;
         *b = st_13linear2alaw((int16_t) v);
     }




More information about the pulseaudio-commits mailing list