FFmpeg
Data Structures | Macros | Functions | Variables
libxavs2.c File Reference
#include "xavs2.h"
#include "mpeg12.h"
#include "libavutil/avstring.h"

Go to the source code of this file.

Data Structures

struct  XAVS2EContext
 

Macros

#define xavs2_opt_set2(name, format, ...)
 
#define OFFSET(x)   offsetof(XAVS2EContext, x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

static av_cold int xavs2_init (AVCodecContext *avctx)
 
static void xavs2_copy_frame_with_shift (xavs2_picture_t *pic, const AVFrame *frame, const int shift_in)
 
static void xavs2_copy_frame (xavs2_picture_t *pic, const AVFrame *frame)
 
static int xavs2_encode_frame (AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
 
static av_cold int xavs2_close (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 
static const AVClass libxavs2
 
static const AVCodecDefault xavs2_defaults []
 
AVCodec ff_libxavs2_encoder
 

Macro Definition Documentation

#define xavs2_opt_set2 (   name,
  format,
  ... 
)
Value:
do{ \
char opt_str[16] = {0}; \
int err; \
av_strlcatf(opt_str, sizeof(opt_str), format, __VA_ARGS__); \
err = cae->api->opt_set2(cae->param, name, opt_str); \
if (err < 0) {\
av_log(avctx, AV_LOG_WARNING, "Invalid value for %s: %s\n", name, opt_str);\
}\
} while(0);
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition: log.h:182
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample format(the sample packing is implied by the sample format) and sample rate.The lists are not just lists
#define av_log(a,...)
if(ret)
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
Definition: avstring.c:101
int
const char * name
Definition: opengl_enc.c:102

Definition at line 29 of file libxavs2.c.

Referenced by xavs2_init().

#define OFFSET (   x)    offsetof(XAVS2EContext, x)

Definition at line 253 of file libxavs2.c.

Definition at line 254 of file libxavs2.c.

Function Documentation

static av_cold int xavs2_init ( AVCodecContext avctx)
static

Definition at line 60 of file libxavs2.c.

static void xavs2_copy_frame_with_shift ( xavs2_picture_t *  pic,
const AVFrame frame,
const int  shift_in 
)
static

Definition at line 125 of file libxavs2.c.

Referenced by xavs2_encode_frame().

static void xavs2_copy_frame ( xavs2_picture_t *  pic,
const AVFrame frame 
)
static

Definition at line 147 of file libxavs2.c.

Referenced by xavs2_encode_frame().

static int xavs2_encode_frame ( AVCodecContext avctx,
AVPacket pkt,
const AVFrame frame,
int got_packet 
)
static

Definition at line 167 of file libxavs2.c.

static av_cold int xavs2_close ( AVCodecContext avctx)
static

Definition at line 239 of file libxavs2.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "lcu_row_threads" , "number of parallel threads for rows" , OFFSET(lcu_row_threads) , AV_OPT_TYPE_INT, {.i64 = 0 }, 0, INT_MAX, VE },
{ "initial_qp" , "Quantization initial parameter" , OFFSET(initial_qp) , AV_OPT_TYPE_INT, {.i64 = 34 }, 1, 63, VE },
{ "qp" , "Quantization parameter" , OFFSET(qp) , AV_OPT_TYPE_INT, {.i64 = 34 }, 1, 63, VE },
{ "max_qp" , "max qp for rate control" , OFFSET(max_qp) , AV_OPT_TYPE_INT, {.i64 = 55 }, 0, 63, VE },
{ "min_qp" , "min qp for rate control" , OFFSET(min_qp) , AV_OPT_TYPE_INT, {.i64 = 20 }, 0, 63, VE },
{ "speed_level" , "Speed level, higher is better but slower", OFFSET(preset_level) , AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 9, VE },
{ "log_level" , "log level: -1: none, 0: error, 1: warning, 2: info, 3: debug", OFFSET(log_level) , AV_OPT_TYPE_INT, {.i64 = 0 }, -1, 3, VE },
{ "xavs2-params" , "set the xavs2 configuration using a :-separated list of key=value parameters", OFFSET(xavs2_opts), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE },
{ NULL },
}
#define NULL
Definition: coverity.c:32
#define VE
Definition: libxavs2.c:254
#define OFFSET(x)
Definition: libxavs2.c:253

Definition at line 256 of file libxavs2.c.

const AVClass libxavs2
static
Initial value:
= {
.class_name = "XAVS2EContext",
.item_name = av_default_item_name,
.option = options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
static const AVOption options[]
Definition: libxavs2.c:256

Definition at line 268 of file libxavs2.c.

const AVCodecDefault xavs2_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ "g", "48"},
{ "bf", "7" },
{ NULL },
}
#define NULL
Definition: coverity.c:32

Definition at line 275 of file libxavs2.c.

AVCodec ff_libxavs2_encoder
Initial value:
= {
.name = "libxavs2",
.long_name = NULL_IF_CONFIG_SMALL("libxavs2 AVS2-P2/IEEE1857.4"),
.priv_data_size = sizeof(XAVS2EContext),
.encode2 = xavs2_encode_frame,
.close = xavs2_close,
.priv_class = &libxavs2,
.defaults = xavs2_defaults,
.wrapper_name = "libxavs2",
}
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
#define AV_CODEC_CAP_AUTO_THREADS
Codec supports avctx->thread_count == 0 (auto).
Definition: avcodec.h:473
static int xavs2_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *frame, int *got_packet)
Definition: libxavs2.c:167
#define AV_CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: avcodec.h:430
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static av_cold int xavs2_close(AVCodecContext *avctx)
Definition: libxavs2.c:239
static const AVCodecDefault xavs2_defaults[]
Definition: libxavs2.c:275
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:275
static av_cold int xavs2_init(AVCodecContext *avctx)
Definition: libxavs2.c:60
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
static const AVClass libxavs2
Definition: libxavs2.c:268
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64

Definition at line 282 of file libxavs2.c.