FFmpeg
Macros | Functions | Variables
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)   cbs_ ## codec ## _ ## rw ## _ ## name
 
#define FUNC_NAME1(rw, codec, name)   FUNC_NAME2(rw, codec, name)
 
#define FUNC_LCEVC(name)   FUNC_NAME1(READWRITE, lcevc, name)
 
#define FUNC_NAME2_EXPORT(rw, codec, name)   ff_cbs_ ## codec ## _ ## rw ## _ ## name
 
#define FUNC_NAME1_EXPORT(rw, codec, name)   FUNC_NAME2_EXPORT(rw, codec, name)
 
#define FUNC_SEI(name)   FUNC_NAME1_EXPORT(READWRITE, sei, name)
 
#define SEI_FUNC(name, args)
 
#define LCEVC_BLOCK_FUNC(name, args)
 
#define SUBSCRIPTS(subs, ...)   (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)
 
#define u(width, name, range_min, range_max)   xu(width, name, current->name, range_min, range_max, 0, )
 
#define flag(name)   ub(1, name)
 
#define ue(name, range_min, range_max)   xue(name, current->name, range_min, range_max, 0, )
 
#define i(width, name, range_min, range_max)   xi(width, name, current->name, range_min, range_max, 0, )
 
#define ib(width, name)   xi(width, name, current->name, MIN_INT_BITS(width), MAX_INT_BITS(width), 0, )
 
#define se(name, range_min, range_max)   xse(name, current->name, range_min, range_max, 0, )
 
#define us(width, name, range_min, range_max, subs, ...)   xu(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)
 
#define ubs(width, name, subs, ...)   xu(width, name, current->name, 0, MAX_UINT_BITS(width), subs, __VA_ARGS__)
 
#define flags(name, subs, ...)   xu(1, name, current->name, 0, 1, subs, __VA_ARGS__)
 
#define ues(name, range_min, range_max, subs, ...)   xue(name, current->name, range_min, range_max, subs, __VA_ARGS__)
 
#define is(width, name, range_min, range_max, subs, ...)   xi(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)
 
#define ibs(width, name, subs, ...)   xi(width, name, current->name, MIN_INT_BITS(width), MAX_INT_BITS(width), subs, __VA_ARGS__)
 
#define ses(name, range_min, range_max, subs, ...)   xse(name, current->name, range_min, range_max, subs, __VA_ARGS__)
 
#define mb(name)   xmb(name, current->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)   ((var) = ff_cbs_h2645_read_more_rbsp_data(rw))
 
#define bit_position(rw)   (get_bits_count(rw))
 
#define byte_alignment(rw)   (get_bits_count(rw) % 8)
 
#define allocate(name, size)
 
#define FUNC(name)   FUNC_LCEVC(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)   (var)
 
#define bit_position(rw)   (put_bits_count(rw))
 
#define byte_alignment(rw)   (put_bits_count(rw) % 8)
 
#define allocate(name, size)
 
#define FUNC(name)   FUNC_LCEVC(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. More...
 
int ff_cbs_lcevc_list_add (LCEVCRawProcessBlockList *list, int position)
 Allocate a new empty Process Block in a block list at a given position. More...
 
void ff_cbs_lcevc_free_process_block_list (LCEVCRawProcessBlockList *list)
 Free all Process Block in a block list. More...
 
static int cbs_lcevc_get_process_block_list (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, LCEVCRawProcessBlockList **list)
 
int ff_cbs_lcevc_add_process_block (CodedBitstreamContext *ctx, CodedBitstreamFragment *au, int position, uint32_t payload_type, void *payload_data, void *payload_ref)
 Add a process block to an access unit. More...
 
int ff_cbs_lcevc_find_process_block (CodedBitstreamContext *ctx, CodedBitstreamFragment *au, uint32_t payload_type, LCEVCRawProcessBlock **iter)
 Iterate over blocks with the given payload type in an access unit. More...
 
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. More...
 
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 LCEVCProcessBlockTypeDescriptorff_cbs_lcevc_process_block_find_type (CodedBitstreamContext *ctx, int payload_type)
 Find the type descriptor for the given payload type. More...
 

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)

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 
)    cbs_ ## codec ## _ ## rw ## _ ## name

Definition at line 39 of file cbs_lcevc.c.

◆ FUNC_NAME1

#define FUNC_NAME1 (   rw,
  codec,
  name 
)    FUNC_NAME2(rw, codec, name)

Definition at line 40 of file cbs_lcevc.c.

◆ FUNC_LCEVC

#define FUNC_LCEVC (   name)    FUNC_NAME1(READWRITE, lcevc, name)

Definition at line 41 of file cbs_lcevc.c.

◆ FUNC_NAME2_EXPORT

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

Definition at line 42 of file cbs_lcevc.c.

◆ FUNC_NAME1_EXPORT

#define FUNC_NAME1_EXPORT (   rw,
  codec,
  name 
)    FUNC_NAME2_EXPORT(rw, codec, name)

Definition at line 43 of file cbs_lcevc.c.

◆ FUNC_SEI

#define FUNC_SEI (   name)    FUNC_NAME1_EXPORT(READWRITE, sei, name)

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, \
SEIMessageState *state) \
{ \
return FUNC_LCEVC(name)(ctx, rw, cur, state); \
} \
static int FUNC_LCEVC(name) args

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, \
LCEVCProcessBlockState *state, \
int nal_unit_type) \
{ \
return FUNC(name)(ctx, rw, cur, state, nal_unit_type); \
} \
static int FUNC(name) args

Definition at line 56 of file cbs_lcevc.c.

◆ SUBSCRIPTS

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

Definition at line 67 of file cbs_lcevc.c.

◆ u

#define u (   width,
  name,
  range_min,
  range_max 
)    xu(width, name, current->name, range_min, range_max, 0, )

Definition at line 69 of file cbs_lcevc.c.

◆ flag

#define flag (   name)    ub(1, name)

Definition at line 71 of file cbs_lcevc.c.

◆ ue

#define ue (   name,
  range_min,
  range_max 
)    xue(name, current->name, range_min, range_max, 0, )

Definition at line 72 of file cbs_lcevc.c.

◆ i

#define i (   width,
  name,
  range_min,
  range_max 
)    xi(width, name, current->name, range_min, range_max, 0, )

Definition at line 74 of file cbs_lcevc.c.

◆ ib

#define ib (   width,
  name 
)    xi(width, name, current->name, MIN_INT_BITS(width), MAX_INT_BITS(width), 0, )

Definition at line 76 of file cbs_lcevc.c.

◆ se

#define se (   name,
  range_min,
  range_max 
)    xse(name, current->name, range_min, range_max, 0, )

Definition at line 78 of file cbs_lcevc.c.

◆ us

#define us (   width,
  name,
  range_min,
  range_max,
  subs,
  ... 
)    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,
  ... 
)    xu(width, name, current->name, 0, MAX_UINT_BITS(width), subs, __VA_ARGS__)

Definition at line 83 of file cbs_lcevc.c.

◆ flags

#define flags (   name,
  subs,
  ... 
)    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,
  ... 
)    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,
  ... 
)    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,
  ... 
)    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,
  ... 
)    xse(name, current->name, range_min, range_max, subs, __VA_ARGS__)

Definition at line 93 of file cbs_lcevc.c.

◆ mb

#define mb (   name)    xmb(name, current->name)

Definition at line 95 of file cbs_lcevc.c.

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

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 245 of file cbs_lcevc.c.

◆ RWContext [1/2]

#define RWContext   GetBitContext

Definition at line 246 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 248 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)

Definition at line 253 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)

Definition at line 259 of file cbs_lcevc.c.

◆ xi [1/2]

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

Definition at line 265 of file cbs_lcevc.c.

◆ xse [1/2]

#define xse (   name,
  var,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
int32_t value; \
SUBSCRIPTS(subs, __VA_ARGS__), \
&value, range_min, range_max)); \
var = value; \
} while (0)

Definition at line 271 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)

Definition at line 277 of file cbs_lcevc.c.

◆ infer [1/2]

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

Definition at line 282 of file cbs_lcevc.c.

◆ more_rbsp_data [1/2]

#define more_rbsp_data (   var)    ((var) = ff_cbs_h2645_read_more_rbsp_data(rw))

Definition at line 292 of file cbs_lcevc.c.

◆ bit_position [1/2]

#define bit_position (   rw)    (get_bits_count(rw))

Definition at line 294 of file cbs_lcevc.c.

◆ byte_alignment [1/2]

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

Definition at line 295 of file cbs_lcevc.c.

◆ allocate [1/2]

#define allocate (   name,
  size 
)
Value:
do { \
if (!name) \
return AVERROR(ENOMEM); \
} while (0)

Definition at line 297 of file cbs_lcevc.c.

◆ FUNC [1/2]

#define FUNC (   name)    FUNC_LCEVC(name)

Definition at line 305 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 245 of file cbs_lcevc.c.

◆ RWContext [2/2]

#define RWContext   PutBitContext

Definition at line 246 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 248 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 253 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)

Definition at line 259 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 265 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)

Definition at line 271 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)

Definition at line 277 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)

Definition at line 282 of file cbs_lcevc.c.

◆ more_rbsp_data [2/2]

#define more_rbsp_data (   var)    (var)

Definition at line 292 of file cbs_lcevc.c.

◆ bit_position [2/2]

#define bit_position (   rw)    (put_bits_count(rw))

Definition at line 294 of file cbs_lcevc.c.

◆ byte_alignment [2/2]

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

Definition at line 295 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 297 of file cbs_lcevc.c.

◆ FUNC [2/2]

#define FUNC (   name)    FUNC_LCEVC(name)

Definition at line 305 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 772 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 470 of file cbs_lcevc.c.

◆ free_picture_config()

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

Definition at line 495 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 502 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 513 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 525 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 552 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 591 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,
CodedBitstreamFragment au,
int  position,
uint32_t  payload_type,
void *  payload_data,
void *  payload_ref 
)

Add a process block to an access unit.

An existing NAL unit of type IDR or NON_IDR are required.

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 613 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,
LCEVCRawProcessBlock **  block 
)

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

Set block to NULL in the first call. Returns 0 while more blocks are available, AVERROR(ENOENT) when all blocks have been found.

Definition at line 665 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 701 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 720 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 741 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 750 of file cbs_lcevc.c.

◆ cbs_lcevc_free_nal()

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

Definition at line 758 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 811 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

◆ cbs_lcevc_process_block_types

const LCEVCProcessBlockTypeDescriptor cbs_lcevc_process_block_types[]
static

Definition at line 776 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,
}

Definition at line 822 of file cbs_lcevc.c.

name
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
Definition: writing_filters.txt:88
cbs_lcevc_close
static av_cold void cbs_lcevc_close(CodedBitstreamContext *ctx)
Definition: cbs_lcevc.c:750
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
ff_cbs_read_ue_golomb
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
int64_t
long long int64_t
Definition: coverity.c:34
cbs_lcevc_split_fragment
static int cbs_lcevc_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_lcevc.c:330
CodedBitstreamContext
Context structure for coded bitstream operations.
Definition: cbs.h:226
ff_cbs_h2645_assemble_fragment
int ff_cbs_h2645_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_h2645.c:323
close
static av_cold void close(AVCodecParserContext *s)
Definition: apv_parser.c:197
cbs_lcevc_write_nal_unit
static int cbs_lcevc_write_nal_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
Definition: cbs_lcevc.c:470
LCEVC_NON_IDR_NUT
@ LCEVC_NON_IDR_NUT
Definition: lcevc.h:60
cbs_lcevc_flush
static av_cold void cbs_lcevc_flush(CodedBitstreamContext *ctx)
Definition: cbs_lcevc.c:741
av_refstruct_allocz
static void * av_refstruct_allocz(size_t size)
Equivalent to av_refstruct_alloc_ext(size, 0, NULL, NULL)
Definition: refstruct.h:105
ff_cbs_write_ue_golomb
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
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
ctx
static AVFormatContext * ctx
Definition: movenc.c:49
SUBSCRIPTS
#define SUBSCRIPTS(subs,...)
Definition: cbs_lcevc.c:67
LCEVCRawNAL
Definition: cbs_lcevc.h:190
cbs_write_multi_byte
static int cbs_write_multi_byte(CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, uint32_t value)
Definition: cbs_lcevc.c:218
ff_cbs_read_se_golomb
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
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts.c:552
CodedBitstreamLCEVCContext
Definition: cbs_lcevc.h:237
size
int size
Definition: twinvq_data.h:10344
ff_cbs_write_se_golomb
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
FUNC_LCEVC
#define FUNC_LCEVC(name)
Definition: cbs_lcevc.c:41
state
static struct @583 state
cbs_lcevc_unit_types
static CodedBitstreamUnitTypeDescriptor cbs_lcevc_unit_types[]
Definition: cbs_lcevc.c:764
AV_CODEC_ID_LCEVC
@ AV_CODEC_ID_LCEVC
Definition: codec_id.h:615
CBS_UNIT_TYPES_COMPLEX
#define CBS_UNIT_TYPES_COMPLEX(types, structure, free_func)
Definition: cbs_internal.h:379
value
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default value
Definition: writing_filters.txt:86
FUNC
#define FUNC(name)
Definition: cbs_lcevc.c:305
CBS_UNIT_TYPE_END_OF_LIST
#define CBS_UNIT_TYPE_END_OF_LIST
Definition: cbs_internal.h:389
cbs_read_multi_byte
static int cbs_read_multi_byte(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint32_t *write_to)
Definition: cbs_lcevc.c:104
cbs_lcevc_read_nal_unit
static int cbs_lcevc_read_nal_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_lcevc.c:418
AV_INPUT_BUFFER_PADDING_SIZE
#define AV_INPUT_BUFFER_PADDING_SIZE
Definition: defs.h:40
cbs_lcevc_free_nal
static void cbs_lcevc_free_nal(AVRefStructOpaque unused, void *content)
Definition: cbs_lcevc.c:758
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
width
#define width
Definition: dsp.h:89
LCEVC_IDR_NUT
@ LCEVC_IDR_NUT
Definition: lcevc.h:61