Author: post
Date: 2009-10-13 12:45:50 +0200 (Tue, 13 Oct 2009)
New Revision: 2707

Modified:
   trunk/plugins/resample/resample.c
Log:
Resampler: Don't add fraction, since SSE2 conversion does this automatically. 
Move constants out out loop.

Modified: trunk/plugins/resample/resample.c
===================================================================
--- trunk/plugins/resample/resample.c   2009-10-13 00:47:36 UTC (rev 2706)
+++ trunk/plugins/resample/resample.c   2009-10-13 10:45:50 UTC (rev 2707)
@@ -737,12 +737,13 @@
        /* 24 pixels = 48 bytes/loop */
        gint end_x_sse = (end_x/24)*24;
        
-       /* Rounder after accumulation, half because input is scaled down */
-       gint add_round_sub = (FPScale >> 2);
        /* Subtract 32768 as it would appear after shift */
-       add_round_sub -= (32768 << (FPScaleShift-1));
+       gint add_round_sub = (32768 << (FPScaleShift-1));
        /* 0.5 pixel value is lost to rounding times fir_filter_size, 
compensate */
        add_round_sub += fir_filter_size * (FPScale >> 2);
+       
+       __m128i add_32 = _mm_set_epi32(add_round_sub, add_round_sub, 
add_round_sub, add_round_sub);
+       __m128i signxor = _mm_set_epi32(0x80008000, 0x80008000, 0x80008000, 
0x80008000);
 
        for (y = 0; y < new_size ; y++)
        {
@@ -802,8 +803,6 @@
                                acc2 = _mm_add_epi32(acc2, src2i);
                                acc3 = _mm_add_epi32(acc3, src3i);
                        }
-                       __m128i add_32 = _mm_set_epi32(add_round_sub, 
add_round_sub, add_round_sub, add_round_sub);
-                       __m128i signxor = _mm_set_epi32(0x80008000, 0x80008000, 
0x80008000, 0x80008000);
                        
                        /* Add rounder and subtract 32768 */
                        acc1_h = _mm_add_epi32(acc1_h, add_32);


_______________________________________________
Rawstudio-commit mailing list
[email protected]
http://rawstudio.org/cgi-bin/mailman/listinfo/rawstudio-commit

Reply via email to