FFmpeg  4.0
Data Structures | Macros | Functions | Variables
snow.h File Reference
#include "libavutil/motion_vector.h"
#include "hpeldsp.h"
#include "me_cmp.h"
#include "qpeldsp.h"
#include "snow_dwt.h"
#include "rangecoder.h"
#include "mathops.h"
#include "mpegvideo.h"
#include "h264qpel.h"

Go to the source code of this file.

Data Structures

struct  BlockNode
 
struct  x_and_coeff
 
struct  SubBand
 
struct  Plane
 
struct  SnowContext
 

Macros

#define FF_ME_ITER   3
 
#define MID_STATE   128
 
#define MAX_PLANES   4
 
#define QSHIFT   5
 
#define QROOT   (1<<QSHIFT)
 
#define LOSSLESS_QLOG   -128
 
#define FRAC_BITS   4
 
#define MAX_REF_FRAMES   8
 
#define LOG2_OBMC_MAX   8
 
#define OBMC_MAX   (1<<(LOG2_OBMC_MAX))
 
#define BLOCK_INTRA   1
 Intra block, inter otherwise. More...
 
#define BLOCK_OPT   2
 Block needs no checks in this round of iterative motion estiation. More...
 
#define LOG2_MB_SIZE   4
 
#define MB_SIZE   (1<<LOG2_MB_SIZE)
 
#define ENCODER_EXTRA_BITS   4
 
#define HTAPS_MAX   8
 
#define QBIAS_SHIFT   3
 
#define ME_CACHE_SIZE   1024
 
#define QEXPSHIFT   (7-FRAC_BITS+8)
 

Functions

static av_always_inline void snow_interleave_line_header (int *i, int width, IDWTELEM *low, IDWTELEM *high)
 
static av_always_inline void snow_interleave_line_footer (int *i, IDWTELEM *low, IDWTELEM *high)
 
static av_always_inline void snow_horizontal_compose_lift_lead_out (int i, IDWTELEM *dst, IDWTELEM *src, IDWTELEM *ref, int width, int w, int lift_high, int mul, int add, int shift)
 
static av_always_inline void snow_horizontal_compose_liftS_lead_out (int i, IDWTELEM *dst, IDWTELEM *src, IDWTELEM *ref, int width, int w)
 
int ff_snow_common_init (AVCodecContext *avctx)
 
int ff_snow_common_init_after_header (AVCodecContext *avctx)
 
void ff_snow_common_end (SnowContext *s)
 
void ff_snow_release_buffer (AVCodecContext *avctx)
 
void ff_snow_reset_contexts (SnowContext *s)
 
int ff_snow_alloc_blocks (SnowContext *s)
 
int ff_snow_frame_start (SnowContext *s)
 
void ff_snow_pred_block (SnowContext *s, uint8_t *dst, uint8_t *tmp, ptrdiff_t stride, int sx, int sy, int b_w, int b_h, const BlockNode *block, int plane_index, int w, int h)
 
int ff_snow_get_buffer (SnowContext *s, AVFrame *frame)
 
static void pred_mv (SnowContext *s, int *mx, int *my, int ref, const BlockNode *left, const BlockNode *top, const BlockNode *tr)
 
static av_always_inline int same_block (BlockNode *a, BlockNode *b)
 
static av_always_inline void add_yblock (SnowContext *s, int sliced, slice_buffer *sb, IDWTELEM *dst, uint8_t *dst8, const uint8_t *obmc, int src_x, int src_y, int b_w, int b_h, int w, int h, int dst_stride, int src_stride, int obmc_stride, int b_x, int b_y, int add, int offset_dst, int plane_index)
 
static av_always_inline void predict_slice (SnowContext *s, IDWTELEM *buf, int plane_index, int add, int mb_y)
 
static av_always_inline void predict_plane (SnowContext *s, IDWTELEM *buf, int plane_index, int add)
 
static void set_blocks (SnowContext *s, int level, int x, int y, int l, int cb, int cr, int mx, int my, int ref, int type)
 
static void init_ref (MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3], uint8_t *ref2[3], int x, int y, int ref_index)
 
static void put_symbol (RangeCoder *c, uint8_t *state, int v, int is_signed)
 
static int get_symbol (RangeCoder *c, uint8_t *state, int is_signed)
 
static void put_symbol2 (RangeCoder *c, uint8_t *state, int v, int log2)
 
static int get_symbol2 (RangeCoder *c, uint8_t *state, int log2)
 
static void unpack_coeffs (SnowContext *s, SubBand *b, SubBand *parent, int orientation)
 

Variables

static const BlockNode null_block
 
const uint8_t *const ff_obmc_tab [4]
 
uint8_t ff_qexp [QROOT]
 
int ff_scale_mv_ref [MAX_REF_FRAMES][MAX_REF_FRAMES]
 
const int8_t ff_quant3bA [256]
 

Macro Definition Documentation

◆ FF_ME_ITER

#define FF_ME_ITER   3

Definition at line 38 of file snow.h.

Referenced by encode_blocks(), and encode_init().

◆ MID_STATE

#define MID_STATE   128

Definition at line 40 of file snow.h.

Referenced by decode_header(), encode_header(), and ff_snow_reset_contexts().

◆ MAX_PLANES

#define MAX_PLANES   4

Definition at line 42 of file snow.h.

◆ QSHIFT

#define QSHIFT   5

◆ QROOT

#define QROOT   (1<<QSHIFT)

◆ LOSSLESS_QLOG

#define LOSSLESS_QLOG   -128

◆ FRAC_BITS

#define FRAC_BITS   4

Definition at line 46 of file snow.h.

Referenced by add_yblock(), and predict_slice().

◆ MAX_REF_FRAMES

#define MAX_REF_FRAMES   8

Definition at line 47 of file snow.h.

Referenced by decode_header(), encode_init(), ff_snow_common_end(), and mca().

◆ LOG2_OBMC_MAX

#define LOG2_OBMC_MAX   8

Definition at line 49 of file snow.h.

Referenced by add_yblock(), ff_snow_inner_add_yblock(), get_block_rd(), and get_dc().

◆ OBMC_MAX

#define OBMC_MAX   (1<<(LOG2_OBMC_MAX))

Definition at line 50 of file snow.h.

◆ BLOCK_INTRA

#define BLOCK_INTRA   1

◆ BLOCK_OPT

#define BLOCK_OPT   2

Block needs no checks in this round of iterative motion estiation.

Definition at line 59 of file snow.h.

Referenced by iterative_me().

◆ LOG2_MB_SIZE

#define LOG2_MB_SIZE   4

Definition at line 73 of file snow.h.

Referenced by encode_q_branch(), and ff_snow_alloc_blocks().

◆ MB_SIZE

#define MB_SIZE   (1<<LOG2_MB_SIZE)

Definition at line 74 of file snow.h.

Referenced by add_yblock(), and predict_slice().

◆ ENCODER_EXTRA_BITS

#define ENCODER_EXTRA_BITS   4

Definition at line 75 of file snow.h.

Referenced by encode_frame(), and quantize().

◆ HTAPS_MAX

#define HTAPS_MAX   8

◆ QBIAS_SHIFT

#define QBIAS_SHIFT   3

Definition at line 164 of file snow.h.

Referenced by decode_subband_slice_buffered(), dequantize(), and dequantize_slice_buffered().

◆ ME_CACHE_SIZE

#define ME_CACHE_SIZE   1024

Definition at line 172 of file snow.h.

Referenced by check_4block_inter(), and check_block().

◆ QEXPSHIFT

#define QEXPSHIFT   (7-FRAC_BITS+8)

Function Documentation

◆ snow_interleave_line_header()

static av_always_inline void snow_interleave_line_header ( int i,
int  width,
IDWTELEM low,
IDWTELEM high 
)
static

Definition at line 202 of file snow.h.

◆ snow_interleave_line_footer()

static av_always_inline void snow_interleave_line_footer ( int i,
IDWTELEM low,
IDWTELEM high 
)
static

Definition at line 211 of file snow.h.

◆ snow_horizontal_compose_lift_lead_out()

static av_always_inline void snow_horizontal_compose_lift_lead_out ( int  i,
IDWTELEM dst,
IDWTELEM src,
IDWTELEM ref,
int  width,
int  w,
int  lift_high,
int  mul,
int  add,
int  shift 
)
static

Definition at line 218 of file snow.h.

◆ snow_horizontal_compose_liftS_lead_out()

static av_always_inline void snow_horizontal_compose_liftS_lead_out ( int  i,
IDWTELEM dst,
IDWTELEM src,
IDWTELEM ref,
int  width,
int  w 
)
static

Definition at line 228 of file snow.h.

◆ ff_snow_common_init()

int ff_snow_common_init ( AVCodecContext avctx)

◆ ff_snow_common_init_after_header()

int ff_snow_common_init_after_header ( AVCodecContext avctx)

Definition at line 514 of file snow.c.

Referenced by decode_frame(), encode_frame(), and snow_horizontal_compose_liftS_lead_out().

◆ ff_snow_common_end()

void ff_snow_common_end ( SnowContext s)

Definition at line 693 of file snow.c.

Referenced by decode_end(), encode_end(), and snow_horizontal_compose_liftS_lead_out().

◆ ff_snow_release_buffer()

void ff_snow_release_buffer ( AVCodecContext avctx)

◆ ff_snow_reset_contexts()

void ff_snow_reset_contexts ( SnowContext s)

Definition at line 96 of file snow.c.

Referenced by decode_header(), encode_header(), and snow_horizontal_compose_liftS_lead_out().

◆ ff_snow_alloc_blocks()

int ff_snow_alloc_blocks ( SnowContext s)

Definition at line 110 of file snow.c.

Referenced by decode_frame(), encode_init(), and snow_horizontal_compose_liftS_lead_out().

◆ ff_snow_frame_start()

int ff_snow_frame_start ( SnowContext s)

Definition at line 655 of file snow.c.

Referenced by decode_frame(), encode_frame(), and snow_horizontal_compose_liftS_lead_out().

◆ ff_snow_pred_block()

void ff_snow_pred_block ( SnowContext s,
uint8_t dst,
uint8_t tmp,
ptrdiff_t  stride,
int  sx,
int  sy,
int  b_w,
int  b_h,
const BlockNode block,
int  plane_index,
int  w,
int  h 
)

Definition at line 327 of file snow.c.

Referenced by add_yblock(), get_block_rd(), and snow_horizontal_compose_liftS_lead_out().

◆ ff_snow_get_buffer()

int ff_snow_get_buffer ( SnowContext s,
AVFrame frame 
)

Definition at line 69 of file snow.c.

Referenced by encode_init(), ff_snow_frame_start(), and snow_horizontal_compose_liftS_lead_out().

◆ pred_mv()

static void pred_mv ( SnowContext s,
int mx,
int my,
int  ref,
const BlockNode left,
const BlockNode top,
const BlockNode tr 
)
inlinestatic

Definition at line 254 of file snow.h.

◆ same_block()

static av_always_inline int same_block ( BlockNode a,
BlockNode b 
)
static

Definition at line 270 of file snow.h.

Referenced by add_yblock(), encode_q_branch2(), get_4block_rd(), and iterative_me().

◆ add_yblock()

static av_always_inline void add_yblock ( SnowContext s,
int  sliced,
slice_buffer sb,
IDWTELEM dst,
uint8_t dst8,
const uint8_t obmc,
int  src_x,
int  src_y,
int  b_w,
int  b_h,
int  w,
int  h,
int  dst_stride,
int  src_stride,
int  obmc_stride,
int  b_x,
int  b_y,
int  add,
int  offset_dst,
int  plane_index 
)
static

Definition at line 280 of file snow.h.

Referenced by get_4block_rd(), get_dc(), predict_slice(), and predict_slice_buffered().

◆ predict_slice()

static av_always_inline void predict_slice ( SnowContext s,
IDWTELEM buf,
int  plane_index,
int  add,
int  mb_y 
)
static

Definition at line 404 of file snow.h.

Referenced by predict_plane().

◆ predict_plane()

static av_always_inline void predict_plane ( SnowContext s,
IDWTELEM buf,
int  plane_index,
int  add 
)
static

Definition at line 455 of file snow.h.

Referenced by decode_frame(), and encode_frame().

◆ set_blocks()

static void set_blocks ( SnowContext s,
int  level,
int  x,
int  y,
int  l,
int  cb,
int  cr,
int  mx,
int  my,
int  ref,
int  type 
)
inlinestatic

Definition at line 462 of file snow.h.

Referenced by decode_q_branch(), encode_q_branch(), and encode_q_branch2().

◆ init_ref()

static void init_ref ( MotionEstContext c,
uint8_t src[3],
uint8_t ref[3],
uint8_t ref2[3],
int  x,
int  y,
int  ref_index 
)
inlinestatic

Definition at line 487 of file snow.h.

◆ put_symbol()

static void put_symbol ( RangeCoder c,
uint8_t state,
int  v,
int  is_signed 
)
inlinestatic

Definition at line 509 of file snow.h.

◆ get_symbol()

static int get_symbol ( RangeCoder c,
uint8_t state,
int  is_signed 
)
inlinestatic

Definition at line 540 of file snow.h.

◆ put_symbol2()

static void put_symbol2 ( RangeCoder c,
uint8_t state,
int  v,
int  log2 
)
inlinestatic

Definition at line 563 of file snow.h.

Referenced by encode_subband_c0run().

◆ get_symbol2()

static int get_symbol2 ( RangeCoder c,
uint8_t state,
int  log2 
)
inlinestatic

Definition at line 583 of file snow.h.

Referenced by unpack_coeffs().

◆ unpack_coeffs()

static void unpack_coeffs ( SnowContext s,
SubBand b,
SubBand parent,
int  orientation 
)
inlinestatic

Definition at line 603 of file snow.h.

Referenced by decode_frame().

Variable Documentation

◆ null_block

const BlockNode null_block
static
Initial value:
= {
.color= {128,128,128},
.mx= 0,
.my= 0,
.ref= 0,
.type= 0,
.level= 0,
}

Definition at line 64 of file snow.h.

Referenced by decode_q_branch(), encode_q_branch(), encode_q_branch2(), and get_block_bits().

◆ ff_obmc_tab

const uint8_t* const ff_obmc_tab[4]

◆ ff_qexp

uint8_t ff_qexp[QROOT]

◆ ff_scale_mv_ref

int ff_scale_mv_ref[MAX_REF_FRAMES][MAX_REF_FRAMES]

Definition at line 129 of file snowdata.h.

Referenced by mca(), and pred_mv().

◆ ff_quant3bA

const int8_t ff_quant3bA[256]

Definition at line 104 of file snowdata.h.

Referenced by encode_subband_c0run(), init_ref(), and unpack_coeffs().