22 #include "libavutil/attributes.h"
23 #include "libavutil/avassert.h"
24 #include "libavutil/common.h"
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++)
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++)
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++)
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;
567 while (d->
cs[level].
y <=
FFMIN((y>>level)+support, hl))
#define COMPOSE_HAARiH0(b0, b1)
static int shift(int a, int b)
static void horizontal_compose_dd97i(IDWTELEM *b, IDWTELEM *tmp, int w)
static void spatial_compose_dd137i_init(DWTCompose *cs, IDWTELEM *buffer, int height, int stride)
static void horizontal_compose_dd137i(IDWTELEM *b, IDWTELEM *tmp, int w)
static void vertical_compose_daub97iH0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
#define COMPOSE_DAUB97iL0(b0, b1, b2)
static void vertical_compose_dd97iH0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, int width)
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
static void spatial_compose_daub97i_dy(DWTContext *d, int level, int width, int height, int stride)
static av_always_inline void interleave(IDWTELEM *dst, IDWTELEM *src0, IDWTELEM *src1, int w2, int add, int shift)
#define COMPOSE_FIDELITYiH0(b0, b1, b2, b3, b4, b5, b6, b7, b8)
static void vertical_compose_dd137iL0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, int width)
static void vertical_compose_daub97iL0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
void(* spatial_compose)(struct DWTContext *cs, int level, int width, int height, int stride)
#define COMPOSE_DAUB97iL1(b0, b1, b2)
static void spatial_compose_dd97i_init(DWTCompose *cs, IDWTELEM *buffer, int height, int stride)
static void vertical_compose_fidelityiH0(IDWTELEM *dst, IDWTELEM *b[8], int width)
void(* vertical_compose_h1)(void)
#define COMPOSE_DD97iH0(b0, b1, b2, b3, b4)
#define COMPOSE_53iL0(b0, b1, b2)
static void vertical_compose_haar(IDWTELEM *b0, IDWTELEM *b1, int width)
static void spatial_compose97i_init2(DWTCompose *cs, IDWTELEM *buffer, int height, int stride)
#define COMPOSE_DIRAC53iH0(b0, b1, b2)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void(* vertical_compose_9tap)(IDWTELEM *dst, IDWTELEM *b[8], int width)
static void spatial_compose_dd97i_dy(DWTContext *d, int level, int width, int height, int stride)
static void vertical_compose_dirac53iH0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
static void vertical_compose53iL0(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
#define COMPOSE_DAUB97iH1(b0, b1, b2)
static void spatial_compose_dd137i_dy(DWTContext *d, int level, int width, int height, int stride)
static void horizontal_compose_haar0i(IDWTELEM *b, IDWTELEM *temp, int w)
static void vertical_compose_daub97iL1(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
void(* vertical_compose_2tap)(IDWTELEM *b0, IDWTELEM *b1, int width)
void ff_spatial_idwt_slice2(DWTContext *d, int y)
static void spatial_compose53i_init2(DWTCompose *cs, IDWTELEM *buffer, int height, int stride)
static void vertical_compose_fidelityiL0(IDWTELEM *dst, IDWTELEM *b[8], int width)
void(* vertical_compose_h0)(void)
void ff_spatial_idwt_init_mmx(DWTContext *d, enum dwt_type type)
static void spatial_compose_dirac53i_dy(DWTContext *d, int level, int width, int height, int stride)
static void horizontal_compose_daub97i(IDWTELEM *b, IDWTELEM *temp, int w)
void(* vertical_compose_3tap)(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
static void horizontal_compose_haar1i(IDWTELEM *b, IDWTELEM *temp, int w)
BYTE int const BYTE int int int height
void(* horizontal_compose)(IDWTELEM *b, IDWTELEM *tmp, int width)
int ff_spatial_idwt_init2(DWTContext *d, IDWTELEM *buffer, int width, int height, int stride, enum dwt_type type, int decomposition_count, IDWTELEM *temp)
#define COMPOSE_FIDELITYiL0(b0, b1, b2, b3, b4, b5, b6, b7, b8)
static void vertical_compose_daub97iH1(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
DWTCompose cs[MAX_DECOMPOSITIONS]
static int mirror(int v, int m)
static av_always_inline void horizontal_compose_haari(IDWTELEM *b, IDWTELEM *temp, int w, int shift)
static void spatial_compose_fidelity(DWTContext *d, int level, int width, int height, int stride)
static void spatial_compose_haari_dy(DWTContext *d, int level, int width, int height, int stride)
#define COMPOSE_DD137iL0(b0, b1, b2, b3, b4)
IDWTELEM * b[MAX_DWT_SUPPORT]
void(* vertical_compose)(void)
one set of lowpass and highpass combined
#define COMPOSE_HAARiL0(b0, b1)
static void horizontal_compose_fidelityi(IDWTELEM *b, IDWTELEM *tmp, int w)
static void horizontal_compose_dirac53i(IDWTELEM *b, IDWTELEM *temp, int w)
void(* vertical_compose_5tap)(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, int width)
void(* vertical_compose_l0)(void)
#define COMPOSE_DAUB97iH0(b0, b1, b2)
void(* vertical_compose_l1)(void)