avcodec/jpeg2000dwt: More special cases to handle singularities in 9/7 decode
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 17 Jun 2015 12:45:15 +0000 (14:45 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 17 Jun 2015 13:07:50 +0000 (15:07 +0200)
Fixes Ticket4634

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/jpeg2000dwt.c
tests/ref/vsynth/vsynth1-jpeg2000-97
tests/ref/vsynth/vsynth2-jpeg2000-97
tests/ref/vsynth/vsynth_lena-jpeg2000-97

index 225b08f..511f223 100644 (file)
@@ -365,6 +365,8 @@ static void sr_1d97_float(float *p, int i0, int i1)
     if (i1 <= i0 + 1) {
         if (i0 == 1)
             p[1] *= F_LFTG_K/2;
+        else
+            p[0] *= F_LFTG_X/2;
         return;
     }
 
@@ -440,6 +442,8 @@ static void sr_1d97_int(int32_t *p, int i0, int i1)
     if (i1 <= i0 + 1) {
         if (i0 == 1)
             p[1] = (p[1] * I_LFTG_K + (1<<16)) >> 17;
+        else
+            p[0] = (p[0] * I_LFTG_X + (1<<16)) >> 17;
         return;
     }
 
index a8e9bf8..2d3e16c 100644 (file)
@@ -1,4 +1,4 @@
 dfb35e733795195c6519ecc37e953931 *tests/data/fate/vsynth1-jpeg2000-97.avi
 2243136 tests/data/fate/vsynth1-jpeg2000-97.avi
-e1a095b40d7f6440f6c46f2995c4759c *tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
-stddev:    6.23 PSNR: 32.23 MAXDIFF:   75 bytes:  7603200/  7603200
+30a9c13e18fe4acaf28062b5003bb671 *tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
+stddev:    6.41 PSNR: 31.99 MAXDIFF:   75 bytes:  7603200/  7603200
index 21ab8ad..e59811d 100644 (file)
@@ -1,4 +1,4 @@
 f8880f48a46ad43623d00de15ecba2cd *tests/data/fate/vsynth2-jpeg2000-97.avi
 1467472 tests/data/fate/vsynth2-jpeg2000-97.avi
-e523db4385f586d73aa0ee2688a75d2e *tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
-stddev:    5.44 PSNR: 33.41 MAXDIFF:   57 bytes:  7603200/  7603200
+9ec4f90641d5d0e6424184b654923676 *tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
+stddev:    6.32 PSNR: 32.11 MAXDIFF:   57 bytes:  7603200/  7603200
index 5945ac7..cb839c3 100644 (file)
@@ -1,4 +1,4 @@
 ba27504dcabe43d6608798c9cadc5cca *tests/data/fate/vsynth_lena-jpeg2000-97.avi
 1118956 tests/data/fate/vsynth_lena-jpeg2000-97.avi
-8ac8b9ee81fa73c873668e9f6b78764d *tests/data/fate/vsynth_lena-jpeg2000-97.out.rawvideo
-stddev:    4.95 PSNR: 34.23 MAXDIFF:   60 bytes:  7603200/  7603200
+9d69ac6d46152ed2d6dd6a90d5793c80 *tests/data/fate/vsynth_lena-jpeg2000-97.out.rawvideo
+stddev:    5.32 PSNR: 33.61 MAXDIFF:   60 bytes:  7603200/  7603200