aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-27 19:57:42 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-27 19:57:42 +0200
commit1bbb46ff7126d71256b710645acf6cbfad857a23 (patch)
tree4987f9ca056e5a41983117fd4b628fe8f44624f5
parentee189701a6f7fec56570ee3728d5d80378cbadd3 (diff)
downloadffmpeg-1bbb46ff7126d71256b710645acf6cbfad857a23.tar.gz
j2k_dwt: fix scaling of 9/7 dwt
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/j2k_dwt.c16
-rw-r--r--tests/ref/vsynth/vsynth1-j2k-978
-rw-r--r--tests/ref/vsynth/vsynth2-j2k-978
3 files changed, 16 insertions, 16 deletions
diff --git a/libavcodec/j2k_dwt.c b/libavcodec/j2k_dwt.c
index 6f1457fc22..8494ecd9fc 100644
--- a/libavcodec/j2k_dwt.c
+++ b/libavcodec/j2k_dwt.c
@@ -160,9 +160,9 @@ static void dwt_encode97(DWTContext *s, int *t)
// copy back and deinterleave
for (i = mh; i < lh; i+=2, j++)
- t[w*lp + j] = scale97[mh] * l[i] / 2;
+ t[w*lp + j] = scale97[0] * l[i] / 2;
for (i = 1-mh; i < lh; i+=2, j++)
- t[w*lp + j] = scale97[mh] * l[i] / 2;
+ t[w*lp + j] = scale97[1] * l[i] / 2;
}
// VER_SD
@@ -177,9 +177,9 @@ static void dwt_encode97(DWTContext *s, int *t)
// copy back and deinterleave
for (i = mv; i < lv; i+=2, j++)
- t[w*j + lp] = scale97[mv] * l[i] / 2;
+ t[w*j + lp] = scale97[0] * l[i] / 2;
for (i = 1-mv; i < lv; i+=2, j++)
- t[w*j + lp] = scale97[mv] * l[i] / 2;
+ t[w*j + lp] = scale97[1] * l[i] / 2;
}
}
}
@@ -288,9 +288,9 @@ static void dwt_decode97(DWTContext *s, int *t)
int i, j = 0;
// copy with interleaving
for (i = mh; i < lh; i+=2, j++)
- l[i] = scale97[1-mh] * t[w*lp + j];
+ l[i] = scale97[1] * t[w*lp + j];
for (i = 1-mh; i < lh; i+=2, j++)
- l[i] = scale97[1-mh] * t[w*lp + j];
+ l[i] = scale97[0] * t[w*lp + j];
sr_1d97(line, mh, mh + lh);
@@ -304,9 +304,9 @@ static void dwt_decode97(DWTContext *s, int *t)
int i, j = 0;
// copy with interleaving
for (i = mv; i < lv; i+=2, j++)
- l[i] = scale97[1-mv] * t[w*j + lp];
+ l[i] = scale97[1] * t[w*j + lp];
for (i = 1-mv; i < lv; i+=2, j++)
- l[i] = scale97[1-mv] * t[w*j + lp];
+ l[i] = scale97[0] * t[w*j + lp];
sr_1d97(line, mv, mv + lv);
diff --git a/tests/ref/vsynth/vsynth1-j2k-97 b/tests/ref/vsynth/vsynth1-j2k-97
index fb1ad8b023..5b564c649a 100644
--- a/tests/ref/vsynth/vsynth1-j2k-97
+++ b/tests/ref/vsynth/vsynth1-j2k-97
@@ -1,4 +1,4 @@
-a8e2db2dc6fcd4c9ea3150dc8d6d7619 *tests/data/fate/vsynth1-j2k-97.avi
-2963264 tests/data/fate/vsynth1-j2k-97.avi
-68f26a8d366fce47cbd003cadc861cd8 *tests/data/fate/vsynth1-j2k-97.out.rawvideo
-stddev: 7.66 PSNR: 30.44 MAXDIFF: 58 bytes: 7603200/ 7603200
+fc02bacb438c091a96ab327ab7aca5f9 *tests/data/fate/vsynth1-j2k-97.avi
+2034146 tests/data/fate/vsynth1-j2k-97.avi
+5975c315f9fd79e57e26bda1f749e8f6 *tests/data/fate/vsynth1-j2k-97.out.rawvideo
+stddev: 8.77 PSNR: 29.26 MAXDIFF: 104 bytes: 7603200/ 7603200
diff --git a/tests/ref/vsynth/vsynth2-j2k-97 b/tests/ref/vsynth/vsynth2-j2k-97
index b799d18106..27562e7817 100644
--- a/tests/ref/vsynth/vsynth2-j2k-97
+++ b/tests/ref/vsynth/vsynth2-j2k-97
@@ -1,4 +1,4 @@
-245c0ab429b553b39cac5989bb23c0ce *tests/data/fate/vsynth2-j2k-97.avi
-1444170 tests/data/fate/vsynth2-j2k-97.avi
-61c52045d566b70886113e2aeb8ddde4 *tests/data/fate/vsynth2-j2k-97.out.rawvideo
-stddev: 7.13 PSNR: 31.06 MAXDIFF: 53 bytes: 7603200/ 7603200
+316ae4cce1ba8cf0b359c9d25322711f *tests/data/fate/vsynth2-j2k-97.avi
+1005146 tests/data/fate/vsynth2-j2k-97.avi
+b7826bc75f9c04754d12fa01b3e69a4a *tests/data/fate/vsynth2-j2k-97.out.rawvideo
+stddev: 7.91 PSNR: 30.16 MAXDIFF: 64 bytes: 7603200/ 7603200