FFmpeg
Loading...
Searching...
No Matches
cbs_lcevc.c File Reference
#include "libavutil/mem.h"
#include "libavutil/refstruct.h"
#include "bytestream.h"
#include "cbs.h"
#include "cbs_internal.h"
#include "cbs_h2645.h"
#include "cbs_lcevc.h"
#include "cbs_sei.h"
#include "get_bits.h"
#include "cbs_lcevc_syntax_template.c"

Go to the source code of this file.

Macros

#define HEADER(name)
 
#define CHECK(call)
 
#define FUNC_NAME2(rw, codec, name)
 
#define FUNC_NAME1(rw, codec, name)
 
#define FUNC_LCEVC(name)
 
#define FUNC_NAME2_EXPORT(rw, codec, name)
 
#define FUNC_NAME1_EXPORT(rw, codec, name)
 
#define FUNC_SEI(name)
 
#define SEI_FUNC(name, args)
 
#define LCEVC_BLOCK_FUNC(name, args)
 
#define SUBSCRIPTS(subs, ...)
 
#define u(width, name, range_min, range_max)
 
#define flag(name)
 
#define ue(name, range_min, range_max)
 
#define i(width, name, range_min, range_max)
 
#define ib(width, name)
 
#define se(name, range_min, range_max)
 
#define us(width, name, range_min, range_max, subs, ...)
 
#define ubs(width, name, subs, ...)
 
#define flags(name, subs, ...)
 
#define ues(name, range_min, range_max, subs, ...)
 
#define is(width, name, range_min, range_max, subs, ...)
 
#define ibs(width, name, subs, ...)
 
#define ses(name, range_min, range_max, subs, ...)
 
#define mb(name)
 
#define fixed(width, name, value)
 
#define READ
 
#define READWRITE   read
 
#define RWContext   GetBitContext
 
#define ub(width, name)
 
#define xu(width, name, var, range_min, range_max, subs, ...)
 
#define xue(name, var, range_min, range_max, subs, ...)
 
#define xi(width, name, var, range_min, range_max, subs, ...)
 
#define xse(name, var, range_min, range_max, subs, ...)
 
#define xmb(name, var)
 
#define infer(name, value)
 
#define more_rbsp_data(var)
 
#define bit_position(rw)
 
#define byte_alignment(rw)
 
#define allocate(name, size)
 
#define FUNC(name)
 
#define WRITE
 
#define READWRITE   write
 
#define RWContext   PutBitContext
 
#define ub(width, name)
 
#define xu(width, name, var, range_min, range_max, subs, ...)
 
#define xue(name, var, range_min, range_max, subs, ...)
 
#define xi(width, name, var, range_min, range_max, subs, ...)
 
#define xse(name, var, range_min, range_max, subs, ...)
 
#define xmb(name, var)
 
#define infer(name, value)
 
#define more_rbsp_data(var)
 
#define bit_position(rw)
 
#define byte_alignment(rw)
 
#define allocate(name, size)
 
#define FUNC(name)
 
#define LCEVC_PROCESS_BLOCK_RW(codec, name)
 

Functions

static int cbs_read_multi_byte (CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint32_t *write_to)
 
static int cbs_write_multi_byte (CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, uint32_t value)
 
static int cbs_lcevc_split_fragment (CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
 
static int cbs_lcevc_read_nal_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
 
static int cbs_lcevc_write_nal_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
 
static void free_picture_config (AVRefStructOpaque unused, void *obj)
 
static void free_encoded_data (AVRefStructOpaque unused, void *obj)
 
static void free_additional_info (AVRefStructOpaque unused, void *obj)
 
int ff_cbs_lcevc_alloc_process_block_payload (LCEVCRawProcessBlock *block, const LCEVCProcessBlockTypeDescriptor *desc)
 Allocate a new payload for the given Process Block.
 
int ff_cbs_lcevc_list_add (LCEVCRawProcessBlockList *list, int position)
 Allocate a new empty Process Block in a block list at a given position.
 
void ff_cbs_lcevc_free_process_block_list (LCEVCRawProcessBlockList *list)
 Free all Process Block in a block list.
 
static int cbs_lcevc_get_process_block_list (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, LCEVCRawProcessBlockList **list)
 
int ff_cbs_lcevc_add_process_block (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, int position, uint32_t payload_type, void *payload_data, void *payload_ref)
 Add a process block to a NAL unit of type IDR or NON_IDR, at the given position of its block list or at the end if position is -1.
 
int ff_cbs_lcevc_find_process_block (CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type, CodedBitstreamUnit **block_unit, LCEVCRawProcessBlock **iter)
 Iterate over blocks with the given payload type in an access unit.
 
static void cbs_lcevc_delete_process_block (LCEVCRawProcessBlockList *list, int position)
 
void ff_cbs_lcevc_delete_process_block_type (CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type)
 Delete all blocks with the given payload type from an access unit.
 
static av_cold void cbs_lcevc_flush (CodedBitstreamContext *ctx)
 
static av_cold void cbs_lcevc_close (CodedBitstreamContext *ctx)
 
static void cbs_lcevc_free_nal (AVRefStructOpaque unused, void *content)
 
const LCEVCProcessBlockTypeDescriptor * ff_cbs_lcevc_process_block_find_type (CodedBitstreamContext *ctx, int payload_type)
 Find the type descriptor for the given payload type.
 

Variables

static CodedBitstreamUnitTypeDescriptor cbs_lcevc_unit_types []
 
static const LCEVCProcessBlockTypeDescriptor cbs_lcevc_process_block_types []
 
const CodedBitstreamType ff_cbs_type_lcevc
 

Macro Definition Documentation

◆ HEADER

#define HEADER ( name)
Value:
do { \
ff_cbs_trace_header(ctx, name); \
} while (0)
static AVFormatContext * ctx
const char * name
Definition qsvenc.c:142

Definition at line 29 of file cbs_lcevc.c.

◆ CHECK

#define CHECK ( call)
Value:
do { \
err = (call); \
if (err < 0) \
return err; \
} while (0)

Definition at line 33 of file cbs_lcevc.c.

◆ FUNC_NAME2

#define FUNC_NAME2 ( rw,
codec,
name )
Value:
cbs_ ## codec ## _ ## rw ## _ ## name
#define _

Definition at line 39 of file cbs_lcevc.c.

◆ FUNC_NAME1

#define FUNC_NAME1 ( rw,
codec,
name )
Value:
FUNC_NAME2(rw, codec, name)
#define FUNC_NAME2(rw, codec, name)
Definition cbs_h264.c:39

Definition at line 40 of file cbs_lcevc.c.

◆ FUNC_LCEVC

#define FUNC_LCEVC ( name)
Value:
#define FUNC_NAME1(rw, codec, name)
Definition cbs_h264.c:40
#define READWRITE
Definition cbs_h264.c:92

Definition at line 41 of file cbs_lcevc.c.

◆ FUNC_NAME2_EXPORT

#define FUNC_NAME2_EXPORT ( rw,
codec,
name )
Value:
ff_cbs_ ## codec ## _ ## rw ## _ ## name

Definition at line 42 of file cbs_lcevc.c.

◆ FUNC_NAME1_EXPORT

#define FUNC_NAME1_EXPORT ( rw,
codec,
name )
Value:
#define FUNC_NAME2_EXPORT(rw, codec, name)
Definition cbs_h264.c:42

Definition at line 43 of file cbs_lcevc.c.

◆ FUNC_SEI

#define FUNC_SEI ( name)
Value:
#define FUNC_NAME1_EXPORT(rw, codec, name)
Definition cbs_h264.c:43
static int FUNC sei(CodedBitstreamContext *ctx, RWContext *rw, H264RawSEI *current)

Definition at line 44 of file cbs_lcevc.c.

◆ SEI_FUNC

#define SEI_FUNC ( name,
args )
Value:
static int FUNC_LCEVC(name) args; \
static int FUNC_LCEVC(name ## _internal)(CodedBitstreamContext *ctx, \
RWContext *rw, void *cur, \
{ \
return FUNC_LCEVC(name)(ctx, rw, cur, state); \
} \
static int FUNC_LCEVC(name) args
#define RWContext
Definition cbs_h264.c:93
#define FUNC_LCEVC(name)
Definition cbs_lcevc.c:41
Context structure for coded bitstream operations.
Definition cbs.h:226
static struct @232240247175332074307271266321204261331170211232 state

Definition at line 46 of file cbs_lcevc.c.

◆ LCEVC_BLOCK_FUNC

#define LCEVC_BLOCK_FUNC ( name,
args )
Value:
static int FUNC(name) args; \
static int FUNC(name ## _internal)(CodedBitstreamContext *ctx, \
RWContext *rw, void *cur, \
int nal_unit_type) \
{ \
return FUNC(name)(ctx, rw, cur, state, nal_unit_type); \
} \
static int FUNC(name) args
#define FUNC(a)

Definition at line 56 of file cbs_lcevc.c.

◆ SUBSCRIPTS

#define SUBSCRIPTS ( subs,
... )
Value:
(subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)
#define NULL
Definition coverity.c:32

Definition at line 67 of file cbs_lcevc.c.

◆ u

#define u ( width,
name,
range_min,
range_max )
Value:
xu(width, name, current->name, range_min, range_max, 0, )
#define xu(width, name, var, range_min, range_max, subs,...)
Definition cbs_h264.c:101
static struct @111144215057303131116103221376075045141373005341 current
#define width
Definition dsp.h:99

Definition at line 69 of file cbs_lcevc.c.

◆ flag

#define flag ( name)
Value:
ub(1, name)
#define ub(width, name)
Definition cbs_h264.c:95

Definition at line 71 of file cbs_lcevc.c.

◆ ue

#define ue ( name,
range_min,
range_max )
Value:
xue(name, current->name, range_min, range_max, 0, )
#define xue(name, var, range_min, range_max, subs,...)
Definition cbs_h264.c:108

Definition at line 72 of file cbs_lcevc.c.

◆ i

#define i ( width,
name,
range_min,
range_max )
Value:
xi(width, name, current->name, range_min, range_max, 0, )
#define xi(width, name, var, range_min, range_max, subs,...)
Definition cbs_h264.c:115

Definition at line 74 of file cbs_lcevc.c.

◆ ib

#define ib ( width,
name )
Value:
#define MAX_INT_BITS(length)
#define MIN_INT_BITS(length)

Definition at line 76 of file cbs_lcevc.c.

◆ se

#define se ( name,
range_min,
range_max )
Value:
xse(name, current->name, range_min, range_max, 0, )
#define xse(name, var, range_min, range_max, subs,...)
Definition cbs_h264.c:122

Definition at line 78 of file cbs_lcevc.c.

◆ us

#define us ( width,
name,
range_min,
range_max,
subs,
... )
Value:
xu(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)

Definition at line 81 of file cbs_lcevc.c.

◆ ubs

#define ubs ( width,
name,
subs,
... )
Value:
xu(width, name, current->name, 0, MAX_UINT_BITS(width), subs, __VA_ARGS__)
#define MAX_UINT_BITS(length)

Definition at line 83 of file cbs_lcevc.c.

◆ flags

#define flags ( name,
subs,
... )
Value:
xu(1, name, current->name, 0, 1, subs, __VA_ARGS__)

Definition at line 85 of file cbs_lcevc.c.

◆ ues

#define ues ( name,
range_min,
range_max,
subs,
... )
Value:
xue(name, current->name, range_min, range_max, subs, __VA_ARGS__)

Definition at line 87 of file cbs_lcevc.c.

◆ is

#define is ( width,
name,
range_min,
range_max,
subs,
... )
Value:
xi(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)

Definition at line 89 of file cbs_lcevc.c.

◆ ibs

#define ibs ( width,
name,
subs,
... )
Value:
xi(width, name, current->name, MIN_INT_BITS(width), MAX_INT_BITS(width), subs, __VA_ARGS__)

Definition at line 91 of file cbs_lcevc.c.

◆ ses

#define ses ( name,
range_min,
range_max,
subs,
... )
Value:
xse(name, current->name, range_min, range_max, subs, __VA_ARGS__)

Definition at line 93 of file cbs_lcevc.c.

◆ mb

◆ fixed

#define fixed ( width,
name,
value )
Value:
do { \
av_unused uint32_t fixed_value = value; \
xu(width, name, fixed_value, value, value, 0, ); \
} while (0)
double value
Definition eval.c:102
#define av_unused
Definition attributes.h:164

Definition at line 98 of file cbs_lcevc.c.

◆ READ

#define READ

Definition at line 135 of file cbs_lcevc.c.

◆ READWRITE [1/2]

#define READWRITE   read

Definition at line 136 of file cbs_lcevc.c.

◆ RWContext [1/2]

#define RWContext   GetBitContext

Definition at line 137 of file cbs_lcevc.c.

◆ ub [1/2]

#define ub ( width,
name )
Value:
do { \
uint32_t value; \
CHECK(ff_cbs_read_simple_unsigned(ctx, rw, width, #name, \
&value)); \
current->name = value; \
} while (0)

Definition at line 139 of file cbs_lcevc.c.

◆ xu [1/2]

#define xu ( width,
name,
var,
range_min,
range_max,
subs,
... )
Value:
do { \
uint32_t value; \
CHECK(ff_cbs_read_unsigned(ctx, rw, width, #name, \
SUBSCRIPTS(subs, __VA_ARGS__), \
&value, range_min, range_max)); \
var = value; \
} while (0)
#define SUBSCRIPTS(subs,...)
Definition cbs_apv.c:65

Definition at line 145 of file cbs_lcevc.c.

◆ xue [1/2]

#define xue ( name,
var,
range_min,
range_max,
subs,
... )
Value:
do { \
uint32_t value; \
SUBSCRIPTS(subs, __VA_ARGS__), \
&value, range_min, range_max)); \
var = value; \
} while (0)
int ff_cbs_read_ue_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max)
Definition cbs_h2645.c:41

Definition at line 152 of file cbs_lcevc.c.

◆ xi [1/2]

#define xi ( width,
name,
var,
range_min,
range_max,
subs,
... )
Value:
do { \
CHECK(ff_cbs_read_signed(ctx, rw, width, #name, \
SUBSCRIPTS(subs, __VA_ARGS__), \
&value, range_min, range_max)); \
var = value; \
} while (0)
int32_t

Definition at line 159 of file cbs_lcevc.c.

◆ xse [1/2]

#define xse ( name,
var,
range_min,
range_max,
subs,
... )
Value:
do { \
SUBSCRIPTS(subs, __VA_ARGS__), \
&value, range_min, range_max)); \
var = value; \
} while (0)
int ff_cbs_read_se_golomb(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, const int *subscripts, int32_t *write_to, int32_t range_min, int32_t range_max)
Definition cbs_h2645.c:90

Definition at line 166 of file cbs_lcevc.c.

◆ xmb [1/2]

#define xmb ( name,
var )
Value:
do { \
uint32_t value; \
CHECK(cbs_read_multi_byte(ctx, rw, #name, &value)); \
var = value; \
} while (0)
static int cbs_read_multi_byte(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint32_t *write_to)
Definition cbs_lcevc.c:104

Definition at line 173 of file cbs_lcevc.c.

Referenced by process_block_list().

◆ infer [1/2]

#define infer ( name,
value )
Value:
do { \
current->name = value; \
} while (0)

Definition at line 179 of file cbs_lcevc.c.

◆ more_rbsp_data [1/2]

#define more_rbsp_data ( var)
Value:
int ff_cbs_h2645_read_more_rbsp_data(GetBitContext *gbc)
Definition cbs_h2645.c:217

Definition at line 183 of file cbs_lcevc.c.

◆ bit_position [1/2]

#define bit_position ( rw)
Value:
static int get_bits_count(const GetBitContext *s)
Definition get_bits.h:254

Definition at line 185 of file cbs_lcevc.c.

◆ byte_alignment [1/2]

#define byte_alignment ( rw)
Value:
(get_bits_count(rw) % 8)

Definition at line 186 of file cbs_lcevc.c.

◆ allocate [1/2]

#define allocate ( name,
size )
Value:
do { \
if (!name) \
return AVERROR(ENOMEM); \
} while (0)
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
Definition defs.h:40
#define AVERROR(e)
Definition error.h:45
static void * av_refstruct_allocz(size_t size)
Equivalent to av_refstruct_alloc_ext(size, 0, NULL, NULL)
Definition refstruct.h:105
int size

Definition at line 190 of file cbs_lcevc.c.

◆ FUNC [1/2]

#define FUNC ( name)
Value:

Definition at line 197 of file cbs_lcevc.c.

◆ WRITE

#define WRITE

Definition at line 244 of file cbs_lcevc.c.

◆ READWRITE [2/2]

#define READWRITE   write

Definition at line 136 of file cbs_lcevc.c.

◆ RWContext [2/2]

#define RWContext   PutBitContext

Definition at line 137 of file cbs_lcevc.c.

◆ ub [2/2]

#define ub ( width,
name )
Value:
do { \
uint32_t value = current->name; \
CHECK(ff_cbs_write_simple_unsigned(ctx, rw, width, #name, \
value)); \
} while (0)

Definition at line 139 of file cbs_lcevc.c.

◆ xu [2/2]

#define xu ( width,
name,
var,
range_min,
range_max,
subs,
... )
Value:
do { \
uint32_t value = var; \
CHECK(ff_cbs_write_unsigned(ctx, rw, width, #name, \
SUBSCRIPTS(subs, __VA_ARGS__), \
value, range_min, range_max)); \
} while (0)

Definition at line 145 of file cbs_lcevc.c.

◆ xue [2/2]

#define xue ( name,
var,
range_min,
range_max,
subs,
... )
Value:
do { \
uint32_t value = var; \
SUBSCRIPTS(subs, __VA_ARGS__), \
value, range_min, range_max)); \
} while (0)
int ff_cbs_write_ue_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max)
Definition cbs_h2645.c:145

Definition at line 152 of file cbs_lcevc.c.

◆ xi [2/2]

#define xi ( width,
name,
var,
range_min,
range_max,
subs,
... )
Value:
do { \
int32_t value = var; \
CHECK(ff_cbs_write_signed(ctx, rw, width, #name, \
SUBSCRIPTS(subs, __VA_ARGS__), \
value, range_min, range_max)); \
} while (0)

Definition at line 159 of file cbs_lcevc.c.

◆ xse [2/2]

#define xse ( name,
var,
range_min,
range_max,
subs,
... )
Value:
do { \
int32_t value = var; \
SUBSCRIPTS(subs, __VA_ARGS__), \
value, range_min, range_max)); \
} while (0)
int ff_cbs_write_se_golomb(CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, const int *subscripts, int32_t value, int32_t range_min, int32_t range_max)
Definition cbs_h2645.c:177

Definition at line 166 of file cbs_lcevc.c.

◆ xmb [2/2]

#define xmb ( name,
var )
Value:
do { \
uint32_t value = var; \
CHECK(cbs_write_multi_byte(ctx, rw, #name, value)); \
} while (0)
static int cbs_write_multi_byte(CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, uint32_t value)
Definition cbs_lcevc.c:218

Definition at line 173 of file cbs_lcevc.c.

◆ infer [2/2]

#define infer ( name,
value )
Value:
do { \
if (current->name != (value)) { \
av_log(ctx->log_ctx, AV_LOG_ERROR, \
"%s does not match inferred value: " \
"%"PRId64", but should be %"PRId64".\n", \
#name, (int64_t)current->name, (int64_t)(value)); \
} \
} while (0)
long long int64_t
Definition coverity.c:34
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition error.h:61
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210

Definition at line 179 of file cbs_lcevc.c.

◆ more_rbsp_data [2/2]

#define more_rbsp_data ( var)
Value:
(var)

Definition at line 183 of file cbs_lcevc.c.

◆ bit_position [2/2]

#define bit_position ( rw)
Value:
static int put_bits_count(PutBitContext *s)
Definition put_bits.h:90

Definition at line 185 of file cbs_lcevc.c.

◆ byte_alignment [2/2]

#define byte_alignment ( rw)
Value:
(put_bits_count(rw) % 8)

Definition at line 186 of file cbs_lcevc.c.

◆ allocate [2/2]

#define allocate ( name,
size )
Value:
do { \
if (!name) { \
av_log(ctx->log_ctx, AV_LOG_ERROR, "%s must be set " \
"for writing.\n", #name); \
} \
} while (0)

Definition at line 190 of file cbs_lcevc.c.

◆ FUNC [2/2]

#define FUNC ( name)
Value:

Definition at line 197 of file cbs_lcevc.c.

◆ LCEVC_PROCESS_BLOCK_RW

#define LCEVC_PROCESS_BLOCK_RW ( codec,
name )
Value:
.read = cbs_ ## codec ## _read_ ## name ## _internal, \
.write = cbs_ ## codec ## _write_ ## name ## _internal

Definition at line 764 of file cbs_lcevc.c.

Function Documentation

◆ cbs_read_multi_byte()

static int cbs_read_multi_byte ( CodedBitstreamContext * ctx,
GetBitContext * gbc,
const char * name,
uint32_t * write_to )
static

Definition at line 104 of file cbs_lcevc.c.

◆ cbs_write_multi_byte()

static int cbs_write_multi_byte ( CodedBitstreamContext * ctx,
PutBitContext * pbc,
const char * name,
uint32_t value )
static

Definition at line 218 of file cbs_lcevc.c.

◆ cbs_lcevc_split_fragment()

static int cbs_lcevc_split_fragment ( CodedBitstreamContext * ctx,
CodedBitstreamFragment * frag,
int header )
static

Definition at line 330 of file cbs_lcevc.c.

◆ cbs_lcevc_read_nal_unit()

static int cbs_lcevc_read_nal_unit ( CodedBitstreamContext * ctx,
CodedBitstreamUnit * unit )
static

Definition at line 418 of file cbs_lcevc.c.

◆ cbs_lcevc_write_nal_unit()

static int cbs_lcevc_write_nal_unit ( CodedBitstreamContext * ctx,
CodedBitstreamUnit * unit,
PutBitContext * pbc )
static

Definition at line 467 of file cbs_lcevc.c.

◆ free_picture_config()

static void free_picture_config ( AVRefStructOpaque unused,
void * obj )
static

Definition at line 492 of file cbs_lcevc.c.

Referenced by ff_cbs_lcevc_alloc_process_block_payload().

◆ free_encoded_data()

static void free_encoded_data ( AVRefStructOpaque unused,
void * obj )
static

Definition at line 499 of file cbs_lcevc.c.

Referenced by ff_cbs_lcevc_alloc_process_block_payload().

◆ free_additional_info()

static void free_additional_info ( AVRefStructOpaque unused,
void * obj )
static

Definition at line 510 of file cbs_lcevc.c.

Referenced by ff_cbs_lcevc_alloc_process_block_payload().

◆ ff_cbs_lcevc_alloc_process_block_payload()

int ff_cbs_lcevc_alloc_process_block_payload ( LCEVCRawProcessBlock * block,
const LCEVCProcessBlockTypeDescriptor * desc )

Allocate a new payload for the given Process Block.

Definition at line 522 of file cbs_lcevc.c.

Referenced by process_block().

◆ ff_cbs_lcevc_list_add()

int ff_cbs_lcevc_list_add ( LCEVCRawProcessBlockList * list,
int position )

Allocate a new empty Process Block in a block list at a given position.

Definition at line 549 of file cbs_lcevc.c.

Referenced by ff_cbs_lcevc_add_process_block(), and process_block_list().

◆ ff_cbs_lcevc_free_process_block_list()

void ff_cbs_lcevc_free_process_block_list ( LCEVCRawProcessBlockList * list)

Free all Process Block in a block list.

Definition at line 588 of file cbs_lcevc.c.

Referenced by cbs_lcevc_free_nal().

◆ cbs_lcevc_get_process_block_list()

static int cbs_lcevc_get_process_block_list ( CodedBitstreamContext * ctx,
CodedBitstreamUnit * unit,
LCEVCRawProcessBlockList ** list )
static

◆ ff_cbs_lcevc_add_process_block()

int ff_cbs_lcevc_add_process_block ( CodedBitstreamContext * ctx,
CodedBitstreamUnit * unit,
int position,
uint32_t payload_type,
void * payload_data,
void * payload_ref )

Add a process block to a NAL unit of type IDR or NON_IDR, at the given position of its block list or at the end if position is -1.

If set, payload_ref must be a RefStruct reference backing payload_data. This function creates a new reference to payload_ref in this case. If payload_ref is NULL, the new message will not be reference counted.

Definition at line 610 of file cbs_lcevc.c.

Referenced by lcevc_metadata_handle_vui().

◆ ff_cbs_lcevc_find_process_block()

int ff_cbs_lcevc_find_process_block ( CodedBitstreamContext * ctx,
CodedBitstreamFragment * au,
uint32_t payload_type,
CodedBitstreamUnit ** block_unit,
LCEVCRawProcessBlock ** block )

Iterate over blocks with the given payload type in an access unit.

Set block to NULL in the first call. Returns the position of the block in the block list of its NAL unit, which is stored in block_unit if that is not NULL, or AVERROR(ENOENT) when all blocks have been found.

Definition at line 654 of file cbs_lcevc.c.

Referenced by ff_lcevc_parse_frame(), and lcevc_metadata_handle_vui().

◆ cbs_lcevc_delete_process_block()

static void cbs_lcevc_delete_process_block ( LCEVCRawProcessBlockList * list,
int position )
static

Definition at line 693 of file cbs_lcevc.c.

Referenced by ff_cbs_lcevc_delete_process_block_type().

◆ ff_cbs_lcevc_delete_process_block_type()

void ff_cbs_lcevc_delete_process_block_type ( CodedBitstreamContext * ctx,
CodedBitstreamFragment * au,
uint32_t payload_type )

Delete all blocks with the given payload type from an access unit.

Definition at line 712 of file cbs_lcevc.c.

Referenced by lcevc_metadata_update_fragment().

◆ cbs_lcevc_flush()

static av_cold void cbs_lcevc_flush ( CodedBitstreamContext * ctx)
static

Definition at line 733 of file cbs_lcevc.c.

Referenced by cbs_lcevc_close().

◆ cbs_lcevc_close()

static av_cold void cbs_lcevc_close ( CodedBitstreamContext * ctx)
static

Definition at line 742 of file cbs_lcevc.c.

◆ cbs_lcevc_free_nal()

static void cbs_lcevc_free_nal ( AVRefStructOpaque unused,
void * content )
static

Definition at line 750 of file cbs_lcevc.c.

◆ ff_cbs_lcevc_process_block_find_type()

const LCEVCProcessBlockTypeDescriptor * ff_cbs_lcevc_process_block_find_type ( CodedBitstreamContext * ctx,
int payload_type )

Find the type descriptor for the given payload type.

Returns NULL if the payload type is not known.

Definition at line 803 of file cbs_lcevc.c.

Referenced by ff_cbs_lcevc_add_process_block(), and process_block().

Variable Documentation

◆ cbs_lcevc_unit_types

CodedBitstreamUnitTypeDescriptor cbs_lcevc_unit_types[]
static
Initial value:
= {
}
#define CBS_UNIT_TYPE_END_OF_LIST
#define CBS_UNIT_TYPES_COMPLEX(types, structure, free_func)
static void cbs_lcevc_free_nal(AVRefStructOpaque unused, void *content)
Definition cbs_lcevc.c:750
@ LCEVC_NON_IDR_NUT
Definition lcevc.h:60
@ LCEVC_IDR_NUT
Definition lcevc.h:61

Definition at line 756 of file cbs_lcevc.c.

◆ cbs_lcevc_process_block_types

const LCEVCProcessBlockTypeDescriptor cbs_lcevc_process_block_types[]
static

Definition at line 768 of file cbs_lcevc.c.

Referenced by ff_cbs_lcevc_process_block_find_type().

◆ ff_cbs_type_lcevc

const CodedBitstreamType ff_cbs_type_lcevc
Initial value:
= {
.codec_id = AV_CODEC_ID_LCEVC,
.priv_data_size = sizeof(CodedBitstreamLCEVCContext),
.unit_types = cbs_lcevc_unit_types,
.split_fragment = &cbs_lcevc_split_fragment,
.read_unit = &cbs_lcevc_read_nal_unit,
.write_unit = &cbs_lcevc_write_nal_unit,
.assemble_fragment = &ff_cbs_h2645_assemble_fragment,
}
int ff_cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition cbs_h2645.c:323
static int cbs_lcevc_write_nal_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
Definition cbs_lcevc.c:467
static int cbs_lcevc_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition cbs_lcevc.c:330
static CodedBitstreamUnitTypeDescriptor cbs_lcevc_unit_types[]
Definition cbs_lcevc.c:756
static av_cold void cbs_lcevc_flush(CodedBitstreamContext *ctx)
Definition cbs_lcevc.c:733
static int cbs_lcevc_read_nal_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition cbs_lcevc.c:418
static av_cold void cbs_lcevc_close(CodedBitstreamContext *ctx)
Definition cbs_lcevc.c:742
void(* flush)(AVBSFContext *ctx)
Definition dts2pts.c:615
@ AV_CODEC_ID_LCEVC
Definition codec_id.h:615
av_cold void CBS_FUNC close(CodedBitstreamContext **ctx_ptr)
Close a context and free all internal state.
Definition cbs.c:118

Definition at line 814 of file cbs_lcevc.c.