30 static const float scale97[] = {1.625786, 1.230174};
32 static inline void extend53(
int *p,
int i0,
int i1)
34 p[i0 - 1] = p[i0 + 1];
36 p[i0 - 2] = p[i0 + 2];
37 p[i1 + 1] = p[i1 - 3];
40 static inline void extend97(
float *p,
int i0,
int i1)
44 for (i = 1; i <= 4; i++){
45 p[i0 - i] = p[i0 + i];
46 p[i1 + i - 1] = p[i1 - i - 1];
50 static void sd_1d53(
int *p,
int i0,
int i1)
59 for (i = (i0+1)/2 - 1; i < (i1+1)/2; i++)
60 p[2*i+1] -= (p[2*i] + p[2*i+2]) >> 1;
61 for (i = (i0+1)/2; i < (i1+1)/2; i++)
62 p[2*i] += (p[2*i-1] + p[2*i+1] + 2) >> 2;
82 for (lp = 0; lp < lv; lp++){
85 for (i = 0; i < lh; i++)
91 for (i = mh; i < lh; i+=2, j++)
93 for (i = 1-mh; i < lh; i+=2, j++)
99 for (lp = 0; lp < lh; lp++) {
102 for (i = 0; i < lv; i++)
108 for (i = mv; i < lv; i+=2, j++)
110 for (i = 1-mv; i < lv; i+=2, j++)
126 for (i = i0/2 - 2; i < i1/2 + 1; i++)
127 p[2*i+1] -= 1.586134 * (p[2*i] + p[2*i+2]);
128 for (i = i0/2 - 1; i < i1/2 + 1; i++)
129 p[2*i] -= 0.052980 * (p[2*i-1] + p[2*i+1]);
130 for (i = i0/2 - 1; i < i1/2; i++)
131 p[2*i+1] += 0.882911 * (p[2*i] + p[2*i+2]);
132 for (i = i0/2; i < i1/2; i++)
133 p[2*i] += 0.443506 * (p[2*i-1] + p[2*i+1]);
153 for (lp = 0; lp < lv; lp++){
156 for (i = 0; i < lh; i++)
162 for (i = mh; i < lh; i+=2, j++)
163 t[w*lp + j] =
scale97[mh] * l[i] / 2;
164 for (i = 1-mh; i < lh; i+=2, j++)
165 t[w*lp + j] =
scale97[mh] * l[i] / 2;
170 for (lp = 0; lp < lh; lp++) {
173 for (i = 0; i < lv; i++)
179 for (i = mv; i < lv; i+=2, j++)
180 t[w*j + lp] =
scale97[mv] * l[i] / 2;
181 for (i = 1-mv; i < lv; i+=2, j++)
182 t[w*j + lp] =
scale97[mv] * l[i] / 2;
196 for (i = i0/2; i < i1/2 + 1; i++)
197 p[2*i] -= (p[2*i-1] + p[2*i+1] + 2) >> 2;
198 for (i = i0/2; i < i1/2; i++)
199 p[2*i+1] += (p[2*i] + p[2*i+2]) >> 1;
219 for (lp = 0; lp < lv; lp++){
222 for (i = mh; i < lh; i+=2, j++)
224 for (i = 1-mh; i < lh; i+=2, j++)
229 for (i = 0; i < lh; i++)
235 for (lp = 0; lp < lh; lp++){
238 for (i = mv; i < lv; i+=2, j++)
240 for (i = 1-mv; i < lv; i+=2, j++)
245 for (i = 0; i < lv; i++)
260 for (i = i0/2 - 1; i < i1/2 + 2; i++)
261 p[2*i] -= 0.443506 * (p[2*i-1] + p[2*i+1]);
262 for (i = i0/2 - 1; i < i1/2 + 1; i++)
263 p[2*i+1] -= 0.882911 * (p[2*i] + p[2*i+2]);
264 for (i = i0/2; i < i1/2 + 1; i++)
265 p[2*i] += 0.052980 * (p[2*i-1] + p[2*i+1]);
266 for (i = i0/2; i < i1/2; i++)
267 p[2*i+1] += 1.586134 * (p[2*i] + p[2*i+2]);
287 for (lp = 0; lp < lv; lp++){
290 for (i = mh; i < lh; i+=2, j++)
291 l[i] =
scale97[1-mh] * t[w*lp + j];
292 for (i = 1-mh; i < lh; i+=2, j++)
293 l[i] =
scale97[1-mh] * t[w*lp + j];
297 for (i = 0; i < lh; i++)
303 for (lp = 0; lp < lh; lp++){
306 for (i = mv; i < lv; i+=2, j++)
307 l[i] =
scale97[1-mv] * t[w*j + lp];
308 for (i = 1-mv; i < lv; i+=2, j++)
309 l[i] =
scale97[1-mv] * t[w*j + lp];
313 for (i = 0; i < lv; i++)
321 int i, j, lev = decomp_levels, maxlen,
329 for (i = 0; i < 2; i++)
330 for(j = 0; j < 2; j++)
331 b[i][j] = border[i][j];
333 maxlen =
FFMAX(b[0][1] - b[0][0],
337 for (i = 0; i < 2; i++){
338 s->
linelen[lev][i] = b[i][1] - b[i][0];
339 s->
mod[lev][i] = b[i][0] & 1;
340 for (j = 0; j < 2; j++)
341 b[i][j] = (b[i][j] + 1) >> 1;