Data Structures | Macros | Functions | Variables
libdav1d.c File Reference
#include <dav1d/dav1d.h>
#include "libavutil/avassert.h"
#include "libavutil/film_grain_params.h"
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "atsc_a53.h"
#include "avcodec.h"
#include "bytestream.h"
#include "decode.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  Libdav1dContext


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


static void libdav1d_log_callback (void *opaque, const char *fmt, va_list vl)
static int libdav1d_picture_allocator (Dav1dPicture *p, void *cookie)
static void libdav1d_picture_release (Dav1dPicture *p, void *cookie)
static av_cold int libdav1d_init (AVCodecContext *c)
static void libdav1d_flush (AVCodecContext *c)
static void libdav1d_data_free (const uint8_t *data, void *opaque)
static void libdav1d_user_data_free (const uint8_t *data, void *opaque)
static int libdav1d_receive_frame (AVCodecContext *c, AVFrame *frame)
static av_cold int libdav1d_close (AVCodecContext *c)


static enum AVPixelFormat pix_fmt [][3]
static enum AVPixelFormat pix_fmt_rgb [3]
static const AVOption libdav1d_options []
static const AVClass libdav1d_class
AVCodec ff_libdav1d_decoder

Macro Definition Documentation

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

Definition at line 459 of file libdav1d.c.

Definition at line 460 of file libdav1d.c.

Function Documentation

static void libdav1d_log_callback ( void opaque,
const char *  fmt,
va_list  vl 

Definition at line 61 of file libdav1d.c.

Referenced by libdav1d_init().

static int libdav1d_picture_allocator ( Dav1dPicture *  p,
void cookie 

Definition at line 68 of file libdav1d.c.

Referenced by libdav1d_init().

static void libdav1d_picture_release ( Dav1dPicture *  p,
void cookie 

Definition at line 116 of file libdav1d.c.

Referenced by libdav1d_init().

static av_cold int libdav1d_init ( AVCodecContext c)

Definition at line 123 of file libdav1d.c.

static void libdav1d_flush ( AVCodecContext c)

Definition at line 164 of file libdav1d.c.

static void libdav1d_data_free ( const uint8_t data,
void opaque 

Definition at line 172 of file libdav1d.c.

Referenced by libdav1d_receive_frame().

static void libdav1d_user_data_free ( const uint8_t data,
void opaque 

Definition at line 178 of file libdav1d.c.

Referenced by libdav1d_receive_frame().

static int libdav1d_receive_frame ( AVCodecContext c,
AVFrame frame 

Definition at line 183 of file libdav1d.c.

static av_cold int libdav1d_close ( AVCodecContext c)

Definition at line 448 of file libdav1d.c.

Variable Documentation

enum AVPixelFormat pix_fmt[][3]
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:403
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:380
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:381
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:404
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:402
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:70
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:399
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:400
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:406
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
Y , 8bpp.
Definition: pixfmt.h:74

Definition at line 50 of file libdav1d.c.

Referenced by libdav1d_picture_allocator(), and libdav1d_receive_frame().

enum AVPixelFormat pix_fmt_rgb[3]
Initial value:
= {
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:168
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:415
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:416

Definition at line 57 of file libdav1d.c.

Referenced by libdav1d_receive_frame(), and read_colorspace_details().

const AVOption libdav1d_options[]
Initial value:
= {
{ "tilethreads", "Tile threads", OFFSET(tile_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_TILE_THREADS, VD },
{ "framethreads", "Frame threads", OFFSET(frame_threads), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, DAV1D_MAX_FRAME_THREADS, VD },
{ "filmgrain", "Apply Film Grain", OFFSET(apply_grain), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD | AV_OPT_FLAG_DEPRECATED },
{ "oppoint", "Select an operating point of the scalable bitstream", OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 31, VD },
{ "alllayers", "Output all spatial layers", OFFSET(all_layers), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
{ NULL }
#define NULL
Definition: coverity.c:32
set if option is deprecated, users should refer to AVOption.help text for more information ...
Definition: opt.h:295
#define OFFSET(x)
Definition: libdav1d.c:459
#define VD
Definition: libdav1d.c:460

Definition at line 461 of file libdav1d.c.

const AVClass libdav1d_class
Initial value:
= {
.class_name = "libdav1d decoder",
.item_name = av_default_item_name,
.option = libdav1d_options,
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
static const AVOption libdav1d_options[]
Definition: libdav1d.c:461

Definition at line 470 of file libdav1d.c.

AVCodec ff_libdav1d_decoder
Initial value:
= {
.name = "libdav1d",
.long_name = NULL_IF_CONFIG_SMALL("dav1d AV1 decoder by VideoLAN"),
.priv_data_size = sizeof(Libdav1dContext),
.close = libdav1d_close,
.priv_class = &libdav1d_class,
.wrapper_name = "libdav1d",
static void flush(AVCodecContext *avctx)
static av_cold int init(AVCodecContext *avctx)
Definition: avrndec.c:35
static CopyRet receive_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame)
Definition: crystalhd.c:560
Codec supports avctx->thread_count == 0 (auto).
Definition: codec.h:118
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
Definition: codec.h:75
The codec does not modify any global variables in the init function, allowing to call the init functi...
Definition: internal.h:40
static void libdav1d_flush(AVCodecContext *c)
Definition: libdav1d.c:164
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:115
static av_cold int libdav1d_init(AVCodecContext *c)
Definition: libdav1d.c:123
static const AVClass libdav1d_class
Definition: libdav1d.c:470
Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set AVFrame.pkt_dts manually.
Definition: internal.h:55
static av_cold int libdav1d_close(AVCodecContext *c)
Definition: libdav1d.c:448
static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
Definition: libdav1d.c:183

Definition at line 477 of file libdav1d.c.