libavcodec/snowenc.c File Reference

#include "libavutil/intmath.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
#include "dsputil.h"
#include "dwt.h"
#include "snow.h"
#include "rangecoder.h"
#include "mathops.h"
#include "mpegvideo.h"
#include "h263.h"
#include <assert.h>

Go to the source code of this file.

Defines

#define QUANTIZE2   0
#define P_LEFT   P[1]
#define P_TOP   P[2]
#define P_TOPRIGHT   P[3]
#define P_MEDIAN   P[4]
#define P_MV1   P[9]
#define FLAG_QPEL   1
#define OFFSET(x)   offsetof(SnowContext, x)
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM

Functions

static av_cold int encode_init (AVCodecContext *avctx)
static int pix_sum (uint8_t *pix, int line_size, int w)
static int pix_norm1 (uint8_t *pix, int line_size, int w)
static int encode_q_branch (SnowContext *s, int level, int x, int y)
static void encode_q_branch2 (SnowContext *s, int level, int x, int y)
static int get_dc (SnowContext *s, int mb_x, int mb_y, int plane_index)
static int get_block_bits (SnowContext *s, int x, int y, int w)
static int get_block_rd (SnowContext *s, int mb_x, int mb_y, int plane_index, const uint8_t *obmc_edged)
static int get_4block_rd (SnowContext *s, int mb_x, int mb_y, int plane_index)
static int encode_subband_c0run (SnowContext *s, SubBand *b, const IDWTELEM *src, const IDWTELEM *parent, int stride, int orientation)
static int encode_subband (SnowContext *s, SubBand *b, const IDWTELEM *src, const IDWTELEM *parent, int stride, int orientation)
static av_always_inline int check_block (SnowContext *s, int mb_x, int mb_y, int p[3], int intra, const uint8_t *obmc_edged, int *best_rd)
static av_always_inline int check_block_inter (SnowContext *s, int mb_x, int mb_y, int p0, int p1, const uint8_t *obmc_edged, int *best_rd)
static av_always_inline int check_4block_inter (SnowContext *s, int mb_x, int mb_y, int p0, int p1, int ref, int *best_rd)
static void iterative_me (SnowContext *s)
static void encode_blocks (SnowContext *s, int search)
static void quantize (SnowContext *s, SubBand *b, IDWTELEM *dst, DWTELEM *src, int stride, int bias)
static void dequantize (SnowContext *s, SubBand *b, IDWTELEM *src, int stride)
static void decorrelate (SnowContext *s, SubBand *b, IDWTELEM *src, int stride, int inverse, int use_median)
static void correlate (SnowContext *s, SubBand *b, IDWTELEM *src, int stride, int inverse, int use_median)
static void encode_qlogs (SnowContext *s)
static void encode_header (SnowContext *s)
static void update_last_header_values (SnowContext *s)
static int qscale2qlog (int qscale)
static int ratecontrol_1pass (SnowContext *s, AVFrame *pict)
static void calculate_visual_weight (SnowContext *s, Plane *p)
static int encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
static av_cold int encode_end (AVCodecContext *avctx)

Variables

static const AVOption options []
static const AVClass snowenc_class
AVCodec ff_snow_encoder


Define Documentation

#define FLAG_QPEL   1

Definition at line 295 of file snowenc.c.

#define OFFSET (  )     offsetof(SnowContext, x)

Definition at line 1907 of file snowenc.c.

#define P_LEFT   P[1]

Definition at line 290 of file snowenc.c.

#define P_MEDIAN   P[4]

Definition at line 293 of file snowenc.c.

#define P_MV1   P[9]

Definition at line 294 of file snowenc.c.

#define P_TOP   P[2]

Definition at line 291 of file snowenc.c.

#define P_TOPRIGHT   P[3]

Definition at line 292 of file snowenc.c.

#define QUANTIZE2   0

Definition at line 39 of file snowenc.c.

Referenced by encode_frame().

#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM

Definition at line 1908 of file snowenc.c.


Function Documentation

static void calculate_visual_weight ( SnowContext s,
Plane p 
) [static]

Definition at line 1578 of file snowenc.c.

Referenced by encode_frame().

static av_always_inline int check_4block_inter ( SnowContext s,
int  mb_x,
int  mb_y,
int  p0,
int  p1,
int  ref,
int *  best_rd 
) [static]

Definition at line 1004 of file snowenc.c.

Referenced by iterative_me().

static av_always_inline int check_block ( SnowContext s,
int  mb_x,
int  mb_y,
int  p[3],
int  intra,
const uint8_t obmc_edged,
int *  best_rd 
) [static]

Definition at line 958 of file snowenc.c.

Referenced by check_block_inter(), and iterative_me().

static av_always_inline int check_block_inter ( SnowContext s,
int  mb_x,
int  mb_y,
int  p0,
int  p1,
const uint8_t obmc_edged,
int *  best_rd 
) [static]

Definition at line 999 of file snowenc.c.

Referenced by iterative_me().

static void correlate ( SnowContext s,
SubBand b,
IDWTELEM src,
int  stride,
int  inverse,
int  use_median 
) [static]

Definition at line 1393 of file snowenc.c.

Referenced by encode_frame().

static void decorrelate ( SnowContext s,
SubBand b,
IDWTELEM src,
int  stride,
int  inverse,
int  use_median 
) [static]

Definition at line 1369 of file snowenc.c.

Referenced by encode_frame(), and ratecontrol_1pass().

static void dequantize ( SnowContext s,
SubBand b,
IDWTELEM src,
int  stride 
) [static]

Definition at line 1347 of file snowenc.c.

Referenced by encode_frame().

static void encode_blocks ( SnowContext s,
int  search 
) [static]

Definition at line 1264 of file snowenc.c.

Referenced by encode_frame().

static av_cold int encode_end ( AVCodecContext avctx  )  [static]

Definition at line 1894 of file snowenc.c.

static int encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame pict,
int *  got_packet 
) [static]

Definition at line 1604 of file snowenc.c.

static void encode_header ( SnowContext s  )  [static]

Definition at line 1430 of file snowenc.c.

Referenced by encode_frame().

static av_cold int encode_init ( AVCodecContext avctx  )  [static]

Definition at line 156 of file snowenc.c.

static int encode_q_branch ( SnowContext s,
int  level,
int  x,
int  y 
) [static]

Definition at line 297 of file snowenc.c.

Referenced by encode_blocks(), and iterative_me().

static void encode_q_branch2 ( SnowContext s,
int  level,
int  x,
int  y 
) [static]

Definition at line 521 of file snowenc.c.

Referenced by encode_blocks().

static void encode_qlogs ( SnowContext s  )  [static]

Definition at line 1417 of file snowenc.c.

Referenced by encode_header().

static int encode_subband ( SnowContext s,
SubBand b,
const IDWTELEM src,
const IDWTELEM parent,
int  stride,
int  orientation 
) [static]

Definition at line 951 of file snowenc.c.

Referenced by encode_frame().

static int encode_subband_c0run ( SnowContext s,
SubBand b,
const IDWTELEM src,
const IDWTELEM parent,
int  stride,
int  orientation 
) [static]

Definition at line 832 of file snowenc.c.

Referenced by encode_subband().

static int get_4block_rd ( SnowContext s,
int  mb_x,
int  mb_y,
int  plane_index 
) [static]

Definition at line 766 of file snowenc.c.

Referenced by check_4block_inter(), and iterative_me().

static int get_block_bits ( SnowContext s,
int  x,
int  y,
int  w 
) [inline, static]

Definition at line 630 of file snowenc.c.

Referenced by get_4block_rd(), and get_block_rd().

static int get_block_rd ( SnowContext s,
int  mb_x,
int  mb_y,
int  plane_index,
const uint8_t obmc_edged 
) [static]

Definition at line 668 of file snowenc.c.

Referenced by check_block().

static int get_dc ( SnowContext s,
int  mb_x,
int  mb_y,
int  plane_index 
) [static]

Definition at line 575 of file snowenc.c.

static void iterative_me ( SnowContext s  )  [static]

Definition at line 1042 of file snowenc.c.

Referenced by encode_blocks().

static int pix_norm1 ( uint8_t pix,
int  line_size,
int  w 
) [static]

Definition at line 273 of file snowenc.c.

Referenced by encode_q_branch().

static int pix_sum ( uint8_t pix,
int  line_size,
int  w 
) [static]

Definition at line 257 of file snowenc.c.

Referenced by encode_q_branch().

static int qscale2qlog ( int  qscale  )  [static]

< 64 > 60

Definition at line 1521 of file snowenc.c.

Referenced by encode_frame(), and ratecontrol_1pass().

static void quantize ( SnowContext s,
SubBand b,
IDWTELEM dst,
DWTELEM src,
int  stride,
int  bias 
) [static]

Definition at line 1286 of file snowenc.c.

static int ratecontrol_1pass ( SnowContext s,
AVFrame pict 
) [static]

Definition at line 1526 of file snowenc.c.

Referenced by encode_frame().

static void update_last_header_values ( SnowContext s  )  [static]

Definition at line 1501 of file snowenc.c.

Referenced by encode_frame().


Variable Documentation

Initial value:

 {
    .name           = "snow",
    .type           = AVMEDIA_TYPE_VIDEO,
    .id             = CODEC_ID_SNOW,
    .priv_data_size = sizeof(SnowContext),
    .init           = encode_init,
    .encode2        = encode_frame,
    .close          = encode_end,
    .long_name      = NULL_IF_CONFIG_SMALL("Snow"),
    .priv_class     = &snowenc_class,
}

Definition at line 1922 of file snowenc.c.

const AVOption options[] [static]

Initial value:

 {
    { "memc_only",      "Only do ME/MC (I frames -> ref, P frame -> ME+MC).",   OFFSET(memc_only), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
    { "no_bitstream",   "Skip final bitstream writeout.",                    OFFSET(no_bitstream), AV_OPT_TYPE_INT, { 0 }, 0, 1, VE },
    { NULL },
}

Definition at line 1909 of file snowenc.c.

const AVClass snowenc_class [static]

Initial value:

 {
    .class_name = "snow encoder",
    .item_name  = av_default_item_name,
    .option     = options,
    .version    = LIBAVUTIL_VERSION_INT,
}

Definition at line 1915 of file snowenc.c.


Generated on Fri Oct 26 02:47:59 2012 for FFmpeg by  doxygen 1.5.8