diff vp3.c @ 1984:ef919e9ef73e libavcodec

separate out put_signed_pixels_clamped() into its own function and implement an optimized MMX version of the function
author melanson
date Tue, 27 Apr 2004 03:58:06 +0000
parents 89422281f6f6
children 141a9539e270
line wrap: on
line diff
--- a/vp3.c	Mon Apr 26 21:46:01 2004 +0000
+++ b/vp3.c	Tue Apr 27 03:58:06 2004 +0000
@@ -2061,10 +2061,6 @@
     int motion_halfpel_index;
     uint8_t *motion_source;
 
-    int16_t *op;
-    uint8_t *dest;
-    int j, k;
-
     debug_vp3("  vp3: rendering final fragments for %s\n",
         (plane == 0) ? "Y plane" : (plane == 1) ? "U plane" : "V plane");
 
@@ -2186,22 +2182,9 @@
                     s->all_fragments[i].coeff_count,
                     output_samples);
                 if (s->all_fragments[i].coding_method == MODE_INTRA) {
-                    /* this really needs to be optimized sooner or later */
-                    op = output_samples;
-                    dest = output_plane + s->all_fragments[i].first_pixel;
-                    for (j = 0; j < 8; j++) {
-                        for (k = 0; k < 8; k++) {
-                            if (*op < -128)
-                                *dest = 0;
-                            else if (*op > 127)
-                                *dest = 255;
-                            else
-                                *dest = (uint8_t)(*op + 128);
-                            op++;
-                            dest++;
-                        }
-                        dest += (stride - 8);
-                    }
+                    s->dsp.put_signed_pixels_clamped(output_samples,
+                        output_plane + s->all_fragments[i].first_pixel,
+                        stride);
                 } else {
                     s->dsp.add_pixels_clamped(output_samples,
                         output_plane + s->all_fragments[i].first_pixel,