aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/jpeg2000dwt.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-06-02 22:21:14 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-06-03 13:24:20 +0200
commit8a266aaaacc0610c9ee1e3563ef345c46decb2b0 (patch)
tree94282525254cea0eb04d32c35e7b42c0f8783eae /libavcodec/jpeg2000dwt.c
parent96b71a6ec509023c892aaf9e7597ed0accbafb32 (diff)
downloadffmpeg-8a266aaaacc0610c9ee1e3563ef345c46decb2b0.tar.gz
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>
Diffstat (limited to 'libavcodec/jpeg2000dwt.c')
-rw-r--r--libavcodec/jpeg2000dwt.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/libavcodec/jpeg2000dwt.c b/libavcodec/jpeg2000dwt.c
index 13712d9703..266edece04 100644
--- a/libavcodec/jpeg2000dwt.c
+++ b/libavcodec/jpeg2000dwt.c
@@ -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);