FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
h264.h File Reference

H.264 / AVC / MPEG4 part10 codec. More...

#include "libavutil/intreadwrite.h"
#include "libavutil/thread.h"
#include "cabac.h"
#include "error_resilience.h"
#include "get_bits.h"
#include "h264chroma.h"
#include "h264dsp.h"
#include "h264pred.h"
#include "h264qpel.h"
#include "internal.h"
#include "mpegutils.h"
#include "parser.h"
#include "qpeldsp.h"
#include "rectangle.h"
#include "videodsp.h"

Go to the source code of this file.

Data Structures

struct  SPS
 Sequence parameter set. More...
 
struct  PPS
 Picture parameter set. More...
 
struct  FPA
 Frame Packing Arrangement Type. More...
 
struct  GreenMetaData
 Green MetaData Information Type. More...
 
struct  MMCO
 Memory management control operation. More...
 
struct  H264Picture
 
struct  H264Ref
 
struct  H264SliceContext
 
struct  H264Context
 H264Context. More...
 

Macros

#define H264_MAX_PICTURE_COUNT   36
 
#define H264_MAX_THREADS   32
 
#define MAX_SPS_COUNT   32
 
#define MAX_PPS_COUNT   256
 
#define MAX_MMCO_COUNT   66
 
#define MAX_DELAYED_PIC_COUNT   16
 
#define MAX_MBPAIR_SIZE   (256*1024)
 
#define ALLOW_INTERLACE
 
#define FMO   0
 
#define MAX_SLICES   32
 The maximum number of slices supported by the decoder. More...
 
#define MB_MBAFF(h)   (h)->mb_mbaff
 
#define MB_FIELD(sl)   (sl)->mb_field_decoding_flag
 
#define FRAME_MBAFF(h)   (h)->mb_aff_frame
 
#define FIELD_PICTURE(h)   ((h)->picture_structure != PICT_FRAME)
 
#define LEFT_MBS   2
 
#define LTOP   0
 
#define LBOT   1
 
#define LEFT(i)   (i)
 
#define FIELD_OR_MBAFF_PICTURE(h)   (FRAME_MBAFF(h) || FIELD_PICTURE(h))
 
#define CABAC(h)   (h)->pps.cabac
 
#define CHROMA(h)   ((h)->sps.chroma_format_idc)
 
#define CHROMA422(h)   ((h)->sps.chroma_format_idc == 2)
 
#define CHROMA444(h)   ((h)->sps.chroma_format_idc == 3)
 
#define EXTENDED_SAR   255
 
#define MB_TYPE_REF0   MB_TYPE_ACPRED
 
#define MB_TYPE_8x8DCT   0x01000000
 
#define IS_REF0(a)   ((a) & MB_TYPE_REF0)
 
#define IS_8x8DCT(a)   ((a) & MB_TYPE_8x8DCT)
 
#define QP_MAX_NUM   (51 + 6*6)
 
#define LIST_NOT_USED   -1
 
#define PART_NOT_AVAILABLE   -2
 
#define FRAME_RECOVERED_IDR   (1 << 0)
 We have seen an IDR, so all the following frames in coded order are correctly decodable. More...
 
#define FRAME_RECOVERED_SEI   (1 << 1)
 Sufficient number of frames have been decoded since a SEI recovery point, so all the following frames in presentation order are correct. More...
 
#define LUMA_DC_BLOCK_INDEX   48
 
#define CHROMA_DC_BLOCK_INDEX   49
 
#define SLICE_SINGLETHREAD   1
 
#define SLICE_SKIPED   2
 

Enumerations

enum  {
  NAL_SLICE = 1, NAL_DPA = 2, NAL_DPB = 3, NAL_DPC = 4,
  NAL_IDR_SLICE = 5, NAL_SEI = 6, NAL_SPS = 7, NAL_PPS = 8,
  NAL_AUD = 9, NAL_END_SEQUENCE = 10, NAL_END_STREAM = 11, NAL_FILLER_DATA = 12,
  NAL_SPS_EXT = 13, NAL_AUXILIARY_SLICE = 19, NAL_FF_IGNORE = 0xff0f001
}
 
enum  SEI_Type {
  SEI_TYPE_BUFFERING_PERIOD = 0, SEI_TYPE_PIC_TIMING = 1, SEI_TYPE_USER_DATA_REGISTERED = 4, SEI_TYPE_USER_DATA_UNREGISTERED = 5,
  SEI_TYPE_RECOVERY_POINT = 6, SEI_TYPE_FRAME_PACKING = 45, SEI_TYPE_DISPLAY_ORIENTATION = 47, SEI_TYPE_GREEN_METADATA = 56
}
 SEI message types. More...
 
enum  SEI_PicStructType {
  SEI_PIC_STRUCT_FRAME = 0, SEI_PIC_STRUCT_TOP_FIELD = 1, SEI_PIC_STRUCT_BOTTOM_FIELD = 2, SEI_PIC_STRUCT_TOP_BOTTOM = 3,
  SEI_PIC_STRUCT_BOTTOM_TOP = 4, SEI_PIC_STRUCT_TOP_BOTTOM_TOP = 5, SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM = 6, SEI_PIC_STRUCT_FRAME_DOUBLING = 7,
  SEI_PIC_STRUCT_FRAME_TRIPLING = 8
}
 pic_struct in picture timing SEI message More...
 
enum  SEI_FpaType {
  SEI_FPA_TYPE_CHECKERBOARD = 0, SEI_FPA_TYPE_INTERLEAVE_COLUMN = 1, SEI_FPA_TYPE_INTERLEAVE_ROW = 2, SEI_FPA_TYPE_SIDE_BY_SIDE = 3,
  SEI_FPA_TYPE_TOP_BOTTOM = 4, SEI_FPA_TYPE_INTERLEAVE_TEMPORAL = 5, SEI_FPA_TYPE_2D = 6
}
 frame_packing_arrangement types More...
 
enum  MMCOOpcode {
  MMCO_END = 0, MMCO_SHORT2UNUSED, MMCO_LONG2UNUSED, MMCO_SHORT2LONG,
  MMCO_SET_MAX_LONG, MMCO_RESET, MMCO_LONG
}
 Memory management control operation opcode. More...
 

Functions

int ff_h264_decode_sei (H264Context *h)
 Decode SEI. More...
 
int ff_h264_decode_seq_parameter_set (H264Context *h, int ignore_truncation)
 Decode SPS. More...
 
int ff_h264_get_profile (SPS *sps)
 compute profile from sps More...
 
int ff_h264_decode_picture_parameter_set (H264Context *h, int bit_length)
 Decode PPS. More...
 
const uint8_tff_h264_decode_nal (H264Context *h, H264SliceContext *sl, const uint8_t *src, int *dst_length, int *consumed, int length)
 Decode a network abstraction layer unit. More...
 
void ff_h264_free_context (H264Context *h)
 Free any data that may have been allocated in the H264 context like SPS, PPS etc. More...
 
int ff_h264_get_slice_type (const H264SliceContext *sl)
 Reconstruct bitstream slice_type. More...
 
int ff_h264_alloc_tables (H264Context *h)
 Allocate tables. More...
 
int ff_h264_decode_ref_pic_list_reordering (H264Context *h, H264SliceContext *sl)
 
void ff_h264_fill_mbaff_ref_list (H264Context *h, H264SliceContext *sl)
 
void ff_h264_remove_all_refs (H264Context *h)
 
int ff_h264_execute_ref_pic_marking (H264Context *h, MMCO *mmco, int mmco_count)
 Execute the reference picture marking (memory management control operations). More...
 
int ff_h264_decode_ref_pic_marking (H264Context *h, GetBitContext *gb, int first_slice)
 
int ff_generate_sliding_window_mmcos (H264Context *h, int first_slice)
 
int ff_h264_check_intra4x4_pred_mode (const H264Context *h, H264SliceContext *sl)
 Check if the top & left blocks are available if needed & change the dc mode so it only uses the available blocks. More...
 
int ff_h264_check_intra_pred_mode (const H264Context *h, H264SliceContext *sl, int mode, int is_chroma)
 Check if the top & left blocks are available if needed & change the dc mode so it only uses the available blocks. More...
 
void ff_h264_hl_decode_mb (const H264Context *h, H264SliceContext *sl)
 
int ff_h264_decode_extradata (H264Context *h, const uint8_t *buf, int size)
 
int ff_h264_decode_init (AVCodecContext *avctx)
 
void ff_h264_decode_init_vlc (void)
 
int ff_h264_decode_mb_cavlc (const H264Context *h, H264SliceContext *sl)
 Decode a macroblock. More...
 
int ff_h264_decode_mb_cabac (const H264Context *h, H264SliceContext *sl)
 Decode a CABAC coded macroblock. More...
 
void ff_h264_init_cabac_states (const H264Context *h, H264SliceContext *sl)
 
void ff_h264_init_dequant_tables (H264Context *h)
 
void ff_h264_direct_dist_scale_factor (const H264Context *const h, H264SliceContext *sl)
 
void ff_h264_direct_ref_list_init (const H264Context *const h, H264SliceContext *sl)
 
void ff_h264_pred_direct_motion (const H264Context *const h, H264SliceContext *sl, int *mb_type)
 
void ff_h264_filter_mb_fast (const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize)
 
void ff_h264_filter_mb (const H264Context *h, H264SliceContext *sl, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize)
 
void ff_h264_reset_sei (H264Context *h)
 Reset SEI values at the beginning of the frame. More...
 
const char * ff_h264_sei_stereo_mode (H264Context *h)
 Get stereo_mode string from the h264 frame_packing_arrangement. More...
 
static av_always_inline uint32_t pack16to32 (unsigned a, unsigned b)
 
static av_always_inline uint16_t pack8to16 (unsigned a, unsigned b)
 
static av_always_inline int get_chroma_qp (const H264Context *h, int t, int qscale)
 Get the chroma qp. More...
 
static av_always_inline int pred_intra_mode (const H264Context *h, H264SliceContext *sl, int n)
 Get the predicted intra4x4 prediction mode. More...
 
static av_always_inline void write_back_intra_pred_mode (const H264Context *h, H264SliceContext *sl)
 
static av_always_inline void write_back_non_zero_count (const H264Context *h, H264SliceContext *sl)
 
static av_always_inline void write_back_motion_list (const H264Context *h, H264SliceContext *sl, int b_stride, int b_xy, int b8_xy, int mb_type, int list)
 
static av_always_inline void write_back_motion (const H264Context *h, H264SliceContext *sl, int mb_type)
 
static av_always_inline int get_dct8x8_allowed (const H264Context *h, H264SliceContext *sl)
 
static int find_start_code (const uint8_t *buf, int buf_size, int buf_index, int next_avc)
 
static int get_avc_nalsize (H264Context *h, const uint8_t *buf, int buf_size, int *buf_index)
 
int ff_h264_field_end (H264Context *h, H264SliceContext *sl, int in_setup)
 
int ff_h264_ref_picture (H264Context *h, H264Picture *dst, H264Picture *src)
 
void ff_h264_unref_picture (H264Context *h, H264Picture *pic)
 
int ff_h264_slice_context_init (H264Context *h, H264SliceContext *sl)
 Init context Allocate buffers which are not shared amongst multiple threads. More...
 
void ff_h264_draw_horiz_band (const H264Context *h, H264SliceContext *sl, int y, int height)
 
int ff_init_poc (H264Context *h, int pic_field_poc[2], int *pic_poc)
 
int ff_pred_weight_table (H264Context *h, H264SliceContext *sl)
 
int ff_set_ref_count (H264Context *h, H264SliceContext *sl)
 
int ff_h264_decode_slice_header (H264Context *h, H264SliceContext *sl)
 Decode a slice header. More...
 
int ff_h264_execute_decode_slices (H264Context *h, unsigned context_count)
 Call decode_slice() for each context. More...
 
int ff_h264_update_thread_context (AVCodecContext *dst, const AVCodecContext *src)
 
void ff_h264_flush_change (H264Context *h)
 
void ff_h264_free_tables (H264Context *h)
 
void ff_h264_set_erpic (ERPicture *dst, H264Picture *src)
 

Variables

const uint8_t ff_h264_chroma_qp [7][QP_MAX_NUM+1]
 One chroma qp table for each possible bit depth (8-14). More...
 
const uint16_t ff_h264_mb_sizes [4]
 
static const uint8_t scan8 [16 *3+3]
 

Detailed Description

H.264 / AVC / MPEG4 part10 codec.

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

Definition in file h264.h.

Macro Definition Documentation

#define H264_MAX_PICTURE_COUNT   36
#define H264_MAX_THREADS   32

Definition at line 48 of file h264.h.

Referenced by h264_init_context(), and h264_slice_header_init().

#define MAX_SPS_COUNT   32
#define MAX_PPS_COUNT   256
#define MAX_MMCO_COUNT   66
#define MAX_DELAYED_PIC_COUNT   16
#define MAX_MBPAIR_SIZE   (256*1024)

Definition at line 57 of file h264.h.

Referenced by ff_h264_decode_nal().

#define ALLOW_INTERLACE

Definition at line 61 of file h264.h.

#define FMO   0

Definition at line 63 of file h264.h.

Referenced by ff_h264_alloc_tables(), fill_decode_neighbors(), and write_back_motion_list().

#define MAX_SLICES   32

The maximum number of slices supported by the decoder.

must be a power of 2

Definition at line 69 of file h264.h.

#define MB_MBAFF (   h)    (h)->mb_mbaff
#define MB_FIELD (   sl)    (sl)->mb_field_decoding_flag
#define FRAME_MBAFF (   h)    (h)->mb_aff_frame
#define FIELD_PICTURE (   h)    ((h)->picture_structure != PICT_FRAME)
#define LEFT_MBS   2

Definition at line 76 of file h264.h.

Referenced by fill_decode_caches(), fill_decode_neighbors(), and fill_filter_caches().

#define LTOP   0
#define LBOT   1

Definition at line 78 of file h264.h.

Referenced by fill_decode_caches(), fill_decode_neighbors(), and fill_filter_caches().

#define LEFT (   i)    (i)

Definition at line 79 of file h264.h.

#define FIELD_OR_MBAFF_PICTURE (   h)    (FRAME_MBAFF(h) || FIELD_PICTURE(h))
#define CABAC (   h)    (h)->pps.cabac
#define CHROMA (   h)    ((h)->sps.chroma_format_idc)

Definition at line 98 of file h264.h.

#define CHROMA422 (   h)    ((h)->sps.chroma_format_idc == 2)
#define CHROMA444 (   h)    ((h)->sps.chroma_format_idc == 3)
#define EXTENDED_SAR   255

Definition at line 102 of file h264.h.

Referenced by decode_vui_parameters().

#define MB_TYPE_REF0   MB_TYPE_ACPRED

Definition at line 104 of file h264.h.

#define MB_TYPE_8x8DCT   0x01000000

Definition at line 105 of file h264.h.

Referenced by ff_h264_decode_mb_cabac(), and ff_h264_decode_mb_cavlc().

#define IS_REF0 (   a)    ((a) & MB_TYPE_REF0)

Definition at line 106 of file h264.h.

Referenced by ff_h264_decode_mb_cavlc().

#define IS_8x8DCT (   a)    ((a) & MB_TYPE_8x8DCT)
#define QP_MAX_NUM   (51 + 6*6)

Definition at line 109 of file h264.h.

#define LIST_NOT_USED   -1
#define PART_NOT_AVAILABLE   -2
#define FRAME_RECOVERED_IDR   (1 << 0)

We have seen an IDR, so all the following frames in coded order are correctly decodable.

Definition at line 800 of file h264.h.

Referenced by decode_nal_units().

#define FRAME_RECOVERED_SEI   (1 << 1)

Sufficient number of frames have been decoded since a SEI recovery point, so all the following frames in presentation order are correct.

Definition at line 805 of file h264.h.

Referenced by decode_postinit(), and ff_h264_execute_ref_pic_marking().

#define LUMA_DC_BLOCK_INDEX   48
#define CHROMA_DC_BLOCK_INDEX   49
#define SLICE_SINGLETHREAD   1

Definition at line 1220 of file h264.h.

Referenced by decode_nal_units(), and ff_h264_decode_slice_header().

#define SLICE_SKIPED   2

Definition at line 1221 of file h264.h.

Referenced by decode_nal_units(), and ff_h264_decode_slice_header().

Enumeration Type Documentation

anonymous enum
Enumerator
NAL_SLICE 
NAL_DPA 
NAL_DPB 
NAL_DPC 
NAL_IDR_SLICE 
NAL_SEI 
NAL_SPS 
NAL_PPS 
NAL_AUD 
NAL_END_SEQUENCE 
NAL_END_STREAM 
NAL_FILLER_DATA 
NAL_SPS_EXT 
NAL_AUXILIARY_SLICE 
NAL_FF_IGNORE 

Definition at line 112 of file h264.h.

enum SEI_Type

SEI message types.

Enumerator
SEI_TYPE_BUFFERING_PERIOD 

buffering period (H.264, D.1.1)

SEI_TYPE_PIC_TIMING 

picture timing

SEI_TYPE_USER_DATA_REGISTERED 

registered user data as specified by Rec. ITU-T T.35

SEI_TYPE_USER_DATA_UNREGISTERED 

unregistered user data

SEI_TYPE_RECOVERY_POINT 

recovery point (frame # to decoder sync)

SEI_TYPE_FRAME_PACKING 

frame packing arrangement

SEI_TYPE_DISPLAY_ORIENTATION 

display orientation

SEI_TYPE_GREEN_METADATA 

GreenMPEG information.

Definition at line 133 of file h264.h.

pic_struct in picture timing SEI message

Enumerator
SEI_PIC_STRUCT_FRAME 

0: frame

SEI_PIC_STRUCT_TOP_FIELD 

1: top field

SEI_PIC_STRUCT_BOTTOM_FIELD 

2: bottom field

SEI_PIC_STRUCT_TOP_BOTTOM 

3: top field, bottom field, in that order

SEI_PIC_STRUCT_BOTTOM_TOP 

4: bottom field, top field, in that order

SEI_PIC_STRUCT_TOP_BOTTOM_TOP 

5: top field, bottom field, top field repeated, in that order

SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM 

6: bottom field, top field, bottom field repeated, in that order

SEI_PIC_STRUCT_FRAME_DOUBLING 

7: frame doubling

SEI_PIC_STRUCT_FRAME_TRIPLING 

8: frame tripling

Definition at line 147 of file h264.h.

frame_packing_arrangement types

Enumerator
SEI_FPA_TYPE_CHECKERBOARD 
SEI_FPA_TYPE_INTERLEAVE_COLUMN 
SEI_FPA_TYPE_INTERLEAVE_ROW 
SEI_FPA_TYPE_SIDE_BY_SIDE 
SEI_FPA_TYPE_TOP_BOTTOM 
SEI_FPA_TYPE_INTERLEAVE_TEMPORAL 
SEI_FPA_TYPE_2D 

Definition at line 162 of file h264.h.

enum MMCOOpcode

Memory management control operation opcode.

Enumerator
MMCO_END 
MMCO_SHORT2UNUSED 
MMCO_LONG2UNUSED 
MMCO_SHORT2LONG 
MMCO_SET_MAX_LONG 
MMCO_RESET 
MMCO_LONG 

Definition at line 295 of file h264.h.

Function Documentation

int ff_h264_decode_sei ( H264Context h)

Decode SEI.

Definition at line 421 of file h264_sei.c.

Referenced by decode_nal_units(), and parse_nal_units().

int ff_h264_decode_seq_parameter_set ( H264Context h,
int  ignore_truncation 
)

Decode SPS.

Definition at line 323 of file h264_ps.c.

Referenced by decode_nal_units(), and parse_nal_units().

int ff_h264_get_profile ( SPS sps)

compute profile from sps

compute profile from sps

Parameters
spsSPS
Returns
profile as defined by FF_PROFILE_H264_*

Definition at line 1224 of file h264.c.

Referenced by ff_h264_decode_slice_header(), and parse_nal_units().

int ff_h264_decode_picture_parameter_set ( H264Context h,
int  bit_length 
)

Decode PPS.

Definition at line 630 of file h264_ps.c.

Referenced by decode_nal_units(), and parse_nal_units().

const uint8_t* ff_h264_decode_nal ( H264Context h,
H264SliceContext sl,
const uint8_t src,
int *  dst_length,
int *  consumed,
int  length 
)

Decode a network abstraction layer unit.

Parameters
consumedis the number of bytes used as input
lengthis the length of the array
dst_lengthis the number of decoded bytes FIXME here or a decode rbsp tailing?
Returns
decoded bytes, might be src+1 if no escapes

Definition at line 229 of file h264.c.

Referenced by decode_nal_units(), get_last_needed_nal(), and parse_nal_units().

void ff_h264_free_context ( H264Context h)

Free any data that may have been allocated in the H264 context like SPS, PPS etc.

Definition at line 1911 of file h264.c.

Referenced by h264_close(), h264_decode_end(), and svq3_decode_end().

int ff_h264_get_slice_type ( const H264SliceContext sl)

Reconstruct bitstream slice_type.

Definition at line 1948 of file h264_slice.c.

Referenced by fill_slice_long(), and vaapi_h264_decode_slice().

int ff_h264_alloc_tables ( H264Context h)

Allocate tables.

needs width/height

Definition at line 401 of file h264.c.

Referenced by h264_slice_header_init(), and svq3_decode_init().

int ff_h264_decode_ref_pic_list_reordering ( H264Context h,
H264SliceContext sl 
)

Definition at line 241 of file h264_refs.c.

Referenced by ff_h264_decode_slice_header().

void ff_h264_fill_mbaff_ref_list ( H264Context h,
H264SliceContext sl 
)

Definition at line 372 of file h264_refs.c.

Referenced by ff_h264_decode_slice_header().

void ff_h264_remove_all_refs ( H264Context h)

Definition at line 512 of file h264_refs.c.

Referenced by h264_decode_end(), and idr().

int ff_h264_execute_ref_pic_marking ( H264Context h,
MMCO mmco,
int  mmco_count 
)

Execute the reference picture marking (memory management control operations).

Definition at line 622 of file h264_refs.c.

Referenced by ff_h264_decode_slice_header(), ff_h264_field_end(), and ff_h264_update_thread_context().

int ff_h264_decode_ref_pic_marking ( H264Context h,
GetBitContext gb,
int  first_slice 
)

Definition at line 831 of file h264_refs.c.

Referenced by ff_h264_decode_slice_header().

int ff_generate_sliding_window_mmcos ( H264Context h,
int  first_slice 
)

Definition at line 590 of file h264_refs.c.

Referenced by ff_h264_decode_ref_pic_marking(), and ff_h264_decode_slice_header().

int ff_h264_check_intra4x4_pred_mode ( const H264Context h,
H264SliceContext sl 
)

Check if the top & left blocks are available if needed & change the dc mode so it only uses the available blocks.

Check if the top & left blocks are available if needed & change the dc mode so it only uses the available blocks.

Definition at line 140 of file h264.c.

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

int ff_h264_check_intra_pred_mode ( const H264Context h,
H264SliceContext sl,
int  mode,
int  is_chroma 
)

Check if the top & left blocks are available if needed & change the dc mode so it only uses the available blocks.

Check if the top & left blocks are available if needed & change the dc mode so it only uses the available blocks.

Definition at line 187 of file h264.c.

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

void ff_h264_hl_decode_mb ( const H264Context h,
H264SliceContext sl 
)

Definition at line 818 of file h264_mb.c.

Referenced by decode_slice(), h264_er_decode_mb(), and svq3_decode_frame().

int ff_h264_decode_extradata ( H264Context h,
const uint8_t buf,
int  size 
)

Definition at line 530 of file h264.c.

Referenced by ff_h264_decode_init(), h264_decode_frame(), and h264_parse().

int ff_h264_decode_init ( AVCodecContext avctx)

Definition at line 652 of file h264.c.

Referenced by svq3_decode_init().

void ff_h264_decode_init_vlc ( void  )

Definition at line 327 of file h264_cavlc.c.

Referenced by ff_h264_decode_init().

int ff_h264_decode_mb_cavlc ( const H264Context h,
H264SliceContext sl 
)

Decode a macroblock.

Returns
0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR on error

Definition at line 709 of file h264_cavlc.c.

Referenced by decode_slice().

int ff_h264_decode_mb_cabac ( const H264Context h,
H264SliceContext sl 
)

Decode a CABAC coded macroblock.

Returns
0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR on error

Decode a CABAC coded macroblock.

Returns
0 if OK, ER_AC_ERROR / ER_DC_ERROR / ER_MV_ERROR if an error is noticed

Definition at line 1915 of file h264_cabac.c.

Referenced by decode_slice().

void ff_h264_init_cabac_states ( const H264Context h,
H264SliceContext sl 
)

Definition at line 1264 of file h264_cabac.c.

Referenced by decode_slice().

void ff_h264_init_dequant_tables ( H264Context h)

Definition at line 367 of file h264_slice.c.

Referenced by ff_h264_alloc_tables(), and ff_h264_decode_slice_header().

void ff_h264_direct_dist_scale_factor ( const H264Context *const  h,
H264SliceContext sl 
)

Definition at line 51 of file h264_direct.c.

Referenced by ff_h264_decode_slice_header().

void ff_h264_direct_ref_list_init ( const H264Context *const  h,
H264SliceContext sl 
)

Definition at line 110 of file h264_direct.c.

Referenced by ff_h264_decode_slice_header().

void ff_h264_pred_direct_motion ( const H264Context *const  h,
H264SliceContext sl,
int *  mb_type 
)

Definition at line 706 of file h264_direct.c.

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

void ff_h264_filter_mb_fast ( const H264Context h,
H264SliceContext sl,
int  mb_x,
int  mb_y,
uint8_t img_y,
uint8_t img_cb,
uint8_t img_cr,
unsigned int  linesize,
unsigned int  uvlinesize 
)

Definition at line 417 of file h264_loopfilter.c.

Referenced by loop_filter().

void ff_h264_filter_mb ( const H264Context h,
H264SliceContext sl,
int  mb_x,
int  mb_y,
uint8_t img_y,
uint8_t img_cb,
uint8_t img_cr,
unsigned int  linesize,
unsigned int  uvlinesize 
)

Definition at line 717 of file h264_loopfilter.c.

Referenced by ff_h264_filter_mb_fast(), and loop_filter().

void ff_h264_reset_sei ( H264Context h)

Reset SEI values at the beginning of the frame.

Parameters
hH.264 context.

Definition at line 37 of file h264_sei.c.

Referenced by decode_nal_units(), ff_h264_flush_change(), h264_init_context(), and parse_nal_units().

const char* ff_h264_sei_stereo_mode ( H264Context h)

Get stereo_mode string from the h264 frame_packing_arrangement.

Parameters
hH.264 context.

Definition at line 491 of file h264_sei.c.

Referenced by output_frame().

static av_always_inline uint32_t pack16to32 ( unsigned  a,
unsigned  b 
)
static
static av_always_inline uint16_t pack8to16 ( unsigned  a,
unsigned  b 
)
static

Definition at line 1030 of file h264.h.

Referenced by ff_h264_decode_mb_cabac().

static av_always_inline int get_chroma_qp ( const H264Context h,
int  t,
int  qscale 
)
static
static av_always_inline int pred_intra_mode ( const H264Context h,
H264SliceContext sl,
int  n 
)
static

Get the predicted intra4x4 prediction mode.

Definition at line 1050 of file h264.h.

Referenced by ff_h264_decode_mb_cabac(), and ff_h264_decode_mb_cavlc().

static av_always_inline void write_back_intra_pred_mode ( const H264Context h,
H264SliceContext sl 
)
static

Definition at line 1066 of file h264.h.

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

static av_always_inline void write_back_non_zero_count ( const H264Context h,
H264SliceContext sl 
)
static

Definition at line 1078 of file h264.h.

Referenced by ff_h264_decode_mb_cabac(), and ff_h264_decode_mb_cavlc().

static av_always_inline void write_back_motion_list ( const H264Context h,
H264SliceContext sl,
int  b_stride,
int  b_xy,
int  b8_xy,
int  mb_type,
int  list 
)
static

Definition at line 1102 of file h264.h.

Referenced by write_back_motion().

static av_always_inline void write_back_motion ( const H264Context h,
H264SliceContext sl,
int  mb_type 
)
static

Definition at line 1138 of file h264.h.

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

static av_always_inline int get_dct8x8_allowed ( const H264Context h,
H264SliceContext sl 
)
static

Definition at line 1165 of file h264.h.

Referenced by ff_h264_decode_mb_cabac(), and ff_h264_decode_mb_cavlc().

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

Definition at line 1177 of file h264.h.

Referenced by decode_nal_units(), get_last_needed_nal(), and parse_nal_units().

static int get_avc_nalsize ( H264Context h,
const uint8_t buf,
int  buf_size,
int *  buf_index 
)
inlinestatic

Definition at line 1187 of file h264.h.

Referenced by decode_nal_units(), get_last_needed_nal(), and parse_nal_units().

int ff_h264_field_end ( H264Context h,
H264SliceContext sl,
int  in_setup 
)

Definition at line 154 of file h264_picture.c.

Referenced by ff_h264_decode_slice_header(), and h264_decode_frame().

int ff_h264_ref_picture ( H264Context h,
H264Picture dst,
H264Picture src 
)
void ff_h264_unref_picture ( H264Context h,
H264Picture pic 
)
int ff_h264_slice_context_init ( H264Context h,
H264SliceContext sl 
)

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

Definition at line 462 of file h264.c.

Referenced by h264_slice_header_init().

void ff_h264_draw_horiz_band ( const H264Context h,
H264SliceContext sl,
int  y,
int  height 
)
int ff_init_poc ( H264Context h,
int  pic_field_poc[2],
int *  pic_poc 
)

Definition at line 1139 of file h264.c.

Referenced by ff_h264_decode_slice_header(), and parse_nal_units().

int ff_pred_weight_table ( H264Context h,
H264SliceContext sl 
)

Definition at line 1002 of file h264.c.

Referenced by ff_h264_decode_slice_header(), and scan_mmco_reset().

int ff_set_ref_count ( H264Context h,
H264SliceContext sl 
)

Definition at line 1244 of file h264.c.

Referenced by ff_h264_decode_slice_header(), and scan_mmco_reset().

int ff_h264_decode_slice_header ( H264Context h,
H264SliceContext sl 
)

Decode a slice header.

This will (re)intialize the decoder and call h264_frame_start() as needed.

Parameters
hh264context
Returns
0 if okay, <0 if an error occurred, 1 if decoding must not be multithreaded

Definition at line 1150 of file h264_slice.c.

Referenced by decode_nal_units().

int ff_h264_execute_decode_slices ( H264Context h,
unsigned  context_count 
)

Call decode_slice() for each context.

Parameters
hh264 master context
context_countnumber of contexts to execute

Definition at line 2531 of file h264_slice.c.

Referenced by decode_nal_units().

int ff_h264_update_thread_context ( AVCodecContext dst,
const AVCodecContext src 
)

Definition at line 433 of file h264_slice.c.

void ff_h264_flush_change ( H264Context h)

Definition at line 1090 of file h264.c.

Referenced by ff_h264_decode_init(), ff_h264_decode_slice_header(), and flush_dpb().

void ff_h264_free_tables ( H264Context h)
void ff_h264_set_erpic ( ERPicture dst,
H264Picture src 
)

Definition at line 131 of file h264_picture.c.

Referenced by ff_h264_field_end(), and h264_frame_start().

Variable Documentation

const uint8_t ff_h264_chroma_qp[7][QP_MAX_NUM+1]

One chroma qp table for each possible bit depth (8-14).

Definition at line 53 of file h264_ps.c.

Referenced by build_qp_table(), and hl_decode_mb().

const uint16_t ff_h264_mb_sizes[4]

Definition at line 57 of file h264.c.

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

const uint8_t scan8[16 *3+3]
static
Initial value:
= {
4 + 1 * 8, 5 + 1 * 8, 4 + 2 * 8, 5 + 2 * 8,
6 + 1 * 8, 7 + 1 * 8, 6 + 2 * 8, 7 + 2 * 8,
4 + 3 * 8, 5 + 3 * 8, 4 + 4 * 8, 5 + 4 * 8,
6 + 3 * 8, 7 + 3 * 8, 6 + 4 * 8, 7 + 4 * 8,
4 + 6 * 8, 5 + 6 * 8, 4 + 7 * 8, 5 + 7 * 8,
6 + 6 * 8, 7 + 6 * 8, 6 + 7 * 8, 7 + 7 * 8,
4 + 8 * 8, 5 + 8 * 8, 4 + 9 * 8, 5 + 9 * 8,
6 + 8 * 8, 7 + 8 * 8, 6 + 9 * 8, 7 + 9 * 8,
4 + 11 * 8, 5 + 11 * 8, 4 + 12 * 8, 5 + 12 * 8,
6 + 11 * 8, 7 + 11 * 8, 6 + 12 * 8, 7 + 12 * 8,
4 + 13 * 8, 5 + 13 * 8, 4 + 14 * 8, 5 + 14 * 8,
6 + 13 * 8, 7 + 13 * 8, 6 + 14 * 8, 7 + 14 * 8,
0 + 0 * 8, 0 + 5 * 8, 0 + 10 * 8
}

Definition at line 1005 of file h264.h.

Referenced by decode_cabac_luma_residual(), decode_cabac_mb_ref(), decode_cabac_residual_dc(), decode_cabac_residual_dc_422(), decode_cabac_residual_internal(), decode_cabac_residual_nondc(), decode_luma_residual(), decode_residual(), decode_slice(), fetch_diagonal_mv(), ff_h264_check_intra4x4_pred_mode(), ff_h264_decode_mb_cabac(), ff_h264_decode_mb_cavlc(), ff_h264_idct8_add4(), ff_h264_idct8_add4_8_mmi(), ff_h264_idct8_add4_msa(), ff_h264_idct_add16(), ff_h264_idct_add16_8_mmi(), ff_h264_idct_add16_intra_msa(), ff_h264_idct_add16_msa(), ff_h264_idct_add16intra(), ff_h264_idct_add16intra_8_mmi(), ff_h264_idct_add8(), ff_h264_idct_add8_422(), ff_h264_idct_add8_422_8_mmi(), ff_h264_idct_add8_422_msa(), ff_h264_idct_add8_8_mmi(), ff_h264_idct_add8_msa(), ff_h264_slice_context_init(), fill_decode_caches(), fill_filter_caches(), fill_filter_caches_inter(), filter_mb_dir(), get_cabac_cbf_ctx(), get_lowest_part_list_y(), get_lowest_part_y(), h264_er_decode_mb(), h264_frame_start(), hl_decode_mb(), hl_decode_mb_444(), hl_decode_mb_idct_luma(), hl_decode_mb_predict_luma(), mc_dir_part(), mc_part(), mc_part_std(), mc_part_weighted(), pred_16x8_motion(), pred_8x16_motion(), pred_intra_mode(), pred_motion(), pred_non_zero_count(), pred_pskip_motion(), pred_spatial_direct_motion(), pred_temp_direct_motion(), prefetch_motion(), svq3_decode_frame(), svq3_decode_mb(), svq3_mc_dir(), and write_back_motion_list().