Commit 8a266aaa authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/jpeg2000dwt: merge rescaling with interleave in 9/7 int IDWT

Tha fate tests change because the edge mirroring was wrong before this commit
Reviewed-by: 's avatarNicolas BERTRAND <nicoinattendu@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 96b71a6e
...@@ -431,13 +431,6 @@ static void sr_1d97_int(int32_t *p, int i0, int i1) ...@@ -431,13 +431,6 @@ static void sr_1d97_int(int32_t *p, int i0, int i1)
extend97_int(p, i0, i1); extend97_int(p, i0, i1);
/*step 1*/
for (i = i0 / 2 - 1; i < i1 / 2 + 2; i++)
p[2 * i] = ((p[2 * i] * I_LFTG_K) + (1 << 15)) >> 16;
/* step 2*/
for (i = i0 / 2 - 2; i < i1 / 2 + 2; i++)
p[2 * i + 1] = ((p[2 * i + 1] * I_LFTG_X) + (1 << 15)) >> 16;
/* step 3*/
for (i = i0 / 2 - 1; i < i1 / 2 + 2; i++) for (i = i0 / 2 - 1; i < i1 / 2 + 2; i++)
p[2 * i] -= (I_LFTG_DELTA * (p[2 * i - 1] + p[2 * i + 1]) + (1 << 15)) >> 16; p[2 * i] -= (I_LFTG_DELTA * (p[2 * i - 1] + p[2 * i + 1]) + (1 << 15)) >> 16;
/* step 4 */ /* step 4 */
...@@ -471,11 +464,11 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t) ...@@ -471,11 +464,11 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
l = line + mh; l = line + mh;
for (lp = 0; lp < lv; lp++) { for (lp = 0; lp < lv; lp++) {
int i, j = 0; int i, j = 0;
// copy with interleaving // rescale with interleaving
for (i = mh; i < lh; i += 2, j++) for (i = mh; i < lh; i += 2, j++)
l[i] = data[w * lp + j]; l[i] = ((data[w * lp + j] * I_LFTG_K) + (1 << 15)) >> 16;
for (i = 1 - mh; i < lh; i += 2, j++) for (i = 1 - mh; i < lh; i += 2, j++)
l[i] = data[w * lp + j]; l[i] = ((data[w * lp + j] * I_LFTG_X) + (1 << 15)) >> 16;
sr_1d97_int(line, mh, mh + lh); sr_1d97_int(line, mh, mh + lh);
...@@ -487,11 +480,11 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t) ...@@ -487,11 +480,11 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
l = line + mv; l = line + mv;
for (lp = 0; lp < lh; lp++) { for (lp = 0; lp < lh; lp++) {
int i, j = 0; int i, j = 0;
// copy with interleaving // rescale with interleaving
for (i = mv; i < lv; i += 2, j++) for (i = mv; i < lv; i += 2, j++)
l[i] = data[w * j + lp]; l[i] = ((data[w * j + lp] * I_LFTG_K) + (1 << 15)) >> 16;
for (i = 1 - mv; i < lv; i += 2, j++) for (i = 1 - mv; i < lv; i += 2, j++)
l[i] = data[w * j + lp]; l[i] = ((data[w * j + lp] * I_LFTG_X) + (1 << 15)) >> 16;
sr_1d97_int(line, mv, mv + lv); sr_1d97_int(line, mv, mv + lv);
......
c135eb14e9f219242180270c2a242634 *tests/data/fate/vsynth1-jpeg2000-97.avi c135eb14e9f219242180270c2a242634 *tests/data/fate/vsynth1-jpeg2000-97.avi
2243132 tests/data/fate/vsynth1-jpeg2000-97.avi 2243132 tests/data/fate/vsynth1-jpeg2000-97.avi
30a9c13e18fe4acaf28062b5003bb671 *tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo e1a095b40d7f6440f6c46f2995c4759c *tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
stddev: 6.41 PSNR: 31.99 MAXDIFF: 75 bytes: 7603200/ 7603200 stddev: 6.23 PSNR: 32.23 MAXDIFF: 75 bytes: 7603200/ 7603200
3ac3e49a89136bddde9e44bac3e5b4ed *tests/data/fate/vsynth2-jpeg2000-97.avi 3ac3e49a89136bddde9e44bac3e5b4ed *tests/data/fate/vsynth2-jpeg2000-97.avi
1118952 tests/data/fate/vsynth2-jpeg2000-97.avi 1118952 tests/data/fate/vsynth2-jpeg2000-97.avi
9d69ac6d46152ed2d6dd6a90d5793c80 *tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo 8ac8b9ee81fa73c873668e9f6b78764d *tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
stddev: 5.32 PSNR: 33.61 MAXDIFF: 60 bytes: 7603200/ 7603200 stddev: 4.95 PSNR: 34.23 MAXDIFF: 60 bytes: 7603200/ 7603200
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment