FFmpeg
Macros | Functions | Variables
cbs_av1.c File Reference
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include "libavutil/pixfmt.h"
#include "cbs.h"
#include "cbs_internal.h"
#include "cbs_av1.h"
#include "defs.h"
#include "refstruct.h"
#include "cbs_av1_syntax_template.c"

Go to the source code of this file.

Macros

#define HEADER(name)
 
#define CHECK(call)
 
#define FUNC_NAME(rw, codec, name)   cbs_ ## codec ## _ ## rw ## _ ## name
 
#define FUNC_AV1(rw, name)   FUNC_NAME(rw, av1, name)
 
#define FUNC(name)   FUNC_AV1(READWRITE, name)
 
#define SUBSCRIPTS(subs, ...)   (subs > 0 ? ((int[subs + 1]){ subs, __VA_ARGS__ }) : NULL)
 
#define fc(width, name, range_min, range_max)   xf(width, name, current->name, range_min, range_max, 0, )
 
#define flag(name)   fb(1, name)
 
#define su(width, name)   xsu(width, name, current->name, 0, )
 
#define fbs(width, name, subs, ...)   xf(width, name, current->name, 0, MAX_UINT_BITS(width), subs, __VA_ARGS__)
 
#define fcs(width, name, range_min, range_max, subs, ...)   xf(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)
 
#define flags(name, subs, ...)   xf(1, name, current->name, 0, 1, subs, __VA_ARGS__)
 
#define sus(width, name, subs, ...)   xsu(width, name, current->name, subs, __VA_ARGS__)
 
#define fixed(width, name, value)
 
#define READ
 
#define READWRITE   read
 
#define RWContext   GetBitContext
 
#define fb(width, name)
 
#define xf(width, name, var, range_min, range_max, subs, ...)
 
#define xsu(width, name, var, subs, ...)
 
#define uvlc(name, range_min, range_max)
 
#define ns(max_value, name, subs, ...)
 
#define increment(name, min, max)
 
#define subexp(name, max, subs, ...)
 
#define delta_q(name)
 
#define leb128(name)
 
#define infer(name, value)
 
#define byte_alignment(rw)   (get_bits_count(rw) % 8)
 
#define WRITE
 
#define READWRITE   write
 
#define RWContext   PutBitContext
 
#define fb(width, name)
 
#define xf(width, name, var, range_min, range_max, subs, ...)
 
#define xsu(width, name, var, subs, ...)
 
#define uvlc(name, range_min, range_max)
 
#define ns(max_value, name, subs, ...)
 
#define increment(name, min, max)
 
#define subexp(name, max, subs, ...)
 
#define delta_q(name)
 
#define leb128(name)
 
#define infer(name, value)
 
#define byte_alignment(rw)   (put_bits_count(rw) % 8)
 
#define OFFSET(x)   offsetof(CodedBitstreamAV1Context, x)
 

Functions

static int cbs_av1_read_uvlc (CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint32_t *write_to, uint32_t range_min, uint32_t range_max)
 
static int cbs_av1_write_uvlc (CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, uint32_t value, uint32_t range_min, uint32_t range_max)
 
static int cbs_av1_read_leb128 (CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint64_t *write_to)
 
static int cbs_av1_write_leb128 (CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, uint64_t value, int fixed_length)
 
static int cbs_av1_read_ns (CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t n, const char *name, const int *subscripts, uint32_t *write_to)
 
static int cbs_av1_write_ns (CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t n, const char *name, const int *subscripts, uint32_t value)
 
static int cbs_av1_read_increment (CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t range_min, uint32_t range_max, const char *name, uint32_t *write_to)
 
static int cbs_av1_write_increment (CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t range_min, uint32_t range_max, const char *name, uint32_t value)
 
static int cbs_av1_read_subexp (CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t range_max, const char *name, const int *subscripts, uint32_t *write_to)
 
static int cbs_av1_write_subexp (CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t range_max, const char *name, const int *subscripts, uint32_t value)
 
static int cbs_av1_tile_log2 (int blksize, int target)
 
static int cbs_av1_get_relative_dist (const AV1RawSequenceHeader *seq, unsigned int a, unsigned int b)
 
static size_t cbs_av1_get_payload_bytes_left (GetBitContext *gbc)
 
static int cbs_av1_split_fragment (CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
 
static int cbs_av1_ref_tile_data (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, GetBitContext *gbc, AV1RawTileData *td)
 
static int cbs_av1_read_unit (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
 
static int cbs_av1_write_obu (CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
 
static int cbs_av1_assemble_fragment (CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
 
static void cbs_av1_flush (CodedBitstreamContext *ctx)
 
static void cbs_av1_close (CodedBitstreamContext *ctx)
 
static void cbs_av1_free_metadata (FFRefStructOpaque unused, void *content)
 

Variables

static const CodedBitstreamUnitTypeDescriptor cbs_av1_unit_types []
 
static const AVOption cbs_av1_options []
 
static const AVClass cbs_av1_class
 
const CodedBitstreamType ff_cbs_type_av1
 

Macro Definition Documentation

◆ HEADER

#define HEADER (   name)
Value:
do { \
ff_cbs_trace_header(ctx, name); \
} while (0)

Definition at line 456 of file cbs_av1.c.

◆ CHECK

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

Definition at line 460 of file cbs_av1.c.

◆ FUNC_NAME

#define FUNC_NAME (   rw,
  codec,
  name 
)    cbs_ ## codec ## _ ## rw ## _ ## name

Definition at line 466 of file cbs_av1.c.

◆ FUNC_AV1

#define FUNC_AV1 (   rw,
  name 
)    FUNC_NAME(rw, av1, name)

Definition at line 467 of file cbs_av1.c.

◆ FUNC

#define FUNC (   name)    FUNC_AV1(READWRITE, name)

Definition at line 468 of file cbs_av1.c.

◆ SUBSCRIPTS

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

Definition at line 470 of file cbs_av1.c.

◆ fc

#define fc (   width,
  name,
  range_min,
  range_max 
)    xf(width, name, current->name, range_min, range_max, 0, )

Definition at line 472 of file cbs_av1.c.

◆ flag

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

Definition at line 474 of file cbs_av1.c.

◆ su

#define su (   width,
  name 
)    xsu(width, name, current->name, 0, )

Definition at line 475 of file cbs_av1.c.

◆ fbs

#define fbs (   width,
  name,
  subs,
  ... 
)    xf(width, name, current->name, 0, MAX_UINT_BITS(width), subs, __VA_ARGS__)

Definition at line 478 of file cbs_av1.c.

◆ fcs

#define fcs (   width,
  name,
  range_min,
  range_max,
  subs,
  ... 
)    xf(width, name, current->name, range_min, range_max, subs, __VA_ARGS__)

Definition at line 480 of file cbs_av1.c.

◆ flags

#define flags (   name,
  subs,
  ... 
)    xf(1, name, current->name, 0, 1, subs, __VA_ARGS__)
Examples
ffhash.c.

Definition at line 482 of file cbs_av1.c.

◆ sus

#define sus (   width,
  name,
  subs,
  ... 
)    xsu(width, name, current->name, subs, __VA_ARGS__)

Definition at line 484 of file cbs_av1.c.

◆ fixed

#define fixed (   width,
  name,
  value 
)
Value:
do { \
av_unused uint32_t fixed_value = value; \
xf(width, name, fixed_value, value, value, 0, ); \
} while (0)

Definition at line 487 of file cbs_av1.c.

◆ READ

#define READ

Definition at line 493 of file cbs_av1.c.

◆ READWRITE [1/2]

#define READWRITE   read

Definition at line 590 of file cbs_av1.c.

◆ RWContext [1/2]

#define RWContext   GetBitContext

Definition at line 591 of file cbs_av1.c.

◆ fb [1/2]

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

Definition at line 593 of file cbs_av1.c.

◆ xf [1/2]

#define xf (   width,
  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 598 of file cbs_av1.c.

◆ xsu [1/2]

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

Definition at line 604 of file cbs_av1.c.

◆ uvlc [1/2]

#define uvlc (   name,
  range_min,
  range_max 
)
Value:
do { \
uint32_t value; \
CHECK(cbs_av1_read_uvlc(ctx, rw, #name, \
&value, range_min, range_max)); \
current->name = value; \
} while (0)

Definition at line 611 of file cbs_av1.c.

◆ ns [1/2]

#define ns (   max_value,
  name,
  subs,
  ... 
)
Value:
do { \
uint32_t value; \
CHECK(cbs_av1_read_ns(ctx, rw, max_value, #name, \
SUBSCRIPTS(subs, __VA_ARGS__), &value)); \
current->name = value; \
} while (0)

Definition at line 616 of file cbs_av1.c.

◆ increment [1/2]

#define increment (   name,
  min,
  max 
)
Value:
do { \
uint32_t value; \
CHECK(cbs_av1_read_increment(ctx, rw, min, max, #name, &value)); \
current->name = value; \
} while (0)

Definition at line 622 of file cbs_av1.c.

◆ subexp [1/2]

#define subexp (   name,
  max,
  subs,
  ... 
)
Value:
do { \
uint32_t value; \
CHECK(cbs_av1_read_subexp(ctx, rw, max, #name, \
SUBSCRIPTS(subs, __VA_ARGS__), &value)); \
current->name = value; \
} while (0)

Definition at line 627 of file cbs_av1.c.

◆ delta_q [1/2]

#define delta_q (   name)
Value:
do { \
uint8_t delta_coded; \
int8_t delta_q; \
xf(1, name.delta_coded, delta_coded, 0, 1, 0, ); \
if (delta_coded) \
xsu(1 + 6, name.delta_q, delta_q, 0, ); \
else \
delta_q = 0; \
current->name = delta_q; \
} while (0)

Definition at line 633 of file cbs_av1.c.

◆ leb128 [1/2]

#define leb128 (   name)
Value:
do { \
uint64_t value; \
CHECK(cbs_av1_read_leb128(ctx, rw, #name, &value)); \
current->name = value; \
} while (0)

Definition at line 639 of file cbs_av1.c.

◆ infer [1/2]

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

Definition at line 643 of file cbs_av1.c.

◆ byte_alignment [1/2]

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

Definition at line 653 of file cbs_av1.c.

◆ WRITE

#define WRITE

Definition at line 589 of file cbs_av1.c.

◆ READWRITE [2/2]

#define READWRITE   write

Definition at line 590 of file cbs_av1.c.

◆ RWContext [2/2]

#define RWContext   PutBitContext

Definition at line 591 of file cbs_av1.c.

◆ fb [2/2]

#define fb (   width,
  name 
)
Value:
do { \
current->name)); \
} while (0)

Definition at line 593 of file cbs_av1.c.

◆ xf [2/2]

#define xf (   width,
  name,
  var,
  range_min,
  range_max,
  subs,
  ... 
)
Value:
do { \
SUBSCRIPTS(subs, __VA_ARGS__), \
var, range_min, range_max)); \
} while (0)

Definition at line 598 of file cbs_av1.c.

◆ xsu [2/2]

#define xsu (   width,
  name,
  var,
  subs,
  ... 
)
Value:
do { \
SUBSCRIPTS(subs, __VA_ARGS__), var, \
} while (0)

Definition at line 604 of file cbs_av1.c.

◆ uvlc [2/2]

#define uvlc (   name,
  range_min,
  range_max 
)
Value:
do { \
CHECK(cbs_av1_write_uvlc(ctx, rw, #name, current->name, \
range_min, range_max)); \
} while (0)

Definition at line 611 of file cbs_av1.c.

◆ ns [2/2]

#define ns (   max_value,
  name,
  subs,
  ... 
)
Value:
do { \
CHECK(cbs_av1_write_ns(ctx, rw, max_value, #name, \
SUBSCRIPTS(subs, __VA_ARGS__), \
current->name)); \
} while (0)

Definition at line 616 of file cbs_av1.c.

◆ increment [2/2]

#define increment (   name,
  min,
  max 
)
Value:
do { \
current->name)); \
} while (0)

Definition at line 622 of file cbs_av1.c.

◆ subexp [2/2]

#define subexp (   name,
  max,
  subs,
  ... 
)
Value:
do { \
CHECK(cbs_av1_write_subexp(ctx, rw, max, #name, \
SUBSCRIPTS(subs, __VA_ARGS__), \
current->name)); \
} while (0)

Definition at line 627 of file cbs_av1.c.

◆ delta_q [2/2]

#define delta_q (   name)
Value:
do { \
xf(1, name.delta_coded, current->name != 0, 0, 1, 0, ); \
if (current->name) \
xsu(1 + 6, name.delta_q, current->name, 0, ); \
} while (0)

Definition at line 633 of file cbs_av1.c.

◆ leb128 [2/2]

#define leb128 (   name)
Value:
do { \
CHECK(cbs_av1_write_leb128(ctx, rw, #name, current->name, 0)); \
} while (0)

Definition at line 639 of file cbs_av1.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 643 of file cbs_av1.c.

◆ byte_alignment [2/2]

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

Definition at line 653 of file cbs_av1.c.

◆ OFFSET

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

Definition at line 1277 of file cbs_av1.c.

Function Documentation

◆ cbs_av1_read_uvlc()

static int cbs_av1_read_uvlc ( CodedBitstreamContext ctx,
GetBitContext gbc,
const char *  name,
uint32_t *  write_to,
uint32_t  range_min,
uint32_t  range_max 
)
static

Definition at line 30 of file cbs_av1.c.

◆ cbs_av1_write_uvlc()

static int cbs_av1_write_uvlc ( CodedBitstreamContext ctx,
PutBitContext pbc,
const char *  name,
uint32_t  value,
uint32_t  range_min,
uint32_t  range_max 
)
static

Definition at line 88 of file cbs_av1.c.

◆ cbs_av1_read_leb128()

static int cbs_av1_read_leb128 ( CodedBitstreamContext ctx,
GetBitContext gbc,
const char *  name,
uint64_t *  write_to 
)
static

Definition at line 119 of file cbs_av1.c.

Referenced by cbs_av1_read_unit(), and cbs_av1_split_fragment().

◆ cbs_av1_write_leb128()

static int cbs_av1_write_leb128 ( CodedBitstreamContext ctx,
PutBitContext pbc,
const char *  name,
uint64_t  value,
int  fixed_length 
)
static

Definition at line 150 of file cbs_av1.c.

Referenced by cbs_av1_write_obu().

◆ cbs_av1_read_ns()

static int cbs_av1_read_ns ( CodedBitstreamContext ctx,
GetBitContext gbc,
uint32_t  n,
const char *  name,
const int *  subscripts,
uint32_t *  write_to 
)
static

Definition at line 186 of file cbs_av1.c.

Referenced by cbs_av1_read_subexp().

◆ cbs_av1_write_ns()

static int cbs_av1_write_ns ( CodedBitstreamContext ctx,
PutBitContext pbc,
uint32_t  n,
const char *  name,
const int *  subscripts,
uint32_t  value 
)
static

Definition at line 224 of file cbs_av1.c.

Referenced by cbs_av1_write_subexp().

◆ cbs_av1_read_increment()

static int cbs_av1_read_increment ( CodedBitstreamContext ctx,
GetBitContext gbc,
uint32_t  range_min,
uint32_t  range_max,
const char *  name,
uint32_t *  write_to 
)
static

Definition at line 260 of file cbs_av1.c.

Referenced by cbs_av1_read_subexp().

◆ cbs_av1_write_increment()

static int cbs_av1_write_increment ( CodedBitstreamContext ctx,
PutBitContext pbc,
uint32_t  range_min,
uint32_t  range_max,
const char *  name,
uint32_t  value 
)
static

Definition at line 288 of file cbs_av1.c.

Referenced by cbs_av1_write_subexp().

◆ cbs_av1_read_subexp()

static int cbs_av1_read_subexp ( CodedBitstreamContext ctx,
GetBitContext gbc,
uint32_t  range_max,
const char *  name,
const int *  subscripts,
uint32_t *  write_to 
)
static

Definition at line 319 of file cbs_av1.c.

◆ cbs_av1_write_subexp()

static int cbs_av1_write_subexp ( CodedBitstreamContext ctx,
PutBitContext pbc,
uint32_t  range_max,
const char *  name,
const int *  subscripts,
uint32_t  value 
)
static

Definition at line 364 of file cbs_av1.c.

◆ cbs_av1_tile_log2()

static int cbs_av1_tile_log2 ( int  blksize,
int  target 
)
static

Definition at line 425 of file cbs_av1.c.

Referenced by tile_group_obu(), and tile_info().

◆ cbs_av1_get_relative_dist()

static int cbs_av1_get_relative_dist ( const AV1RawSequenceHeader seq,
unsigned int  a,
unsigned int  b 
)
static

Definition at line 432 of file cbs_av1.c.

Referenced by set_frame_refs(), skip_mode_params(), and uncompressed_header().

◆ cbs_av1_get_payload_bytes_left()

static size_t cbs_av1_get_payload_bytes_left ( GetBitContext gbc)
static

Definition at line 444 of file cbs_av1.c.

Referenced by metadata_itut_t35(), metadata_unknown(), and padding_obu().

◆ cbs_av1_split_fragment()

static int cbs_av1_split_fragment ( CodedBitstreamContext ctx,
CodedBitstreamFragment frag,
int  header 
)
static

Definition at line 673 of file cbs_av1.c.

◆ cbs_av1_ref_tile_data()

static int cbs_av1_ref_tile_data ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit,
GetBitContext gbc,
AV1RawTileData td 
)
static

Definition at line 782 of file cbs_av1.c.

Referenced by cbs_av1_read_unit().

◆ cbs_av1_read_unit()

static int cbs_av1_read_unit ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit 
)
static

Definition at line 808 of file cbs_av1.c.

◆ cbs_av1_write_obu()

static int cbs_av1_write_obu ( CodedBitstreamContext ctx,
CodedBitstreamUnit unit,
PutBitContext pbc 
)
static

Definition at line 981 of file cbs_av1.c.

◆ cbs_av1_assemble_fragment()

static int cbs_av1_assemble_fragment ( CodedBitstreamContext ctx,
CodedBitstreamFragment frag 
)
static

Definition at line 1184 of file cbs_av1.c.

◆ cbs_av1_flush()

static void cbs_av1_flush ( CodedBitstreamContext ctx)
static

Definition at line 1212 of file cbs_av1.c.

◆ cbs_av1_close()

static void cbs_av1_close ( CodedBitstreamContext ctx)
static

Definition at line 1226 of file cbs_av1.c.

◆ cbs_av1_free_metadata()

static void cbs_av1_free_metadata ( FFRefStructOpaque  unused,
void *  content 
)
static

Definition at line 1234 of file cbs_av1.c.

Variable Documentation

◆ cbs_av1_unit_types

const CodedBitstreamUnitTypeDescriptor cbs_av1_unit_types[]
static

◆ cbs_av1_options

const AVOption cbs_av1_options[]
static
Initial value:
= {
{ "operating_point", "Set operating point to select layers to parse from a scalable bitstream",
OFFSET(operating_point), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, AV1_MAX_OPERATING_POINTS - 1, 0 },
{ "fixed_obu_size_length", "Set fixed length of the obu_size field",
OFFSET(fixed_obu_size_length), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 8, 0 },
{ NULL }
}

Definition at line 1278 of file cbs_av1.c.

◆ cbs_av1_class

const AVClass cbs_av1_class
static
Initial value:
= {
.class_name = "cbs_av1",
.item_name = av_default_item_name,
.option = cbs_av1_options,
}

Definition at line 1286 of file cbs_av1.c.

◆ ff_cbs_type_av1

const CodedBitstreamType ff_cbs_type_av1
Initial value:
= {
.codec_id = AV_CODEC_ID_AV1,
.priv_class = &cbs_av1_class,
.priv_data_size = sizeof(CodedBitstreamAV1Context),
.unit_types = cbs_av1_unit_types,
.split_fragment = &cbs_av1_split_fragment,
.read_unit = &cbs_av1_read_unit,
.write_unit = &cbs_av1_write_obu,
.assemble_fragment = &cbs_av1_assemble_fragment,
.close = &cbs_av1_close,
}

Definition at line 1293 of file cbs_av1.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_UNIT_TYPE_COMPLEX
#define CBS_UNIT_TYPE_COMPLEX(type, structure, free_func)
Definition: cbs_internal.h:332
AV1_OBU_REDUNDANT_FRAME_HEADER
@ AV1_OBU_REDUNDANT_FRAME_HEADER
Definition: av1.h:36
cbs_av1_class
static const AVClass cbs_av1_class
Definition: cbs_av1.c:1286
cbs_av1_unit_types
static const CodedBitstreamUnitTypeDescriptor cbs_av1_unit_types[]
Definition: cbs_av1.c:1256
cbs_av1_write_increment
static int cbs_av1_write_increment(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t range_min, uint32_t range_max, const char *name, uint32_t value)
Definition: cbs_av1.c:288
int64_t
long long int64_t
Definition: coverity.c:34
cbs_av1_read_increment
static int cbs_av1_read_increment(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t range_min, uint32_t range_max, const char *name, uint32_t *write_to)
Definition: cbs_av1.c:260
MAX_INT_BITS
#define MAX_INT_BITS(length)
Definition: cbs_internal.h:200
cbs_av1_read_leb128
static int cbs_av1_read_leb128(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint64_t *write_to)
Definition: cbs_av1.c:119
cbs_av1_read_ns
static int cbs_av1_read_ns(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t n, const char *name, const int *subscripts, uint32_t *write_to)
Definition: cbs_av1.c:186
max
#define max(a, b)
Definition: cuda_runtime.h:33
AV1_OBU_TEMPORAL_DELIMITER
@ AV1_OBU_TEMPORAL_DELIMITER
Definition: av1.h:31
AV1RawTileData::data
uint8_t * data
Definition: cbs_av1.h:292
cbs_av1_read_subexp
static int cbs_av1_read_subexp(CodedBitstreamContext *ctx, GetBitContext *gbc, uint32_t range_max, const char *name, const int *subscripts, uint32_t *write_to)
Definition: cbs_av1.c:319
ff_cbs_write_unsigned
int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max)
Definition: cbs.c:647
AV1_OBU_FRAME_HEADER
@ AV1_OBU_FRAME_HEADER
Definition: av1.h:32
CBS_UNIT_TYPE_INTERNAL_REF
#define CBS_UNIT_TYPE_INTERNAL_REF(type, structure, ref_field)
Definition: cbs_internal.h:312
cbs_av1_close
static void cbs_av1_close(CodedBitstreamContext *ctx)
Definition: cbs_av1.c:1226
cbs_av1_write_obu
static int cbs_av1_write_obu(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
Definition: cbs_av1.c:981
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:209
cbs_av1_read_uvlc
static int cbs_av1_read_uvlc(CodedBitstreamContext *ctx, GetBitContext *gbc, const char *name, uint32_t *write_to, uint32_t range_min, uint32_t range_max)
Definition: cbs_av1.c:30
AV1RawOBU::tile_list
AV1RawTileList tile_list
Definition: cbs_av1.h:410
cbs_av1_free_metadata
static void cbs_av1_free_metadata(FFRefStructOpaque unused, void *content)
Definition: cbs_av1.c:1234
cbs_av1_split_fragment
static int cbs_av1_split_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_av1.c:673
ctx
AVFormatContext * ctx
Definition: movenc.c:49
cbs_av1_write_uvlc
static int cbs_av1_write_uvlc(CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, uint32_t value, uint32_t range_min, uint32_t range_max)
Definition: cbs_av1.c:88
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
AV1RawOBU
Definition: cbs_av1.h:400
NULL
#define NULL
Definition: coverity.c:32
AV_CODEC_ID_AV1
@ AV_CODEC_ID_AV1
Definition: codec_id.h:284
cbs_av1_read_unit
static int cbs_av1_read_unit(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_av1.c:808
cbs_av1_options
static const AVOption cbs_av1_options[]
Definition: cbs_av1.c:1278
delta_q
#define delta_q(name)
Definition: cbs_av1.c:633
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
flush
void(* flush)(AVBSFContext *ctx)
Definition: dts2pts.c:370
cbs_av1_write_subexp
static int cbs_av1_write_subexp(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t range_max, const char *name, const int *subscripts, uint32_t value)
Definition: cbs_av1.c:364
AV1_OBU_TILE_GROUP
@ AV1_OBU_TILE_GROUP
Definition: av1.h:33
ff_cbs_read_simple_unsigned
int ff_cbs_read_simple_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, uint32_t *write_to)
Definition: cbs.c:640
AV1_OBU_FRAME
@ AV1_OBU_FRAME
Definition: av1.h:35
AV1RawTileList::tile_data
AV1RawTileData tile_data
Definition: cbs_av1.h:315
cbs_av1_flush
static void cbs_av1_flush(CodedBitstreamContext *ctx)
Definition: cbs_av1.c:1212
OFFSET
#define OFFSET(x)
Definition: cbs_av1.c:1277
AV1_OBU_SEQUENCE_HEADER
@ AV1_OBU_SEQUENCE_HEADER
Definition: av1.h:30
ff_cbs_write_signed
int ff_cbs_write_signed(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, const int *subscripts, int32_t value, int32_t range_min, int32_t range_max)
Definition: cbs.c:715
CBS_UNIT_TYPE_POD
#define CBS_UNIT_TYPE_POD(type_, structure)
Definition: cbs_internal.h:288
ff_cbs_read_signed
int ff_cbs_read_signed(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, int32_t *write_to, int32_t range_min, int32_t range_max)
Definition: cbs.c:683
cbs_av1_assemble_fragment
static int cbs_av1_assemble_fragment(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_av1.c:1184
AV1_OBU_PADDING
@ AV1_OBU_PADDING
Definition: av1.h:39
cbs_av1_write_leb128
static int cbs_av1_write_leb128(CodedBitstreamContext *ctx, PutBitContext *pbc, const char *name, uint64_t value, int fixed_length)
Definition: cbs_av1.c:150
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
ff_cbs_read_unsigned
int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max)
Definition: cbs.c:631
AV1RawOBU::tile_group
AV1RawTileGroup tile_group
Definition: cbs_av1.h:409
AV1RawTileGroup::tile_data
AV1RawTileData tile_data
Definition: cbs_av1.h:302
CBS_UNIT_TYPE_END_OF_LIST
#define CBS_UNIT_TYPE_END_OF_LIST
Definition: cbs_internal.h:335
AV1_OBU_TILE_LIST
@ AV1_OBU_TILE_LIST
Definition: av1.h:37
SUBSCRIPTS
#define SUBSCRIPTS(subs,...)
Definition: cbs_av1.c:470
ff_cbs_write_simple_unsigned
int ff_cbs_write_simple_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, uint32_t value)
Definition: cbs.c:676
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
MIN_INT_BITS
#define MIN_INT_BITS(length)
Definition: cbs_internal.h:204
AV1RawOBU::frame
AV1RawFrame frame
Definition: cbs_av1.h:408
AV1RawFrame::tile_group
AV1RawTileGroup tile_group
Definition: cbs_av1.h:307
AV1_MAX_OPERATING_POINTS
@ AV1_MAX_OPERATING_POINTS
Definition: av1.h:74
cbs_av1_write_ns
static int cbs_av1_write_ns(CodedBitstreamContext *ctx, PutBitContext *pbc, uint32_t n, const char *name, const int *subscripts, uint32_t value)
Definition: cbs_av1.c:224
AV1RawPadding::payload
uint8_t * payload
Definition: cbs_av1.h:394
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
width
#define width
Definition: dsp.h:85
AV1RawOBU::padding
AV1RawPadding padding
Definition: cbs_av1.h:412
AV1_OBU_METADATA
@ AV1_OBU_METADATA
Definition: av1.h:34
min
float min
Definition: vorbis_enc_data.h:429
CodedBitstreamAV1Context
Definition: cbs_av1.h:438