Go to the documentation of this file.
33 #define START_CODE 0x000001
51 for (
int i = 0;
i < buf_size;
i++) {
59 nut = (pc->
state >> 1) & 0x1F;
84 uint64_t payload_size;
85 int payload_size_type, payload_type;
92 payload_size_type =
get_bits(&gb, 3);
94 payload_size = payload_size_type;
95 if (payload_size_type == 6)
97 if (payload_size_type == 7)
98 payload_size =
get_mb(&gb);
107 switch (payload_type) {
113 int resolution_type, chroma_format_idc,
bit_depth;
114 int processed_planes_type_flag;
116 processed_planes_type_flag =
get_bits1(&gb);
119 chroma_format_idc =
get_bits(&gb, 2);
125 if (resolution_type < 63) {
129 int upsample_type, tile_dimensions_type;
130 int temporal_step_width_modifier_signalled_flag, level1_filtering_signalled_flag;
132 temporal_step_width_modifier_signalled_flag =
get_bits1(&gb);
135 level1_filtering_signalled_flag =
get_bits1(&gb);
137 tile_dimensions_type =
get_bits(&gb, 2);
139 if (processed_planes_type_flag)
141 if (temporal_step_width_modifier_signalled_flag)
145 if (level1_filtering_signalled_flag)
147 if (tile_dimensions_type) {
148 if (tile_dimensions_type == 3)
185 for (
i = 0;
i <
ctx->pkt.nb_nals;
i++) {
205 const uint8_t **poutbuf,
int *poutbuf_size,
206 const uint8_t *buf,
int buf_size)
213 ctx->parsed_extradata = 1;
234 *poutbuf_size = buf_size;
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
@ AV_PICTURE_STRUCTURE_UNKNOWN
unknown
int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, void *logctx, int nal_length_size, enum AVCodecID codec_id, int flags)
Split an input packet into NAL units.
static int parse_nal_unit(AVCodecParserContext *s, AVCodecContext *avctx, const H2645NAL *nal)
static int get_bits_count(const GetBitContext *s)
const struct FFLCEVCDim ff_lcevc_resolution_type[63]
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
uint32_t state
contains the last few bytes in MSB order
static uint64_t get_mb(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static av_cold void close(AVCodecParserContext *s)
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
void ff_h2645_packet_uninit(H2645Packet *pkt)
Free all the allocated memory in the packet.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static AVFormatContext * ctx
enum AVPixelFormat ff_lcevc_depth_type[4][4]
static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf, int buf_size, AVCodecContext *avctx)
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static unsigned int get_bits1(GetBitContext *s)
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
int level
Encoding level descriptor.
#define i(width, name, range_min, range_max)
@ AV_PICTURE_TYPE_NONE
Undefined.
#define START_CODE
start_code_prefix_one_3bytes
static void skip_bits1(GetBitContext *s)
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
@ H2645_FLAG_SMALL_PADDING
#define PARSER_FLAG_COMPLETE_FRAMES
static int FUNC() nal(CodedBitstreamContext *ctx, RWContext *rw, LCEVCRawNAL *current, int nal_unit_type)
uint8_t * extradata
Out-of-band global headers that may be used by some codecs.
static int lcevc_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
const FFCodecParser ff_lcevc_parser
#define PARSER_CODEC_LIST(...)
static int lcevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf, int buf_size)
static void lcevc_parser_close(AVCodecParserContext *s)
main external API structure.
@ LCEVC_PAYLOAD_TYPE_SEQUENCE_CONFIG
@ LCEVC_PAYLOAD_TYPE_GLOBAL_CONFIG
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.