[FFmpeg-soc] [soc]: r887 - dirac/libavcodec/dirac.c

marco subversion at mplayerhq.hu
Thu Aug 16 17:50:08 CEST 2007


Author: marco
Date: Thu Aug 16 17:50:07 2007
New Revision: 887

Log:
interleave lifting steps for the 5/3 IDWT

Modified:
   dirac/libavcodec/dirac.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Thu Aug 16 17:50:07 2007
@@ -1623,12 +1623,14 @@ START_TIMER
          A[2*n+1] += (A[2*n] + A[2*n+2] + 1) >> 1
     */
 
-    /* Vertical synthesis: Lifting stage 1.  */
     synthline = synth;
     for (x = 0; x < synth_width; x++) {
         synthline[x] -= (synthline[synth_width + x]
                        + synthline[synth_width + x]
                        + 2) >> 2;
+        synthline[x + synth_width] += (synthline[x]
+                       + synthline[x + 2 * synth_width]
+                       + 1) >> 1;
     }
     synthline = synth + (synth_width << 1);
     for (y = 1; y < height - 1; y++) {
@@ -1636,25 +1638,6 @@ START_TIMER
             synthline[x] -= (synthline[x - synth_width]
                            + synthline[x + synth_width]
                            + 2) >> 2;
-        }
-        synthline += (synth_width << 1);
-    }
-    synthline = synth + (synth_height - 2) * synth_width;
-    for (x = 0; x < synth_width; x++) {
-        synthline[x] -= (synthline[x - synth_width]
-                       + synthline[x + synth_width]
-                       + 2) >> 2;
-    }
-
-    /* Vertical synthesis: Lifting stage 2.  */
-    synthline = synth + synth_width;
-    for (x = 0; x < synth_width; x++)
-        synthline[x] += (synthline[x - synth_width]
-                       + synthline[x + synth_width]
-                       + 1) >> 1;
-    synthline = synth + (synth_width << 1);
-    for (y = 1; y < height - 1; y++) {
-        for (x = 0; x < synth_width; x++) {
             synthline[x + synth_width] += (synthline[x]
                                          + synthline[x + synth_width * 2]
                                          + 1) >> 1;
@@ -1662,35 +1645,35 @@ START_TIMER
         synthline += (synth_width << 1);
     }
     synthline = synth + (synth_height - 1) * synth_width;
-    for (x = 0; x < synth_width; x++)
+    for (x = 0; x < synth_width; x++) {
+        synthline[x - synth_width] -= (synthline[x - 2 * synth_width]
+                       + synthline[x]
+                       + 2) >> 2;
         synthline[x] += (synthline[x - synth_width]
                        + synthline[x - synth_width]
                        + 1) >> 1;
-
+    }
 
     /* Horizontal synthesis.  */
     synthline = synth;
     for (y = 0; y < synth_height; y++) {
-
-        /* Lifting stage 1.  */
         synthline[0] -= (synthline[1]
                        + synthline[1]
                        + 2) >> 2;
+        synthline[1] += (synthline[0]
+                       + synthline[2]
+                       + 1) >> 1;
         for (x = 1; x < width - 1; x++) {
             synthline[2*x] -= (synthline[2*x - 1]
                              + synthline[2*x + 1]
                              + 2) >> 2;
-        }
-        synthline[synth_width - 2] -= (synthline[synth_width - 3]
-                                     + synthline[synth_width - 1]
-                                     + 2) >> 2;
-
-        /* Lifting stage 2.  */
-        for (x = 0; x < width - 1; x++) {
             synthline[2*x + 1] += (synthline[2*x]
                                  + synthline[2*x + 2]
                                  + 1) >> 1;
         }
+        synthline[synth_width - 2] -= (synthline[synth_width - 3]
+                                     + synthline[synth_width - 1]
+                                     + 2) >> 2;
         synthline[synth_width - 1] += (synthline[synth_width - 2]
                                      + synthline[synth_width - 2]
                                      + 1) >> 1;



More information about the FFmpeg-soc mailing list