FFmpeg
Loading...
Searching...
No Matches
librav1e.c File Reference
#include <rav1e.h>
#include "libavutil/buffer.h"
#include "libavutil/internal.h"
#include "libavutil/avassert.h"
#include "libavutil/base64.h"
#include "libavutil/common.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "codec_internal.h"
#include "encode.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  librav1eContext
 
struct  FrameData
 

Macros

#define OFFSET(x)
 
#define VE   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
 

Functions

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 void frame_data_free (void *data)
 
static int librav1e_receive_packet (AVCodecContext *avctx, AVPacket *pkt)
 

Variables

static const AVOption options []
 
static const FFCodecDefault librav1e_defaults []
 
enum AVPixelFormat librav1e_pix_fmts []
 
class { 
 
      class_name = "librav1e" 
 
      item_name = av_default_item_name 
 
      option = options 
 
      version = LIBAVUTIL_VERSION_INT 
 
};  
 
const FFCodec ff_librav1e_encoder
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 608 of file librav1e.c.

◆ VE

Definition at line 609 of file librav1e.c.

Function Documentation

◆ range_map()

static RaPixelRange range_map ( enum AVPixelFormat pix_fmt,
enum AVColorRange range )
inlinestatic

Definition at line 66 of file librav1e.c.

Referenced by librav1e_encode_init().

◆ pix_fmt_map()

static RaChromaSampling pix_fmt_map ( enum AVPixelFormat pix_fmt)
inlinestatic

Definition at line 84 of file librav1e.c.

Referenced by librav1e_encode_init().

◆ chroma_loc_map()

static RaChromaSamplePosition chroma_loc_map ( enum AVChromaLocation chroma_loc)
inlinestatic

Definition at line 107 of file librav1e.c.

Referenced by librav1e_encode_init().

◆ get_stats()

static int get_stats ( AVCodecContext * avctx,
int eos )
static

Definition at line 119 of file librav1e.c.

Referenced by librav1e_receive_packet().

◆ set_stats()

static int set_stats ( AVCodecContext * avctx)
static

Definition at line 158 of file librav1e.c.

Referenced by librav1e_receive_packet().

◆ librav1e_encode_close()

static av_cold int librav1e_encode_close ( AVCodecContext * avctx)
static

Definition at line 173 of file librav1e.c.

◆ librav1e_encode_init()

static av_cold int librav1e_encode_init ( AVCodecContext * avctx)
static

Definition at line 192 of file librav1e.c.

◆ frame_data_free()

static void frame_data_free ( void * data)
static

Definition at line 431 of file librav1e.c.

Referenced by librav1e_receive_packet().

◆ librav1e_receive_packet()

static int librav1e_receive_packet ( AVCodecContext * avctx,
AVPacket * pkt )
static

Definition at line 442 of file librav1e.c.

Variable Documentation

◆ options

const AVOption options[]
static
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 VE
Definition amfenc_av1.c:30
#define NULL
Definition coverity.c:32
#define OFFSET(x)
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_DICT
Underlying C type is AVDictionary*.
Definition opt.h:289
int tile_rows
int tiles
Definition av1_levels.c:72
int tile_cols
Definition av1_levels.c:73

Definition at line 611 of file librav1e.c.

◆ librav1e_defaults

const FFCodecDefault librav1e_defaults[]
static
Initial value:
= {
{ "b", "0" },
{ "g", "0" },
{ "keyint_min", "0" },
{ "qmax", "-1" },
{ "qmin", "-1" },
{ NULL }
}

Definition at line 621 of file librav1e.c.

◆ librav1e_pix_fmts

enum AVPixelFormat librav1e_pix_fmts[]
Initial value:
= {
}
#define AV_PIX_FMT_YUV444P12
Definition pixfmt.h:552
#define AV_PIX_FMT_YUV420P10
Definition pixfmt.h:545
#define AV_PIX_FMT_YUV420P12
Definition pixfmt.h:549
#define AV_PIX_FMT_YUV422P12
Definition pixfmt.h:550
#define AV_PIX_FMT_YUV422P10
Definition pixfmt.h:546
@ AV_PIX_FMT_NONE
Definition pixfmt.h:72
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition pixfmt.h:73
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:77
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ AV_PIX_FMT_YUVJ422P
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
Definition pixfmt.h:86
@ AV_PIX_FMT_YUVJ444P
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
Definition pixfmt.h:87
@ AV_PIX_FMT_YUVJ420P
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
Definition pixfmt.h:85
#define AV_PIX_FMT_YUV444P10
Definition pixfmt.h:548

Definition at line 630 of file librav1e.c.

◆ class_name

class_name = "librav1e"
private

Definition at line 647 of file librav1e.c.

◆ item_name

item_name = av_default_item_name
private

Definition at line 648 of file librav1e.c.

◆ option

option = options
private

Definition at line 649 of file librav1e.c.

◆ version

version = LIBAVUTIL_VERSION_INT
private

Definition at line 650 of file librav1e.c.

◆ [class]

const AVClass class { ... }

◆ ff_librav1e_encoder

const FFCodec ff_librav1e_encoder
Initial value:
= {
.p.name = "librav1e",
CODEC_LONG_NAME("librav1e AV1"),
.p.type = AVMEDIA_TYPE_VIDEO,
.p.id = AV_CODEC_ID_AV1,
.priv_data_size = sizeof(librav1eContext),
.p.priv_class = &class,
.defaults = librav1e_defaults,
.p.wrapper_name = "librav1e",
}
#define CODEC_PIXFMTS_ARRAY(array)
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
#define FF_CODEC_RECEIVE_PACKET_CB(func)
#define CODEC_LONG_NAME(str)
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
#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:147
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
Definition codec.h:112
#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 codec.h:79
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition codec.h:49
#define AV_CODEC_CAP_ENCODER_RECON_FRAME
The encoder is able to output reconstructed frame data, i.e.
Definition codec.h:162
@ AV_CODEC_ID_AV1
Definition codec_id.h:275
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
static const FFCodecDefault librav1e_defaults[]
Definition librav1e.c:621
static int librav1e_receive_packet(AVCodecContext *avctx, AVPacket *pkt)
Definition librav1e.c:442
static av_cold int librav1e_encode_close(AVCodecContext *avctx)
Definition librav1e.c:173
enum AVPixelFormat librav1e_pix_fmts[]
Definition librav1e.c:630
static av_cold int librav1e_encode_init(AVCodecContext *avctx)
Definition librav1e.c:192
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition pixfmt.h:766
@ AVCOL_RANGE_JPEG
Full range content.
Definition pixfmt.h:783

Definition at line 653 of file librav1e.c.