1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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: Nicolas BERTRAND <nicoinattendu@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-06-02 22:21:14 +02:00
parent 96b71a6ec5
commit 8a266aaaac
3 changed files with 10 additions and 17 deletions

View File

@ -431,13 +431,6 @@ static void sr_1d97_int(int32_t *p, int i0, int 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++)
p[2 * i] -= (I_LFTG_DELTA * (p[2 * i - 1] + p[2 * i + 1]) + (1 << 15)) >> 16;
/* step 4 */
@ -471,11 +464,11 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
l = line + mh;
for (lp = 0; lp < lv; lp++) {
int i, j = 0;
// copy with interleaving
// rescale with interleaving
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++)
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);
@ -487,11 +480,11 @@ static void dwt_decode97_int(DWTContext *s, int32_t *t)
l = line + mv;
for (lp = 0; lp < lh; lp++) {
int i, j = 0;
// copy with interleaving
// rescale with interleaving
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++)
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);

View File

@ -1,4 +1,4 @@
c135eb14e9f219242180270c2a242634 *tests/data/fate/vsynth1-jpeg2000-97.avi
2243132 tests/data/fate/vsynth1-jpeg2000-97.avi
30a9c13e18fe4acaf28062b5003bb671 *tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
stddev: 6.41 PSNR: 31.99 MAXDIFF: 75 bytes: 7603200/ 7603200
e1a095b40d7f6440f6c46f2995c4759c *tests/data/fate/vsynth1-jpeg2000-97.out.rawvideo
stddev: 6.23 PSNR: 32.23 MAXDIFF: 75 bytes: 7603200/ 7603200

View File

@ -1,4 +1,4 @@
3ac3e49a89136bddde9e44bac3e5b4ed *tests/data/fate/vsynth2-jpeg2000-97.avi
1118952 tests/data/fate/vsynth2-jpeg2000-97.avi
9d69ac6d46152ed2d6dd6a90d5793c80 *tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
stddev: 5.32 PSNR: 33.61 MAXDIFF: 60 bytes: 7603200/ 7603200
8ac8b9ee81fa73c873668e9f6b78764d *tests/data/fate/vsynth2-jpeg2000-97.out.rawvideo
stddev: 4.95 PSNR: 34.23 MAXDIFF: 60 bytes: 7603200/ 7603200