FFmpeg
jpeg2000dwt.h
Go to the documentation of this file.
1 /*
2  * Discrete wavelet transform
3  * Copyright (c) 2007 Kamil Nowosad
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 #ifndef AVCODEC_JPEG2000DWT_H
23 #define AVCODEC_JPEG2000DWT_H
24 
25 /**
26  * @file
27  * Discrete wavelet transform
28  */
29 
30 #include <stdint.h>
31 
32 #define FF_DWT_MAX_DECLVLS 32 ///< max number of decomposition levels
33 #define F_LFTG_K 1.230174104914001f
34 #define F_LFTG_X 0.812893066115961f
35 
36 enum DWTType {
41 };
42 
43 typedef struct DWTContext {
44  /// line lengths { horizontal, vertical } in consecutive decomposition levels
46  uint8_t mod[FF_DWT_MAX_DECLVLS][2]; ///< coordinates (x0, y0) of decomp. levels mod 2
47  uint8_t ndeclevels; ///< number of decomposition levels
48  uint8_t type; ///< 0 for 9/7; 1 for 5/3
49  int32_t *i_linebuf; ///< int buffer used by transform
50  float *f_linebuf; ///< float buffer used by transform
51 } DWTContext;
52 
53 /**
54  * Initialize DWT.
55  * @param s DWT context
56  * @param border coordinates of transformed region {{x0, x1}, {y0, y1}}
57  * @param decomp_levels number of decomposition levels
58  * @param type 0 for DWT 9/7; 1 for DWT 5/3
59  */
60 int ff_jpeg2000_dwt_init(DWTContext *s, int border[2][2],
61  int decomp_levels, int type);
62 
63 int ff_dwt_encode(DWTContext *s, void *t);
64 int ff_dwt_decode(DWTContext *s, void *t);
65 
67 
68 #endif /* AVCODEC_JPEG2000DWT_H */
DWTContext::f_linebuf
float * f_linebuf
float buffer used by transform
Definition: jpeg2000dwt.h:50
FF_DWT_NB
@ FF_DWT_NB
Definition: jpeg2000dwt.h:40
FF_DWT97
@ FF_DWT97
Definition: jpeg2000dwt.h:37
DWTContext::i_linebuf
int32_t * i_linebuf
int buffer used by transform
Definition: jpeg2000dwt.h:49
DWTContext::ndeclevels
uint8_t ndeclevels
number of decomposition levels
Definition: jpeg2000dwt.h:47
DWTContext::type
uint8_t type
0 for 9/7; 1 for 5/3
Definition: jpeg2000dwt.h:48
ff_dwt_encode
int ff_dwt_encode(DWTContext *s, void *t)
Definition: jpeg2000dwt.c:581
type
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf type
Definition: writing_filters.txt:86
s
#define s(width, name)
Definition: cbs_vp9.c:257
int32_t
int32_t
Definition: audio_convert.c:194
DWTContext::linelen
int linelen[FF_DWT_MAX_DECLVLS][2]
line lengths { horizontal, vertical } in consecutive decomposition levels
Definition: jpeg2000dwt.h:45
ff_dwt_destroy
void ff_dwt_destroy(DWTContext *s)
Definition: jpeg2000dwt.c:620
FF_DWT_MAX_DECLVLS
#define FF_DWT_MAX_DECLVLS
max number of decomposition levels
Definition: jpeg2000dwt.h:32
uint8_t
uint8_t
Definition: audio_convert.c:194
DWTContext
Definition: dirac_dwt.h:54
FF_DWT53
@ FF_DWT53
Definition: jpeg2000dwt.h:38
DWTContext::mod
uint8_t mod[FF_DWT_MAX_DECLVLS][2]
coordinates (x0, y0) of decomp. levels mod 2
Definition: jpeg2000dwt.h:46
ff_jpeg2000_dwt_init
int ff_jpeg2000_dwt_init(DWTContext *s, int border[2][2], int decomp_levels, int type)
Initialize DWT.
Definition: jpeg2000dwt.c:537
DWTType
DWTType
Definition: jpeg2000dwt.h:36
FF_DWT97_INT
@ FF_DWT97_INT
Definition: jpeg2000dwt.h:39
ff_dwt_decode
int ff_dwt_decode(DWTContext *s, void *t)
Definition: jpeg2000dwt.c:599