X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcbs_internal.h;h=172b8a2515983aa15c04836e44b52472e7af6e47;hb=755e618399264d57a64a21115e2bf067b73492e7;hp=ae0b417b43afe92d5c965667a53a7598083491b6;hpb=b3e5899e475d02dc0730e9405b4c067c8c78d8f4;p=ffmpeg diff --git a/libavcodec/cbs_internal.h b/libavcodec/cbs_internal.h index ae0b417b43a..172b8a25159 100644 --- a/libavcodec/cbs_internal.h +++ b/libavcodec/cbs_internal.h @@ -32,9 +32,9 @@ typedef struct CodedBitstreamType { // Split frag->data into coded bitstream units, creating the // frag->units array. Fill data but not content on each unit. - // header is set if the fragment came from a header block, which - // may require different parsing for some codecs (e.g. the AVCC - // header in H.264). + // The header argument should be set if the fragment came from + // a header block, which may require different parsing for some + // codecs (e.g. the AVCC header in H.264). int (*split_fragment)(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header); @@ -53,9 +53,6 @@ typedef struct CodedBitstreamType { int (*assemble_fragment)(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag); - // Free the content and data of a single unit. - void (*free_unit)(CodedBitstreamUnit *unit); - // Free the codec internal state. void (*close)(CodedBitstreamContext *ctx); } CodedBitstreamType; @@ -66,8 +63,8 @@ typedef struct CodedBitstreamType { void ff_cbs_trace_header(CodedBitstreamContext *ctx, const char *name); -void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, - int position, const char *name, +void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, + const char *name, const int *subscripts, const char *bitstring, int64_t value); @@ -75,17 +72,24 @@ void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, // generation of trace output. int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, - int width, const char *name, uint32_t *write_to, + int width, const char *name, + const int *subscripts, uint32_t *write_to, uint32_t range_min, uint32_t range_max); int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, - int width, const char *name, uint32_t value, + int width, const char *name, + const int *subscripts, uint32_t value, uint32_t range_min, uint32_t range_max); +// The largest value representable in N bits, suitable for use as +// range_max in the above functions. +#define MAX_UINT_BITS(length) ((UINT64_C(1) << (length)) - 1) + extern const CodedBitstreamType ff_cbs_type_h264; extern const CodedBitstreamType ff_cbs_type_h265; extern const CodedBitstreamType ff_cbs_type_mpeg2; +extern const CodedBitstreamType ff_cbs_type_vp9; #endif /* AVCODEC_CBS_INTERNAL_H */