FFmpeg
Loading...
Searching...
No Matches
wavelet97.c File Reference
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "wavelet97.h"

Go to the source code of this file.

Functions

static void decompose (float *dst_l, float *dst_h, const float *src, const double coeff[2][5], int linesize, int w)
 
static void compose (float *dst, const float *src_l, const float *src_h, int linesize, int w)
 
static void decompose_decimated (float *dst, const float *src, const double coeff[2][5], int stride, int n)
 
static void compose_decimated (float *dst, const float *src, int stride, int n)
 
void ff_wavelet97_decompose_lines (float *dst_l, float *dst_h, const float *src, const double coeff[2][5], int xlinesize, int ylinesize, int step, int w, int line0, int line1)
 Undecimated analysis of lines line0..line1-1 along one direction.
 
void ff_wavelet97_compose_lines (float *dst, const float *src_l, const float *src_h, int xlinesize, int ylinesize, int step, int w, int line0, int line1)
 Inverse of ff_wavelet97_decompose_lines() with ff_wavelet97_coeff.
 
void ff_wavelet97_decompose_decimated_lines (float *dst, const float *src, const double coeff[2][5], int xstride, int ystride, int len, int line0, int line1)
 Decimated analysis of lines line0..line1-1 along one direction.
 
void ff_wavelet97_compose_decimated_lines (float *dst, const float *src, int xstride, int ystride, int len, int line0, int line1)
 Inverse of ff_wavelet97_decompose_decimated_lines() with ff_wavelet97_coeff.
 
void ff_wavelet97_decompose (float *dst[4], const float *src, float *temp[2], const double coeff[2][5], int linesize, int step, int w, int h)
 One level of undecimated 2D analysis, filters are mirrored at the plane borders.
 
void ff_wavelet97_compose (float *dst, float *const src[4], float *temp[2], int linesize, int step, int w, int h)
 One level of 2D synthesis, the inverse of ff_wavelet97_decompose() with ff_wavelet97_coeff.
 

Variables

const double ff_wavelet97_coeff [2][5]
 Undecimated 9/7 wavelet transform.
 
static const double icoeff [2][5]
 

Function Documentation

◆ decompose()

static void decompose ( float * dst_l,
float * dst_h,
const float * src,
const double coeff[2][5],
int linesize,
int w )
inlinestatic

Definition at line 56 of file wavelet97.c.

Referenced by ff_wavelet97_decompose_lines().

◆ compose()

static void compose ( float * dst,
const float * src_l,
const float * src_h,
int linesize,
int w )
inlinestatic

Definition at line 75 of file wavelet97.c.

Referenced by ff_wavelet97_compose_lines().

◆ decompose_decimated()

static void decompose_decimated ( float * dst,
const float * src,
const double coeff[2][5],
int stride,
int n )
inlinestatic

Definition at line 93 of file wavelet97.c.

Referenced by ff_wavelet97_decompose_decimated_lines().

◆ compose_decimated()

static void compose_decimated ( float * dst,
const float * src,
int stride,
int n )
inlinestatic

Definition at line 107 of file wavelet97.c.

Referenced by ff_wavelet97_compose_decimated_lines().

◆ ff_wavelet97_decompose_lines()

void ff_wavelet97_decompose_lines ( float * dst_l,
float * dst_h,
const float * src,
const double coeff[2][5],
int xlinesize,
int ylinesize,
int step,
int w,
int line0,
int line1 )

Undecimated analysis of lines line0..line1-1 along one direction.

Line y, sample x is at src[y * ylinesize + x * xlinesize], x < w, w >= 2.

Parameters
dst_llowpass output, same layout as src
dst_hhighpass output, same layout as src
coefflowpass and highpass filters, normally ff_wavelet97_coeff
stepdilation of the filters, 1 << level

Definition at line 120 of file wavelet97.c.

Referenced by ff_wavelet97_decompose(), and run_pass_slice().

◆ ff_wavelet97_compose_lines()

void ff_wavelet97_compose_lines ( float * dst,
const float * src_l,
const float * src_h,
int xlinesize,
int ylinesize,
int step,
int w,
int line0,
int line1 )

Inverse of ff_wavelet97_decompose_lines() with ff_wavelet97_coeff.

Definition at line 134 of file wavelet97.c.

Referenced by ff_wavelet97_compose(), and run_pass_slice().

◆ ff_wavelet97_decompose_decimated_lines()

void ff_wavelet97_decompose_decimated_lines ( float * dst,
const float * src,
const double coeff[2][5],
int xstride,
int ystride,
int len,
int line0,
int line1 )

Decimated analysis of lines line0..line1-1 along one direction.

Line y, sample x is at src[y * ystride + x * xstride], x < len, len >= 2. Lowpass coefficients are written to even, highpass ones to odd x of dst.

Parameters
coefflowpass and highpass filters, normally ff_wavelet97_coeff

Definition at line 147 of file wavelet97.c.

Referenced by run_pass_slice().

◆ ff_wavelet97_compose_decimated_lines()

void ff_wavelet97_compose_decimated_lines ( float * dst,
const float * src,
int xstride,
int ystride,
int len,
int line0,
int line1 )

Inverse of ff_wavelet97_decompose_decimated_lines() with ff_wavelet97_coeff.

Definition at line 156 of file wavelet97.c.

Referenced by run_pass_slice().

◆ ff_wavelet97_decompose()

void ff_wavelet97_decompose ( float * dst[4],
const float * src,
float * temp[2],
const double coeff[2][5],
int linesize,
int step,
int w,
int h )

One level of undecimated 2D analysis, filters are mirrored at the plane borders.

Parameters
dstoutput bands LL, LH, HL, HH (horizontal/vertical filter)
srcinput plane
temptwo scratch planes
coefflowpass and highpass filters, normally ff_wavelet97_coeff
linesizedistance between lines in floats, same for all planes
stepdilation of the filters, 1 << level

Definition at line 164 of file wavelet97.c.

Referenced by filter().

◆ ff_wavelet97_compose()

void ff_wavelet97_compose ( float * dst,
float *const src[4],
float * temp[2],
int linesize,
int step,
int w,
int h )

One level of 2D synthesis, the inverse of ff_wavelet97_decompose() with ff_wavelet97_coeff.

Definition at line 173 of file wavelet97.c.

Referenced by filter().

Variable Documentation

◆ ff_wavelet97_coeff

const double ff_wavelet97_coeff[2][5]
Initial value:
= {
{
0.6029490182363579 * M_SQRT2,
0.2668641184428723 * M_SQRT2,
-0.07822326652898785 * M_SQRT2,
-0.01686411844287495 * M_SQRT2,
0.02674875741080976 * M_SQRT2,
},{
1.115087052456994 / M_SQRT2,
-0.5912717631142470 / M_SQRT2,
-0.05754352622849957 / M_SQRT2,
0.09127176311424948 / M_SQRT2,
}
}
#define M_SQRT2

Undecimated 9/7 wavelet transform.

Analysis lowpass and highpass filters, both symmetric around tap 0

Definition at line 26 of file wavelet97.c.

Referenced by filter(), init(), transform_decimated(), and transform_undecimated().

◆ icoeff

const double icoeff[2][5]
static
Initial value:
= {
{
1.115087052456994 / M_SQRT2,
0.5912717631142470 / M_SQRT2,
-0.05754352622849957 / M_SQRT2,
-0.09127176311424948 / M_SQRT2,
},{
0.6029490182363579 * M_SQRT2,
-0.2668641184428723 * M_SQRT2,
-0.07822326652898785 * M_SQRT2,
0.01686411844287495 * M_SQRT2,
0.02674875741080976 * M_SQRT2,
}
}

Definition at line 41 of file wavelet97.c.

Referenced by colormap_slice(), compose(), and compose_decimated().