19 #ifndef AVCODEC_CBS_INTERNAL_H
20 #define AVCODEC_CBS_INTERNAL_H
140 const char *
name,
const int *subscripts,
141 const char *bitstring, int64_t
value);
149 const int *subscripts, uint32_t *write_to,
150 uint32_t range_min, uint32_t range_max);
154 const int *subscripts, uint32_t
value,
155 uint32_t range_min, uint32_t range_max);
159 const int *subscripts,
int32_t *write_to,
169 #define MAX_UINT_BITS(length) ((UINT64_C(1) << (length)) - 1)
173 #define MAX_INT_BITS(length) ((INT64_C(1) << ((length) - 1)) - 1)
177 #define MIN_INT_BITS(length) (-(INT64_C(1) << ((length) - 1)))
180 #define CBS_UNIT_TYPE_POD(type, structure) { \
181 .nb_unit_types = 1, \
182 .unit_types = { type }, \
183 .content_type = CBS_CONTENT_TYPE_POD, \
184 .content_size = sizeof(structure), \
186 #define CBS_UNIT_TYPE_INTERNAL_REF(type, structure, ref_field) { \
187 .nb_unit_types = 1, \
188 .unit_types = { type }, \
189 .content_type = CBS_CONTENT_TYPE_INTERNAL_REFS, \
190 .content_size = sizeof(structure), \
191 .nb_ref_offsets = 1, \
192 .ref_offsets = { offsetof(structure, ref_field) }, \
194 #define CBS_UNIT_TYPE_COMPLEX(type, structure, free_func) { \
195 .nb_unit_types = 1, \
196 .unit_types = { type }, \
197 .content_type = CBS_CONTENT_TYPE_COMPLEX, \
198 .content_size = sizeof(structure), \
199 .content_free = free_func, \
201 #define CBS_UNIT_TYPE_END_OF_LIST { .nb_unit_types = 0 }
Libavcodec external API header.
uint32_t CodedBitstreamUnitType
The codec-specific type of a bitstream unit.
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)
const CodedBitstreamType ff_cbs_type_jpeg
const CodedBitstreamType ff_cbs_type_mpeg2
const CodedBitstreamType ff_cbs_type_h265
@ CBS_CONTENT_TYPE_INTERNAL_REFS
@ CBS_CONTENT_TYPE_COMPLEX
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)
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)
const CodedBitstreamType ff_cbs_type_vp9
void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, const char *name, const int *subscripts, const char *bitstring, int64_t value)
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)
void ff_cbs_trace_header(CodedBitstreamContext *ctx, const char *name)
const CodedBitstreamType ff_cbs_type_h264
const CodedBitstreamType ff_cbs_type_av1
bitstream reader API header.
AVCodecID
Identify the syntax and semantics of the bitstream.
typedef void(RENAME(mix_any_func_type))
static const uint8_t header[24]
A reference to a data buffer.
Describe the class of an AVClass context structure.
Context structure for coded bitstream operations.
Coded bitstream fragment structure, combining one or more units.
int(* split_fragment)(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
int(* read_unit)(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
void(* flush)(CodedBitstreamContext *ctx)
int(* write_unit)(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit, PutBitContext *pbc)
void(* close)(CodedBitstreamContext *ctx)
int(* assemble_fragment)(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
const CodedBitstreamUnitTypeDescriptor * unit_types
const AVClass * priv_class
const CodedBitstreamUnitType unit_types[CBS_MAX_UNIT_TYPES]
const CodedBitstreamUnitType unit_type_range_start
void(* content_free)(void *opaque, uint8_t *data)
int(* content_clone)(AVBufferRef **ref, CodedBitstreamUnit *unit)
enum CBSContentType content_type
const CodedBitstreamUnitType unit_type_range_end
size_t ref_offsets[CBS_MAX_REF_OFFSETS]
Coded bitstream unit structure.
static int ref[MAX_W *MAX_W]