30 #define START_CODE 0x000001 32 #define IS_IRAP_NAL(nal) (nal->type >= 16 && nal->type <= 23) 131 for (i = 0; i < buf_size; i++) {
139 nut = (pc->
state64 >> 2 * 8 + 1) & 0x3F;
142 (nut >= 41 && nut <= 44) || (nut >= 48 && nut <= 55)) {
149 int first_slice_segment_in_pic_flag = buf[i] >> 7;
150 if (first_slice_segment_in_pic_flag) {
166 const uint8_t **poutbuf,
int *poutbuf_size,
167 const uint8_t *buf,
int buf_size)
193 *poutbuf_size = buf_size;
204 for (i = 0; i < buf_size; i++) {
205 state = (state << 8) | buf[i];
206 if (((state >> 8) & 0xFFFFFF) ==
START_CODE) {
207 int nut = (state >> 1) & 0x3F;
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_buffer_unref(AVBufferRef **buf)
Free a given reference and automatically free the buffer if there are no more references to it...
static int hevc_parse_slice_header(AVCodecParserContext *s, H2645NAL *nal, AVCodecContext *avctx)
static int hevc_split(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
int width
Dimensions of the decoded video intended for presentation.
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length, void *logctx, int is_nalff, int nal_length_size, enum AVCodecID codec_id)
Split an input packet into NAL units.
int coded_width
Dimensions of the coded video.
#define FF_ARRAY_ELEMS(a)
int ff_hevc_decode_nal_sps(GetBitContext *gb, AVCodecContext *avctx, HEVCParamSets *ps, int apply_defdispwin)
AVBufferRef * vps_list[MAX_VPS_COUNT]
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void ff_h2645_packet_uninit(H2645Packet *pkt)
Free all the allocated memory in the packet.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int ff_hevc_decode_nal_pps(GetBitContext *gb, AVCodecContext *avctx, HEVCParamSets *ps)
int ff_combine_frame(ParseContext *pc, int next, const uint8_t **buf, int *buf_size)
Combine the (truncated) bitstream to a complete frame.
static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf, int buf_size)
Find the end of the current frame in the bitstream.
static char * split(char *message, char delim)
static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf, int buf_size, AVCodecContext *avctx)
AVBufferRef * pps_list[MAX_PPS_COUNT]
static unsigned get_ue_golomb_long(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
enum AVPixelFormat pix_fmt
#define START_CODE
start_code_prefix_one_3bytes
unsigned int sps_id
seq_parameter_set_id
main external API structure.
uint8_t * data
The data buffer.
AVCodecParser ff_hevc_parser
static unsigned int get_bits1(GetBitContext *s)
uint64_t state64
contains the last 8 bytes in MSB order
int ff_hevc_decode_nal_vps(GetBitContext *gb, AVCodecContext *avctx, HEVCParamSets *ps)
common internal and external API header
#define PARSER_FLAG_COMPLETE_FRAMES
int format
The format of the coded data, corresponds to enum AVPixelFormat for video and for enum AVSampleFormat...
static int hevc_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static void hevc_parser_close(AVCodecParserContext *s)
int key_frame
Set by parser to 1 for key frames and 0 for non-key frames.
AVBufferRef * sps_list[MAX_SPS_COUNT]