32 while ((
unsigned)v > (
unsigned)m) {
45 for (i = 0; i <
width; i++)
46 b1[i] -= (b0[i] + b2[i] + 2) >> 2;
54 for (i = 0; i < w2; i++) {
55 dst[2*i ] = (src0[i] + add) >> shift;
56 dst[2*i+1] = (src1[i] + add) >> shift;
62 const int w2 = w >> 1;
66 for (x = 1; x < w2; x++) {
77 const int w2 = w >> 1;
81 for (x = 1; x < w2; x++)
86 tmp[w2+1] = tmp[w2] = tmp[w2-1];
88 for (x = 0; x < w2; x++) {
89 b[2*x ] = (tmp[x] + 1)>>1;
90 b[2*x+1] = (
COMPOSE_DD97iH0(tmp[x-1], tmp[x], b[x+w2], tmp[x+1], tmp[x+2]) + 1)>>1;
96 const int w2 = w >> 1;
101 for (x = 2; x < w2-1; x++)
107 tmp[w2+1] = tmp[w2] = tmp[w2-1];
109 for (x = 0; x < w2; x++) {
110 b[2*x ] = (tmp[x] + 1)>>1;
111 b[2*x+1] = (
COMPOSE_DD97iH0(tmp[x-1], tmp[x], b[x+w2], tmp[x+1], tmp[x+2]) + 1)>>1;
118 const int w2 = w >> 1;
121 for (x = 0; x < w2; x++) {
126 interleave(b, temp, temp+w2, w2, shift, shift);
141 const int w2 = w >> 1;
145 for (x = 0; x < w2; x++) {
146 for (i = 0; i < 8; i++)
147 v[i] = b[av_clip(x-3+i, 0, w2-1)];
151 for (x = 0; x < w2; x++) {
152 for (i = 0; i < 8; i++)
153 v[i] = tmp[av_clip(x-4+i, 0, w2-1)];
162 const int w2 = w >> 1;
166 for (x = 1; x < w2; x++) {
174 b[0] = (b0 + 1) >> 1;
175 for (x = 1; x < w2; x++) {
178 b[2*x-1] = (b1 + 1) >> 1;
179 b[2*x ] = (b2 + 1) >> 1;
189 for(i=0; i<
width; i++){
199 for(i=0; i<
width; i++){
209 for(i=0; i<
width; i++){
218 for (i = 0; i <
width; i++) {
228 for(i=0; i<
width; i++){
229 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]);
237 for(i=0; i<
width; i++){
238 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]);
246 for(i=0; i<
width; i++){
255 for(i=0; i<
width; i++){
264 for(i=0; i<
width; i++){
273 for(i=0; i<
width; i++){
287 for (i = 0; i < 6; i++)
289 b[6] = d->
buffer + av_clip(y+5, 0, height-2)*stride;
290 b[7] = d->
buffer + av_clip(y+6, 1, height-1)*stride;
292 if(y+5<(
unsigned)height) vertical_compose_l0( b[5], b[6], b[7], width);
293 if(y+1<(
unsigned)height) vertical_compose_h0(b[0], b[2], b[3], b[4], b[6], width);
298 for (i = 0; i < 6; i++)
314 if(y+1<(
unsigned)height) vertical_compose_l0(b[1], b[2], b[3], width);
315 if(y+0<(
unsigned)height) vertical_compose_h0(b[0], b[1], b[2], width);
334 for (i = 0; i < 8; i++)
336 b[8] = d->
buffer + av_clip(y+7, 0, height-2)*stride;
337 b[9] = d->
buffer + av_clip(y+8, 1, height-1)*stride;
339 if(y+5<(
unsigned)height) vertical_compose_l0(b[3], b[5], b[6], b[7], b[9], width);
340 if(y+1<(
unsigned)height) vertical_compose_h0(b[0], b[2], b[3], b[4], b[6], width);
345 for (i = 0; i < 8; i++)
354 int y = d->
cs[level].
y;
358 vertical_compose(b0, b1, width);
374 for (y = 1; y <
height; y += 2) {
375 for (i = 0; i < 8; i++)
376 b[i] = d->
buffer + av_clip((y-7 + 2*i), 0, height-2)*stride;
377 vertical_compose_h0(d->
buffer + y*stride, b, width);
380 for (y = 0; y <
height; y += 2) {
381 for (i = 0; i < 8; i++)
382 b[i] = d->
buffer + av_clip((y-7 + 2*i), 1, height-1)*stride;
383 vertical_compose_l0(d->
buffer + y*stride, b, width);
386 for (y = 0; y <
height; y++)
402 for (i = 0; i < 4; i++)
407 if(y+3<(
unsigned)height) vertical_compose_l1(b[3], b[4], b[5], width);
408 if(y+2<(
unsigned)height) vertical_compose_h1(b[2], b[3], b[4], width);
409 if(y+1<(
unsigned)height) vertical_compose_l0(b[1], b[2], b[3], width);
410 if(y+0<(
unsigned)height) vertical_compose_h0(b[0], b[1], b[2], width);
415 for (i = 0; i < 4; i++)
423 cs->
b[0] = buffer +
mirror(-3-1, height-1)*stride;
424 cs->
b[1] = buffer +
mirror(-3 , height-1)*stride;
425 cs->
b[2] = buffer +
mirror(-3+1, height-1)*stride;
426 cs->
b[3] = buffer +
mirror(-3+2, height-1)*stride;
432 cs->
b[0] = buffer +
mirror(-1-1, height-1)*stride;
433 cs->
b[1] = buffer +
mirror(-1 , height-1)*stride;
439 cs->
b[0] = buffer + av_clip(-5-1, 0, height-2)*stride;
440 cs->
b[1] = buffer + av_clip(-5 , 1, height-1)*stride;
441 cs->
b[2] = buffer + av_clip(-5+1, 0, height-2)*stride;
442 cs->
b[3] = buffer + av_clip(-5+2, 1, height-1)*stride;
443 cs->
b[4] = buffer + av_clip(-5+3, 0, height-2)*stride;
444 cs->
b[5] = buffer + av_clip(-5+4, 1, height-1)*stride;
450 cs->
b[0] = buffer + av_clip(-5-1, 0, height-2)*stride;
451 cs->
b[1] = buffer + av_clip(-5 , 1, height-1)*stride;
452 cs->
b[2] = buffer + av_clip(-5+1, 0, height-2)*stride;
453 cs->
b[3] = buffer + av_clip(-5+2, 1, height-1)*stride;
454 cs->
b[4] = buffer + av_clip(-5+3, 0, height-2)*stride;
455 cs->
b[5] = buffer + av_clip(-5+4, 1, height-1)*stride;
456 cs->
b[6] = buffer + av_clip(-5+5, 0, height-2)*stride;
457 cs->
b[7] = buffer + av_clip(-5+6, 1, height-1)*stride;
474 for(level=decomposition_count-1; level>=0; level--){
475 int hl = height >>
level;
476 int stride_l = stride <<
level;
568 while (d->
cs[level].
y <=
FFMIN((y>>level)+support, hl))