[pulseaudio-commits] r2319 - /branches/glitch-free/src/pulsecore/sample-util.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu May 1 12:13:54 PDT 2008


Author: lennart
Date: Thu May  1 21:13:53 2008
New Revision: 2319

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=2319&root=pulseaudio&view=rev
Log:
port pa_sample_clamp() to liboil

Modified:
    branches/glitch-free/src/pulsecore/sample-util.c

Modified: branches/glitch-free/src/pulsecore/sample-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/glitch-free/src/pulsecore/sample-util.c?rev=2319&root=pulseaudio&r1=2318&r2=2319&view=diff
==============================================================================
--- branches/glitch-free/src/pulsecore/sample-util.c (original)
+++ branches/glitch-free/src/pulsecore/sample-util.c Thu May  1 21:13:53 2008
@@ -1013,12 +1013,8 @@
     d = dst;
 
     if (format == PA_SAMPLE_FLOAT32NE) {
-        for (; n > 0; n--) {
-            *d = PA_CLAMP_UNLIKELY(*s, -1.0, 1.0);
-
-            s = (const float*) ((const uint8_t*) s + sstr);
-            d = (float*) ((uint8_t*) d + dstr);
-        }
+        const static float minus_one = -1.0, plus_one = 1.0;
+        oil_clip_f32(dst, dstr, src, sstr, n, &minus_one, &plus_one);
     } else
         for (; n > 0; n--) {
             float f;




More information about the pulseaudio-commits mailing list