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

marco subversion at mplayerhq.hu
Tue Jul 24 12:41:16 CEST 2007


Author: marco
Date: Tue Jul 24 12:41:16 2007
New Revision: 521

Log:
For the IDWT, start in the top left corner instead of the bottom right corner. Now the code matches the description in the specification.


Modified:
   dirac/libavcodec/dirac.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Tue Jul 24 12:41:16 2007
@@ -1046,8 +1046,8 @@ static int dirac_subband_idwt(AVCodecCon
     */
 
     /* Vertical synthesis: Lifting stage 1.  */
-    for (y = height-1; y >= 0; y--) {
-        for (x = synth_width - 1; x >= 0; x--) {
+    for (y = 0; y < height; y++) {
+        for (x = 0; x < synth_width; x++) {
             synth[POS(x, 2*y)] -= (    synth[VSYNTH_EVEN_POS(x, 2*y - 1)]
                                      + synth[VSYNTH_EVEN_POS(x, 2*y + 1)]
                                      + 2) >> 2;
@@ -1055,8 +1055,8 @@ static int dirac_subband_idwt(AVCodecCon
     }
 
     /* Vertical synthesis: Lifting stage 2.  */
-    for (y = height-1; y >= 0; y--) {
-        for (x = synth_width-1; x >= 0; x--) {
+    for (y = 0; y < height; y++) {
+        for (x = 0; x < synth_width; x++) {
             synth[POS(x, 2*y + 1)] += (     -synth[VSYNTH_ODD_POS(x, 2*y - 2)]
                                        + 9 * synth[VSYNTH_ODD_POS(x, 2*y)]
                                        + 9 * synth[VSYNTH_ODD_POS(x, 2*y + 2)]
@@ -1066,16 +1066,16 @@ static int dirac_subband_idwt(AVCodecCon
     }
 
     /* Horizontal synthesis.  */
-    for (y = synth_height-1; y >= 0; y--) {
+    for (y = 0; y < synth_height; y++) {
         /* Lifting stage 1.  */
-        for (x = width-1; x > 0; x--) {
+        for (x = 0; x < width; x++) {
             synth[POS(2*x, y)] -= (    synth[HSYNTH_EVEN_POS(2*x - 1, y)]
                                      + synth[HSYNTH_EVEN_POS(2*x + 1, y)]
                                      + 2) >> 2;
         }
 
         /* Lifting stage 2.  */
-        for (x = width-1; x >= 0; x--) {
+        for (x = 0; x < width; x++) {
             synth[POS(2*x + 1, y)] += (     -synth[HSYNTH_ODD_POS(2*x - 2, y)]
                                        + 9 * synth[HSYNTH_ODD_POS(2*x, y)]
                                        + 9 * synth[HSYNTH_ODD_POS(2*x + 2, y)]



More information about the FFmpeg-soc mailing list