FFmpeg
Macros | Functions | Variables
h264dec.c File Reference

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

#include "libavutil/avassert.h"
#include "libavutil/display.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
#include "libavutil/stereo3d.h"
#include "libavutil/video_enc_params.h"

Go to the source code of this file.

Macros

#define UNCHECKED_BITSTREAM_READER   1
 

Functions

int avpriv_h264_has_num_reorder_frames (AVCodecContext *avctx)
 
static void h264_er_decode_mb (void *opaque, int ref, int mv_dir, int mv_type, int(*mv)[2][4][2], int mb_x, int mb_y, int mb_intra, int mb_skipped)
 
void ff_h264_draw_horiz_band (const H264Context *h, H264SliceContext *sl, int y, int height)
 
void ff_h264_free_tables (H264Context *h)
 
int ff_h264_alloc_tables (H264Context *h)
 Allocate tables. More...
 
int ff_h264_slice_context_init (H264Context *h, H264SliceContext *sl)
 Init context Allocate buffers which are not shared amongst multiple threads. More...
 
static int h264_init_context (AVCodecContext *avctx, H264Context *h)
 
static av_cold int h264_decode_end (AVCodecContext *avctx)
 
static av_cold int h264_decode_init (AVCodecContext *avctx)
 
static void idr (H264Context *h)
 instantaneous decoder refresh. More...
 
void ff_h264_flush_change (H264Context *h)
 
static void h264_decode_flush (AVCodecContext *avctx)
 
static int get_last_needed_nal (H264Context *h)
 
static void debug_green_metadata (const H264SEIGreenMetaData *gm, void *logctx)
 
static int decode_nal_units (H264Context *h, const uint8_t *buf, int buf_size)
 
static int get_consumed_bytes (int pos, int buf_size)
 Return the number of bytes consumed for building the current frame. More...
 
static int h264_export_enc_params (AVFrame *f, H264Picture *p)
 
static int output_frame (H264Context *h, AVFrame *dst, H264Picture *srcp)
 
static int is_extra (const uint8_t *buf, int buf_size)
 
static int finalize_frame (H264Context *h, AVFrame *dst, H264Picture *out, int *got_frame)
 
static int send_next_delayed_frame (H264Context *h, AVFrame *dst_frame, int *got_frame, int buf_index)
 
static int h264_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 

Variables

const uint16_t ff_h264_mb_sizes [4] = { 256, 384, 512, 768 }
 
static AVOnce h264_vlc_init = AV_ONCE_INIT
 
static const AVOption h264_options []
 
static const AVClass h264_class
 
AVCodec ff_h264_decoder
 

Detailed Description

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

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

Definition in file h264dec.c.

Macro Definition Documentation

#define UNCHECKED_BITSTREAM_READER   1

Definition at line 28 of file h264dec.c.

Function Documentation

int avpriv_h264_has_num_reorder_frames ( AVCodecContext avctx)

Definition at line 61 of file h264dec.c.

Referenced by has_decode_delay_been_guessed().

static void h264_er_decode_mb ( void opaque,
int  ref,
int  mv_dir,
int  mv_type,
int(*)  mv[2][4][2],
int  mb_x,
int  mb_y,
int  mb_intra,
int  mb_skipped 
)
static

Definition at line 67 of file h264dec.c.

Referenced by ff_h264_slice_context_init().

void ff_h264_draw_horiz_band ( const H264Context h,
H264SliceContext sl,
int  y,
int  height 
)
void ff_h264_free_tables ( H264Context h)
int ff_h264_alloc_tables ( H264Context h)

Allocate tables.

needs width/height

Definition at line 181 of file h264dec.c.

Referenced by h264_slice_header_init().

int ff_h264_slice_context_init ( H264Context h,
H264SliceContext sl 
)

Init context Allocate buffers which are not shared amongst multiple threads.

Definition at line 239 of file h264dec.c.

Referenced by find_start_code(), and h264_slice_header_init().

static int h264_init_context ( AVCodecContext avctx,
H264Context h 
)
static

Definition at line 304 of file h264dec.c.

Referenced by h264_decode_init().

static av_cold int h264_decode_end ( AVCodecContext avctx)
static

Definition at line 356 of file h264dec.c.

Referenced by h264_decode_init().

static av_cold int h264_decode_init ( AVCodecContext avctx)
static

Definition at line 390 of file h264dec.c.

static void idr ( H264Context h)
static

instantaneous decoder refresh.

Definition at line 453 of file h264dec.c.

Referenced by decode_nal_units(), ff_h264_flush_change(), and h264_probe().

void ff_h264_flush_change ( H264Context h)

Definition at line 466 of file h264dec.c.

Referenced by find_start_code(), h264_decode_flush(), h264_decode_init(), and h264_init_ps().

static void h264_decode_flush ( AVCodecContext avctx)
static

Definition at line 491 of file h264dec.c.

static int get_last_needed_nal ( H264Context h)
static

Definition at line 512 of file h264dec.c.

Referenced by decode_nal_units().

static void debug_green_metadata ( const H264SEIGreenMetaData gm,
void logctx 
)
static

Definition at line 554 of file h264dec.c.

Referenced by decode_nal_units().

static int decode_nal_units ( H264Context h,
const uint8_t buf,
int  buf_size 
)
static

< number of NALs that need decoding before the next frame thread starts

Definition at line 582 of file h264dec.c.

Referenced by h264_decode_frame().

static int get_consumed_bytes ( int  pos,
int  buf_size 
)
static

Return the number of bytes consumed for building the current frame.

Definition at line 807 of file h264dec.c.

Referenced by h264_decode_frame().

static int h264_export_enc_params ( AVFrame f,
H264Picture p 
)
static

Definition at line 817 of file h264dec.c.

Referenced by output_frame().

static int output_frame ( H264Context h,
AVFrame dst,
H264Picture srcp 
)
static
static int is_extra ( const uint8_t buf,
int  buf_size 
)
static

Definition at line 877 of file h264dec.c.

Referenced by h264_decode_frame().

static int finalize_frame ( H264Context h,
AVFrame dst,
H264Picture out,
int got_frame 
)
static

Definition at line 901 of file h264dec.c.

Referenced by h264_decode_frame(), and send_next_delayed_frame().

static int send_next_delayed_frame ( H264Context h,
AVFrame dst_frame,
int got_frame,
int  buf_index 
)
static

Definition at line 951 of file h264dec.c.

Referenced by h264_decode_frame().

static int h264_decode_frame ( AVCodecContext avctx,
void data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 984 of file h264dec.c.

Variable Documentation

const uint16_t ff_h264_mb_sizes[4] = { 256, 384, 512, 768 }

Definition at line 59 of file h264dec.c.

Referenced by ff_h264_decode_mb_cabac(), ff_h264_decode_mb_cavlc(), and hl_decode_mb().

AVOnce h264_vlc_init = AV_ONCE_INIT
static

Definition at line 388 of file h264dec.c.

const AVOption h264_options[]
static
Initial value:
= {
{ "is_avc", "is avc", OFFSET(is_avc), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, 0 },
{ "nal_length_size", "nal_length_size", OFFSET(nal_length_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0 },
{ "enable_er", "Enable error resilience on damaged frames (unsafe)", OFFSET(enable_er), AV_OPT_TYPE_BOOL, { .i64 = -1 }, -1, 1, VD },
{ "x264_build", "Assume this x264 version if no x264 version found in any SEI", OFFSET(x264_build), AV_OPT_TYPE_INT, {.i64 = -1}, -1, INT_MAX, VD },
{ NULL },
}
#define NULL
Definition: coverity.c:32
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option keep it simple and lowercase description are in without and describe what they for example set the foo of the bar offset is the offset of the field in your local see the OFFSET() macro
#define VD
Definition: cuviddec.c:1071

Definition at line 1058 of file h264dec.c.

const AVClass h264_class
static
Initial value:
= {
.class_name = "H264 Decoder",
.item_name = av_default_item_name,
.option = h264_options,
}
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
static const AVOption h264_options[]
Definition: h264dec.c:1058

Definition at line 1066 of file h264dec.c.

AVCodec ff_h264_decoder

Definition at line 1073 of file h264dec.c.