24#if defined(TEMPLATE_8bit)
26# define RENAME(N) N ## _8bit
30#elif defined(TEMPLATE_10bit)
32# define RENAME(N) N ## _10bit
36#elif defined(TEMPLATE_12bit)
38# define RENAME(N) N ## _12bit
52 b1[
i] -= (
unsigned)((int)(
b0[
i] + (unsigned)
b2[
i] + 2) >> 2);
59 for (
i = 0;
i < w2;
i++) {
65static void RENAME(horizontal_compose_dirac53i)(uint8_t *_b, uint8_t *_temp,
int w)
68 const int w2 =
w >> 1;
73 for (x = 1; x < w2; x++) {
82static void RENAME(horizontal_compose_dd97i)(uint8_t *_b, uint8_t *_tmp,
int w)
85 const int w2 =
w >> 1;
90 for (x = 1; x < w2; x++)
97 for (x = 0; x < w2; x++) {
98 b[2*x ] = ((int)(
tmp[x] + 1U))>>1;
103static void RENAME(horizontal_compose_dd137i)(uint8_t *_b, uint8_t *_tmp,
int w)
105 const int w2 =
w >> 1;
112 for (x = 2; x < w2-1; x++)
120 for (x = 0; x < w2; x++) {
121 b[2*x ] = ((int)(
tmp[x] + 1U))>>1;
129 const int w2 =
w >> 1;
132 for (x = 0; x < w2; x++) {
140static void RENAME(horizontal_compose_haar0i)(uint8_t *_b, uint8_t *_temp,
int w)
147static void RENAME(horizontal_compose_haar1i)(uint8_t *_b, uint8_t *_temp,
int w)
154static void RENAME(horizontal_compose_fidelityi)(uint8_t *_b, uint8_t *_tmp,
int w)
156 const int w2 =
w >> 1;
162 for (x = 0; x < w2; x++) {
163 for (
i = 0;
i < 8;
i++)
168 for (x = 0; x < w2; x++) {
169 for (
i = 0;
i < 8;
i++)
177static void RENAME(horizontal_compose_daub97i)(uint8_t *_b, uint8_t *_temp,
int w)
179 const int w2 =
w >> 1;
185 for (x = 1; x < w2; x++) {
193 b[0] = ~((
~b0) >> 1);
194 for (x = 1; x < w2; x++) {
197 b[2*x-1] = ~((
~b1) >> 1);
198 b[2*x ] = ~((
~b2) >> 1);
204static void RENAME(vertical_compose_dirac53iH0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
216static void RENAME(vertical_compose_dd97iH0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
217 uint8_t *_b3, uint8_t *_b4,
int width)
230static void RENAME(vertical_compose_dd137iL0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
231 uint8_t *_b3, uint8_t *_b4,
int width)
244static void RENAME(vertical_compose_haar)(uint8_t *_b0, uint8_t *_b1,
int width)
256static void RENAME(vertical_compose_fidelityiH0)(uint8_t *
_dst, uint8_t *_b[8],
int width)
273static void RENAME(vertical_compose_fidelityiL0)(uint8_t *
_dst, uint8_t *_b[8],
int width)
291static void RENAME(vertical_compose_daub97iH0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
int width)
303static void RENAME(vertical_compose_daub97iH1)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
int width)
315static void RENAME(vertical_compose_daub97iL0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
int width)
327static void RENAME(vertical_compose_daub97iL1)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
int width)
347 for (
i = 0;
i < 6;
i++)
352 if(y+5<(
unsigned)
height) vertical_compose_l0(
b[5],
b[6],
b[7],
width);
353 if(y+1<(
unsigned)
height) vertical_compose_h0(
b[0],
b[2],
b[3],
b[4],
b[6],
width);
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++)
370 uint8_t *
b[4] = { cs->
b[0], cs->
b[1] };
374 if(y+1<(
unsigned)
height) vertical_compose_l0(
b[1],
b[2],
b[3],
width);
375 if(y+0<(
unsigned)
height) vertical_compose_h0(
b[0],
b[1],
b[2],
width);
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++)
398 if(y+5<(
unsigned)
height) vertical_compose_l0(
b[3],
b[5],
b[6],
b[7],
b[9],
width);
399 if(y+1<(
unsigned)
height) vertical_compose_h0(
b[0],
b[2],
b[3],
b[4],
b[6],
width);
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;
414 uint8_t *
b0 = d->buffer + (y-1)*
stride;
415 uint8_t *
b1 = d->buffer + (y )*
stride;
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++)
439 for (y = 0; y <
height; y += 2) {
440 for (
i = 0;
i < 8;
i++)
445 for (y = 0; y <
height; y++)
446 d->horizontal_compose(d->buffer + y*
stride, d->temp,
width);
461 for (
i = 0;
i < 4;
i++)
466 if(y+3<(
unsigned)
height) vertical_compose_l1(
b[3],
b[4],
b[5],
width);
467 if(y+2<(
unsigned)
height) vertical_compose_h1(
b[2],
b[3],
b[4],
width);
468 if(y+1<(
unsigned)
height) vertical_compose_l0(
b[1],
b[2],
b[3],
width);
469 if(y+0<(
unsigned)
height) vertical_compose_h0(
b[0],
b[1],
b[2],
width);
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);
526 int hl = d->height >>
level;
527 ptrdiff_t 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.tap5 =
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.tap3 =
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.tap5 =
RENAME(vertical_compose_dd137iL0);
570 d->vertical_compose_h0.tap5 =
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 =
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.tap9 =
RENAME(vertical_compose_fidelityiL0);
587 d->vertical_compose_h0.tap9 =
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.tap3 =
RENAME(vertical_compose_daub97iL0);
594 d->vertical_compose_h0.tap3 =
RENAME(vertical_compose_daub97iH0);
595 d->vertical_compose_l1 =
RENAME(vertical_compose_daub97iL1);
596 d->vertical_compose_h1 =
RENAME(vertical_compose_daub97iH1);
597 d->horizontal_compose =
RENAME(horizontal_compose_daub97i);
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
#define i(width, name, range_min, range_max)
#define COMPOSE_DAUB97iL0(b0, b1, b2)
#define COMPOSE_DIRAC53iH0(b0, b1, b2)
#define COMPOSE_HAARiH0(b0, b1)
void(* vertical_compose_5tap)(uint8_t *b0, uint8_t *b1, uint8_t *b2, uint8_t *b3, uint8_t *b4, int width)
#define COMPOSE_DAUB97iH1(b0, b1, b2)
#define COMPOSE_HAARiL0(b0, b1)
#define COMPOSE_DD97iH0(b0, b1, b2, b3, b4)
#define COMPOSE_53iL0(b0, b1, b2)
#define COMPOSE_FIDELITYiL0(b0, b1, b2, b3, b4, b5, b6, b7, b8)
void(* vertical_compose_2tap)(uint8_t *b0, uint8_t *b1, int width)
#define COMPOSE_FIDELITYiH0(b0, b1, b2, b3, b4, b5, b6, b7, b8)
#define COMPOSE_DD137iL0(b0, b1, b2, b3, b4)
void(* vertical_compose_3tap)(uint8_t *b0, uint8_t *b1, uint8_t *b2, int width)
#define COMPOSE_DAUB97iL1(b0, b1, b2)
void(* vertical_compose_9tap)(uint8_t *dst, uint8_t *b[8], int width)
#define COMPOSE_DAUB97iH0(b0, b1, b2)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static int shift(int a, int b)
static av_always_inline av_const int avpriv_mirror(int x, int w)
static void spatial_compose53i_init(DWTCompose *cs, IDWTELEM *buffer, int height, int stride)
static void spatial_compose97i_init(DWTCompose *cs, IDWTELEM *buffer, int height, int stride)
static void spatial_idwt_init(DWTCompose *cs, IDWTELEM *buffer, int width, int height, int stride, int type, int decomposition_count)
static void vertical_compose53iL0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
uint8_t * b[MAX_DWT_SUPPORT]
static void interleave(uint8_t *dst, uint8_t *src, int w, int h, int dst_linesize, int src_linesize, enum FilterMode mode, int swap)
static double b1(void *priv, double x, double y)
static double b2(void *priv, double x, double y)
static double b3(void *priv, double x, double y)
static double b0(void *priv, double x, double y)