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 "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
 

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 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)
 

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

Definition at line 419 of file libdav1d.c.

Function Documentation

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

Definition at line 60 of file libdav1d.c.

Referenced by libdav1d_init().

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

Definition at line 67 of file libdav1d.c.

Referenced by libdav1d_init().

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

Definition at line 115 of file libdav1d.c.

Referenced by libdav1d_init().

static av_cold int libdav1d_init ( AVCodecContext c)
static

Definition at line 122 of file libdav1d.c.

static void libdav1d_flush ( AVCodecContext c)
static

Definition at line 161 of file libdav1d.c.

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

Definition at line 169 of file libdav1d.c.

Referenced by libdav1d_receive_frame().

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

Definition at line 175 of file libdav1d.c.

Referenced by libdav1d_receive_frame().

static int libdav1d_receive_frame ( AVCodecContext c,
AVFrame frame 
)
static

Definition at line 180 of file libdav1d.c.

static av_cold int libdav1d_close ( AVCodecContext c)
static

Definition at line 407 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: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 49 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:415
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:416

Definition at line 56 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 }, -1, 1, VD },
{ "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
#define OFFSET(x)
Definition: libdav1d.c:418
#define VD
Definition: libdav1d.c:419

Definition at line 420 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:235
static const AVOption libdav1d_options[]
Definition: libdav1d.c:420

Definition at line 429 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: codec.h:118
#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:75
#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:161
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:153
static av_cold int libdav1d_init(AVCodecContext *c)
Definition: libdav1d.c:122
static const AVClass libdav1d_class
Definition: libdav1d.c:429
#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:407
static int libdav1d_receive_frame(AVCodecContext *c, AVFrame *frame)
Definition: libdav1d.c:180

Definition at line 436 of file libdav1d.c.