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;
95 uint64_t payload_size;
96 int payload_size_type, payload_type;
103 payload_size_type =
get_bits(&gb, 3);
105 payload_size = payload_size_type;
106 if (payload_size_type == 6)
108 if (payload_size_type == 7)
109 payload_size =
get_mb(&gb);
118 switch (payload_type) {
124 int resolution_type, chroma_format_idc,
bit_depth;
125 int processed_planes_type_flag;
127 processed_planes_type_flag =
get_bits1(&gb);
130 chroma_format_idc =
get_bits(&gb, 2);
136 if (resolution_type < 63) {
140 int upsample_type, tile_dimensions_type;
141 int temporal_step_width_modifier_signalled_flag, level1_filtering_signalled_flag;
143 temporal_step_width_modifier_signalled_flag =
get_bits1(&gb);
146 level1_filtering_signalled_flag =
get_bits1(&gb);
148 tile_dimensions_type =
get_bits(&gb, 2);
150 if (processed_planes_type_flag)
152 if (temporal_step_width_modifier_signalled_flag)
156 if (level1_filtering_signalled_flag)
158 if (tile_dimensions_type) {
159 if (tile_dimensions_type == 3)
196 for (
i = 0;
i <
ctx->pkt.nb_nals;
i++) {
216 const uint8_t **poutbuf,
int *poutbuf_size,
217 const uint8_t *buf,
int buf_size)
224 ctx->parsed_extradata = 1;
245 *poutbuf_size = buf_size;
static void skip_bits_long(GetBitContext *s, int n)
Skips the specified number of bits.
AVPixelFormat
Pixel format.
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)
#define AV_PIX_FMT_YUV420P10
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.
#define AV_PIX_FMT_YUV444P10
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static AVFormatContext * ctx
#define AV_PIX_FMT_GRAY14
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define AV_PIX_FMT_GRAY10
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)
#define AV_PIX_FMT_YUV422P10
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
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.
static enum AVPixelFormat pix_fmts[4][4]
#define i(width, name, range_min, range_max)
#define AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV444P12
@ 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)
#define AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV422P14
static void lcevc_parser_close(AVCodecParserContext *s)
main external API structure.
@ LCEVC_PAYLOAD_TYPE_SEQUENCE_CONFIG
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
@ 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.
#define AV_PIX_FMT_YUV444P14
#define AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_YUV420P14