OpenJPEG  2.4.0
Data Structures | Macros
DWT - Implementation of a discrete wavelet transform

Data Structures

struct  dwt_local
 
union  opj_v8_t
 
struct  v8dwt_local
 

Macros

#define OPJ_WS(i)   v->mem[(i)*2]
 
#define OPJ_WD(i)   v->mem[(1+(i)*2)]
 
#define VREG_INT_COUNT   4
 Number of int32 values in a SSE2 register. More...
 
#define PARALLEL_COLS_53   (2*VREG_INT_COUNT)
 Number of columns that we can process in parallel in the vertical pass. More...
 

Local data structures

typedef struct dwt_local opj_dwt_t
 
typedef struct v8dwt_local opj_v8dwt_t
 
static const OPJ_FLOAT32 opj_dwt_alpha = -1.586134342f
 
static const OPJ_FLOAT32 opj_dwt_beta = -0.052980118f
 
static const OPJ_FLOAT32 opj_dwt_gamma = 0.882911075f
 
static const OPJ_FLOAT32 opj_dwt_delta = 0.443506852f
 
static const OPJ_FLOAT32 opj_K = 1.230174105f
 
static const OPJ_FLOAT32 opj_invK = (OPJ_FLOAT32)(1.0 / 1.230174105)
 
#define NB_ELTS_V8   8
 

Local static functions

typedef void(* opj_encode_and_deinterleave_v_fnptr_type) (void *array, void *tmp, OPJ_UINT32 height, OPJ_BOOL even, OPJ_UINT32 stride_width, OPJ_UINT32 cols)
 
typedef void(* opj_encode_and_deinterleave_h_one_row_fnptr_type) (void *row, void *tmp, OPJ_UINT32 width, OPJ_BOOL even)
 
static void opj_dwt_deinterleave_h (const OPJ_INT32 *OPJ_RESTRICT a, OPJ_INT32 *OPJ_RESTRICT b, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas)
 Forward lazy transform (horizontal) More...
 
static void opj_dwt_encode_1_real (void *a, OPJ_INT32 dn, OPJ_INT32 sn, OPJ_INT32 cas)
 Forward 9-7 wavelet transform in 1-D. More...
 
static void opj_dwt_encode_stepsize (OPJ_INT32 stepsize, OPJ_INT32 numbps, opj_stepsize_t *bandno_stepsize)
 Explicit calculation of the Quantization Stepsizes. More...
 
static OPJ_BOOL opj_dwt_decode_tile (opj_thread_pool_t *tp, opj_tcd_tilecomp_t *tilec, OPJ_UINT32 i)
 Inverse wavelet transform in 2-D. More...
 
static OPJ_BOOL opj_dwt_decode_partial_tile (opj_tcd_tilecomp_t *tilec, OPJ_UINT32 numres)
 
static OPJ_BOOL opj_dwt_encode_procedure (opj_thread_pool_t *tp, opj_tcd_tilecomp_t *tilec, opj_encode_and_deinterleave_v_fnptr_type p_encode_and_deinterleave_v, opj_encode_and_deinterleave_h_one_row_fnptr_type p_encode_and_deinterleave_h_one_row)
 
static OPJ_UINT32 opj_dwt_max_resolution (opj_tcd_resolution_t *OPJ_RESTRICT r, OPJ_UINT32 i)
 

Exported functions

OPJ_BOOL opj_dwt_encode (opj_tcd_t *p_tcd, opj_tcd_tilecomp_t *tilec)
 Forward 5-3 wavelet transform in 2-D. More...
 
OPJ_BOOL opj_dwt_decode (opj_tcd_t *p_tcd, opj_tcd_tilecomp_t *tilec, OPJ_UINT32 numres)
 Inverse 5-3 wavelet transform in 2-D. More...
 
OPJ_FLOAT64 opj_dwt_getnorm (OPJ_UINT32 level, OPJ_UINT32 orient)
 Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT. More...
 
OPJ_BOOL opj_dwt_encode_real (opj_tcd_t *p_tcd, opj_tcd_tilecomp_t *tilec)
 Forward 9-7 wavelet transform in 2-D. More...
 
OPJ_BOOL opj_dwt_decode_real (opj_tcd_t *p_tcd, opj_tcd_tilecomp_t *OPJ_RESTRICT tilec, OPJ_UINT32 numres)
 Inverse 9-7 wavelet transform in 2-D. More...
 
OPJ_FLOAT64 opj_dwt_getnorm_real (OPJ_UINT32 level, OPJ_UINT32 orient)
 Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT. More...
 
void opj_dwt_calc_explicit_stepsizes (opj_tccp_t *tccp, OPJ_UINT32 prec)
 Explicit calculation of the Quantization Stepsizes. More...
 

Detailed Description

Macro Definition Documentation

#define NB_ELTS_V8   8
#define OPJ_WD (   i)    v->mem[(1+(i)*2)]
#define OPJ_WS (   i)    v->mem[(i)*2]
#define PARALLEL_COLS_53   (2*VREG_INT_COUNT)

Number of columns that we can process in parallel in the vertical pass.

Referenced by opj_dwt_decode_tile(), opj_dwt_decode_v_func(), opj_idwt53_h(), and opj_idwt53_v().

#define VREG_INT_COUNT   4

Number of int32 values in a SSE2 register.

Referenced by opj_idwt53_h().

Typedef Documentation

typedef struct dwt_local opj_dwt_t
typedef void(* opj_encode_and_deinterleave_h_one_row_fnptr_type) (void *row, void *tmp, OPJ_UINT32 width, OPJ_BOOL even)
typedef void(* opj_encode_and_deinterleave_v_fnptr_type) (void *array, void *tmp, OPJ_UINT32 height, OPJ_BOOL even, OPJ_UINT32 stride_width, OPJ_UINT32 cols)
typedef struct v8dwt_local opj_v8dwt_t

Function Documentation

void opj_dwt_calc_explicit_stepsizes ( opj_tccp_t tccp,
OPJ_UINT32  prec 
)

Explicit calculation of the Quantization Stepsizes.

Parameters
tccpTile-component coding parameters
precPrecint analyzed

References J2K_CCP_QNTSTY_NOQNT, opj_tccp::numresolutions, opj_dwt_encode_stepsize(), opj_dwt_getnorm_real(), opj_tccp::qmfbid, opj_tccp::qntsty, and opj_tccp::stepsizes.

Referenced by opj_j2k_setup_encoder().

OPJ_BOOL opj_dwt_decode ( opj_tcd_t p_tcd,
opj_tcd_tilecomp_t tilec,
OPJ_UINT32  numres 
)

Inverse 5-3 wavelet transform in 2-D.

Apply a reversible inverse DWT transform to a component of an image.

Parameters
p_tcdTCD handle
tilecTile component information (current tile)
numresNumber of resolution levels to decode

References opj_dwt_decode_partial_tile(), opj_dwt_decode_tile(), opj_tcd::thread_pool, and opj_tcd::whole_tile_decoding.

Referenced by main(), and opj_tcd_dwt_decode().

static OPJ_BOOL opj_dwt_decode_partial_tile ( opj_tcd_tilecomp_t tilec,
OPJ_UINT32  numres 
)
static
OPJ_BOOL opj_dwt_decode_real ( opj_tcd_t p_tcd,
opj_tcd_tilecomp_t *OPJ_RESTRICT  tilec,
OPJ_UINT32  numres 
)

Inverse 9-7 wavelet transform in 2-D.

Apply an irreversible inverse DWT transform to a component of an image.

Parameters
p_tcdTCD handle
tilecTile component information (current tile)
numresNumber of resolution levels to decode

References opj_dwt_decode_partial_97(), opj_dwt_decode_tile_97(), opj_tcd::thread_pool, and opj_tcd::whole_tile_decoding.

Referenced by main(), and opj_tcd_dwt_decode().

static OPJ_BOOL opj_dwt_decode_tile ( opj_thread_pool_t tp,
opj_tcd_tilecomp_t tilec,
OPJ_UINT32  i 
)
static
static void opj_dwt_deinterleave_h ( const OPJ_INT32 *OPJ_RESTRICT  a,
OPJ_INT32 *OPJ_RESTRICT  b,
OPJ_INT32  dn,
OPJ_INT32  sn,
OPJ_INT32  cas 
)
static
OPJ_BOOL opj_dwt_encode ( opj_tcd_t p_tcd,
opj_tcd_tilecomp_t tilec 
)

Forward 5-3 wavelet transform in 2-D.

Apply a reversible DWT transform to a component of an image.

Parameters
p_tcdTCD handle
tilecTile component information (current tile)

References opj_dwt_encode_and_deinterleave_h_one_row(), opj_dwt_encode_and_deinterleave_v(), opj_dwt_encode_procedure(), and opj_tcd::thread_pool.

Referenced by main(), and opj_tcd_dwt_encode().

static void opj_dwt_encode_1_real ( void *  a,
OPJ_INT32  dn,
OPJ_INT32  sn,
OPJ_INT32  cas 
)
static
static INLINE OPJ_BOOL opj_dwt_encode_procedure ( opj_thread_pool_t tp,
opj_tcd_tilecomp_t tilec,
opj_encode_and_deinterleave_v_fnptr_type  p_encode_and_deinterleave_v,
opj_encode_and_deinterleave_h_one_row_fnptr_type  p_encode_and_deinterleave_h_one_row 
)
static
OPJ_BOOL opj_dwt_encode_real ( opj_tcd_t p_tcd,
opj_tcd_tilecomp_t tilec 
)

Forward 9-7 wavelet transform in 2-D.

Apply an irreversible DWT transform to a component of an image.

Parameters
p_tcdTCD handle
tilecTile component information (current tile)

References opj_dwt_encode_and_deinterleave_h_one_row_real(), opj_dwt_encode_and_deinterleave_v_real(), opj_dwt_encode_procedure(), and opj_tcd::thread_pool.

Referenced by main(), and opj_tcd_dwt_encode().

static void opj_dwt_encode_stepsize ( OPJ_INT32  stepsize,
OPJ_INT32  numbps,
opj_stepsize_t bandno_stepsize 
)
static

Explicit calculation of the Quantization Stepsizes.

References opj_stepsize::expn, opj_stepsize::mant, and opj_int_floorlog2().

Referenced by opj_dwt_calc_explicit_stepsizes().

OPJ_FLOAT64 opj_dwt_getnorm ( OPJ_UINT32  level,
OPJ_UINT32  orient 
)

Get the norm of a wavelet function of a subband at a specified level for the reversible 5-3 DWT.

Parameters
levelLevel of the wavelet function
orientBand of the wavelet function
Returns
Returns the norm of the wavelet function

Referenced by opj_t1_getwmsedec().

OPJ_FLOAT64 opj_dwt_getnorm_real ( OPJ_UINT32  level,
OPJ_UINT32  orient 
)

Get the norm of a wavelet function of a subband at a specified level for the irreversible 9-7 DWT.

Parameters
levelLevel of the wavelet function
orientBand of the wavelet function
Returns
Returns the norm of the 9-7 wavelet

Referenced by opj_dwt_calc_explicit_stepsizes(), and opj_t1_getwmsedec().

static OPJ_UINT32 opj_dwt_max_resolution ( opj_tcd_resolution_t *OPJ_RESTRICT  r,
OPJ_UINT32  i 
)
static

Variable Documentation

const OPJ_FLOAT32 opj_dwt_alpha = -1.586134342f
static
const OPJ_FLOAT32 opj_dwt_beta = -0.052980118f
static
const OPJ_FLOAT32 opj_dwt_delta = 0.443506852f
static
const OPJ_FLOAT32 opj_dwt_gamma = 0.882911075f
static
const OPJ_FLOAT32 opj_invK = (OPJ_FLOAT32)(1.0 / 1.230174105)
static
const OPJ_FLOAT32 opj_K = 1.230174105f
static