Go to the documentation of this file.
31 #define START_CODE 0x000001
49 for (
int i = 0;
i < buf_size;
i++) {
57 nut = (pc->
state >> 1) & 0x1F;
89 { 360, 200 }, { 400, 240 }, { 480, 320 }, { 640, 360 },
90 { 640, 480 }, { 768, 480 }, { 800, 600 }, { 852, 480 },
91 { 854, 480 }, { 856, 480 }, { 960, 540 }, { 960, 640 },
92 { 1024, 576 }, { 1024, 600 }, { 1024, 768 }, { 1152, 864 },
93 { 1280, 720 }, { 1280, 800 }, { 1280, 1024 }, { 1360, 768 },
94 { 1366, 768 }, { 1920, 1200 }, { 2048, 1080 }, { 2048, 1152 },
95 { 2048, 1536 }, { 2160, 1440 }, { 2560, 1440 }, { 2560, 1600 },
96 { 2560, 2048 }, { 3200, 1800 }, { 3200, 2048 }, { 3200, 2400 },
97 { 3440, 1440 }, { 3840, 1600 }, { 3840, 2160 }, { 3840, 2400 },
98 { 4096, 2160 }, { 4096, 3072 }, { 5120, 2880 }, { 5120, 3200 },
99 { 5120, 4096 }, { 6400, 4096 }, { 6400, 4800 }, { 7680, 4320 },
109 unsigned bits =
byte & 0x7f;
128 int payload_size_type, payload_type, payload_size;
133 payload_size_type =
get_bits(&gb, 3);
135 payload_size = payload_size_type;
136 if (payload_size_type == 6)
138 if (payload_size_type == 7)
139 payload_size =
get_mb(&gb);
145 switch (payload_type) {
151 int resolution_type, chroma_format_idc,
bit_depth;
152 int processed_planes_type_flag;
154 processed_planes_type_flag =
get_bits1(&gb);
157 chroma_format_idc =
get_bits(&gb, 2);
163 if (resolution_type < 63) {
167 int upsample_type, tile_dimensions_type;
168 int temporal_step_width_modifier_signalled_flag, level1_filtering_signalled_flag;
170 temporal_step_width_modifier_signalled_flag =
get_bits1(&gb);
173 level1_filtering_signalled_flag =
get_bits1(&gb);
175 tile_dimensions_type =
get_bits(&gb, 2);
177 if (processed_planes_type_flag)
179 if (temporal_step_width_modifier_signalled_flag)
183 if (level1_filtering_signalled_flag)
185 if (tile_dimensions_type) {
186 if (tile_dimensions_type == 3)
223 for (
i = 0;
i <
ctx->pkt.nb_nals;
i++) {
243 const uint8_t **poutbuf,
int *poutbuf_size,
244 const uint8_t *buf,
int buf_size)
251 ctx->parsed_extradata = 1;
272 *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
static int parse_nal_unit(AVCodecParserContext *s, AVCodecContext *avctx, const H2645NAL *nal)
static int get_bits_count(const GetBitContext *s)
void ff_h2645_packet_uninit(H2645Packet *pkt)
Free all the allocated memory in the packet.
#define AV_PIX_FMT_YUV420P10
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 const struct @177 resolution_type_lut[63]
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.
@ LCEVC_PAYLOAD_TYPE_SEQUENCE_CONFIG
static uint64_t get_mb(GetBitContext *s)
#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.
@ LCEVC_PAYLOAD_TYPE_GLOBAL_CONFIG
#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.
@ 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)
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
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.
#define AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_YUV420P14