aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-17 14:45:15 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-17 15:07:50 +0200
commit9841024402e83e0d239edf4f356d97e0519aaf4d (patch)
tree7d539adbed9d3ac97957320569ea61db3414829d
parent63eaf529bcfa2f685f5978d4ba4d327ac837c2e2 (diff)
downloadffmpeg-9841024402e83e0d239edf4f356d97e0519aaf4d.tar.gz
avcodec/jpeg2000dwt: More special cases to handle singularities in 9/7 decode
Fixes Ticket4634 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/jpeg2000dwt.c4
-rw-r--r--tests/ref/vsynth/vsynth1-jpeg2000-974
-rw-r--r--tests/ref/vsynth/vsynth2-jpeg2000-974
-rw-r--r--tests/ref/vsynth/vsynth_lena-jpeg2000-974
4 files changed, 10 insertions, 6 deletions
diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index 225b08f3ef..511f223718 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -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;
}
diff --git a/tests/ref/vsynth/vsynth1-jpeg2000-97 b/tests/ref/vsynth/vsynth1-jpeg2000-97
index a8e9bf8d93..2d3e16c55d 100644
--- a/tests/ref/vsynth/vsynth1-jpeg2000-97
+++ b/tests/ref/vsynth/vsynth1-jpeg2000-97
@@ -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
diff --git a/tests/ref/vsynth/vsynth2-jpeg2000-97 b/tests/ref/vsynth/vsynth2-jpeg2000-97
index 21ab8ad5d0..e59811d839 100644
--- a/tests/ref/vsynth/vsynth2-jpeg2000-97
+++ b/tests/ref/vsynth/vsynth2-jpeg2000-97
@@ -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
diff --git a/tests/ref/vsynth/vsynth_lena-jpeg2000-97 b/tests/ref/vsynth/vsynth_lena-jpeg2000-97
index 5945ac7dce..cb839c3f26 100644
--- a/tests/ref/vsynth/vsynth_lena-jpeg2000-97
+++ b/tests/ref/vsynth/vsynth_lena-jpeg2000-97
@@ -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