FFmpeg
Loading...
Searching...
No Matches
parser.c File Reference
#include "libavutil/common.h"
#include "libavutil/mem.h"
#include "libavcodec/golomb.h"
#include "libavcodec/parser_internal.h"
#include "libavcodec/h2645_parse.h"
#include "libavcodec/parser.h"
#include "hevc.h"
#include "parse.h"
#include "ps.h"
#include "sei.h"

Go to the source code of this file.

Data Structures

struct  HEVCParserContext
 

Macros

#define START_CODE   0x000001
 start_code_prefix_one_3bytes
 
#define IS_IRAP_NAL(nal)
 
#define IS_IDR_NAL(nal)
 

Functions

static int hevc_parse_slice_header (AVCodecParserContext *s, H2645NAL *nal, AVCodecContext *avctx)
 
static int parse_nal_units (AVCodecParserContext *s, const uint8_t *buf, int buf_size, AVCodecContext *avctx)
 Parse NAL units of found picture and decode some basic information.
 
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 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)
 

Variables

const FFCodecParser ff_hevc_parser
 

Macro Definition Documentation

◆ START_CODE

#define START_CODE   0x000001

start_code_prefix_one_3bytes

Definition at line 36 of file parser.c.

◆ IS_IRAP_NAL

#define IS_IRAP_NAL ( nal)
Value:
(nal->type >= 16 && nal->type <= 23)
static int FUNC nal(CodedBitstreamContext *ctx, RWContext *rw, LCEVCRawNAL *current, int nal_unit_type)

Definition at line 38 of file parser.c.

Referenced by hevc_parse_slice_header().

◆ IS_IDR_NAL

#define IS_IDR_NAL ( nal)
Value:
@ HEVC_NAL_IDR_W_RADL
Definition hevc.h:48
@ HEVC_NAL_IDR_N_LP
Definition hevc.h:49

Definition at line 39 of file parser.c.

Referenced by hevc_parse_slice_header().

Function Documentation

◆ hevc_parse_slice_header()

static int hevc_parse_slice_header ( AVCodecParserContext * s,
H2645NAL * nal,
AVCodecContext * avctx )
static

Definition at line 56 of file parser.c.

Referenced by parse_nal_units().

◆ parse_nal_units()

static int parse_nal_units ( AVCodecParserContext * s,
const uint8_t * buf,
int buf_size,
AVCodecContext * avctx )
static

Parse NAL units of found picture and decode some basic information.

Parameters
sparser context.
avctxcodec context.
bufbuffer with field/frame data.
buf_sizesize of the buffer.

Definition at line 181 of file parser.c.

Referenced by hevc_parse().

◆ hevc_find_frame_end()

static int hevc_find_frame_end ( AVCodecParserContext * s,
const uint8_t * buf,
int buf_size )
static

Find the end of the current frame in the bitstream.

Returns
the position of the first byte of the next frame, or END_NOT_FOUND

Definition at line 259 of file parser.c.

Referenced by hevc_parse().

◆ hevc_parse()

static int hevc_parse ( AVCodecParserContext * s,
AVCodecContext * avctx,
const uint8_t ** poutbuf,
int * poutbuf_size,
const uint8_t * buf,
int buf_size )
static

Definition at line 308 of file parser.c.

◆ hevc_parser_close()

static void hevc_parser_close ( AVCodecParserContext * s)
static

Definition at line 346 of file parser.c.

Variable Documentation

◆ ff_hevc_parser

const FFCodecParser ff_hevc_parser
Initial value:
= {
.priv_data_size = sizeof(HEVCParserContext),
}
static int parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition apv_parser.c:92
static av_cold void close(AVCodecParserContext *s)
Definition apv_parser.c:197
@ AV_CODEC_ID_HEVC
Definition codec_id.h:223
static int hevc_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
Definition parser.c:308
static void hevc_parser_close(AVCodecParserContext *s)
Definition parser.c:346
#define PARSER_CODEC_LIST(...)

Definition at line 357 of file parser.c.