FFmpeg
Data Structures | Macros | Functions | Variables
dovi_rpu.c File Reference
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "bsf.h"
#include "bsf_internal.h"
#include "cbs.h"
#include "cbs_bsf.h"
#include "cbs_av1.h"
#include "cbs_h265.h"
#include "dovi_rpu.h"
#include "h2645data.h"
#include "h265_profile_level.h"
#include "itut35.h"
#include "hevc/hevc.h"

Go to the source code of this file.

Data Structures

struct  DoviRpuContext
 

Macros

#define OFFSET(x)   offsetof(DoviRpuContext, x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 

Functions

static int update_rpu (AVBSFContext *bsf, const AVPacket *pkt, int flags, const uint8_t *rpu, size_t rpu_size, uint8_t **out_rpu, int *out_size)
 
static int dovi_rpu_update_fragment_hevc (AVBSFContext *bsf, AVPacket *pkt, CodedBitstreamFragment *au)
 
static int dovi_rpu_update_fragment_av1 (AVBSFContext *bsf, AVPacket *pkt, CodedBitstreamFragment *frag)
 
static int dovi_rpu_init (AVBSFContext *bsf)
 
static void dovi_rpu_close (AVBSFContext *bsf)
 

Variables

static const CBSBSFType dovi_rpu_hevc_type
 
static const CBSBSFType dovi_rpu_av1_type
 
static const AVOption dovi_rpu_options []
 
static const AVClass dovi_rpu_class
 
static enum AVCodecID dovi_rpu_codec_ids []
 
const FFBitStreamFilter ff_dovi_rpu_bsf
 

Macro Definition Documentation

◆ OFFSET

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

Definition at line 259 of file dovi_rpu.c.

◆ FLAGS

Definition at line 260 of file dovi_rpu.c.

Function Documentation

◆ update_rpu()

static int update_rpu ( AVBSFContext bsf,
const AVPacket pkt,
int  flags,
const uint8_t *  rpu,
size_t  rpu_size,
uint8_t **  out_rpu,
int *  out_size 
)
static

Definition at line 45 of file dovi_rpu.c.

Referenced by dovi_rpu_update_fragment_av1(), and dovi_rpu_update_fragment_hevc().

◆ dovi_rpu_update_fragment_hevc()

static int dovi_rpu_update_fragment_hevc ( AVBSFContext bsf,
AVPacket pkt,
CodedBitstreamFragment au 
)
static

Definition at line 79 of file dovi_rpu.c.

◆ dovi_rpu_update_fragment_av1()

static int dovi_rpu_update_fragment_av1 ( AVBSFContext bsf,
AVPacket pkt,
CodedBitstreamFragment frag 
)
static

Definition at line 128 of file dovi_rpu.c.

◆ dovi_rpu_init()

static int dovi_rpu_init ( AVBSFContext bsf)
static

Definition at line 192 of file dovi_rpu.c.

◆ dovi_rpu_close()

static void dovi_rpu_close ( AVBSFContext bsf)
static

Definition at line 251 of file dovi_rpu.c.

Variable Documentation

◆ dovi_rpu_hevc_type

const CBSBSFType dovi_rpu_hevc_type
static
Initial value:
= {
.codec_id = AV_CODEC_ID_HEVC,
.fragment_name = "access unit",
.unit_name = "NAL unit",
.update_fragment = &dovi_rpu_update_fragment_hevc,
}

Definition at line 178 of file dovi_rpu.c.

Referenced by dovi_rpu_init().

◆ dovi_rpu_av1_type

const CBSBSFType dovi_rpu_av1_type
static
Initial value:
= {
.codec_id = AV_CODEC_ID_AV1,
.fragment_name = "temporal unit",
.unit_name = "OBU",
.update_fragment = &dovi_rpu_update_fragment_av1,
}

Definition at line 185 of file dovi_rpu.c.

Referenced by dovi_rpu_init().

◆ dovi_rpu_options

const AVOption dovi_rpu_options[]
static
Initial value:
= {
{ "strip", "Strip Dolby Vision metadata", OFFSET(strip), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ "compression", "DV metadata compression mode", OFFSET(compression), AV_OPT_TYPE_INT, { .i64 = AV_DOVI_COMPRESSION_LIMITED }, 0, AV_DOVI_COMPRESSION_EXTENDED, FLAGS, .unit = "compression" },
{ "none", "Don't compress metadata", 0, AV_OPT_TYPE_CONST, {.i64 = 0}, .flags = FLAGS, .unit = "compression" },
{ "limited", "Limited metadata compression", 0, AV_OPT_TYPE_CONST, {.i64 = AV_DOVI_COMPRESSION_LIMITED}, .flags = FLAGS, .unit = "compression" },
{ "extended", "Extended metadata compression",0, AV_OPT_TYPE_CONST, {.i64 = AV_DOVI_COMPRESSION_EXTENDED}, .flags = FLAGS, .unit = "compression" },
{ NULL }
}

Definition at line 261 of file dovi_rpu.c.

◆ dovi_rpu_class

const AVClass dovi_rpu_class
static
Initial value:
= {
.class_name = "dovi_rpu_bsf",
.item_name = av_default_item_name,
.option = dovi_rpu_options,
}

Definition at line 270 of file dovi_rpu.c.

◆ dovi_rpu_codec_ids

enum AVCodecID dovi_rpu_codec_ids[]
static
Initial value:

Definition at line 277 of file dovi_rpu.c.

◆ ff_dovi_rpu_bsf

const FFBitStreamFilter ff_dovi_rpu_bsf
Initial value:
= {
.p.name = "dovi_rpu",
.p.codec_ids = dovi_rpu_codec_ids,
.p.priv_class = &dovi_rpu_class,
.priv_data_size = sizeof(DoviRpuContext),
.close = &dovi_rpu_close,
}

Definition at line 281 of file dovi_rpu.c.

FLAGS
#define FLAGS
Definition: dovi_rpu.c:260
AV_DOVI_COMPRESSION_LIMITED
@ AV_DOVI_COMPRESSION_LIMITED
Definition: dovi_meta.h:69
filter
void(* filter)(uint8_t *src, int stride, int qscale)
Definition: h263dsp.c:29
dovi_rpu_update_fragment_av1
static int dovi_rpu_update_fragment_av1(AVBSFContext *bsf, AVPacket *pkt, CodedBitstreamFragment *frag)
Definition: dovi_rpu.c:128
dovi_rpu_close
static void dovi_rpu_close(AVBSFContext *bsf)
Definition: dovi_rpu.c:251
AV_DOVI_COMPRESSION_EXTENDED
@ AV_DOVI_COMPRESSION_EXTENDED
Definition: dovi_meta.h:71
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
dovi_rpu_codec_ids
static enum AVCodecID dovi_rpu_codec_ids[]
Definition: dovi_rpu.c:277
AV_CODEC_ID_AV1
@ AV_CODEC_ID_AV1
Definition: codec_id.h:284
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
dovi_rpu_class
static const AVClass dovi_rpu_class
Definition: dovi_rpu.c:270
DoviRpuContext
Definition: dovi_rpu.c:36
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:368
dovi_rpu_update_fragment_hevc
static int dovi_rpu_update_fragment_hevc(AVBSFContext *bsf, AVPacket *pkt, CodedBitstreamFragment *au)
Definition: dovi_rpu.c:79
AV_CODEC_ID_NONE
@ AV_CODEC_ID_NONE
Definition: codec_id.h:50
AV_CODEC_ID_HEVC
@ AV_CODEC_ID_HEVC
Definition: codec_id.h:228
dovi_rpu_init
static int dovi_rpu_init(AVBSFContext *bsf)
Definition: dovi_rpu.c:192
ff_cbs_bsf_generic_filter
int ff_cbs_bsf_generic_filter(AVBSFContext *bsf, AVPacket *pkt)
Filter operation for CBS BSF.
Definition: cbs_bsf.c:61
OFFSET
#define OFFSET(x)
Definition: dovi_rpu.c:259
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
dovi_rpu_options
static const AVOption dovi_rpu_options[]
Definition: dovi_rpu.c:261
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition: opt.h:299