Data Structures | Macros | Functions | Variables
librav1e.c File Reference
#include <rav1e.h>
#include "libavutil/internal.h"
#include "libavutil/avassert.h"
#include "libavutil/base64.h"
#include "libavutil/common.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  librav1eContext


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


static RaPixelRange range_map (enum AVPixelFormat pix_fmt, enum AVColorRange range)
static RaChromaSampling pix_fmt_map (enum AVPixelFormat pix_fmt)
static RaChromaSamplePosition chroma_loc_map (enum AVChromaLocation chroma_loc)
static int get_stats (AVCodecContext *avctx, int eos)
static int set_stats (AVCodecContext *avctx)
static av_cold int librav1e_encode_close (AVCodecContext *avctx)
static av_cold int librav1e_encode_init (AVCodecContext *avctx)
static int librav1e_send_frame (AVCodecContext *avctx, const AVFrame *frame)
static int librav1e_receive_packet (AVCodecContext *avctx, AVPacket *pkt)


static const AVOption options []
static const AVCodecDefault librav1e_defaults []
enum AVPixelFormat librav1e_pix_fmts []
class {
      class_name = "librav1e"
      item_name = av_default_item_name
      option = options
AVCodec ff_librav1e_encoder

Macro Definition Documentation

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

Definition at line 544 of file librav1e.c.

Definition at line 545 of file librav1e.c.

Function Documentation

static RaPixelRange range_map ( enum AVPixelFormat  pix_fmt,
enum AVColorRange  range 

Definition at line 53 of file librav1e.c.

Referenced by librav1e_encode_init().

static RaChromaSampling pix_fmt_map ( enum AVPixelFormat  pix_fmt)

Definition at line 71 of file librav1e.c.

Referenced by librav1e_encode_init().

static RaChromaSamplePosition chroma_loc_map ( enum AVChromaLocation  chroma_loc)

Definition at line 94 of file librav1e.c.

Referenced by librav1e_encode_init().

static int get_stats ( AVCodecContext avctx,
int  eos 

Definition at line 106 of file librav1e.c.

Referenced by librav1e_receive_packet().

static int set_stats ( AVCodecContext avctx)

Definition at line 145 of file librav1e.c.

Referenced by librav1e_receive_packet().

static av_cold int librav1e_encode_close ( AVCodecContext avctx)

Definition at line 160 of file librav1e.c.

static av_cold int librav1e_encode_init ( AVCodecContext avctx)

Definition at line 175 of file librav1e.c.

static int librav1e_send_frame ( AVCodecContext avctx,
const AVFrame frame 

Definition at line 419 of file librav1e.c.

static int librav1e_receive_packet ( AVCodecContext avctx,
AVPacket pkt 

Definition at line 463 of file librav1e.c.

Variable Documentation

const AVOption options[]
Initial value:
= {
{ "qp", "use constant quantizer mode", OFFSET(quantizer), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 255, VE },
{ "speed", "what speed preset to use", OFFSET(speed), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 10, VE },
{ "tiles", "number of tiles encode with", OFFSET(tiles), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },
{ "tile-rows", "number of tiles rows to encode with", OFFSET(tile_rows), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },
{ "tile-columns", "number of tiles columns to encode with", OFFSET(tile_cols), AV_OPT_TYPE_INT, { .i64 = 0 }, -1, INT64_MAX, VE },
{ "rav1e-params", "set the rav1e configuration using a :-separated list of key=value parameters", OFFSET(rav1e_opts), AV_OPT_TYPE_DICT, { 0 }, 0, 0, VE },
{ NULL }
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: librav1e.c:544
int tile_cols
Definition: h265_levels.c:218
int tile_rows
Definition: h265_levels.c:217
#define VE
Definition: librav1e.c:545

Definition at line 547 of file librav1e.c.

const AVCodecDefault librav1e_defaults[]
Initial value:
= {
{ "b", "0" },
{ "g", "0" },
{ "keyint_min", "0" },
{ "qmax", "-1" },
{ "qmin", "-1" },
{ NULL }
#define NULL
Definition: coverity.c:32

Definition at line 557 of file librav1e.c.

enum AVPixelFormat librav1e_pix_fmts[]
Initial value:
= {
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:401
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition: pixfmt.h:79
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:402
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:400
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition: pixfmt.h:78
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:397
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:398
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:404
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition: pixfmt.h:80

Definition at line 566 of file librav1e.c.

class_name = "librav1e"

Definition at line 583 of file librav1e.c.

item_name = av_default_item_name

Definition at line 584 of file librav1e.c.

option = options

Definition at line 585 of file librav1e.c.


Definition at line 586 of file librav1e.c.

const { ... }
AVCodec ff_librav1e_encoder
Initial value:
= {
.name = "librav1e",
.long_name = NULL_IF_CONFIG_SMALL("librav1e AV1"),
.send_frame = librav1e_send_frame,
.receive_packet = librav1e_receive_packet,
.priv_data_size = sizeof(librav1eContext),
.priv_class = &class,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "librav1e",
The codec allows calling the close function for deallocation even if the init function returned a fai...
Definition: internal.h:48
Codec supports avctx->thread_count == 0 (auto).
Definition: avcodec.h:473
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: avcodec.h:430
static int librav1e_send_frame(AVCodecContext *avctx, const AVFrame *frame)
Definition: librav1e.c:419
static av_cold int librav1e_encode_init(AVCodecContext *avctx)
Definition: librav1e.c:175
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:186
static const AVCodecDefault defaults[]
Definition: amfenc_h264.c:361
static const AVCodecDefault librav1e_defaults[]
Definition: librav1e.c:557
static av_cold int librav1e_encode_close(AVCodecContext *avctx)
Definition: librav1e.c:160
enum AVPixelFormat librav1e_pix_fmts[]
Definition: librav1e.c:566
static int librav1e_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
Definition: librav1e.c:463
static enum AVPixelFormat pix_fmts[]
Definition: libkvazaar.c:275

Definition at line 589 of file librav1e.c.