FFmpeg
Data Structures | Macros | Functions | Variables
svq1enc.c File Reference
#include "libavutil/emms.h"
#include "libavutil/mem.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "hpeldsp.h"
#include "me_cmp.h"
#include "mpegvideo.h"
#include "h263.h"
#include "h263enc.h"
#include "internal.h"
#include "mpegutils.h"
#include "packet_internal.h"
#include "put_bits.h"
#include "svq1.h"
#include "svq1encdsp.h"
#include "svq1enc_cb.h"
#include "version.h"
#include "libavutil/avassert.h"
#include "libavutil/frame.h"
#include "libavutil/mem_internal.h"

Go to the source code of this file.

Data Structures

struct  SVQ1EncContext
 

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, PutBitContext *pb, int frame_type)
 
static int encode_block (SVQ1EncContext *s, uint8_t *src, uint8_t *ref, uint8_t *decoded, int stride, unsigned level, int threshold, int lambda, int intra)
 
static void init_block_index (MpegEncContext *s)
 
static int svq1_encode_plane (SVQ1EncContext *s, int plane, PutBitContext *pb, const 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 write_ident (AVCodecContext *avctx, const char *ident)
 
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 FFCodec 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 138 of file svq1enc.c.

◆ THRESHOLD_MULTIPLIER

#define THRESHOLD_MULTIPLIER   0.6

Definition at line 139 of file svq1enc.c.

◆ OFFSET

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

Definition at line 719 of file svq1enc.c.

◆ VE

Definition at line 720 of file svq1enc.c.

Function Documentation

◆ svq1_write_header()

static void svq1_write_header ( SVQ1EncContext s,
PutBitContext pb,
int  frame_type 
)
static

Definition at line 104 of file svq1enc.c.

Referenced by svq1_encode_frame().

◆ encode_block()

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

Definition at line 141 of file svq1enc.c.

Referenced by svq1_encode_plane().

◆ init_block_index()

static void init_block_index ( MpegEncContext s)
static

Definition at line 294 of file svq1enc.c.

Referenced by svq1_encode_plane().

◆ svq1_encode_plane()

static int svq1_encode_plane ( SVQ1EncContext s,
int  plane,
PutBitContext pb,
const 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 303 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 533 of file svq1enc.c.

◆ write_ident()

static av_cold int write_ident ( AVCodecContext avctx,
const char *  ident 
)
static

Definition at line 564 of file svq1enc.c.

Referenced by svq1_encode_init().

◆ svq1_encode_init()

static av_cold int svq1_encode_init ( AVCodecContext avctx)
static

Definition at line 577 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 639 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, .unit = "motion-est"},
{ "zero", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_ZERO }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "motion-est" },
{ "epzs", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_EPZS }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "motion-est" },
{ "xone", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = FF_ME_XONE }, 0, 0, FF_MPV_OPT_FLAGS, .unit = "motion-est" },
{ NULL },
}

Definition at line 721 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 730 of file svq1enc.c.

◆ ff_svq1_encoder

const FFCodec ff_svq1_encoder
Initial value:
= {
.p.name = "svq1",
CODEC_LONG_NAME("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"),
.p.type = AVMEDIA_TYPE_VIDEO,
.priv_data_size = sizeof(SVQ1EncContext),
.p.priv_class = &svq1enc_class,
.close = svq1_encode_end,
.p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P,
.color_ranges = AVCOL_RANGE_MPEG,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
}

Definition at line 737 of file svq1enc.c.

AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:71
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: codec_internal.h:43
FF_ME_EPZS
#define FF_ME_EPZS
Definition: motion_est.h:42
options
static const AVOption options[]
Definition: svq1enc.c:721
SVQ1EncContext
Definition: svq1enc.c:58
svq1_encode_frame
static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
Definition: svq1enc.c:639
VE
#define VE
Definition: svq1enc.c:720
FF_CODEC_ENCODE_CB
#define FF_CODEC_ENCODE_CB(func)
Definition: codec_internal.h:320
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
#define AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE
This encoder can reorder user opaque values from input AVFrames and return them with corresponding ou...
Definition: codec.h:159
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:296
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
FF_ME_XONE
#define FF_ME_XONE
Definition: motion_est.h:43
svq1_encode_end
static av_cold int svq1_encode_end(AVCodecContext *avctx)
Definition: svq1enc.c:533
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
OFFSET
#define OFFSET(x)
Definition: svq1enc.c:719
AV_CODEC_ID_SVQ1
@ AV_CODEC_ID_SVQ1
Definition: codec_id.h:74
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:700
FF_MPV_OPT_FLAGS
#define FF_MPV_OPT_FLAGS
Definition: mpegvideoenc.h:83
AV_PIX_FMT_NONE
@ AV_PIX_FMT_NONE
Definition: pixfmt.h:72
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
svq1enc_class
static const AVClass svq1enc_class
Definition: svq1enc.c:730
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
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:79
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299
svq1_encode_init
static av_cold int svq1_encode_init(AVCodecContext *avctx)
Definition: svq1enc.c:577
FF_ME_ZERO
#define FF_ME_ZERO
Definition: motion_est.h:41