FFmpeg
Loading...
Searching...
No Matches
h264_parser.c File Reference

H.264 / AVC / MPEG-4 part10 parser. More...

#include <stdint.h>
#include "libavutil/attributes.h"
#include "libavutil/avutil.h"
#include "libavutil/error.h"
#include "libavutil/log.h"
#include "libavutil/mem.h"
#include "libavutil/pixfmt.h"
#include "avcodec.h"
#include "get_bits.h"
#include "golomb.h"
#include "h264.h"
#include "h264dsp.h"
#include "h264_parse.h"
#include "h264_sei.h"
#include "h264_ps.h"
#include "h2645_parse.h"
#include "h264data.h"
#include "mpegutils.h"
#include "parser.h"
#include "libavutil/refstruct.h"
#include "parser_internal.h"
#include "startcode.h"

Go to the source code of this file.

Data Structures

struct  H264ParseContext
 

Macros

#define UNCHECKED_BITSTREAM_READER   1
 

Functions

static int find_start_code (const uint8_t *buf, int buf_size, int buf_index, int next_avc)
 
static int h264_find_frame_end (H264ParseContext *p, const uint8_t *buf, int buf_size, void *logctx)
 
static int scan_mmco_reset (AVCodecParserContext *s, GetBitContext *gb, void *logctx)
 
static int parse_nal_units (AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t *const buf, int buf_size)
 Parse NAL units of found picture and decode some basic information.
 
static int h264_parse (AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
 
static av_cold void h264_close (AVCodecParserContext *s)
 
static av_cold int init (AVCodecParserContext *s)
 

Variables

const FFCodecParser ff_h264_parser
 

Detailed Description

H.264 / AVC / MPEG-4 part10 parser.

Author
Michael Niedermayer micha.nosp@m.elni.nosp@m.@gmx..nosp@m.at

Definition in file h264_parser.c.

Macro Definition Documentation

◆ UNCHECKED_BITSTREAM_READER

#define UNCHECKED_BITSTREAM_READER   1

Definition at line 28 of file h264_parser.c.

Function Documentation

◆ find_start_code()

static int find_start_code ( const uint8_t * buf,
int buf_size,
int buf_index,
int next_avc )
static

Definition at line 72 of file h264_parser.c.

Referenced by parse_nal_units().

◆ h264_find_frame_end()

static int h264_find_frame_end ( H264ParseContext * p,
const uint8_t * buf,
int buf_size,
void * logctx )
static

Definition at line 82 of file h264_parser.c.

Referenced by h264_parse().

◆ scan_mmco_reset()

static int scan_mmco_reset ( AVCodecParserContext * s,
GetBitContext * gb,
void * logctx )
static

Definition at line 173 of file h264_parser.c.

Referenced by parse_nal_units().

◆ parse_nal_units()

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

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 262 of file h264_parser.c.

Referenced by h264_parse().

◆ h264_parse()

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

Definition at line 593 of file h264_parser.c.

◆ h264_close()

static av_cold void h264_close ( AVCodecParserContext * s)
static

Definition at line 676 of file h264_parser.c.

◆ init()

static av_cold int init ( AVCodecParserContext * s)
static

Definition at line 687 of file h264_parser.c.

Variable Documentation

◆ ff_h264_parser

const FFCodecParser ff_h264_parser
Initial value:
= {
.priv_data_size = sizeof(H264ParseContext),
.init = init,
}
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
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
@ AV_CODEC_ID_H264
Definition codec_id.h:77
static av_cold void h264_close(AVCodecParserContext *s)
static int h264_parse(AVCodecParserContext *s, AVCodecContext *avctx, const uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
#define PARSER_CODEC_LIST(...)

Definition at line 697 of file h264_parser.c.