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

Go to the source code of this file.

Data Structures

struct  Libdav1dContext
 

Macros

#define OFFSET(x)   offsetof(Libdav1dContext, x)
 
#define VD   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 

Functions

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 int libdav1d_receive_frame (AVCodecContext *c, AVFrame *frame)
 
static av_cold int libdav1d_close (AVCodecContext *c)
 

Variables

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 339 of file libdav1d.c.

Definition at line 340 of file libdav1d.c.

Function Documentation

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

Definition at line 56 of file libdav1d.c.

Referenced by libdav1d_init().

static int libdav1d_picture_allocator ( Dav1dPicture *  p,
void cookie 
)
static

Definition at line 63 of file libdav1d.c.

Referenced by libdav1d_init().

static void libdav1d_picture_release ( Dav1dPicture *  p,
void cookie 
)
static

Definition at line 111 of file libdav1d.c.

Referenced by libdav1d_init().

static av_cold int libdav1d_init ( AVCodecContext c)
static

Definition at line 118 of file libdav1d.c.

static void libdav1d_flush ( AVCodecContext c)
static

Definition at line 151 of file libdav1d.c.

static void libdav1d_data_free ( const uint8_t data,
void opaque 
)
static

Definition at line 159 of file libdav1d.c.

Referenced by libdav1d_receive_frame().

static int libdav1d_receive_frame ( AVCodecContext c,
AVFrame frame 
)
static

Definition at line 165 of file libdav1d.c.

static av_cold int libdav1d_close ( AVCodecContext c)
static

Definition at line 328 of file libdav1d.c.

Variable Documentation

enum AVPixelFormat pix_fmt[][3]
static
Initial value:
= {
[DAV1D_PIXEL_LAYOUT_I400] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12 },
}
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:391
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:368
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:369
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:392
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:390
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:387
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:388
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:394
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 45 of file libdav1d.c.

Referenced by libdav1d_picture_allocator(), and libdav1d_receive_frame().

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

Definition at line 52 of file libdav1d.c.

Referenced by libdav1d_receive_frame(), and read_colorspace_details().

const AVOption libdav1d_options[]
static
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 }, 0, 1, VD },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define OFFSET(x)
Definition: libdav1d.c:339
#define VD
Definition: libdav1d.c:340

Definition at line 341 of file libdav1d.c.

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

Definition at line 348 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
#define AV_CODEC_CAP_AUTO_THREADS
Codec supports avctx->thread_count == 0 (auto).
Definition: avcodec.h:1049
#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:1006
#define FF_CODEC_CAP_INIT_THREADSAFE
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:151
#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 libdav1d_init(AVCodecContext *c)
Definition: libdav1d.c:118
static const AVClass libdav1d_class
Definition: libdav1d.c:348
#define FF_CODEC_CAP_SETS_PKT_DTS
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:328
static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
Definition: libdav1d.c:165

Definition at line 355 of file libdav1d.c.