24 #if defined(TEMPLATE_8bit)
26 # define RENAME(N) N ## _8bit
30 #elif defined(TEMPLATE_10bit)
32 # define RENAME(N) N ## _10bit
34 # undef TEMPLATE_10bit
36 #elif defined(TEMPLATE_12bit)
38 # define RENAME(N) N ## _12bit
40 # undef TEMPLATE_12bit
48 TYPE *b0 = (TYPE *)_b0;
49 TYPE *b1 = (TYPE *)_b1;
50 TYPE *b2 = (TYPE *)_b2;
51 for (i = 0; i <
width; i++)
52 b1[i] -= (b0[i] + b2[i] + 2) >> 2;
59 for (i = 0; i < w2; i++) {
68 const int w2 = w >> 1;
70 TYPE *
temp = (TYPE *)_temp;
73 for (x = 1; x < w2; x++) {
85 const int w2 = w >> 1;
87 TYPE *
tmp = (TYPE *)_tmp;
90 for (x = 1; x < w2; x++)
95 tmp[w2+1] = tmp[w2] = tmp[w2-1];
97 for (x = 0; x < w2; x++) {
98 b[2*x ] = (tmp[x] + 1)>>1;
99 b[2*x+1] = (
COMPOSE_DD97iH0(tmp[x-1], tmp[x], b[x+w2], tmp[x+1], tmp[x+2]) + 1)>>1;
105 const int w2 = w >> 1;
107 TYPE *
b = (TYPE *)_b;
108 TYPE *
tmp = (TYPE *)_tmp;
112 for (x = 2; x < w2-1; x++)
118 tmp[w2+1] = tmp[w2] = tmp[w2-1];
120 for (x = 0; x < w2; x++) {
121 b[2*x ] = (tmp[x] + 1)>>1;
122 b[2*x+1] = (
COMPOSE_DD97iH0(tmp[x-1], tmp[x], b[x+w2], tmp[x+1], tmp[x+2]) + 1)>>1;
129 const int w2 = w >> 1;
132 for (x = 0; x < w2; x++) {
142 TYPE *
b = (TYPE *)_b;
143 TYPE *
temp = (TYPE *)_temp;
149 TYPE *
b = (TYPE *)_b;
150 TYPE *
temp = (TYPE *)_temp;
156 const int w2 = w >> 1;
159 TYPE *
b = (TYPE *)_b;
160 TYPE *
tmp = (TYPE *)_tmp;
162 for (x = 0; x < w2; x++) {
163 for (i = 0; i < 8; i++)
164 v[i] = b[av_clip(x-3+i, 0, w2-1)];
168 for (x = 0; x < w2; x++) {
169 for (i = 0; i < 8; i++)
170 v[i] = tmp[av_clip(x-4+i, 0, w2-1)];
179 const int w2 = w >> 1;
181 TYPE *
b = (TYPE *)_b;
182 TYPE *
temp = (TYPE *)_temp;
185 for (x = 1; x < w2; x++) {
193 b[0] = (b0 + 1) >> 1;
194 for (x = 1; x < w2; x++) {
197 b[2*x-1] = (b1 + 1) >> 1;
198 b[2*x ] = (b2 + 1) >> 1;
208 TYPE *b0 = (TYPE *)_b0;
209 TYPE *b1 = (TYPE *)_b1;
210 TYPE *b2 = (TYPE *)_b2;
211 for(i=0; i<
width; i++){
220 TYPE *b0 = (TYPE *)_b0;
221 TYPE *b1 = (TYPE *)_b1;
222 TYPE *b2 = (TYPE *)_b2;
223 TYPE *b3 = (TYPE *)_b3;
224 TYPE *b4 = (TYPE *)_b4;
225 for(i=0; i<
width; i++){
234 TYPE *b0 = (TYPE *)_b0;
235 TYPE *b1 = (TYPE *)_b1;
236 TYPE *b2 = (TYPE *)_b2;
237 TYPE *b3 = (TYPE *)_b3;
238 TYPE *b4 = (TYPE *)_b4;
239 for(i=0; i<
width; i++){
247 TYPE *b0 = (TYPE *)_b0;
248 TYPE *b1 = (TYPE *)_b1;
250 for (i = 0; i <
width; i++) {
259 TYPE *dst = (TYPE *)_dst;
260 TYPE *b0 = (TYPE *)_b[0];
261 TYPE *b1 = (TYPE *)_b[1];
262 TYPE *b2 = (TYPE *)_b[2];
263 TYPE *b3 = (TYPE *)_b[3];
264 TYPE *b4 = (TYPE *)_b[4];
265 TYPE *b5 = (TYPE *)_b[5];
266 TYPE *b6 = (TYPE *)_b[6];
267 TYPE *b7 = (TYPE *)_b[7];
268 for(i=0; i<
width; i++){
269 dst[i] =
COMPOSE_FIDELITYiH0(b0[i], b1[i], b2[i], b3[i], dst[i], b4[i], b5[i], b6[i], b7[i]);
276 TYPE *dst = (TYPE *)_dst;
277 TYPE *b0 = (TYPE *)_b[0];
278 TYPE *b1 = (TYPE *)_b[1];
279 TYPE *b2 = (TYPE *)_b[2];
280 TYPE *b3 = (TYPE *)_b[3];
281 TYPE *b4 = (TYPE *)_b[4];
282 TYPE *b5 = (TYPE *)_b[5];
283 TYPE *b6 = (TYPE *)_b[6];
284 TYPE *b7 = (TYPE *)_b[7];
286 for(i=0; i<
width; i++){
287 dst[i] =
COMPOSE_FIDELITYiL0(b0[i], b1[i], b2[i], b3[i], dst[i], b4[i], b5[i], b6[i], b7[i]);
294 TYPE *b0 = (TYPE *)_b0;
295 TYPE *b1 = (TYPE *)_b1;
296 TYPE *b2 = (TYPE *)_b2;
298 for(i=0; i<
width; i++){
306 TYPE *b0 = (TYPE *)_b0;
307 TYPE *b1 = (TYPE *)_b1;
308 TYPE *b2 = (TYPE *)_b2;
310 for(i=0; i<
width; i++){
318 TYPE *b0 = (TYPE *)_b0;
319 TYPE *b1 = (TYPE *)_b1;
320 TYPE *b2 = (TYPE *)_b2;
322 for(i=0; i<
width; i++){
330 TYPE *b0 = (TYPE *)_b0;
331 TYPE *b1 = (TYPE *)_b1;
332 TYPE *b2 = (TYPE *)_b2;
334 for(i=0; i<
width; i++){
347 for (i = 0; i < 6; i++)
355 if(y-1<(
unsigned)height) d->horizontal_compose(b[0], d->temp,
width);
356 if(y+0<(
unsigned)height) d->horizontal_compose(b[1], d->temp,
width);
358 for (i = 0; i < 6; i++)
377 if(y-1<(
unsigned)height) d->horizontal_compose(b[0], d->temp,
width);
378 if(y+0<(
unsigned)height) d->horizontal_compose(b[1], d->temp,
width);
393 for (i = 0; i < 8; i++)
401 if(y-1<(
unsigned)height) d->horizontal_compose(b[0], d->temp,
width);
402 if(y+0<(
unsigned)height) d->horizontal_compose(b[1], d->temp,
width);
404 for (i = 0; i < 8; i++)
413 int y = d->cs[
level].y;
418 d->horizontal_compose(b0, d->temp,
width);
419 d->horizontal_compose(b1, d->temp,
width);
433 for (y = 1; y <
height; y += 2) {
434 for (i = 0; i < 8; i++)
435 b[i] = d->buffer + av_clip((y-7 + 2*i), 0, height-2)*
stride;
439 for (y = 0; y <
height; y += 2) {
440 for (i = 0; i < 8; i++)
441 b[i] = d->buffer + av_clip((y-7 + 2*i), 1, height-1)*
stride;
445 for (y = 0; y <
height; y++)
446 d->horizontal_compose(d->buffer + y*
stride, d->temp,
width);
448 d->cs[
level].y = height+1;
461 for (i = 0; i < 4; i++)
471 if(y-1<(
unsigned)height) d->horizontal_compose(b[0], d->temp,
width);
472 if(y+0<(
unsigned)height) d->horizontal_compose(b[1], d->temp,
width);
474 for (i = 0; i < 4; i++)
523 d->temp = (
uint8_t *)(((TYPE *)d->temp) + 8);
525 for (level = d->decomposition_count - 1; level >= 0; level--){
526 int hl = d->height >>
level;
527 int stride_l = d->stride <<
level;
531 RENAME(spatial_compose_dd97i_init)(d->cs+
level, d->buffer, hl, stride_l);
537 RENAME(spatial_compose_dd137i_init)(d->cs+
level, d->buffer, hl, stride_l);
554 d->spatial_compose =
RENAME(spatial_compose_dd97i_dy);
556 d->vertical_compose_h0 = (
void*)
RENAME(vertical_compose_dd97iH0);
557 d->horizontal_compose =
RENAME(horizontal_compose_dd97i);
561 d->spatial_compose =
RENAME(spatial_compose_dirac53i_dy);
563 d->vertical_compose_h0 = (
void*)
RENAME(vertical_compose_dirac53iH0);
564 d->horizontal_compose =
RENAME(horizontal_compose_dirac53i);
568 d->spatial_compose =
RENAME(spatial_compose_dd137i_dy);
569 d->vertical_compose_l0 = (
void*)
RENAME(vertical_compose_dd137iL0);
570 d->vertical_compose_h0 = (
void*)
RENAME(vertical_compose_dd97iH0);
571 d->horizontal_compose =
RENAME(horizontal_compose_dd137i);
576 d->spatial_compose =
RENAME(spatial_compose_haari_dy);
577 d->vertical_compose = (
void*)
RENAME(vertical_compose_haar);
579 d->horizontal_compose =
RENAME(horizontal_compose_haar0i);
581 d->horizontal_compose =
RENAME(horizontal_compose_haar1i);
585 d->spatial_compose =
RENAME(spatial_compose_fidelity);
586 d->vertical_compose_l0 = (
void*)
RENAME(vertical_compose_fidelityiL0);
587 d->vertical_compose_h0 = (
void*)
RENAME(vertical_compose_fidelityiH0);
588 d->horizontal_compose =
RENAME(horizontal_compose_fidelityi);
592 d->spatial_compose =
RENAME(spatial_compose_daub97i_dy);
593 d->vertical_compose_l0 = (
void*)
RENAME(vertical_compose_daub97iL0);
594 d->vertical_compose_h0 = (
void*)
RENAME(vertical_compose_daub97iH0);
595 d->vertical_compose_l1 = (
void*)
RENAME(vertical_compose_daub97iL1);
596 d->vertical_compose_h1 = (
void*)
RENAME(vertical_compose_daub97iH1);
597 d->horizontal_compose =
RENAME(horizontal_compose_daub97i);
#define COMPOSE_HAARiH0(b0, b1)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void(* vertical_compose_5tap)(uint8_t *b0, uint8_t *b1, uint8_t *b2, uint8_t *b3, uint8_t *b4, int width)
static int shift(int a, int b)
uint8_t * b[MAX_DWT_SUPPORT]
#define COMPOSE_DAUB97iL0(b0, b1, b2)
#define COMPOSE_FIDELITYiH0(b0, b1, b2, b3, b4, b5, b6, b7, b8)
#define COMPOSE_DAUB97iL1(b0, b1, b2)
void(* vertical_compose_h1)(void)
#define COMPOSE_DD97iH0(b0, b1, b2, b3, b4)
#define COMPOSE_53iL0(b0, b1, b2)
#define COMPOSE_DIRAC53iH0(b0, b1, b2)
static void spatial_compose53i_init(DWTCompose *cs, IDWTELEM *buffer, int height, int stride)
#define COMPOSE_DAUB97iH1(b0, b1, b2)
static av_always_inline av_const int avpriv_mirror(int x, int w)
void(* vertical_compose_2tap)(uint8_t *b0, uint8_t *b1, int width)
void(* vertical_compose_h0)(void)
#define COMPOSE_FIDELITYiL0(b0, b1, b2, b3, b4, b5, b6, b7, b8)
DWTCompose cs[MAX_DECOMPOSITIONS]
static void interleave(short *output, short **input, int channels, int samples)
static void spatial_compose97i_init(DWTCompose *cs, IDWTELEM *buffer, int height, int stride)
static void vertical_compose53iL0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
GLint GLenum GLboolean GLsizei stride
void(* vertical_compose_3tap)(uint8_t *b0, uint8_t *b1, uint8_t *b2, int width)
#define COMPOSE_DD137iL0(b0, b1, b2, b3, b4)
void(* vertical_compose)(void)
one set of lowpass and highpass combined
#define COMPOSE_HAARiL0(b0, b1)
void(* vertical_compose_9tap)(uint8_t *dst, uint8_t *b[8], int width)
void(* vertical_compose_l0)(void)
#define COMPOSE_DAUB97iH0(b0, b1, b2)
void(* vertical_compose_l1)(void)
int ff_spatial_idwt_init(DWTContext *d, DWTPlane *p, enum dwt_type type, int decomposition_count, int bit_depth)