2 * Copyright (C) 2004-2010 Michael Niedermayer <michaelni@gmx.at>
3 * Copyright (C) 2008 David Conrad
4 * Copyright (C) 2015 Open Broadcast Systems Ltd.
5 * Author (C) 2015 Rostislav Pehlivanov <atomnuker@gmail.com>
7 * This file is part of FFmpeg.
9 * FFmpeg is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * FFmpeg is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with FFmpeg; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
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
44 static void RENAME(vertical_compose53iL0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
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] -= (int)(b0[i] + (unsigned)b2[i] + 2) >> 2;
55 static av_always_inline void RENAME(interleave)(TYPE *dst, TYPE *src0, TYPE *src1, int w2,
59 for (i = 0; i < w2; i++) {
60 dst[2*i ] = (src0[i] + add) >> shift;
61 dst[2*i+1] = (src1[i] + add) >> shift;
65 static void RENAME(horizontal_compose_dirac53i)(uint8_t *_b, uint8_t *_temp, int w)
68 const int w2 = w >> 1;
70 TYPE *temp = (TYPE *)_temp;
72 temp[0] = COMPOSE_53iL0(b[w2], b[0], b[w2]);
73 for (x = 1; x < w2; x++) {
74 temp[x ] = COMPOSE_53iL0 (b[x+w2-1], b[x ], b[x+w2]);
75 temp[x+w2-1] = COMPOSE_DIRAC53iH0(temp[x-1], b[x+w2-1], temp[x]);
77 temp[w-1] = COMPOSE_DIRAC53iH0(temp[w2-1], b[w-1], temp[w2-1]);
79 RENAME(interleave)(b, temp, temp+w2, w2, 1, 1);
82 static void RENAME(horizontal_compose_dd97i)(uint8_t *_b, uint8_t *_tmp, int w)
85 const int w2 = w >> 1;
87 TYPE *tmp = (TYPE *)_tmp;
89 tmp[0] = COMPOSE_53iL0(b[w2], b[0], b[w2]);
90 for (x = 1; x < w2; x++)
91 tmp[x] = COMPOSE_53iL0(b[x+w2-1], b[x], b[x+w2]);
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;
103 static void RENAME(horizontal_compose_dd137i)(uint8_t *_b, uint8_t *_tmp, int w)
105 const int w2 = w >> 1;
107 TYPE *b = (TYPE *)_b;
108 TYPE *tmp = (TYPE *)_tmp;
110 tmp[0] = COMPOSE_DD137iL0(b[w2], b[w2], b[0], b[w2 ], b[w2+1]);
111 tmp[1] = COMPOSE_DD137iL0(b[w2], b[w2], b[1], b[w2+1], b[w2+2]);
112 for (x = 2; x < w2-1; x++)
113 tmp[x] = COMPOSE_DD137iL0(b[x+w2-2], b[x+w2-1], b[x], b[x+w2], b[x+w2+1]);
114 tmp[w2-1] = COMPOSE_DD137iL0(b[w-3], b[w-2], b[w2-1], b[w-1], b[w-1]);
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;
126 static av_always_inline void RENAME(horizontal_compose_haari)(TYPE *b, TYPE *temp,
129 const int w2 = w >> 1;
132 for (x = 0; x < w2; x++) {
133 temp[x ] = COMPOSE_HAARiL0(b[x ], b[x+w2]);
134 temp[x+w2] = COMPOSE_HAARiH0(b[x+w2], temp[x]);
137 RENAME(interleave)(b, temp, temp+w2, w2, shift, shift);
140 static void RENAME(horizontal_compose_haar0i)(uint8_t *_b, uint8_t *_temp, int w)
142 TYPE *b = (TYPE *)_b;
143 TYPE *temp = (TYPE *)_temp;
144 RENAME(horizontal_compose_haari)(b, temp, w, 0);
147 static void RENAME(horizontal_compose_haar1i)(uint8_t *_b, uint8_t *_temp, int w)
149 TYPE *b = (TYPE *)_b;
150 TYPE *temp = (TYPE *)_temp;
151 RENAME(horizontal_compose_haari)(b, temp, w, 1);
154 static void RENAME(horizontal_compose_fidelityi)(uint8_t *_b, uint8_t *_tmp, int w)
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)];
165 tmp[x] = COMPOSE_FIDELITYiH0(v[0], v[1], v[2], v[3], b[x+w2], v[4], v[5], v[6], v[7]);
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)];
171 tmp[x+w2] = COMPOSE_FIDELITYiL0(v[0], v[1], v[2], v[3], b[x], v[4], v[5], v[6], v[7]);
174 RENAME(interleave)(b, tmp+w2, tmp, w2, 0, 0);
177 static void RENAME(horizontal_compose_daub97i)(uint8_t *_b, uint8_t *_temp, int w)
179 const int w2 = w >> 1;
181 TYPE *b = (TYPE *)_b;
182 TYPE *temp = (TYPE *)_temp;
184 temp[0] = COMPOSE_DAUB97iL1(b[w2], b[0], b[w2]);
185 for (x = 1; x < w2; x++) {
186 temp[x ] = COMPOSE_DAUB97iL1(b[x+w2-1], b[x ], b[x+w2]);
187 temp[x+w2-1] = COMPOSE_DAUB97iH1(temp[x-1], b[x+w2-1], temp[x]);
189 temp[w-1] = COMPOSE_DAUB97iH1(temp[w2-1], b[w-1], temp[w2-1]);
191 // second stage combined with interleave and shift
192 b0 = b2 = COMPOSE_DAUB97iL0(temp[w2], temp[0], temp[w2]);
193 b[0] = (b0 + 1) >> 1;
194 for (x = 1; x < w2; x++) {
195 b2 = COMPOSE_DAUB97iL0(temp[x+w2-1], temp[x ], temp[x+w2]);
196 b1 = COMPOSE_DAUB97iH0( b0, temp[x+w2-1], b2 );
197 b[2*x-1] = (b1 + 1) >> 1;
198 b[2*x ] = (b2 + 1) >> 1;
201 b[w-1] = (COMPOSE_DAUB97iH0(b2, temp[w-1], b2) + 1) >> 1;
204 static void RENAME(vertical_compose_dirac53iH0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
208 TYPE *b0 = (TYPE *)_b0;
209 TYPE *b1 = (TYPE *)_b1;
210 TYPE *b2 = (TYPE *)_b2;
211 for(i=0; i<width; i++){
212 b1[i] = COMPOSE_DIRAC53iH0(b0[i], b1[i], b2[i]);
216 static void RENAME(vertical_compose_dd97iH0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
217 uint8_t *_b3, uint8_t *_b4, int width)
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++){
226 b2[i] = COMPOSE_DD97iH0(b0[i], b1[i], b2[i], b3[i], b4[i]);
230 static void RENAME(vertical_compose_dd137iL0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2,
231 uint8_t *_b3, uint8_t *_b4, int width)
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++){
240 b2[i] = COMPOSE_DD137iL0(b0[i], b1[i], b2[i], b3[i], b4[i]);
244 static void RENAME(vertical_compose_haar)(uint8_t *_b0, uint8_t *_b1, int width)
247 TYPE *b0 = (TYPE *)_b0;
248 TYPE *b1 = (TYPE *)_b1;
250 for (i = 0; i < width; i++) {
251 b0[i] = COMPOSE_HAARiL0(b0[i], b1[i]);
252 b1[i] = COMPOSE_HAARiH0(b1[i], b0[i]);
256 static void RENAME(vertical_compose_fidelityiH0)(uint8_t *_dst, uint8_t *_b[8], int width)
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]);
273 static void RENAME(vertical_compose_fidelityiL0)(uint8_t *_dst, uint8_t *_b[8], int width)
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]);
291 static void RENAME(vertical_compose_daub97iH0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2, int width)
294 TYPE *b0 = (TYPE *)_b0;
295 TYPE *b1 = (TYPE *)_b1;
296 TYPE *b2 = (TYPE *)_b2;
298 for(i=0; i<width; i++){
299 b1[i] = COMPOSE_DAUB97iH0(b0[i], b1[i], b2[i]);
303 static void RENAME(vertical_compose_daub97iH1)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2, int width)
306 TYPE *b0 = (TYPE *)_b0;
307 TYPE *b1 = (TYPE *)_b1;
308 TYPE *b2 = (TYPE *)_b2;
310 for(i=0; i<width; i++){
311 b1[i] = COMPOSE_DAUB97iH1(b0[i], b1[i], b2[i]);
315 static void RENAME(vertical_compose_daub97iL0)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2, int width)
318 TYPE *b0 = (TYPE *)_b0;
319 TYPE *b1 = (TYPE *)_b1;
320 TYPE *b2 = (TYPE *)_b2;
322 for(i=0; i<width; i++){
323 b1[i] = COMPOSE_DAUB97iL0(b0[i], b1[i], b2[i]);
327 static void RENAME(vertical_compose_daub97iL1)(uint8_t *_b0, uint8_t *_b1, uint8_t *_b2, int width)
330 TYPE *b0 = (TYPE *)_b0;
331 TYPE *b1 = (TYPE *)_b1;
332 TYPE *b2 = (TYPE *)_b2;
334 for(i=0; i<width; i++){
335 b1[i] = COMPOSE_DAUB97iL1(b0[i], b1[i], b2[i]);
339 static void RENAME(spatial_compose_dd97i_dy)(DWTContext *d, int level, int width, int height, int stride)
341 vertical_compose_3tap vertical_compose_l0 = (void*)d->vertical_compose_l0;
342 vertical_compose_5tap vertical_compose_h0 = (void*)d->vertical_compose_h0;
343 DWTCompose *cs = d->cs + level;
347 for (i = 0; i < 6; i++)
349 b[6] = d->buffer + av_clip(y+5, 0, height-2)*stride;
350 b[7] = d->buffer + av_clip(y+6, 1, height-1)*stride;
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++)
363 static void RENAME(spatial_compose_dirac53i_dy)(DWTContext *d, int level, int width, int height, int stride)
365 vertical_compose_3tap vertical_compose_l0 = (void*)d->vertical_compose_l0;
366 vertical_compose_3tap vertical_compose_h0 = (void*)d->vertical_compose_h0;
367 DWTCompose *cs = d->cs + level;
370 uint8_t *b[4] = { cs->b[0], cs->b[1] };
371 b[2] = d->buffer + avpriv_mirror(y+1, height-1)*stride;
372 b[3] = d->buffer + avpriv_mirror(y+2, height-1)*stride;
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);
385 static void RENAME(spatial_compose_dd137i_dy)(DWTContext *d, int level, int width, int height, int stride)
387 vertical_compose_5tap vertical_compose_l0 = (void*)d->vertical_compose_l0;
388 vertical_compose_5tap vertical_compose_h0 = (void*)d->vertical_compose_h0;
389 DWTCompose *cs = d->cs + level;
393 for (i = 0; i < 8; i++)
395 b[8] = d->buffer + av_clip(y+7, 0, height-2)*stride;
396 b[9] = d->buffer + av_clip(y+8, 1, height-1)*stride;
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++)
409 // haar makes the assumption that height is even (always true for dirac)
410 static void RENAME(spatial_compose_haari_dy)(DWTContext *d, int level, int width, int height, int stride)
412 vertical_compose_2tap vertical_compose = (void*)d->vertical_compose;
413 int y = d->cs[level].y;
414 uint8_t *b0 = d->buffer + (y-1)*stride;
415 uint8_t *b1 = d->buffer + (y )*stride;
417 vertical_compose(b0, b1, width);
418 d->horizontal_compose(b0, d->temp, width);
419 d->horizontal_compose(b1, d->temp, width);
424 // Don't do sliced idwt for fidelity; the 9 tap filter makes it a bit annoying
425 // Fortunately, this filter isn't used in practice.
426 static void RENAME(spatial_compose_fidelity)(DWTContext *d, int level, int width, int height, int stride)
428 vertical_compose_9tap vertical_compose_l0 = (void*)d->vertical_compose_l0;
429 vertical_compose_9tap vertical_compose_h0 = (void*)d->vertical_compose_h0;
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;
436 vertical_compose_h0(d->buffer + y*stride, b, width);
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;
442 vertical_compose_l0(d->buffer + y*stride, b, width);
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;
451 static void RENAME(spatial_compose_daub97i_dy)(DWTContext *d, int level, int width, int height, int stride)
453 vertical_compose_3tap vertical_compose_l0 = (void*)d->vertical_compose_l0;
454 vertical_compose_3tap vertical_compose_h0 = (void*)d->vertical_compose_h0;
455 vertical_compose_3tap vertical_compose_l1 = (void*)d->vertical_compose_l1;
456 vertical_compose_3tap vertical_compose_h1 = (void*)d->vertical_compose_h1;
457 DWTCompose *cs = d->cs + level;
461 for (i = 0; i < 4; i++)
463 b[4] = d->buffer + avpriv_mirror(y+3, height-1)*stride;
464 b[5] = d->buffer + avpriv_mirror(y+4, height-1)*stride;
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++)
479 static void RENAME(spatial_compose97i_init)(DWTCompose *cs, uint8_t *buffer, int height, int stride)
481 cs->b[0] = buffer + avpriv_mirror(-3-1, height-1)*stride;
482 cs->b[1] = buffer + avpriv_mirror(-3 , height-1)*stride;
483 cs->b[2] = buffer + avpriv_mirror(-3+1, height-1)*stride;
484 cs->b[3] = buffer + avpriv_mirror(-3+2, height-1)*stride;
488 static void RENAME(spatial_compose53i_init)(DWTCompose *cs, uint8_t *buffer, int height, int stride)
490 cs->b[0] = buffer + avpriv_mirror(-1-1, height-1)*stride;
491 cs->b[1] = buffer + avpriv_mirror(-1 , height-1)*stride;
495 static void RENAME(spatial_compose_dd97i_init)(DWTCompose *cs, uint8_t *buffer, int height, int stride)
497 cs->b[0] = buffer + av_clip(-5-1, 0, height-2)*stride;
498 cs->b[1] = buffer + av_clip(-5 , 1, height-1)*stride;
499 cs->b[2] = buffer + av_clip(-5+1, 0, height-2)*stride;
500 cs->b[3] = buffer + av_clip(-5+2, 1, height-1)*stride;
501 cs->b[4] = buffer + av_clip(-5+3, 0, height-2)*stride;
502 cs->b[5] = buffer + av_clip(-5+4, 1, height-1)*stride;
506 static void RENAME(spatial_compose_dd137i_init)(DWTCompose *cs, uint8_t *buffer, int height, int stride)
508 cs->b[0] = buffer + av_clip(-5-1, 0, height-2)*stride;
509 cs->b[1] = buffer + av_clip(-5 , 1, height-1)*stride;
510 cs->b[2] = buffer + av_clip(-5+1, 0, height-2)*stride;
511 cs->b[3] = buffer + av_clip(-5+2, 1, height-1)*stride;
512 cs->b[4] = buffer + av_clip(-5+3, 0, height-2)*stride;
513 cs->b[5] = buffer + av_clip(-5+4, 1, height-1)*stride;
514 cs->b[6] = buffer + av_clip(-5+5, 0, height-2)*stride;
515 cs->b[7] = buffer + av_clip(-5+6, 1, height-1)*stride;
519 static int RENAME(ff_spatial_idwt_init)(DWTContext *d, enum dwt_type type)
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;
530 case DWT_DIRAC_DD9_7:
531 RENAME(spatial_compose_dd97i_init)(d->cs+level, d->buffer, hl, stride_l);
533 case DWT_DIRAC_LEGALL5_3:
534 RENAME(spatial_compose53i_init)(d->cs+level, d->buffer, hl, stride_l);
536 case DWT_DIRAC_DD13_7:
537 RENAME(spatial_compose_dd137i_init)(d->cs+level, d->buffer, hl, stride_l);
539 case DWT_DIRAC_HAAR0:
540 case DWT_DIRAC_HAAR1:
543 case DWT_DIRAC_DAUB9_7:
544 RENAME(spatial_compose97i_init)(d->cs+level, d->buffer, hl, stride_l);
553 case DWT_DIRAC_DD9_7:
554 d->spatial_compose = RENAME(spatial_compose_dd97i_dy);
555 d->vertical_compose_l0 = (void*)RENAME(vertical_compose53iL0);
556 d->vertical_compose_h0 = (void*)RENAME(vertical_compose_dd97iH0);
557 d->horizontal_compose = RENAME(horizontal_compose_dd97i);
560 case DWT_DIRAC_LEGALL5_3:
561 d->spatial_compose = RENAME(spatial_compose_dirac53i_dy);
562 d->vertical_compose_l0 = (void*)RENAME(vertical_compose53iL0);
563 d->vertical_compose_h0 = (void*)RENAME(vertical_compose_dirac53iH0);
564 d->horizontal_compose = RENAME(horizontal_compose_dirac53i);
567 case DWT_DIRAC_DD13_7:
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);
574 case DWT_DIRAC_HAAR0:
575 case DWT_DIRAC_HAAR1:
576 d->spatial_compose = RENAME(spatial_compose_haari_dy);
577 d->vertical_compose = (void*)RENAME(vertical_compose_haar);
578 if (type == DWT_DIRAC_HAAR0)
579 d->horizontal_compose = RENAME(horizontal_compose_haar0i);
581 d->horizontal_compose = RENAME(horizontal_compose_haar1i);
584 case DWT_DIRAC_FIDELITY:
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);
589 d->support = 0; // not really used
591 case DWT_DIRAC_DAUB9_7:
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);
601 return AVERROR_INVALIDDATA;