51 if (
sps->profile_idc == 0) {
71 ctx->au_buffer.data_size = 0;
152 int au_end_found = 0, err;
154 while (!au_end_found) {
170 if (!buffer_pkt->data ||
183 if (!nalu_size || nalu_size > INT_MAX) {
203 data_size =
ctx->au_buffer.data_size + nalu_size;
219 memcpy(
ctx->au_buffer.data +
ctx->au_buffer.data_size, in->
data, nalu_size);
221 ctx->au_buffer.data_size = data_size;
223 in->
data += nalu_size;
224 in->
size -= nalu_size;
228 data_size =
ctx->au_buffer.data_size;
230 ctx->au_buffer.data_size = 0;
237 buffer_pkt->data = buffer_pkt->buf->data;
238 buffer_pkt->size = data_size;
240 memcpy(
out->data,
ctx->au_buffer.data, data_size);
248 ctx->au_buffer.data_size = 0;
259 if (!
ctx->in || !
ctx->buffer_pkt)
273 ctx->au_buffer.capacity = 0;
275 ctx->au_buffer.data_size = 0;
283 .p.name =
"evc_frame_merge",
static av_cold void close(AVCodecParserContext *s)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
const FFBitStreamFilter ff_evc_frame_merge_bsf
int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt)
Called by bitstream filters to get packet for filtering.
static int FUNC sps(CodedBitstreamContext *ctx, RWContext *rw, H264RawSPS *current)
void(* flush)(AVBSFContext *ctx)
int(* init)(AVBSFContext *ctx)
static enum AVCodecID evc_frame_merge_codec_ids[]
static void evc_frame_merge_close(AVBSFContext *bsf)
static int evc_frame_merge_init(AVBSFContext *bsf)
static void evc_frame_merge_flush(AVBSFContext *bsf)
static int parse_nal_unit(AVBSFContext *bsf, const uint8_t *buf, int buf_size)
static int end_of_access_unit_found(const EVCParamSets *ps, const EVCParserSliceHeader *sh, const EVCParserPoc *poc, enum EVCNALUnitType nalu_type)
static int evc_frame_merge_filter(AVBSFContext *bsf, AVPacket *out)
int ff_evc_parse_slice_header(GetBitContext *gb, EVCParserSliceHeader *sh, const EVCParamSets *ps, enum EVCNALUnitType nalu_type)
int ff_evc_derive_poc(const EVCParamSets *ps, const EVCParserSliceHeader *sh, EVCParserPoc *poc, enum EVCNALUnitType nalu_type, int tid)
EVC decoder/parser shared code.
static uint32_t evc_read_nal_unit_length(const uint8_t *bits, int bits_size, void *logctx)
int ff_evc_parse_pps(GetBitContext *gb, EVCParamSets *ps)
void ff_evc_ps_free(EVCParamSets *ps)
int ff_evc_parse_sps(GetBitContext *gb, EVCParamSets *ps)
EVC decoder/parser shared code.
bitstream reader API header.
static unsigned int get_bits1(GetBitContext *s)
static void skip_bits(GetBitContext *s, int n)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static void skip_bits1(GetBitContext *s)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
AVCodecID
Identify the syntax and semantics of the bitstream.
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding.
void av_packet_free(AVPacket **pkt)
Free the packet, if the packet is reference counted, it will be unreferenced first.
void av_packet_unref(AVPacket *pkt)
Wipe the packet.
void av_packet_move_ref(AVPacket *dst, AVPacket *src)
Move every field in src to dst and reset src.
AVPacket * av_packet_alloc(void)
Allocate an AVPacket and set its fields to default values.
int av_packet_ref(AVPacket *dst, const AVPacket *src)
Setup a new reference to the data described by a given packet.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it.
int av_buffer_realloc(AVBufferRef **pbuf, size_t size)
Reallocate a given buffer.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
#define AVERROR_EOF
End of file.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void * av_fast_realloc(void *ptr, unsigned int *size, size_t min_size)
Reallocate the given buffer if it is not large enough, otherwise do nothing.
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define EVC_NALU_LENGTH_PREFIX_SIZE
Memory handling functions.
The bitstream filter state.
void * priv_data
Opaque filter-specific private data.
This structure stores compressed data.
int64_t pts
Presentation timestamp in AVStream->time_base units; the time at which the decompressed packet will b...
AccessUnitBuffer au_buffer
EVCParserPPS * pps[EVC_MAX_PPS_COUNT]
EVCParserSPS * sps[EVC_MAX_SPS_COUNT]
void(* filter)(uint8_t *src, ptrdiff_t stride, int qscale)
static AVFormatContext * ctx