h264.c File Reference


Detailed Description

H.264 / AVC / MPEG4 part10 codec.

Author:
Michael Niedermayer <michaelni@gmx.at>

Definition in file h264.c.

Go to the source code of this file.

Functions

static void svq3_luma_dc_dequant_idct_c (DCTELEM *block, int qp)
static void svq3_add_idct_c (uint8_t *dst, DCTELEM *block, int stride, int qp, int dc)
static void filter_mb (H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize)
static void filter_mb_fast (H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint8_t *img_cb, uint8_t *img_cr, unsigned int linesize, unsigned int uvlinesize)
static Pictureremove_long (H264Context *h, int i, int ref_mask)
 Remove a picture from the long term reference list by its index in that list.
static av_always_inline uint32_t pack16to32 (int a, int b)
static void fill_caches (H264Context *h, int mb_type, int for_deblock)
static void write_back_intra_pred_mode (H264Context *h)
static int check_intra4x4_pred_mode (H264Context *h)
 checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
static int check_intra_pred_mode (H264Context *h, int mode)
 checks if the top & left blocks are available if needed & changes the dc mode so it only uses the available blocks.
static int pred_intra_mode (H264Context *h, int n)
 gets the predicted intra4x4 prediction mode.
static void write_back_non_zero_count (H264Context *h)
static int pred_non_zero_count (H264Context *h, int n)
 gets the predicted number of non-zero coefficients.
static int fetch_diagonal_mv (H264Context *h, const int16_t **C, int i, int list, int part_width)
static void pred_motion (H264Context *const h, int n, int part_width, int list, int ref, int *const mx, int *const my)
 gets the predicted MV.
static void pred_16x8_motion (H264Context *const h, int n, int list, int ref, int *const mx, int *const my)
 gets the directionally predicted 16x8 MV.
static void pred_8x16_motion (H264Context *const h, int n, int list, int ref, int *const mx, int *const my)
 gets the directionally predicted 8x16 MV.
static void pred_pskip_motion (H264Context *const h, int *const mx, int *const my)
static int get_scale_factor (H264Context *const h, int poc, int poc1, int i)
static void direct_dist_scale_factor (H264Context *const h)
static void fill_colmap (H264Context *h, int map[2][16+32], int list, int field, int colfield, int mbafi)
static void direct_ref_list_init (H264Context *const h)
static void pred_direct_motion (H264Context *const h, int *mb_type)
static void write_back_motion (H264Context *h, int mb_type)
static const uint8_t * decode_nal (H264Context *h, const uint8_t *src, int *dst_length, int *consumed, int length)
 Decodes a network abstraction layer unit.
static int decode_rbsp_trailing (H264Context *h, const uint8_t *src)
 identifies the exact end of the bitstream
static void h264_luma_dc_dequant_idct_c (DCTELEM *block, int qp, int qmul)
 IDCT transforms the 16 dc values and dequantizes them.
static void h264_luma_dc_dct_c (DCTELEM *block)
 DCT transforms the 16 dc values.
static void chroma_dc_dequant_idct_c (DCTELEM *block, int qp, int qmul)
static void chroma_dc_dct_c (DCTELEM *block)
static int get_chroma_qp (H264Context *h, int t, int qscale)
 gets the chroma qp.
static int quantize_c (DCTELEM *block, uint8_t *scantable, int qscale, int intra, int separate_dc)
static void mc_dir_part (H264Context *h, Picture *pic, int n, int square, int chroma_height, int delta, int list, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int src_x_offset, int src_y_offset, qpel_mc_func *qpix_op, h264_chroma_mc_func chroma_op)
static void mc_part_std (H264Context *h, int n, int square, int chroma_height, int delta, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int x_offset, int y_offset, qpel_mc_func *qpix_put, h264_chroma_mc_func chroma_put, qpel_mc_func *qpix_avg, h264_chroma_mc_func chroma_avg, int list0, int list1)
static void mc_part_weighted (H264Context *h, int n, int square, int chroma_height, int delta, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int x_offset, int y_offset, qpel_mc_func *qpix_put, h264_chroma_mc_func chroma_put, h264_weight_func luma_weight_op, h264_weight_func chroma_weight_op, h264_biweight_func luma_weight_avg, h264_biweight_func chroma_weight_avg, int list0, int list1)
static void mc_part (H264Context *h, int n, int square, int chroma_height, int delta, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, int x_offset, int y_offset, qpel_mc_func *qpix_put, h264_chroma_mc_func chroma_put, qpel_mc_func *qpix_avg, h264_chroma_mc_func chroma_avg, h264_weight_func *weight_op, h264_biweight_func *weight_avg, int list0, int list1)
static void prefetch_motion (H264Context *h, int list)
static void hl_motion (H264Context *h, uint8_t *dest_y, uint8_t *dest_cb, uint8_t *dest_cr, qpel_mc_func(*qpix_put)[16], h264_chroma_mc_func(*chroma_put), qpel_mc_func(*qpix_avg)[16], h264_chroma_mc_func(*chroma_avg), h264_weight_func *weight_op, h264_biweight_func *weight_avg)
static void decode_init_vlc (void)
static void free_tables (H264Context *h)
static void init_dequant8_coeff_table (H264Context *h)
static void init_dequant4_coeff_table (H264Context *h)
static void init_dequant_tables (H264Context *h)
static int alloc_tables (H264Context *h)
 allocates tables.
static void clone_tables (H264Context *dst, H264Context *src)
 Mimic alloc_tables(), but for every context thread.
static int context_init (H264Context *h)
 Init context Allocate buffers which are not shared amongst multiple threads.
static void common_init (H264Context *h)
static int decode_init (AVCodecContext *avctx)
static int frame_start (H264Context *h)
static void backup_mb_border (H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int simple)
static void xchg_mb_border (H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int xchg, int simple)
static av_always_inline void hl_decode_mb_internal (H264Context *h, int simple)
static void hl_decode_mb_simple (H264Context *h)
 Process a macroblock; this case avoids checks for expensive uncommon cases.
static void av_noinline hl_decode_mb_complex (H264Context *h)
 Process a macroblock; this handles edge cases, such as interlacing.
static void hl_decode_mb (H264Context *h)
static void pic_as_field (Picture *pic, const int parity)
static int split_field_copy (Picture *dest, Picture *src, int parity, int id_add)
static int build_def_list (Picture *def, Picture **in, int len, int is_long, int sel)
static int add_sorted (Picture **sorted, Picture **src, int len, int limit, int dir)
static int fill_default_ref_list (H264Context *h)
 fills the default_ref_list.
static void print_short_term (H264Context *h)
 print short term list
static void print_long_term (H264Context *h)
 print long term list
static int pic_num_extract (H264Context *h, int pic_num, int *structure)
 Extract structure information about the picture described by pic_num in the current decoding context (frame or field).
static int decode_ref_pic_list_reordering (H264Context *h)
static void fill_mbaff_ref_list (H264Context *h)
static int pred_weight_table (H264Context *h)
static void implicit_weight_table (H264Context *h)
static int unreference_pic (H264Context *h, Picture *pic, int refmask)
 Mark a picture as no longer needed for reference.
static void idr (H264Context *h)
 instantaneous decoder refresh.
static void flush_dpb (AVCodecContext *avctx)
static Picturefind_short (H264Context *h, int frame_num, int *idx)
 Find a Picture in the short term reference list by frame number.
static void remove_short_at_index (H264Context *h, int i)
 Remove a picture from the short term reference list by its index in that list.
static Pictureremove_short (H264Context *h, int frame_num, int ref_mask)
static int execute_ref_pic_marking (H264Context *h, MMCO *mmco, int mmco_count)
 Executes the reference picture marking (memory management control operations).
static int decode_ref_pic_marking (H264Context *h, GetBitContext *gb)
static int init_poc (H264Context *h)
static void init_scan_tables (H264Context *h)
 initialize scan tables
static void clone_slice (H264Context *dst, H264Context *src)
 Replicates H264 "master" context to thread contexts.
static int decode_slice_header (H264Context *h, H264Context *h0)
 decodes a slice header.
static int get_level_prefix (GetBitContext *gb)
static int get_dct8x8_allowed (H264Context *h)
static int decode_residual (H264Context *h, GetBitContext *gb, DCTELEM *block, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff)
 decodes a residual block.
static void predict_field_decoding_flag (H264Context *h)
static void decode_mb_skip (H264Context *h)
 decodes a P_SKIP or B_SKIP macroblock
static int decode_mb_cavlc (H264Context *h)
 decodes a macroblock
static int decode_cabac_field_decoding_flag (H264Context *h)
static int decode_cabac_intra_mb_type (H264Context *h, int ctx_base, int intra_slice)
static int decode_cabac_mb_type (H264Context *h)
static int decode_cabac_mb_skip (H264Context *h, int mb_x, int mb_y)
static int decode_cabac_mb_intra4x4_pred_mode (H264Context *h, int pred_mode)
static int decode_cabac_mb_chroma_pre_mode (H264Context *h)
static int decode_cabac_mb_cbp_luma (H264Context *h)
static int decode_cabac_mb_cbp_chroma (H264Context *h)
static int decode_cabac_mb_dqp (H264Context *h)
static int decode_cabac_p_mb_sub_type (H264Context *h)
static int decode_cabac_b_mb_sub_type (H264Context *h)
static int decode_cabac_mb_transform_size (H264Context *h)
static int decode_cabac_mb_ref (H264Context *h, int list, int n)
static int decode_cabac_mb_mvd (H264Context *h, int list, int n, int l)
static av_always_inline int get_cabac_cbf_ctx (H264Context *h, int cat, int idx, int is_dc)
 DECLARE_ASM_CONST (1, uint8_t, last_coeff_flag_offset_8x8[63])
static av_always_inline void decode_cabac_residual_internal (H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff, int is_dc)
static void decode_cabac_residual_dc (H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff)
static void decode_cabac_residual_nondc (H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff)
static void decode_cabac_residual (H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff)
static void compute_mb_neighbors (H264Context *h)
static int decode_mb_cabac (H264Context *h)
 decodes a macroblock
static void filter_mb_edgev (H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int qp)
static void filter_mb_edgecv (H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int qp)
static void filter_mb_mbaff_edgev (H264Context *h, uint8_t *pix, int stride, int16_t bS[8], int qp[2])
static void filter_mb_mbaff_edgecv (H264Context *h, uint8_t *pix, int stride, int16_t bS[8], int qp[2])
static void filter_mb_edgeh (H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int qp)
static void filter_mb_edgech (H264Context *h, uint8_t *pix, int stride, int16_t bS[4], int qp)
static int decode_slice (struct AVCodecContext *avctx, H264Context *h)
static int decode_unregistered_user_data (H264Context *h, int size)
static int decode_sei (H264Context *h)
static void decode_hrd_parameters (H264Context *h, SPS *sps)
static int decode_vui_parameters (H264Context *h, SPS *sps)
static void decode_scaling_list (H264Context *h, uint8_t *factors, int size, const uint8_t *jvt_list, const uint8_t *fallback_list)
static void decode_scaling_matrices (H264Context *h, SPS *sps, PPS *pps, int is_sps, uint8_t(*scaling_matrix4)[16], uint8_t(*scaling_matrix8)[64])
static void * alloc_parameter_set (H264Context *h, void **vec, const unsigned int id, const unsigned int max, const size_t size, const char *name)
 Returns and optionally allocates SPS / PPS structures in the supplied array 'vec'.
static int decode_seq_parameter_set (H264Context *h)
static void build_qp_table (PPS *pps, int t, int index)
static int decode_picture_parameter_set (H264Context *h, int bit_length)
static void execute_decode_slices (H264Context *h, int context_count)
 Call decode_slice() for each context.
static int decode_nal_units (H264Context *h, const uint8_t *buf, int buf_size)
static int get_consumed_bytes (MpegEncContext *s, int pos, int buf_size)
 returns the number of bytes consumed for building the current frame
static int decode_frame (AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size)
static void fill_mb_avail (H264Context *h)
int main (void)
static int decode_end (AVCodecContext *avctx)

Variables

static VLC coeff_token_vlc [4]
static VLC_TYPE coeff_token_vlc_tables [520+332+280+256][2]
static const int coeff_token_vlc_tables_size [4] = {520,332,280,256}
static VLC chroma_dc_coeff_token_vlc
static VLC_TYPE chroma_dc_coeff_token_vlc_table [256][2]
static const int chroma_dc_coeff_token_vlc_table_size = 256
static VLC total_zeros_vlc [15]
static VLC_TYPE total_zeros_vlc_tables [15][512][2]
static const int total_zeros_vlc_tables_size = 512
static VLC chroma_dc_total_zeros_vlc [3]
static VLC_TYPE chroma_dc_total_zeros_vlc_tables [3][8][2]
static const int chroma_dc_total_zeros_vlc_tables_size = 8
static VLC run_vlc [6]
static VLC_TYPE run_vlc_tables [6][8][2]
static const int run_vlc_tables_size = 8
static VLC run7_vlc
static VLC_TYPE run7_vlc_table [96][2]
static const int run7_vlc_table_size = 96
const uint8_t ff_rem6 [52]
const uint8_t ff_div6 [52]
static const int left_block_options [4][8]
AVCodec h264_decoder


Function Documentation

static void svq3_luma_dc_dequant_idct_c ( DCTELEM block,
int  qp 
) [static]

Referenced by hl_decode_mb_internal().

static void svq3_add_idct_c ( uint8_t *  dst,
DCTELEM block,
int  stride,
int  qp,
int  dc 
) [static]

Referenced by hl_decode_mb_internal().

static void filter_mb ( H264Context h,
int  mb_x,
int  mb_y,
uint8_t *  img_y,
uint8_t *  img_cb,
uint8_t *  img_cr,
unsigned int  linesize,
unsigned int  uvlinesize 
) [static]

Definition at line 6299 of file h264.c.

Referenced by filter_mb_fast(), and hl_decode_mb_internal().

static void filter_mb_fast ( H264Context h,
int  mb_x,
int  mb_y,
uint8_t *  img_y,
uint8_t *  img_cb,
uint8_t *  img_cr,
unsigned int  linesize,
unsigned int  uvlinesize 
) [static]

Definition at line 6185 of file h264.c.

Referenced by hl_decode_mb_internal().

static Picture * remove_long ( H264Context h,
int  i,
int  ref_mask 
) [static]

Remove a picture from the long term reference list by its index in that list.

Returns:
the removed picture or NULL if an error occurs

Definition at line 3203 of file h264.c.

Referenced by execute_ref_pic_marking(), and idr().

static av_always_inline uint32_t pack16to32 ( int  a,
int  b 
) [static]

static void fill_caches ( H264Context h,
int  mb_type,
int  for_deblock 
) [static]

Definition at line 104 of file h264.c.

Referenced by decode_mb_cabac(), decode_mb_cavlc(), decode_mb_skip(), and hl_decode_mb_internal().

static void write_back_intra_pred_mode ( H264Context h  )  [inline, static]

Definition at line 554 of file h264.c.

Referenced by decode_mb_cabac(), decode_mb_cavlc(), and svq3_decode_mb().

static int check_intra4x4_pred_mode ( H264Context h  )  [inline, static]

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

Definition at line 569 of file h264.c.

Referenced by decode_mb_cabac(), decode_mb_cavlc(), and svq3_decode_mb().

static int check_intra_pred_mode ( H264Context h,
int  mode 
) [inline, static]

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

Definition at line 608 of file h264.c.

Referenced by decode_mb_cabac(), decode_mb_cavlc(), and svq3_decode_mb().

static int pred_intra_mode ( H264Context h,
int  n 
) [inline, static]

gets the predicted intra4x4 prediction mode.

Definition at line 643 of file h264.c.

Referenced by decode_mb_cabac(), and decode_mb_cavlc().

static void write_back_non_zero_count ( H264Context h  )  [inline, static]

Definition at line 655 of file h264.c.

Referenced by decode_mb_cabac(), and decode_mb_cavlc().

static int pred_non_zero_count ( H264Context h,
int  n 
) [inline, static]

gets the predicted number of non-zero coefficients.

Parameters:
n block index

Definition at line 679 of file h264.c.

Referenced by decode_residual().

static int fetch_diagonal_mv ( H264Context h,
const int16_t **  C,
int  i,
int  list,
int  part_width 
) [inline, static]

Definition at line 692 of file h264.c.

Referenced by pred_8x16_motion(), and pred_motion().

static void pred_motion ( H264Context *const   h,
int  n,
int  part_width,
int  list,
int  ref,
int *const   mx,
int *const   my 
) [inline, static]

gets the predicted MV.

Parameters:
n the block index
part_width the width of the partition (4, 8,16) -> (1, 2, 4)
mx the x component of the predicted motion vector
my the y component of the predicted motion vector

Definition at line 756 of file h264.c.

Referenced by decode_mb_cabac(), decode_mb_cavlc(), pred_16x8_motion(), pred_8x16_motion(), pred_direct_motion(), pred_pskip_motion(), and svq3_mc_dir().

static void pred_16x8_motion ( H264Context *const   h,
int  n,
int  list,
int  ref,
int *const   mx,
int *const   my 
) [inline, static]

gets the directionally predicted 16x8 MV.

Parameters:
n the block index
mx the x component of the predicted motion vector
my the y component of the predicted motion vector

Definition at line 811 of file h264.c.

Referenced by decode_mb_cabac(), and decode_mb_cavlc().

static void pred_8x16_motion ( H264Context *const   h,
int  n,
int  list,
int  ref,
int *const   mx,
int *const   my 
) [inline, static]

gets the directionally predicted 8x16 MV.

Parameters:
n the block index
mx the x component of the predicted motion vector
my the y component of the predicted motion vector

Definition at line 846 of file h264.c.

Referenced by decode_mb_cabac(), and decode_mb_cavlc().

static void pred_pskip_motion ( H264Context *const   h,
int *const   mx,
int *const   my 
) [inline, static]

Definition at line 877 of file h264.c.

Referenced by decode_mb_skip().

static int get_scale_factor ( H264Context *const   h,
int  poc,
int  poc1,
int  i 
) [static]

Definition at line 896 of file h264.c.

Referenced by direct_dist_scale_factor().

static void direct_dist_scale_factor ( H264Context *const   h  )  [inline, static]

Definition at line 908 of file h264.c.

Referenced by decode_slice_header().

static void fill_colmap ( H264Context h,
int  map[2][16+32],
int  list,
int  field,
int  colfield,
int  mbafi 
) [static]

Definition at line 925 of file h264.c.

Referenced by direct_ref_list_init().

static void direct_ref_list_init ( H264Context *const   h  )  [inline, static]

Definition at line 958 of file h264.c.

Referenced by decode_slice_header().

static void pred_direct_motion ( H264Context *const   h,
int *  mb_type 
) [inline, static]

Definition at line 989 of file h264.c.

Referenced by decode_mb_cabac(), decode_mb_cavlc(), and decode_mb_skip().

static void write_back_motion ( H264Context h,
int  mb_type 
) [inline, static]

Definition at line 1321 of file h264.c.

Referenced by decode_mb_cabac(), decode_mb_cavlc(), and decode_mb_skip().

static const uint8_t* decode_nal ( H264Context h,
const uint8_t *  src,
int *  dst_length,
int *  consumed,
int  length 
) [static]

Decodes a network abstraction layer unit.

Parameters:
consumed is the number of bytes used as input
length is the length of the array
dst_length is 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 1375 of file h264.c.

Referenced by decode_nal_units(), and main().

static int decode_rbsp_trailing ( H264Context h,
const uint8_t *  src 
) [static]

identifies the exact end of the bitstream

Returns:
the length of the trailing, or 0 if damaged

Definition at line 1442 of file h264.c.

Referenced by decode_nal_units().

static void h264_luma_dc_dequant_idct_c ( DCTELEM block,
int  qp,
int  qmul 
) [static]

IDCT transforms the 16 dc values and dequantizes them.

Parameters:
qp quantization parameter

Definition at line 1459 of file h264.c.

Referenced by hl_decode_mb_internal().

static void h264_luma_dc_dct_c ( DCTELEM block  )  [static]

DCT transforms the 16 dc values.

Parameters:
qp quantization parameter ??? FIXME

Definition at line 1500 of file h264.c.

static void chroma_dc_dequant_idct_c ( DCTELEM block,
int  qp,
int  qmul 
) [static]

Definition at line 1538 of file h264.c.

Referenced by hl_decode_mb_internal().

static void chroma_dc_dct_c ( DCTELEM block  )  [static]

Definition at line 1560 of file h264.c.

static int get_chroma_qp ( H264Context h,
int  t,
int  qscale 
) [inline, static]

gets the chroma qp.

Definition at line 1585 of file h264.c.

Referenced by decode_mb_cabac(), decode_mb_cavlc(), decode_slice_header(), filter_mb(), filter_mb_fast(), and hl_decode_mb_internal().

static int quantize_c ( DCTELEM block,
uint8_t *  scantable,
int  qscale,
int  intra,
int  separate_dc 
) [inline, static]

Definition at line 1591 of file h264.c.

static void mc_dir_part ( H264Context h,
Picture pic,
int  n,
int  square,
int  chroma_height,
int  delta,
int  list,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  src_x_offset,
int  src_y_offset,
qpel_mc_func qpix_op,
h264_chroma_mc_func  chroma_op 
) [inline, static]

Definition at line 1668 of file h264.c.

static void mc_part_std ( H264Context h,
int  n,
int  square,
int  chroma_height,
int  delta,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  x_offset,
int  y_offset,
qpel_mc_func qpix_put,
h264_chroma_mc_func  chroma_put,
qpel_mc_func qpix_avg,
h264_chroma_mc_func  chroma_avg,
int  list0,
int  list1 
) [inline, static]

Definition at line 1729 of file h264.c.

static void mc_part_weighted ( H264Context h,
int  n,
int  square,
int  chroma_height,
int  delta,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  x_offset,
int  y_offset,
qpel_mc_func qpix_put,
h264_chroma_mc_func  chroma_put,
h264_weight_func  luma_weight_op,
h264_weight_func  chroma_weight_op,
h264_biweight_func  luma_weight_avg,
h264_biweight_func  chroma_weight_avg,
int  list0,
int  list1 
) [inline, static]

Definition at line 1763 of file h264.c.

Referenced by mc_part().

static void mc_part ( H264Context h,
int  n,
int  square,
int  chroma_height,
int  delta,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
int  x_offset,
int  y_offset,
qpel_mc_func qpix_put,
h264_chroma_mc_func  chroma_put,
qpel_mc_func qpix_avg,
h264_chroma_mc_func  chroma_avg,
h264_weight_func weight_op,
h264_biweight_func weight_avg,
int  list0,
int  list1 
) [inline, static]

Definition at line 1830 of file h264.c.

Referenced by hl_motion().

static void prefetch_motion ( H264Context h,
int  list 
) [inline, static]

Definition at line 1848 of file h264.c.

Referenced by hl_motion(), and MPV_motion().

static void hl_motion ( H264Context h,
uint8_t *  dest_y,
uint8_t *  dest_cb,
uint8_t *  dest_cr,
qpel_mc_func(*)  qpix_put[16],
h264_chroma_mc_func chroma_put,
qpel_mc_func(*)  qpix_avg[16],
h264_chroma_mc_func chroma_avg,
h264_weight_func weight_op,
h264_biweight_func weight_avg 
) [static]

Definition at line 1864 of file h264.c.

Referenced by hl_decode_mb_internal().

static void decode_init_vlc ( void   )  [static]

Definition at line 1951 of file h264.c.

Referenced by decode_init().

static void free_tables ( H264Context h  )  [static]

Definition at line 2020 of file h264.c.

Referenced by alloc_tables(), decode_end(), and decode_slice_header().

static void init_dequant8_coeff_table ( H264Context h  )  [static]

Definition at line 2051 of file h264.c.

Referenced by init_dequant_tables().

static void init_dequant4_coeff_table ( H264Context h  )  [static]

Definition at line 2074 of file h264.c.

Referenced by init_dequant_tables().

static void init_dequant_tables ( H264Context h  )  [static]

Definition at line 2099 of file h264.c.

Referenced by alloc_tables(), and decode_slice_header().

static int alloc_tables ( H264Context h  )  [static]

allocates tables.

needs width/height

Definition at line 2120 of file h264.c.

Referenced by decode_slice_header(), and svq3_decode_frame().

static void clone_tables ( H264Context dst,
H264Context src 
) [static]

Mimic alloc_tables(), but for every context thread.

Definition at line 2166 of file h264.c.

Referenced by decode_slice_header().

static int context_init ( H264Context h  )  [static]

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

Definition at line 2186 of file h264.c.

Referenced by decode_slice_header().

static void common_init ( H264Context h  )  [static]

Definition at line 2195 of file h264.c.

static int decode_init ( AVCodecContext avctx  )  [static]

Definition at line 2212 of file h264.c.

static int frame_start ( H264Context h  )  [static]

Definition at line 2250 of file h264.c.

Referenced by decode_frame(), decode_slice_header(), encode_frame(), and svq3_decode_frame().

static void backup_mb_border ( H264Context h,
uint8_t *  src_y,
uint8_t *  src_cb,
uint8_t *  src_cr,
int  linesize,
int  uvlinesize,
int  simple 
) [inline, static]

Definition at line 2306 of file h264.c.

Referenced by hl_decode_mb_internal().

static void xchg_mb_border ( H264Context h,
uint8_t *  src_y,
uint8_t *  src_cb,
uint8_t *  src_cr,
int  linesize,
int  uvlinesize,
int  xchg,
int  simple 
) [inline, static]

Definition at line 2369 of file h264.c.

Referenced by hl_decode_mb_internal().

static av_always_inline void hl_decode_mb_internal ( H264Context h,
int  simple 
) [static]

Definition at line 2443 of file h264.c.

Referenced by hl_decode_mb_complex(), and hl_decode_mb_simple().

static void hl_decode_mb_simple ( H264Context h  )  [static]

Process a macroblock; this case avoids checks for expensive uncommon cases.

Definition at line 2664 of file h264.c.

Referenced by hl_decode_mb().

static void av_noinline hl_decode_mb_complex ( H264Context h  )  [static]

Process a macroblock; this handles edge cases, such as interlacing.

Definition at line 2671 of file h264.c.

Referenced by hl_decode_mb().

static void hl_decode_mb ( H264Context h  )  [static]

Definition at line 2675 of file h264.c.

Referenced by decode_slice(), and svq3_decode_frame().

static void pic_as_field ( Picture pic,
const int  parity 
) [static]

Definition at line 2690 of file h264.c.

Referenced by decode_ref_pic_list_reordering(), and split_field_copy().

static int split_field_copy ( Picture dest,
Picture src,
int  parity,
int  id_add 
) [static]

Definition at line 2701 of file h264.c.

Referenced by build_def_list().

static int build_def_list ( Picture def,
Picture **  in,
int  len,
int  is_long,
int  sel 
) [static]

Definition at line 2717 of file h264.c.

Referenced by fill_default_ref_list().

static int add_sorted ( Picture **  sorted,
Picture **  src,
int  len,
int  limit,
int  dir 
) [static]

Definition at line 2739 of file h264.c.

Referenced by fill_default_ref_list().

static int fill_default_ref_list ( H264Context h  )  [static]

fills the default_ref_list.

Definition at line 2763 of file h264.c.

Referenced by decode_slice_header().

static void print_short_term ( H264Context h  )  [static]

print short term list

Definition at line 3222 of file h264.c.

Referenced by decode_ref_pic_list_reordering(), and execute_ref_pic_marking().

static void print_long_term ( H264Context h  )  [static]

print long term list

Definition at line 3236 of file h264.c.

Referenced by decode_ref_pic_list_reordering(), and execute_ref_pic_marking().

static int pic_num_extract ( H264Context h,
int  pic_num,
int *  structure 
) [static]

Extract structure information about the picture described by pic_num in the current decoding context (frame or field).

Note that pic_num is picture number without wrapping (so, 0<=pic_num<max_pic_num).

Parameters:
pic_num picture number for which to extract structure information
structure one of PICT_XXX describing structure of picture with pic_num
Returns:
frame number (short term) or long term index of picture described by pic_num

Definition at line 2828 of file h264.c.

Referenced by decode_ref_pic_list_reordering(), and execute_ref_pic_marking().

static int decode_ref_pic_list_reordering ( H264Context h  )  [static]

Definition at line 2842 of file h264.c.

Referenced by decode_slice_header().

static void fill_mbaff_ref_list ( H264Context h  )  [static]

Definition at line 2953 of file h264.c.

Referenced by decode_slice_header().

static int pred_weight_table ( H264Context h  )  [static]

Definition at line 2986 of file h264.c.

Referenced by decode_slice_header().

static void implicit_weight_table ( H264Context h  )  [static]

Definition at line 3040 of file h264.c.

Referenced by decode_slice_header().

static int unreference_pic ( H264Context h,
Picture pic,
int  refmask 
) [inline, static]

Mark a picture as no longer needed for reference.

The refmask argument allows unreferencing of individual fields or the whole frame. If the picture becomes entirely unreferenced, but is being held for display purposes, it is marked as such.

Parameters:
refmask mask of fields to unreference; the mask is bitwise anded with the reference marking of pic
Returns:
non-zero if pic becomes entirely unreferenced (except possibly for display purposes) zero if one of the fields remains in reference

Definition at line 3087 of file h264.c.

Referenced by idr(), remove_long(), and remove_short().

static void idr ( H264Context h  )  [static]

instantaneous decoder refresh.

Definition at line 3104 of file h264.c.

Referenced by decode_nal_units(), and flush_dpb().

static void flush_dpb ( AVCodecContext avctx  )  [static]

Definition at line 3124 of file h264.c.

static Picture* find_short ( H264Context h,
int  frame_num,
int *  idx 
) [static]

Find a Picture in the short term reference list by frame number.

Parameters:
frame_num frame number to search for
idx the index into h->short_ref where returned picture is found undefined if no picture found.
Returns:
pointer to the found picture, or NULL if no pic with the provided frame number is found

Definition at line 3148 of file h264.c.

Referenced by execute_ref_pic_marking(), and remove_short().

static void remove_short_at_index ( H264Context h,
int  i 
) [static]

Remove a picture from the short term reference list by its index in that list.

This does no checking on the provided index; it is assumed to be valid. Other list entries are shifted down.

Parameters:
i index into h->short_ref of picture to remove.

Definition at line 3170 of file h264.c.

Referenced by execute_ref_pic_marking(), and remove_short().

static Picture* remove_short ( H264Context h,
int  frame_num,
int  ref_mask 
) [static]

Returns:
the removed picture or NULL if an error occurs

Definition at line 3181 of file h264.c.

Referenced by execute_ref_pic_marking().

static int execute_ref_pic_marking ( H264Context h,
MMCO mmco,
int  mmco_count 
) [static]

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

Definition at line 3252 of file h264.c.

Referenced by decode_frame(), and decode_slice_header().

static int decode_ref_pic_marking ( H264Context h,
GetBitContext gb 
) [static]

Definition at line 3407 of file h264.c.

Referenced by decode_slice_header().

static int init_poc ( H264Context h  )  [static]

Definition at line 3470 of file h264.c.

Referenced by decode_slice_header().

static void init_scan_tables ( H264Context h  )  [static]

initialize scan tables

Definition at line 3551 of file h264.c.

Referenced by decode_slice_header().

static void clone_slice ( H264Context dst,
H264Context src 
) [static]

Replicates H264 "master" context to thread contexts.

Definition at line 3600 of file h264.c.

Referenced by decode_slice_header().

static int decode_slice_header ( H264Context h,
H264Context h0 
) [static]

decodes a slice header.

This will also call MPV_common_init() and frame_start() as needed.

Parameters:
h h264context
h0 h264 master context (differs from 'h' when doing sliced based parallel decoding)
Returns:
0 if okay, <0 if an error occured, 1 if decoding must not be multithreaded

Definition at line 3633 of file h264.c.

static int get_level_prefix ( GetBitContext gb  )  [inline, static]

Definition at line 4060 of file h264.c.

Referenced by decode_residual().

static int get_dct8x8_allowed ( H264Context h  )  [inline, static]

Definition at line 4080 of file h264.c.

Referenced by decode_mb_cabac(), and decode_mb_cavlc().

static int decode_residual ( H264Context h,
GetBitContext gb,
DCTELEM block,
int  n,
const uint8_t *  scantable,
const uint32_t qmul,
int  max_coeff 
) [static]

decodes a residual block.

Parameters:
n block index
scantable scantable
max_coeff number of coefficients in the block
Returns:
<0 if an error occured

Definition at line 4097 of file h264.c.

Referenced by decode_mb_cavlc().

static void predict_field_decoding_flag ( H264Context h  )  [static]

Definition at line 4241 of file h264.c.

Referenced by decode_mb_cabac(), and decode_mb_cavlc().

static void decode_mb_skip ( H264Context h  )  [static]

decodes a P_SKIP or B_SKIP macroblock

Definition at line 4255 of file h264.c.

Referenced by decode_mb_cabac(), and decode_mb_cavlc().

static int decode_mb_cavlc ( H264Context h  )  [static]

decodes a macroblock

Returns:
0 if OK, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed

Definition at line 4297 of file h264.c.

Referenced by decode_slice().

static int decode_cabac_field_decoding_flag ( H264Context h  )  [static]

Definition at line 4780 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_intra_mb_type ( H264Context h,
int  ctx_base,
int  intra_slice 
) [static]

Definition at line 4799 of file h264.c.

Referenced by decode_cabac_mb_type().

static int decode_cabac_mb_type ( H264Context h  )  [static]

Definition at line 4832 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_mb_skip ( H264Context h,
int  mb_x,
int  mb_y 
) [static]

Definition at line 4889 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_mb_intra4x4_pred_mode ( H264Context h,
int  pred_mode 
) [static]

Definition at line 4925 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_mb_chroma_pre_mode ( H264Context h  )  [static]

Definition at line 4941 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_mb_cbp_luma ( H264Context h  )  [static]

Definition at line 4965 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_mb_cbp_chroma ( H264Context h  )  [static]

Definition at line 4981 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_mb_dqp ( H264Context h  )  [static]

Definition at line 4999 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_p_mb_sub_type ( H264Context h  )  [static]

Definition at line 5021 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_b_mb_sub_type ( H264Context h  )  [static]

Definition at line 5030 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_mb_transform_size ( H264Context h  )  [inline, static]

Definition at line 5047 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_mb_ref ( H264Context h,
int  list,
int  n 
) [static]

Definition at line 5051 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_cabac_mb_mvd ( H264Context h,
int  list,
int  n,
int  l 
) [static]

Definition at line 5083 of file h264.c.

Referenced by decode_mb_cabac().

static av_always_inline int get_cabac_cbf_ctx ( H264Context h,
int  cat,
int  idx,
int  is_dc 
) [static]

Definition at line 5125 of file h264.c.

Referenced by decode_cabac_residual_internal().

DECLARE_ASM_CONST ( ,
uint8_t  ,
last_coeff_flag_offset_8x8  [63] 
)

static av_always_inline void decode_cabac_residual_internal ( H264Context h,
DCTELEM block,
int  cat,
int  n,
const uint8_t *  scantable,
const uint32_t qmul,
int  max_coeff,
int  is_dc 
) [static]

static void decode_cabac_residual_dc ( H264Context h,
DCTELEM block,
int  cat,
int  n,
const uint8_t *  scantable,
const uint32_t qmul,
int  max_coeff 
) [static]

Definition at line 5352 of file h264.c.

Referenced by decode_cabac_residual().

static void decode_cabac_residual_nondc ( H264Context h,
DCTELEM block,
int  cat,
int  n,
const uint8_t *  scantable,
const uint32_t qmul,
int  max_coeff 
) [static]

Definition at line 5356 of file h264.c.

Referenced by decode_cabac_residual().

static void decode_cabac_residual ( H264Context h,
DCTELEM block,
int  cat,
int  n,
const uint8_t *  scantable,
const uint32_t qmul,
int  max_coeff 
) [static]

Definition at line 5361 of file h264.c.

Referenced by decode_mb_cabac().

static void compute_mb_neighbors ( H264Context h  )  [inline, static]

Definition at line 5370 of file h264.c.

Referenced by decode_mb_cabac().

static int decode_mb_cabac ( H264Context h  )  [static]

decodes a macroblock

Returns:
0 if OK, AC_ERROR / DC_ERROR / MV_ERROR if an error is noticed

Definition at line 5402 of file h264.c.

Referenced by decode_slice().

static void filter_mb_edgev ( H264Context h,
uint8_t *  pix,
int  stride,
int16_t  bS[4],
int  qp 
) [static]

Definition at line 5881 of file h264.c.

Referenced by filter_mb_fast().

static void filter_mb_edgecv ( H264Context h,
uint8_t *  pix,
int  stride,
int16_t  bS[4],
int  qp 
) [static]

Definition at line 5942 of file h264.c.

Referenced by filter_mb_fast().

static void filter_mb_mbaff_edgev ( H264Context h,
uint8_t *  pix,
int  stride,
int16_t  bS[8],
int  qp[2] 
) [static]

Definition at line 5958 of file h264.c.

Referenced by filter_mb().

static void filter_mb_mbaff_edgecv ( H264Context h,
uint8_t *  pix,
int  stride,
int16_t  bS[8],
int  qp[2] 
) [static]

Definition at line 6056 of file h264.c.

Referenced by filter_mb().

static void filter_mb_edgeh ( H264Context h,
uint8_t *  pix,
int  stride,
int16_t  bS[4],
int  qp 
) [static]

Definition at line 6109 of file h264.c.

Referenced by filter_mb_fast().

static void filter_mb_edgech ( H264Context h,
uint8_t *  pix,
int  stride,
int16_t  bS[4],
int  qp 
) [static]

Definition at line 6169 of file h264.c.

Referenced by filter_mb_fast().

static int decode_slice ( struct AVCodecContext avctx,
H264Context h 
) [static]

Definition at line 6620 of file h264.c.

static int decode_unregistered_user_data ( H264Context h,
int  size 
) [static]

Definition at line 6797 of file h264.c.

Referenced by decode_sei().

static int decode_sei ( H264Context h  )  [static]

Definition at line 6823 of file h264.c.

Referenced by decode_nal_units().

static void decode_hrd_parameters ( H264Context h,
SPS sps 
) [inline, static]

Definition at line 6855 of file h264.c.

Referenced by decode_vui_parameters().

static int decode_vui_parameters ( H264Context h,
SPS sps 
) [inline, static]

Definition at line 6872 of file h264.c.

Referenced by decode_seq_parameter_set().

static void decode_scaling_list ( H264Context h,
uint8_t *  factors,
int  size,
const uint8_t *  jvt_list,
const uint8_t *  fallback_list 
) [static]

Definition at line 6955 of file h264.c.

Referenced by decode_scaling_matrices().

static void decode_scaling_matrices ( H264Context h,
SPS sps,
PPS pps,
int  is_sps,
uint8_t(*)  scaling_matrix4[16],
uint8_t(*)  scaling_matrix8[64] 
) [static]

Definition at line 6974 of file h264.c.

Referenced by decode_picture_parameter_set(), and decode_seq_parameter_set().

static void* alloc_parameter_set ( H264Context h,
void **  vec,
const unsigned int  id,
const unsigned int  max,
const size_t  size,
const char *  name 
) [static]

Returns and optionally allocates SPS / PPS structures in the supplied array 'vec'.

Definition at line 7003 of file h264.c.

Referenced by decode_picture_parameter_set(), and decode_seq_parameter_set().

static int decode_seq_parameter_set ( H264Context h  )  [inline, static]

Definition at line 7019 of file h264.c.

Referenced by decode_nal_units().

static void build_qp_table ( PPS pps,
int  t,
int  index 
) [static]

Definition at line 7152 of file h264.c.

Referenced by decode_picture_parameter_set().

static int decode_picture_parameter_set ( H264Context h,
int  bit_length 
) [inline, static]

Definition at line 7159 of file h264.c.

Referenced by decode_nal_units().

static void execute_decode_slices ( H264Context h,
int  context_count 
) [static]

Call decode_slice() for each context.

Parameters:
h h264 master context
context_count number of contexts to execute

Definition at line 7274 of file h264.c.

Referenced by decode_nal_units().

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

Definition at line 7304 of file h264.c.

Referenced by decode_frame().

static int get_consumed_bytes ( MpegEncContext s,
int  pos,
int  buf_size 
) [static]

returns the number of bytes consumed for building the current frame

Definition at line 7492 of file h264.c.

static int decode_frame ( AVCodecContext avctx,
void *  data,
int *  data_size,
const uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 7499 of file h264.c.

static void fill_mb_avail ( H264Context h  )  [inline, static]

Definition at line 7712 of file h264.c.

int main ( void   ) 

Definition at line 7736 of file h264.c.

static int decode_end ( AVCodecContext avctx  )  [static]

Definition at line 7907 of file h264.c.


Variable Documentation

VLC coeff_token_vlc[4] [static]

Definition at line 51 of file h264.c.

VLC_TYPE coeff_token_vlc_tables[520+332+280+256][2] [static]

Definition at line 52 of file h264.c.

Referenced by decode_init_vlc().

const int coeff_token_vlc_tables_size[4] = {520,332,280,256} [static]

Definition at line 53 of file h264.c.

Referenced by decode_init_vlc().

Definition at line 55 of file h264.c.

VLC_TYPE chroma_dc_coeff_token_vlc_table[256][2] [static]

Definition at line 56 of file h264.c.

Referenced by decode_init_vlc().

const int chroma_dc_coeff_token_vlc_table_size = 256 [static]

Definition at line 57 of file h264.c.

Referenced by decode_init_vlc().

VLC total_zeros_vlc[15] [static]

Definition at line 59 of file h264.c.

VLC_TYPE total_zeros_vlc_tables[15][512][2] [static]

Definition at line 60 of file h264.c.

Referenced by decode_init_vlc().

const int total_zeros_vlc_tables_size = 512 [static]

Definition at line 61 of file h264.c.

Referenced by decode_init_vlc().

Definition at line 63 of file h264.c.

VLC_TYPE chroma_dc_total_zeros_vlc_tables[3][8][2] [static]

Definition at line 64 of file h264.c.

Referenced by decode_init_vlc().

const int chroma_dc_total_zeros_vlc_tables_size = 8 [static]

Definition at line 65 of file h264.c.

Referenced by decode_init_vlc().

VLC run_vlc[6] [static]

Definition at line 67 of file h264.c.

VLC_TYPE run_vlc_tables[6][8][2] [static]

Definition at line 68 of file h264.c.

Referenced by decode_init_vlc().

const int run_vlc_tables_size = 8 [static]

Definition at line 69 of file h264.c.

Referenced by decode_init_vlc().

VLC run7_vlc [static]

Definition at line 71 of file h264.c.

VLC_TYPE run7_vlc_table[96][2] [static]

Definition at line 72 of file h264.c.

Referenced by decode_init_vlc().

const int run7_vlc_table_size = 96 [static]

Definition at line 73 of file h264.c.

Referenced by decode_init_vlc().

const uint8_t ff_rem6[52]

Initial value:

{
0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3,
}

Definition at line 89 of file h264.c.

Referenced by init_dequant4_coeff_table(), and init_dequant8_coeff_table().

const uint8_t ff_div6[52]

Initial value:

{
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
}

Definition at line 93 of file h264.c.

Referenced by init_dequant4_coeff_table(), and init_dequant8_coeff_table().

const int left_block_options[4][8] [static]

Initial value:

{
    {0,1,2,3,7,10,8,11},
    {2,2,3,3,8,11,8,11},
    {0,0,1,1,7,10,7,10},
    {0,2,0,2,7,10,7,10}
}

Definition at line 97 of file h264.c.

Referenced by fill_caches().

Initial value:

 {
    "h264",
    CODEC_TYPE_VIDEO,
    CODEC_ID_H264,
    sizeof(H264Context),
    decode_init,
    NULL,
    decode_end,
    decode_frame,
     CODEC_CAP_DR1 | CODEC_CAP_DELAY,
    .flush= flush_dpb,
}

Definition at line 7923 of file h264.c.


Generated on Sat Dec 18 05:15:52 2010 for MythTV by  doxygen 1.5.5