FFmpeg
Macros | Functions
snow_dwt.c File Reference
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "me_cmp.h"
#include "snow_dwt.h"

Go to the source code of this file.

Macros

#define LIFT(src, ref, inv)   ((src) + ((inv) ? -(ref) : +(ref)))
 
#define LIFTS(src, ref, inv)
 

Functions

int ff_slice_buffer_init (slice_buffer *buf, int line_count, int max_allocated_lines, int line_width, IDWTELEM *base_buffer)
 
IDWTELEMff_slice_buffer_load_line (slice_buffer *buf, int line)
 
void ff_slice_buffer_release (slice_buffer *buf, int line)
 
void ff_slice_buffer_flush (slice_buffer *buf)
 
void ff_slice_buffer_destroy (slice_buffer *buf)
 
static av_always_inline void lift (DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse)
 
static av_always_inline void liftS (DWTELEM *dst, DWTELEM *src, DWTELEM *ref, int dst_step, int src_step, int ref_step, int width, int mul, int add, int shift, int highpass, int inverse)
 
static void horizontal_decompose53i (DWTELEM *b, DWTELEM *temp, int width)
 
static void vertical_decompose53iH0 (DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width)
 
static void vertical_decompose53iL0 (DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width)
 
static void spatial_decompose53i (DWTELEM *buffer, DWTELEM *temp, int width, int height, int stride)
 
static void horizontal_decompose97i (DWTELEM *b, DWTELEM *temp, int width)
 
static void vertical_decompose97iH0 (DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width)
 
static void vertical_decompose97iH1 (DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width)
 
static void vertical_decompose97iL0 (DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width)
 
static void vertical_decompose97iL1 (DWTELEM *b0, DWTELEM *b1, DWTELEM *b2, int width)
 
static void spatial_decompose97i (DWTELEM *buffer, DWTELEM *temp, int width, int height, int stride)
 
void ff_spatial_dwt (DWTELEM *buffer, DWTELEM *temp, int width, int height, int stride, int type, int decomposition_count)
 
static void horizontal_compose53i (IDWTELEM *b, IDWTELEM *temp, int width)
 
static void vertical_compose53iH0 (IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
 
static void vertical_compose53iL0 (IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
 
static void spatial_compose53i_buffered_init (DWTCompose *cs, slice_buffer *sb, int height, int stride_line)
 
static void spatial_compose53i_init (DWTCompose *cs, IDWTELEM *buffer, int height, int stride)
 
static void spatial_compose53i_dy_buffered (DWTCompose *cs, slice_buffer *sb, IDWTELEM *temp, int width, int height, int stride_line)
 
static void spatial_compose53i_dy (DWTCompose *cs, IDWTELEM *buffer, IDWTELEM *temp, int width, int height, int stride)
 
static void snow_horizontal_compose97i (IDWTELEM *b, IDWTELEM *temp, int width)
 
static void vertical_compose97iH0 (IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
 
static void vertical_compose97iH1 (IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
 
static void vertical_compose97iL0 (IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
 
static void vertical_compose97iL1 (IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, int width)
 
static void snow_vertical_compose97i (IDWTELEM *b0, IDWTELEM *b1, IDWTELEM *b2, IDWTELEM *b3, IDWTELEM *b4, IDWTELEM *b5, int width)
 
static void spatial_compose97i_buffered_init (DWTCompose *cs, slice_buffer *sb, int height, int stride_line)
 
static void spatial_compose97i_init (DWTCompose *cs, IDWTELEM *buffer, int height, int stride)
 
static void spatial_compose97i_dy_buffered (SnowDWTContext *dsp, DWTCompose *cs, slice_buffer *sb, IDWTELEM *temp, int width, int height, int stride_line)
 
static void spatial_compose97i_dy (DWTCompose *cs, IDWTELEM *buffer, IDWTELEM *temp, int width, int height, int stride)
 
void ff_spatial_idwt_buffered_init (DWTCompose *cs, slice_buffer *sb, int width, int height, int stride_line, int type, int decomposition_count)
 
void ff_spatial_idwt_buffered_slice (SnowDWTContext *dsp, DWTCompose *cs, slice_buffer *slice_buf, IDWTELEM *temp, int width, int height, int stride_line, int type, int decomposition_count, int y)
 
static void spatial_idwt_init (DWTCompose *cs, IDWTELEM *buffer, int width, int height, int stride, int type, int decomposition_count)
 
static void spatial_idwt_slice (DWTCompose *cs, IDWTELEM *buffer, IDWTELEM *temp, int width, int height, int stride, int type, int decomposition_count, int y)
 
void ff_spatial_idwt (IDWTELEM *buffer, IDWTELEM *temp, int width, int height, int stride, int type, int decomposition_count)
 
static int w_c (struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int w, int h, int type)
 
static int w53_8_c (struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h)
 
static int w97_8_c (struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h)
 
static int w53_16_c (struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h)
 
static int w97_16_c (struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h)
 
int ff_w53_32_c (struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h)
 
int ff_w97_32_c (struct MpegEncContext *v, const uint8_t *pix1, const uint8_t *pix2, ptrdiff_t line_size, int h)
 
av_cold void ff_dsputil_init_dwt (MECmpContext *c)
 
av_cold void ff_dwt_init (SnowDWTContext *c)
 

Macro Definition Documentation

◆ LIFT

#define LIFT (   src,
  ref,
  inv 
)    ((src) + ((inv) ? -(ref) : +(ref)))

◆ LIFTS

#define LIFTS (   src,
  ref,
  inv 
)
Value:
((inv) ? (src) + (((ref) + 4 * (src)) >> shift) \
: -((-16 * (src) + (ref) + add / \
4 + 1 + (5 << 25)) / (5 * 4) - (1 << 23)))

Function Documentation

◆ ff_slice_buffer_init()

int ff_slice_buffer_init ( slice_buffer *  buf,
int  line_count,
int  max_allocated_lines,
int  line_width,
IDWTELEM base_buffer 
)

Definition at line 29 of file snow_dwt.c.

Referenced by decode_frame().

◆ ff_slice_buffer_load_line()

IDWTELEM* ff_slice_buffer_load_line ( slice_buffer *  buf,
int  line 
)

Definition at line 63 of file snow_dwt.c.

◆ ff_slice_buffer_release()

void ff_slice_buffer_release ( slice_buffer *  buf,
int  line 
)

Definition at line 79 of file snow_dwt.c.

Referenced by decode_frame(), and ff_slice_buffer_flush().

◆ ff_slice_buffer_flush()

void ff_slice_buffer_flush ( slice_buffer *  buf)

Definition at line 92 of file snow_dwt.c.

Referenced by decode_frame(), and ff_slice_buffer_destroy().

◆ ff_slice_buffer_destroy()

void ff_slice_buffer_destroy ( slice_buffer *  buf)

Definition at line 104 of file snow_dwt.c.

Referenced by decode_end(), and decode_frame().

◆ lift()

static av_always_inline void lift ( DWTELEM dst,
DWTELEM src,
DWTELEM ref,
int  dst_step,
int  src_step,
int  ref_step,
int  width,
int  mul,
int  add,
int  shift,
int  highpass,
int  inverse 
)
static

Definition at line 116 of file snow_dwt.c.

Referenced by horizontal_decompose53i(), and horizontal_decompose97i().

◆ liftS()

static av_always_inline void liftS ( DWTELEM dst,
DWTELEM src,
DWTELEM ref,
int  dst_step,
int  src_step,
int  ref_step,
int  width,
int  mul,
int  add,
int  shift,
int  highpass,
int  inverse 
)
static

Definition at line 146 of file snow_dwt.c.

Referenced by horizontal_decompose97i().

◆ horizontal_decompose53i()

static void horizontal_decompose53i ( DWTELEM b,
DWTELEM temp,
int  width 
)
static

Definition at line 179 of file snow_dwt.c.

Referenced by spatial_decompose53i().

◆ vertical_decompose53iH0()

static void vertical_decompose53iH0 ( DWTELEM b0,
DWTELEM b1,
DWTELEM b2,
int  width 
)
static

Definition at line 195 of file snow_dwt.c.

Referenced by spatial_decompose53i().

◆ vertical_decompose53iL0()

static void vertical_decompose53iL0 ( DWTELEM b0,
DWTELEM b1,
DWTELEM b2,
int  width 
)
static

Definition at line 204 of file snow_dwt.c.

Referenced by spatial_decompose53i().

◆ spatial_decompose53i()

static void spatial_decompose53i ( DWTELEM buffer,
DWTELEM temp,
int  width,
int  height,
int  stride 
)
static

Definition at line 213 of file snow_dwt.c.

Referenced by ff_spatial_dwt().

◆ horizontal_decompose97i()

static void horizontal_decompose97i ( DWTELEM b,
DWTELEM temp,
int  width 
)
static

Definition at line 239 of file snow_dwt.c.

Referenced by spatial_decompose97i().

◆ vertical_decompose97iH0()

static void vertical_decompose97iH0 ( DWTELEM b0,
DWTELEM b1,
DWTELEM b2,
int  width 
)
static

Definition at line 249 of file snow_dwt.c.

Referenced by spatial_decompose97i().

◆ vertical_decompose97iH1()

static void vertical_decompose97iH1 ( DWTELEM b0,
DWTELEM b1,
DWTELEM b2,
int  width 
)
static

Definition at line 258 of file snow_dwt.c.

Referenced by spatial_decompose97i().

◆ vertical_decompose97iL0()

static void vertical_decompose97iL0 ( DWTELEM b0,
DWTELEM b1,
DWTELEM b2,
int  width 
)
static

Definition at line 267 of file snow_dwt.c.

Referenced by spatial_decompose97i().

◆ vertical_decompose97iL1()

static void vertical_decompose97iL1 ( DWTELEM b0,
DWTELEM b1,
DWTELEM b2,
int  width 
)
static

Definition at line 277 of file snow_dwt.c.

Referenced by spatial_decompose97i().

◆ spatial_decompose97i()

static void spatial_decompose97i ( DWTELEM buffer,
DWTELEM temp,
int  width,
int  height,
int  stride 
)
static

Definition at line 286 of file snow_dwt.c.

Referenced by ff_spatial_dwt().

◆ ff_spatial_dwt()

void ff_spatial_dwt ( DWTELEM buffer,
DWTELEM temp,
int  width,
int  height,
int  stride,
int  type,
int  decomposition_count 
)

Definition at line 320 of file snow_dwt.c.

Referenced by encode_frame(), main(), and w_c().

◆ horizontal_compose53i()

static void horizontal_compose53i ( IDWTELEM b,
IDWTELEM temp,
int  width 
)
static

Definition at line 341 of file snow_dwt.c.

Referenced by spatial_compose53i_dy(), and spatial_compose53i_dy_buffered().

◆ vertical_compose53iH0()

static void vertical_compose53iH0 ( IDWTELEM b0,
IDWTELEM b1,
IDWTELEM b2,
int  width 
)
static

Definition at line 366 of file snow_dwt.c.

Referenced by spatial_compose53i_dy(), and spatial_compose53i_dy_buffered().

◆ vertical_compose53iL0()

static void vertical_compose53iL0 ( IDWTELEM b0,
IDWTELEM b1,
IDWTELEM b2,
int  width 
)
static

◆ spatial_compose53i_buffered_init()

static void spatial_compose53i_buffered_init ( DWTCompose cs,
slice_buffer *  sb,
int  height,
int  stride_line 
)
static

Definition at line 384 of file snow_dwt.c.

Referenced by ff_spatial_idwt_buffered_init().

◆ spatial_compose53i_init()

static void spatial_compose53i_init ( DWTCompose cs,
IDWTELEM buffer,
int  height,
int  stride 
)
static

Definition at line 393 of file snow_dwt.c.

Referenced by spatial_idwt_init(), and spatial_idwt_init_TMPL().

◆ spatial_compose53i_dy_buffered()

static void spatial_compose53i_dy_buffered ( DWTCompose cs,
slice_buffer *  sb,
IDWTELEM temp,
int  width,
int  height,
int  stride_line 
)
static

Definition at line 401 of file snow_dwt.c.

Referenced by ff_spatial_idwt_buffered_slice().

◆ spatial_compose53i_dy()

static void spatial_compose53i_dy ( DWTCompose cs,
IDWTELEM buffer,
IDWTELEM temp,
int  width,
int  height,
int  stride 
)
static

Definition at line 441 of file snow_dwt.c.

Referenced by spatial_idwt_slice().

◆ snow_horizontal_compose97i()

static void snow_horizontal_compose97i ( IDWTELEM b,
IDWTELEM temp,
int  width 
)
static

Definition at line 466 of file snow_dwt.c.

Referenced by ff_dwt_init(), and spatial_compose97i_dy().

◆ vertical_compose97iH0()

static void vertical_compose97iH0 ( IDWTELEM b0,
IDWTELEM b1,
IDWTELEM b2,
int  width 
)
static

Definition at line 494 of file snow_dwt.c.

Referenced by spatial_compose97i_dy(), and spatial_compose97i_dy_buffered().

◆ vertical_compose97iH1()

static void vertical_compose97iH1 ( IDWTELEM b0,
IDWTELEM b1,
IDWTELEM b2,
int  width 
)
static

Definition at line 503 of file snow_dwt.c.

Referenced by spatial_compose97i_dy(), and spatial_compose97i_dy_buffered().

◆ vertical_compose97iL0()

static void vertical_compose97iL0 ( IDWTELEM b0,
IDWTELEM b1,
IDWTELEM b2,
int  width 
)
static

Definition at line 512 of file snow_dwt.c.

Referenced by spatial_compose97i_dy(), and spatial_compose97i_dy_buffered().

◆ vertical_compose97iL1()

static void vertical_compose97iL1 ( IDWTELEM b0,
IDWTELEM b1,
IDWTELEM b2,
int  width 
)
static

Definition at line 521 of file snow_dwt.c.

Referenced by spatial_compose97i_dy(), and spatial_compose97i_dy_buffered().

◆ snow_vertical_compose97i()

static void snow_vertical_compose97i ( IDWTELEM b0,
IDWTELEM b1,
IDWTELEM b2,
IDWTELEM b3,
IDWTELEM b4,
IDWTELEM b5,
int  width 
)
static

Definition at line 530 of file snow_dwt.c.

Referenced by ff_dwt_init().

◆ spatial_compose97i_buffered_init()

static void spatial_compose97i_buffered_init ( DWTCompose cs,
slice_buffer *  sb,
int  height,
int  stride_line 
)
static

Definition at line 544 of file snow_dwt.c.

Referenced by ff_spatial_idwt_buffered_init().

◆ spatial_compose97i_init()

static void spatial_compose97i_init ( DWTCompose cs,
IDWTELEM buffer,
int  height,
int  stride 
)
static

Definition at line 554 of file snow_dwt.c.

Referenced by spatial_idwt_init(), and spatial_idwt_init_TMPL().

◆ spatial_compose97i_dy_buffered()

static void spatial_compose97i_dy_buffered ( SnowDWTContext dsp,
DWTCompose cs,
slice_buffer *  sb,
IDWTELEM temp,
int  width,
int  height,
int  stride_line 
)
static

Definition at line 564 of file snow_dwt.c.

Referenced by ff_spatial_idwt_buffered_slice().

◆ spatial_compose97i_dy()

static void spatial_compose97i_dy ( DWTCompose cs,
IDWTELEM buffer,
IDWTELEM temp,
int  width,
int  height,
int  stride 
)
static

Definition at line 607 of file snow_dwt.c.

Referenced by spatial_idwt_slice().

◆ ff_spatial_idwt_buffered_init()

void ff_spatial_idwt_buffered_init ( DWTCompose cs,
slice_buffer *  sb,
int  width,
int  height,
int  stride_line,
int  type,
int  decomposition_count 
)

Definition at line 640 of file snow_dwt.c.

Referenced by decode_frame().

◆ ff_spatial_idwt_buffered_slice()

void ff_spatial_idwt_buffered_slice ( SnowDWTContext dsp,
DWTCompose cs,
slice_buffer *  slice_buf,
IDWTELEM temp,
int  width,
int  height,
int  stride_line,
int  type,
int  decomposition_count,
int  y 
)

Definition at line 659 of file snow_dwt.c.

Referenced by decode_frame().

◆ spatial_idwt_init()

static void spatial_idwt_init ( DWTCompose cs,
IDWTELEM buffer,
int  width,
int  height,
int  stride,
int  type,
int  decomposition_count 
)
static

Definition at line 688 of file snow_dwt.c.

Referenced by ff_spatial_idwt().

◆ spatial_idwt_slice()

static void spatial_idwt_slice ( DWTCompose cs,
IDWTELEM buffer,
IDWTELEM temp,
int  width,
int  height,
int  stride,
int  type,
int  decomposition_count,
int  y 
)
static

Definition at line 707 of file snow_dwt.c.

Referenced by ff_spatial_idwt().

◆ ff_spatial_idwt()

void ff_spatial_idwt ( IDWTELEM buffer,
IDWTELEM temp,
int  width,
int  height,
int  stride,
int  type,
int  decomposition_count 
)

Definition at line 732 of file snow_dwt.c.

Referenced by calculate_visual_weight(), encode_frame(), and main().

◆ w_c()

static int w_c ( struct MpegEncContext v,
const uint8_t *  pix1,
const uint8_t *  pix2,
ptrdiff_t  line_size,
int  w,
int  h,
int  type 
)
inlinestatic

Definition at line 744 of file snow_dwt.c.

Referenced by ff_w53_32_c(), ff_w97_32_c(), w53_16_c(), w53_8_c(), w97_16_c(), and w97_8_c().

◆ w53_8_c()

static int w53_8_c ( struct MpegEncContext v,
const uint8_t *  pix1,
const uint8_t *  pix2,
ptrdiff_t  line_size,
int  h 
)
static

Definition at line 813 of file snow_dwt.c.

Referenced by ff_dsputil_init_dwt().

◆ w97_8_c()

static int w97_8_c ( struct MpegEncContext v,
const uint8_t *  pix1,
const uint8_t *  pix2,
ptrdiff_t  line_size,
int  h 
)
static

Definition at line 818 of file snow_dwt.c.

Referenced by ff_dsputil_init_dwt().

◆ w53_16_c()

static int w53_16_c ( struct MpegEncContext v,
const uint8_t *  pix1,
const uint8_t *  pix2,
ptrdiff_t  line_size,
int  h 
)
static

Definition at line 823 of file snow_dwt.c.

Referenced by ff_dsputil_init_dwt().

◆ w97_16_c()

static int w97_16_c ( struct MpegEncContext v,
const uint8_t *  pix1,
const uint8_t *  pix2,
ptrdiff_t  line_size,
int  h 
)
static

Definition at line 828 of file snow_dwt.c.

Referenced by ff_dsputil_init_dwt().

◆ ff_w53_32_c()

int ff_w53_32_c ( struct MpegEncContext v,
const uint8_t *  pix1,
const uint8_t *  pix2,
ptrdiff_t  line_size,
int  h 
)

Definition at line 833 of file snow_dwt.c.

Referenced by get_block_rd().

◆ ff_w97_32_c()

int ff_w97_32_c ( struct MpegEncContext v,
const uint8_t *  pix1,
const uint8_t *  pix2,
ptrdiff_t  line_size,
int  h 
)

Definition at line 838 of file snow_dwt.c.

Referenced by get_block_rd().

◆ ff_dsputil_init_dwt()

av_cold void ff_dsputil_init_dwt ( MECmpContext c)

Definition at line 843 of file snow_dwt.c.

Referenced by ff_me_cmp_init().

◆ ff_dwt_init()

av_cold void ff_dwt_init ( SnowDWTContext c)

Definition at line 851 of file snow_dwt.c.

Referenced by ff_snow_common_init().

shift
static int shift(int a, int b)
Definition: bonk.c:261
ref
static int ref[MAX_W *MAX_W]
Definition: jpeg2000dwt.c:117
src
#define src
Definition: vp8dsp.c:248