Go to the documentation of this file.
55 int skipped_byte_pos = 0, nalu_length = 3;
60 avio_wb16(pb, bytestream2_get_be16(&gbc));
65 uint64_t payload_size;
66 int payload_size_type, payload_type;
67 int block_size, raw_block_size, block_end;
71 payload_size_type =
get_bits(&gb, 3);
73 payload_size = payload_size_type;
74 if (payload_size_type == 6)
76 if (payload_size_type == 7)
77 payload_size =
get_mb(&gb);
82 block_size = raw_block_size = payload_size + (
get_bits_count(&gb) >> 3);
89 for (; skipped_byte_pos <
nal->skipped_bytes; skipped_byte_pos++) {
90 if (
nal->skipped_bytes_pos[skipped_byte_pos] >= block_end)
95 switch (payload_type) {
104 nalu_length += raw_block_size;
109 int processed_planes_type_flag;
114 processed_planes_type_flag =
get_bits1(&gb);
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)
161 nalu_length += raw_block_size;
167 nalu_length += raw_block_size;
196 uint32_t idr_size = 0, nidr_size = 0;
197 int ret, nb_idr = 0, nb_nidr = 0;
241 if (!idr_size && !nidr_size) {
257 int nb_arrays = !!nb_idr + !!nb_nidr;
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)
static void idr(H264Context *h)
instantaneous decoder refresh.
static av_always_inline int bytestream2_tell(const GetByteContext *g)
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 get_bits_count(const GetBitContext *s)
int ff_isom_write_lvcc(AVIOContext *pb, const uint8_t *data, int len)
const struct FFLCEVCDim ff_lcevc_resolution_type[63]
uint8_t chroma_format_idc
static void bit_depth(AudioStatsContext *s, const uint64_t *const mask, uint8_t *depth)
int avio_get_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
static uint64_t get_mb(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
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.
static av_always_inline int64_t avio_tell(AVIOContext *s)
ftell() equivalent for AVIOContext.
uint8_t bit_depth_luma_minus8
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.
int avio_open_dyn_buf(AVIOContext **s)
Open a write only memory stream.
static int write_nalu(LCEVCDecoderConfigurationRecord *lvcc, AVIOContext *pb, const H2645NAL *nal)
Rewrite the NALu stripping the unneeded blocks.
#define AVERROR_PATCHWELCOME
Not yet implemented in FFmpeg, patches welcome.
static unsigned int get_bits1(GetBitContext *s)
void avio_w8(AVIOContext *s, int b)
#define i(width, name, range_min, range_max)
uint32_t pic_width_in_luma_samples
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
uint32_t pic_height_in_luma_samples
void avio_write(AVIOContext *s, const unsigned char *buf, int size)
void avio_wb32(AVIOContext *s, unsigned int val)
static void skip_bits1(GetBitContext *s)
uint8_t bit_depth_chroma_minus8
static int FUNC() nal(CodedBitstreamContext *ctx, RWContext *rw, LCEVCRawNAL *current, int nal_unit_type)
void ffio_free_dyn_buf(AVIOContext **s)
Free a dynamic buffer.
int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
fseek() equivalent for AVIOContext.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
void avio_wb16(AVIOContext *s, unsigned int val)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_WB32 unsigned int_TMPL AV_RB24