dirac_dwt.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2004-2010 Michael Niedermayer <michaelni@gmx.at>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVCODEC_DIRAC_DWT_H
22 #define AVCODEC_DIRAC_DWT_H
23 
24 #include <stdint.h>
25 
26 typedef int DWTELEM;
27 typedef short IDWTELEM;
28 
29 #define MAX_DWT_SUPPORT 8
30 #define MAX_DECOMPOSITIONS 8
31 
32 typedef struct DWTCompose {
34  int y;
35 } DWTCompose;
36 
37 struct DWTContext;
38 
39 // Possible prototypes for vertical_compose functions
44 
45 typedef struct DWTContext {
48  int width;
49  int height;
50  int stride;
52  int support;
53 
54  void (*spatial_compose)(struct DWTContext *cs, int level, int width, int height, int stride);
59  void (*vertical_compose)(void); ///< one set of lowpass and highpass combined
61 
63 } DWTContext;
64 
65 enum dwt_type {
76 };
77 
78 // -1 if an error occurred, e.g. the dwt_type isn't recognized
80  int stride, enum dwt_type type, int decomposition_count,
81  IDWTELEM *temp);
82 
85 
87 
88 // shared stuff for simd optimiztions
89 #define COMPOSE_53iL0(b0, b1, b2)\
90  (b1 - ((b0 + b2 + 2) >> 2))
91 
92 #define COMPOSE_DIRAC53iH0(b0, b1, b2)\
93  (b1 + ((b0 + b2 + 1) >> 1))
94 
95 #define COMPOSE_DD97iH0(b0, b1, b2, b3, b4)\
96  (b2 + ((-b0 + 9*b1 + 9*b3 - b4 + 8) >> 4))
97 
98 #define COMPOSE_DD137iL0(b0, b1, b2, b3, b4)\
99  (b2 - ((-b0 + 9*b1 + 9*b3 - b4 + 16) >> 5))
100 
101 #define COMPOSE_HAARiL0(b0, b1)\
102  (b0 - ((b1 + 1) >> 1))
103 
104 #define COMPOSE_HAARiH0(b0, b1)\
105  (b0 + b1)
106 
107 #define COMPOSE_FIDELITYiL0(b0, b1, b2, b3, b4, b5, b6, b7, b8)\
108  (b4 - ((-8*(b0+b8) + 21*(b1+b7) - 46*(b2+b6) + 161*(b3+b5) + 128) >> 8))
109 
110 #define COMPOSE_FIDELITYiH0(b0, b1, b2, b3, b4, b5, b6, b7, b8)\
111  (b4 + ((-2*(b0+b8) + 10*(b1+b7) - 25*(b2+b6) + 81*(b3+b5) + 128) >> 8))
112 
113 #define COMPOSE_DAUB97iL1(b0, b1, b2)\
114  (b1 - ((1817*(b0 + b2) + 2048) >> 12))
115 
116 #define COMPOSE_DAUB97iH1(b0, b1, b2)\
117  (b1 - (( 113*(b0 + b2) + 64) >> 7))
118 
119 #define COMPOSE_DAUB97iL0(b0, b1, b2)\
120  (b1 + (( 217*(b0 + b2) + 2048) >> 12))
121 
122 #define COMPOSE_DAUB97iH0(b0, b1, b2)\
123  (b1 + ((6497*(b0 + b2) + 2048) >> 12))
124 
125 
126 #endif /* AVCODEC_DWT_H */
else temp
Definition: vf_mcdeint.c:148
void(* vertical_compose_l0)(void)
Definition: dirac_dwt.h:55
IDWTELEM * temp
Definition: dirac_dwt.h:47
struct DWTContext DWTContext
int stride
Definition: mace.c:144
int decomposition_count
Definition: dirac_dwt.h:51
short IDWTELEM
Definition: dirac_dwt.h:27
set threshold d
void(* vertical_compose_2tap)(IDWTELEM *b0, IDWTELEM *b1, int width)
Definition: dirac_dwt.h:40
int ff_spatial_idwt2(IDWTELEM *buffer, int width, int height, int stride, enum dwt_type type, int decomposition_count, IDWTELEM *temp)
Definition: dirac_dwt.c:572
void(* vertical_compose_3tap)(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
Definition: dirac_dwt.h:41
int support
Definition: dirac_dwt.h:52
void ff_spatial_idwt_slice2(DWTContext *d, int y)
Definition: dirac_dwt.c:558
int ff_spatial_idwt_init2(DWTContext *d, IDWTELEM *buffer, int width, int height, int stride, enum dwt_type type, int decomposition_count, IDWTELEM *temp)
Definition: dirac_dwt.c:461
#define MAX_DWT_SUPPORT
Definition: dirac_dwt.h:29
IDWTELEM * b0
Definition: snow_dwt.h:32
void(* vertical_compose_l1)(void)
Definition: dirac_dwt.h:57
IDWTELEM * b3
Definition: snow_dwt.h:35
FIXME Range Coding of cr are level
Definition: snow.txt:367
dwt_type
Definition: dirac_dwt.h:65
static int width
Definition: tests/utils.c:158
void(* vertical_compose_9tap)(IDWTELEM *dst, IDWTELEM *b[8], int width)
Definition: dirac_dwt.h:43
typedef void(RENAME(mix_any_func_type))
int DWTELEM
Definition: dirac_dwt.h:26
struct DWTCompose DWTCompose
BYTE int const BYTE int int int height
Definition: avisynth_c.h:713
void(* horizontal_compose)(IDWTELEM *b, IDWTELEM *tmp, int width)
Definition: dirac_dwt.h:60
IDWTELEM * buffer
Definition: dirac_dwt.h:46
void(* vertical_compose)(void)
one set of lowpass and highpass combined
Definition: dirac_dwt.h:59
DWTCompose cs[MAX_DECOMPOSITIONS]
Definition: dirac_dwt.h:62
#define type
int stride
Definition: dirac_dwt.h:50
IDWTELEM * b1
Definition: snow_dwt.h:33
#define MAX_DECOMPOSITIONS
Definition: dirac_dwt.h:30
void(* vertical_compose_5tap)(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, int width)
Definition: dirac_dwt.h:42
IDWTELEM * b2
Definition: snow_dwt.h:34
IDWTELEM * b[MAX_DWT_SUPPORT]
Definition: dirac_dwt.h:33
the buffer and buffer reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFilterBuffer structures They must not be accessed but through references stored in AVFilterBufferRef structures Several references can point to the same buffer
else dst[i][x+y *dst_stride[i]]
Definition: vf_mcdeint.c:160
int height
Definition: dirac_dwt.h:49
void(* vertical_compose_h0)(void)
Definition: dirac_dwt.h:56
int width
Definition: dirac_dwt.h:48
void(* vertical_compose_h1)(void)
Definition: dirac_dwt.h:58