FFmpeg
Loading...
Searching...
No Matches
h265_metadata.c File Reference

Go to the source code of this file.

Data Structures

struct  H265MetadataContext
 

Macros

#define SET_OR_INFER(field, value, present_flag, infer)
 
#define CROP(border, unit)
 
#define OFFSET(x)
 
#define FLAGS   (AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_BSF_PARAM)
 
#define LEVEL(name, value)
 

Enumerations

enum  { LEVEL_UNSET = -2 , LEVEL_AUTO = -1 }
 

Functions

static void h265_metadata_guess_level (AVBSFContext *bsf, const CodedBitstreamFragment *au)
 
static void h265_metadata_update_level (AVBSFContext *bsf, uint8_t *level_idc)
 
static int h265_metadata_update_vps (AVBSFContext *bsf, H265RawVPS *vps)
 
static int h265_metadata_deduce_crop (AVBSFContext *bsf, const H265RawSPS *sps, int *crop_left, int *crop_right, int *crop_top, int *crop_bottom)
 
static int h265_metadata_update_sps (AVBSFContext *bsf, H265RawSPS *sps)
 
static int h265_metadata_update_fragment (AVBSFContext *bsf, AVPacket *pkt, CodedBitstreamFragment *au)
 
static int h265_metadata_init (AVBSFContext *bsf)
 

Variables

static const CBSBSFType h265_metadata_type
 
static const AVOption h265_metadata_options []
 
static const AVClass h265_metadata_class
 
static enum AVCodecID h265_metadata_codec_ids []
 
const FFBitStreamFilter ff_hevc_metadata_bsf
 

Macro Definition Documentation

◆ SET_OR_INFER

#define SET_OR_INFER ( field,
value,
present_flag,
infer )
Value:
do { \
if (value >= 0) { \
field = value; \
need_vui = 1; \
} else if (!present_flag) \
field = infer; \
} while (0)
#define infer(name, value)
Definition cbs_h264.c:131
double value
Definition eval.c:102

Referenced by h265_metadata_update_sps().

◆ CROP

#define CROP ( border,
unit )
Value:
do { \
if (crop_ ## border >= 0) { \
if (crop_ ## border % unit != 0) { \
av_log(bsf, AV_LOG_ERROR, "Invalid value for crop_%s: " \
"must be a multiple of %d.\n", #border, unit); \
return AVERROR(EINVAL); \
} \
sps->conf_win_ ## border ## _offset = \
crop_ ## border / unit; \
sps->conformance_window_flag = 1; \
} \
} while (0)
static int FUNC sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
#define AVERROR(e)
Definition error.h:45
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210

Referenced by h265_metadata_update_sps().

◆ OFFSET

#define OFFSET ( x)
Value:

Definition at line 495 of file h265_metadata.c.

◆ FLAGS

Definition at line 496 of file h265_metadata.c.

◆ LEVEL

#define LEVEL ( name,
value )
Value:
{ .i64 = value }, .flags = FLAGS, .unit = "level"
#define FLAGS
Definition cmdutils.c:598
#define NULL
Definition coverity.c:32
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
const char * name
Definition qsvenc.c:142

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
LEVEL_UNSET 
LEVEL_AUTO 

Definition at line 32 of file h265_metadata.c.

Function Documentation

◆ h265_metadata_guess_level()

static void h265_metadata_guess_level ( AVBSFContext * bsf,
const CodedBitstreamFragment * au )
static

Definition at line 71 of file h265_metadata.c.

Referenced by h265_metadata_update_fragment().

◆ h265_metadata_update_level()

static void h265_metadata_update_level ( AVBSFContext * bsf,
uint8_t * level_idc )
static

Definition at line 140 of file h265_metadata.c.

Referenced by h265_metadata_update_sps(), and h265_metadata_update_vps().

◆ h265_metadata_update_vps()

static int h265_metadata_update_vps ( AVBSFContext * bsf,
H265RawVPS * vps )
static

Definition at line 163 of file h265_metadata.c.

Referenced by h265_metadata_update_fragment().

◆ h265_metadata_deduce_crop()

static int h265_metadata_deduce_crop ( AVBSFContext * bsf,
const H265RawSPS * sps,
int * crop_left,
int * crop_right,
int * crop_top,
int * crop_bottom )
static

Definition at line 193 of file h265_metadata.c.

Referenced by h265_metadata_update_sps().

◆ h265_metadata_update_sps()

static int h265_metadata_update_sps ( AVBSFContext * bsf,
H265RawSPS * sps )
static

Definition at line 269 of file h265_metadata.c.

Referenced by h265_metadata_update_fragment().

◆ h265_metadata_update_fragment()

static int h265_metadata_update_fragment ( AVBSFContext * bsf,
AVPacket * pkt,
CodedBitstreamFragment * au )
static

Definition at line 415 of file h265_metadata.c.

◆ h265_metadata_init()

static int h265_metadata_init ( AVBSFContext * bsf)
static

Definition at line 490 of file h265_metadata.c.

Variable Documentation

◆ h265_metadata_type

const CBSBSFType h265_metadata_type
static
Initial value:
= {
.codec_id = AV_CODEC_ID_HEVC,
.fragment_name = "access unit",
.unit_name = "NAL unit",
.update_fragment = &h265_metadata_update_fragment,
}
@ AV_CODEC_ID_HEVC
Definition codec_id.h:223
static int h265_metadata_update_fragment(AVBSFContext *bsf, AVPacket *pkt, CodedBitstreamFragment *au)

Definition at line 483 of file h265_metadata.c.

Referenced by h265_metadata_init().

◆ h265_metadata_options

const AVOption h265_metadata_options[]
static

Definition at line 497 of file h265_metadata.c.

◆ h265_metadata_class

const AVClass h265_metadata_class
static
Initial value:
= {
.class_name = "h265_metadata_bsf",
.item_name = av_default_item_name,
}
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:241
#define LIBAVUTIL_VERSION_INT
Definition version.h:85
static const AVOption h265_metadata_options[]

Definition at line 580 of file h265_metadata.c.

◆ h265_metadata_codec_ids

enum AVCodecID h265_metadata_codec_ids[]
static
Initial value:

Definition at line 587 of file h265_metadata.c.

◆ ff_hevc_metadata_bsf

const FFBitStreamFilter ff_hevc_metadata_bsf
Initial value:
= {
.p.name = "hevc_metadata",
.p.codec_ids = h265_metadata_codec_ids,
.p.priv_class = &h265_metadata_class,
.priv_data_size = sizeof(H265MetadataContext),
}
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
int ff_cbs_bsf_generic_filter(AVBSFContext *bsf, AVPacket *pkt)
Filter operation for CBS BSF.
Definition cbs_bsf.c:97
av_cold void ff_cbs_bsf_generic_close(AVBSFContext *bsf)
Close a generic CBS BSF instance.
Definition cbs_bsf.c:191
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
static const AVClass h265_metadata_class
static int h265_metadata_init(AVBSFContext *bsf)
static enum AVCodecID h265_metadata_codec_ids[]
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
Definition h263dsp.c:29

Definition at line 591 of file h265_metadata.c.