FFmpeg
Macros | Functions | Variables
svq1enc.c File Reference
#include "avcodec.h"
#include "encode.h"
#include "hpeldsp.h"
#include "me_cmp.h"
#include "mpegvideo.h"
#include "h263.h"
#include "internal.h"
#include "mpegutils.h"
#include "packet_internal.h"
#include "svq1.h"
#include "svq1enc.h"
#include "svq1enc_cb.h"
#include "libavutil/avassert.h"

Go to the source code of this file.

Macros

#define QUALITY_THRESHOLD   100
 
#define THRESHOLD_MULTIPLIER   0.6
 
#define OFFSET(x)   offsetof(struct SVQ1EncContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static void svq1_write_header (SVQ1EncContext *s, int frame_type)
 
static int ssd_int8_vs_int16_c (const int8_t *pix1, const int16_t *pix2, intptr_t size)
 
static int encode_block (SVQ1EncContext *s, uint8_t *src, uint8_t *ref, uint8_t *decoded, int stride, int level, int threshold, int lambda, int intra)
 
static void init_block_index (MpegEncContext *s)
 
static int svq1_encode_plane (SVQ1EncContext *s, int plane, unsigned char *src_plane, unsigned char *ref_plane, unsigned char *decoded_plane, int width, int height, int src_stride, int stride)
 
static av_cold int svq1_encode_end (AVCodecContext *avctx)
 
static av_cold int svq1_encode_init (AVCodecContext *avctx)
 
static int svq1_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
 

Variables

static const AVOption options []
 
static const AVClass svq1enc_class
 
const AVCodec ff_svq1_encoder
 

Detailed Description

Sorenson Vector Quantizer #1 (SVQ1) video codec. For more information of the SVQ1 algorithm, visit: http://www.pcisys.net/~melanson/codecs/

Definition in file svq1enc.c.

Macro Definition Documentation

◆ QUALITY_THRESHOLD

#define QUALITY_THRESHOLD   100

Definition at line 78 of file svq1enc.c.

◆ THRESHOLD_MULTIPLIER

#define THRESHOLD_MULTIPLIER   0.6

Definition at line 79 of file svq1enc.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(struct SVQ1EncContext, x)

Definition at line 659 of file svq1enc.c.

◆ VE

Definition at line 660 of file svq1enc.c.

Function Documentation

◆ svq1_write_header()

static void svq1_write_header ( SVQ1EncContext s,
int  frame_type 
)
static

Definition at line 44 of file svq1enc.c.

Referenced by svq1_encode_frame().

◆ ssd_int8_vs_int16_c()

static int ssd_int8_vs_int16_c ( const int8_t *  pix1,
const int16_t *  pix2,
intptr_t  size 
)
static

Definition at line 81 of file svq1enc.c.

Referenced by svq1_encode_init().

◆ encode_block()

static int encode_block ( SVQ1EncContext s,
uint8_t *  src,
uint8_t *  ref,
uint8_t *  decoded,
int  stride,
int  level,
int  threshold,
int  lambda,
int  intra 
)
static

Definition at line 91 of file svq1enc.c.

Referenced by svq1_encode_plane().

◆ init_block_index()

static void init_block_index ( MpegEncContext s)
static

Definition at line 239 of file svq1enc.c.

Referenced by svq1_encode_plane().

◆ svq1_encode_plane()

static int svq1_encode_plane ( SVQ1EncContext s,
int  plane,
unsigned char *  src_plane,
unsigned char *  ref_plane,
unsigned char *  decoded_plane,
int  width,
int  height,
int  src_stride,
int  stride 
)
static

Definition at line 248 of file svq1enc.c.

Referenced by svq1_encode_frame().

◆ svq1_encode_end()

static av_cold int svq1_encode_end ( AVCodecContext avctx)
static

Definition at line 485 of file svq1enc.c.

◆ svq1_encode_init()

static av_cold int svq1_encode_init ( AVCodecContext avctx)
static

Definition at line 516 of file svq1enc.c.

◆ svq1_encode_frame()

static int svq1_encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame pict,
int got_packet 
)
static

Definition at line 579 of file svq1enc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "motion-est", "Motion estimation algorithm", OFFSET(motion_est), AV_OPT_TYPE_INT, { .i64 = FF_ME_EPZS }, FF_ME_ZERO, FF_ME_XONE, VE, "motion-est"},
{ "zero", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_ZERO }, 0, 0, FF_MPV_OPT_FLAGS, "motion-est" },
{ "epzs", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_EPZS }, 0, 0, FF_MPV_OPT_FLAGS, "motion-est" },
{ "xone", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_XONE }, 0, 0, FF_MPV_OPT_FLAGS, "motion-est" },
{ NULL },
}

Definition at line 661 of file svq1enc.c.

◆ svq1enc_class

const AVClass svq1enc_class
static
Initial value:
= {
.class_name = "svq1enc",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 670 of file svq1enc.c.

◆ ff_svq1_encoder

const AVCodec ff_svq1_encoder
Initial value:
= {
.name = "svq1",
.long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
.priv_data_size = sizeof(SVQ1EncContext),
.priv_class = &svq1enc_class,
.encode2 = svq1_encode_frame,
.close = svq1_encode_end,
}

Definition at line 677 of file svq1enc.c.

FF_CODEC_CAP_INIT_THREADSAFE
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:42
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
FF_ME_EPZS
#define FF_ME_EPZS
Definition: motion_est.h:41
SVQ1EncContext
Definition: svq1enc.h:35
init
static int init
Definition: av_tx.c:47
svq1_encode_init
static av_cold int svq1_encode_init(AVCodecContext *avctx)
Definition: svq1enc.c:516
pix_fmts
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:296
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
VE
#define VE
Definition: svq1enc.c:660
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
FF_ME_XONE
#define FF_ME_XONE
Definition: motion_est.h:42
svq1_encode_end
static av_cold int svq1_encode_end(AVCodecContext *avctx)
Definition: svq1enc.c:485
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
AV_CODEC_ID_SVQ1
@ AV_CODEC_ID_SVQ1
Definition: codec_id.h:72
FF_CODEC_CAP_INIT_CLEANUP
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:50
options
static const AVOption options[]
Definition: svq1enc.c:661
FF_MPV_OPT_FLAGS
#define FF_MPV_OPT_FLAGS
Definition: mpegvideo.h:608
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:65
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
OFFSET
#define OFFSET(x)
Definition: svq1enc.c:659
AV_PIX_FMT_YUV410P
@ AV_PIX_FMT_YUV410P
planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples)
Definition: pixfmt.h:72
svq1_encode_frame
static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition: svq1enc.c:579
svq1enc_class
static const AVClass svq1enc_class
Definition: svq1enc.c:670
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233
FF_ME_ZERO
#define FF_ME_ZERO
Definition: motion_est.h:40