31 while ((
unsigned)v > (
unsigned)m) {
44 for (i = 0; i <
width; i++)
45 b1[i] -= (b0[i] + b2[i] + 2) >> 2;
53 for (i = 0; i < w2; i++) {
54 dst[2*i ] = (src0[i] + add) >> shift;
55 dst[2*i+1] = (src1[i] + add) >> shift;
61 const int w2 = w >> 1;
65 for (x = 1; x < w2; x++) {
76 const int w2 = w >> 1;
80 for (x = 1; x < w2; x++)
85 tmp[w2+1] = tmp[w2] = tmp[w2-1];
87 for (x = 0; x < w2; x++) {
88 b[2*x ] = (tmp[x] + 1)>>1;
89 b[2*x+1] = (
COMPOSE_DD97iH0(tmp[x-1], tmp[x], b[x+w2], tmp[x+1], tmp[x+2]) + 1)>>1;
95 const int w2 = w >> 1;
100 for (x = 2; x < w2-1; x++)
106 tmp[w2+1] = tmp[w2] = tmp[w2-1];
108 for (x = 0; x < w2; x++) {
109 b[2*x ] = (tmp[x] + 1)>>1;
110 b[2*x+1] = (
COMPOSE_DD97iH0(tmp[x-1], tmp[x], b[x+w2], tmp[x+1], tmp[x+2]) + 1)>>1;
117 const int w2 = w >> 1;
120 for (x = 0; x < w2; x++) {
125 interleave(b, temp, temp+w2, w2, shift, shift);
140 const int w2 = w >> 1;
144 for (x = 0; x < w2; x++) {
145 for (i = 0; i < 8; i++)
146 v[i] = b[av_clip(x-3+i, 0, w2-1)];
150 for (x = 0; x < w2; x++) {
151 for (i = 0; i < 8; i++)
152 v[i] = tmp[av_clip(x-4+i, 0, w2-1)];
161 const int w2 = w >> 1;
165 for (x = 1; x < w2; x++) {
173 b[0] = (b0 + 1) >> 1;
174 for (x = 1; x < w2; x++) {
177 b[2*x-1] = (b1 + 1) >> 1;
178 b[2*x ] = (b2 + 1) >> 1;
188 for(i=0; i<
width; i++){
198 for(i=0; i<
width; i++){
208 for(i=0; i<
width; i++){
217 for (i = 0; i <
width; i++) {
227 for(i=0; i<
width; i++){
228 dst[i] =
COMPOSE_FIDELITYiH0(b[0][i], b[1][i], b[2][i], b[3][i], dst[i], b[4][i], b[5][i], b[6][i], b[7][i]);
236 for(i=0; i<
width; i++){
237 dst[i] =
COMPOSE_FIDELITYiL0(b[0][i], b[1][i], b[2][i], b[3][i], dst[i], b[4][i], b[5][i], b[6][i], b[7][i]);
245 for(i=0; i<
width; i++){
254 for(i=0; i<
width; i++){
263 for(i=0; i<
width; i++){
272 for(i=0; i<
width; i++){
286 for (i = 0; i < 6; i++)
288 b[6] = d->
buffer + av_clip(y+5, 0, height-2)*stride;
289 b[7] = d->
buffer + av_clip(y+6, 1, height-1)*stride;
291 if(y+5<(
unsigned)height) vertical_compose_l0( b[5], b[6], b[7], width);
292 if(y+1<(
unsigned)height) vertical_compose_h0(b[0], b[2], b[3], b[4], b[6], width);
297 for (i = 0; i < 6; i++)
313 if(y+1<(
unsigned)height) vertical_compose_l0(b[1], b[2], b[3], width);
314 if(y+0<(
unsigned)height) vertical_compose_h0(b[0], b[1], b[2], width);
333 for (i = 0; i < 8; i++)
335 b[8] = d->
buffer + av_clip(y+7, 0, height-2)*stride;
336 b[9] = d->
buffer + av_clip(y+8, 1, height-1)*stride;
338 if(y+5<(
unsigned)height) vertical_compose_l0(b[3], b[5], b[6], b[7], b[9], width);
339 if(y+1<(
unsigned)height) vertical_compose_h0(b[0], b[2], b[3], b[4], b[6], width);
344 for (i = 0; i < 8; i++)
353 int y = d->
cs[level].
y;
357 vertical_compose(b0, b1, width);
373 for (y = 1; y <
height; y += 2) {
374 for (i = 0; i < 8; i++)
375 b[i] = d->
buffer + av_clip((y-7 + 2*i), 0, height-2)*stride;
376 vertical_compose_h0(d->
buffer + y*stride, b, width);
379 for (y = 0; y <
height; y += 2) {
380 for (i = 0; i < 8; i++)
381 b[i] = d->
buffer + av_clip((y-7 + 2*i), 1, height-1)*stride;
382 vertical_compose_l0(d->
buffer + y*stride, b, width);
385 for (y = 0; y <
height; y++)
401 for (i = 0; i < 4; i++)
406 if(y+3<(
unsigned)height) vertical_compose_l1(b[3], b[4], b[5], width);
407 if(y+2<(
unsigned)height) vertical_compose_h1(b[2], b[3], b[4], width);
408 if(y+1<(
unsigned)height) vertical_compose_l0(b[1], b[2], b[3], width);
409 if(y+0<(
unsigned)height) vertical_compose_h0(b[0], b[1], b[2], width);
414 for (i = 0; i < 4; i++)
422 cs->
b[0] = buffer +
mirror(-3-1, height-1)*stride;
423 cs->
b[1] = buffer +
mirror(-3 , height-1)*stride;
424 cs->
b[2] = buffer +
mirror(-3+1, height-1)*stride;
425 cs->
b[3] = buffer +
mirror(-3+2, height-1)*stride;
431 cs->
b[0] = buffer +
mirror(-1-1, height-1)*stride;
432 cs->
b[1] = buffer +
mirror(-1 , height-1)*stride;
438 cs->
b[0] = buffer + av_clip(-5-1, 0, height-2)*stride;
439 cs->
b[1] = buffer + av_clip(-5 , 1, height-1)*stride;
440 cs->
b[2] = buffer + av_clip(-5+1, 0, height-2)*stride;
441 cs->
b[3] = buffer + av_clip(-5+2, 1, height-1)*stride;
442 cs->
b[4] = buffer + av_clip(-5+3, 0, height-2)*stride;
443 cs->
b[5] = buffer + av_clip(-5+4, 1, height-1)*stride;
449 cs->
b[0] = buffer + av_clip(-5-1, 0, height-2)*stride;
450 cs->
b[1] = buffer + av_clip(-5 , 1, height-1)*stride;
451 cs->
b[2] = buffer + av_clip(-5+1, 0, height-2)*stride;
452 cs->
b[3] = buffer + av_clip(-5+2, 1, height-1)*stride;
453 cs->
b[4] = buffer + av_clip(-5+3, 0, height-2)*stride;
454 cs->
b[5] = buffer + av_clip(-5+4, 1, height-1)*stride;
455 cs->
b[6] = buffer + av_clip(-5+5, 0, height-2)*stride;
456 cs->
b[7] = buffer + av_clip(-5+6, 1, height-1)*stride;
473 for(level=decomposition_count-1; level>=0; level--){
474 int hl = height >>
level;
475 int stride_l = stride <<
level;
567 while (d->
cs[level].
y <=
FFMIN((y>>level)+support, hl))