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

marco subversion at mplayerhq.hu
Thu Aug 16 21:37:03 CEST 2007


Author: marco
Date: Thu Aug 16 21:37:03 2007
New Revision: 895

Log:
undo interleaving, this code is wrong

Modified:
   dirac/libavcodec/dirac.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Thu Aug 16 21:37:03 2007
@@ -1635,14 +1635,12 @@ 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++) {
@@ -1650,6 +1648,25 @@ 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;
@@ -1657,35 +1674,35 @@ START_TIMER
         synthline += (synth_width << 1);
     }
     synthline = synth + (synth_height - 1) * synth_width;
-    for (x = 0; x < synth_width; x++) {
-        synthline[x - synth_width] -= (synthline[x - 2 * synth_width]
-                       + synthline[x]
-                       + 2) >> 2;
+    for (x = 0; x < synth_width; x++)
         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[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;
+
+        /* 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 - 1] += (synthline[synth_width - 2]
                                      + synthline[synth_width - 2]
                                      + 1) >> 1;



More information about the FFmpeg-soc mailing list