hvirtual/quicktime/ffmpeg/libavcodec/h264.c File Reference

#include "common.h"
#include "dsputil.h"
#include "avcodec.h"
#include "mpegvideo.h"
#include "h264data.h"
#include "golomb.h"
#include "cabac.h"
#include <assert.h>
#include "svq3.c"

Include dependency graph for h264.c:

Go to the source code of this file.

Data Structures

struct  SPS
struct  PPS
struct  MMCO
struct  H264Context

Defines

#define interlaced_dct   interlaced_dct_is_a_bad_name
#define mb_intra   mb_intra_isnt_initalized_see_mb_type
#define LUMA_DC_BLOCK_INDEX   25
#define CHROMA_DC_BLOCK_INDEX   26
#define CHROMA_DC_COEFF_TOKEN_VLC_BITS   8
#define COEFF_TOKEN_VLC_BITS   8
#define TOTAL_ZEROS_VLC_BITS   9
#define CHROMA_DC_TOTAL_ZEROS_VLC_BITS   3
#define RUN_VLC_BITS   3
#define RUN7_VLC_BITS   6
#define MAX_SPS_COUNT   32
#define MAX_PPS_COUNT   256
#define MAX_MMCO_COUNT   66
#define NAL_SLICE   1
#define NAL_DPA   2
#define NAL_DPB   3
#define NAL_DPC   4
#define NAL_IDR_SLICE   5
#define NAL_SEI   6
#define NAL_SPS   7
#define NAL_PPS   8
#define NAL_PICTURE_DELIMITER   9
#define NAL_FILTER_DATA   10
#define LIST_NOT_USED   -1
#define PART_NOT_AVAILABLE   -2
#define stride   16
#define LOAD_TOP_RIGHT_EDGE
#define LOAD_LEFT_EDGE
#define LOAD_TOP_EDGE
#define SRC(x, y)   src[(x)+(y)*stride]
#define PL(y)   const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
#define PREDICT_8x8_LOAD_LEFT
#define PT(x)   const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
#define PREDICT_8x8_LOAD_TOP
#define PTR(x)   t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
#define PREDICT_8x8_LOAD_TOPRIGHT
#define PREDICT_8x8_LOAD_TOPLEFT   const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2
#define PREDICT_8x8_DC(v)
#define ROW(y)
#define XCHG(a, b, t, xchg)
#define XCHG(a, b, t, xchg)
#define T(x)   (x>>2) | ((x<<2) & 0xF)

Enumerations

enum  MMCOOpcode {
  MMCO_END = 0, MMCO_SHORT2UNUSED, MMCO_LONG2UNUSED, MMCO_SHORT2LONG,
  MMCO_SET_MAX_LONG, MMCO_RESET, MMCO_LONG
}

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 uint32_t pack16to32 (int a, int b)
static void fill_rectangle (void *vp, int w, int h, int stride, uint32_t val, int size)
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)
static int check_intra_pred_mode (H264Context *h, int mode)
static int pred_intra_mode (H264Context *h, int n)
static void write_back_non_zero_count (H264Context *h)
static int pred_non_zero_count (H264Context *h, int n)
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)
static void pred_16x8_motion (H264Context *const h, int n, int list, int ref, int *const mx, int *const my)
static void pred_8x16_motion (H264Context *const h, int n, int list, int ref, int *const mx, int *const my)
static void pred_pskip_motion (H264Context *const h, int *const mx, int *const my)
static void direct_dist_scale_factor (H264Context *const h)
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 uint8_t * decode_nal (H264Context *h, uint8_t *src, int *dst_length, int *consumed, int length)
static int decode_rbsp_trailing (uint8_t *src)
static void h264_luma_dc_dequant_idct_c (DCTELEM *block, int qp)
static void chroma_dc_dequant_idct_c (DCTELEM *block, int qp)
static int get_chroma_qp (int chroma_qp_index_offset, int qscale)
static int quantize_c (DCTELEM *block, uint8_t *scantable, int qscale, int intra, int seperate_dc)
static void pred4x4_vertical_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_horizontal_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_dc_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_left_dc_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_top_dc_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_128_dc_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_down_right_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_down_left_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_vertical_right_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_vertical_left_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_horizontal_up_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_horizontal_down_c (uint8_t *src, uint8_t *topright, int stride)
static void pred16x16_vertical_c (uint8_t *src, int stride)
static void pred16x16_horizontal_c (uint8_t *src, int stride)
static void pred16x16_dc_c (uint8_t *src, int stride)
static void pred16x16_left_dc_c (uint8_t *src, int stride)
static void pred16x16_top_dc_c (uint8_t *src, int stride)
static void pred16x16_128_dc_c (uint8_t *src, int stride)
static void pred16x16_plane_compat_c (uint8_t *src, int stride, const int svq3)
static void pred16x16_plane_c (uint8_t *src, int stride)
static void pred8x8_vertical_c (uint8_t *src, int stride)
static void pred8x8_horizontal_c (uint8_t *src, int stride)
static void pred8x8_128_dc_c (uint8_t *src, int stride)
static void pred8x8_left_dc_c (uint8_t *src, int stride)
static void pred8x8_top_dc_c (uint8_t *src, int stride)
static void pred8x8_dc_c (uint8_t *src, int stride)
static void pred8x8_plane_c (uint8_t *src, int stride)
static void pred8x8l_128_dc_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_left_dc_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_top_dc_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_dc_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_horizontal_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_vertical_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_down_left_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_down_right_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_vertical_right_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_horizontal_down_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_vertical_left_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_horizontal_up_c (uint8_t *src, int has_topleft, int has_topright, int stride)
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 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 (H264Context *h)
static void init_pred_ptrs (H264Context *h)
static void free_tables (H264Context *h)
static int alloc_tables (H264Context *h)
static void common_init (H264Context *h)
static int decode_init (AVCodecContext *avctx)
static void 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)
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)
static void backup_pair_border (H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize)
static void xchg_pair_border (H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int xchg)
static void hl_decode_mb (H264Context *h)
static int fill_default_ref_list (H264Context *h)
static void print_short_term (H264Context *h)
static void print_long_term (H264Context *h)
static int decode_ref_pic_list_reordering (H264Context *h)
static int pred_weight_table (H264Context *h)
static void implicit_weight_table (H264Context *h)
static void unreference_pic (H264Context *h, Picture *pic)
static void idr (H264Context *h)
static void flush_dpb (AVCodecContext *avctx)
static Pictureremove_short (H264Context *h, int frame_num)
static Pictureremove_long (H264Context *h, int i)
static int execute_ref_pic_marking (H264Context *h, MMCO *mmco, int mmco_count)
static int decode_ref_pic_marking (H264Context *h)
static int init_poc (H264Context *h)
static int decode_slice_header (H264Context *h)
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 uint16_t *qmul, int max_coeff)
static void decode_mb_skip (H264Context *h)
static int decode_mb_cavlc (H264Context *h)
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)
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 int get_cabac_cbf_ctx (H264Context *h, int cat, int idx)
static int decode_cabac_residual (H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint16_t *qmul, int max_coeff)
void compute_mb_neighboors (H264Context *h)
static int decode_mb_cabac (H264Context *h)
static void filter_mb_edgev (H264Context *h, uint8_t *pix, int stride, int bS[4], int qp)
static void filter_mb_edgecv (H264Context *h, uint8_t *pix, int stride, int bS[4], int qp)
static void filter_mb_mbaff_edgev (H264Context *h, uint8_t *pix, int stride, int bS[8], int qp[2])
static void filter_mb_mbaff_edgecv (H264Context *h, uint8_t *pix, int stride, int bS[4], int qp[2])
static void filter_mb_edgeh (H264Context *h, uint8_t *pix, int stride, int bS[4], int qp)
static void filter_mb_edgech (H264Context *h, uint8_t *pix, int stride, int bS[4], int qp)
static int decode_slice (H264Context *h)
static void decode_hrd_parameters (H264Context *h, SPS *sps)
static int decode_vui_parameters (H264Context *h, SPS *sps)
static int decode_seq_parameter_set (H264Context *h)
static int decode_picture_parameter_set (H264Context *h, int bit_length)
static int find_frame_end (H264Context *h, const uint8_t *buf, int buf_size)
static int h264_parse (AVCodecParserContext *s, AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, const uint8_t *buf, int buf_size)
static int h264_split (AVCodecContext *avctx, const uint8_t *buf, int buf_size)
static int decode_nal_units (H264Context *h, uint8_t *buf, int buf_size)
static int get_consumed_bytes (MpegEncContext *s, int pos, int buf_size)
static int decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
static int decode_end (AVCodecContext *avctx)

Variables

static VLC coeff_token_vlc [4]
static VLC chroma_dc_coeff_token_vlc
static VLC total_zeros_vlc [15]
static VLC chroma_dc_total_zeros_vlc [3]
static VLC run_vlc [6]
static VLC run7_vlc
static const uint8_t block_idx_x [16]
static const uint8_t block_idx_y [16]
static const uint8_t block_idx_xy [4][4]
AVCodec h264_decoder
AVCodecParser h264_parser


Detailed Description

H.264 / AVC / MPEG4 part10 codec.
Author:
Michael Niedermayer <michaelni@gmx.at>

Definition in file h264.c.


Define Documentation

#define CHROMA_DC_BLOCK_INDEX   26

Definition at line 43 of file h264.c.

Referenced by decode_mb_cavlc(), and decode_residual().

#define CHROMA_DC_COEFF_TOKEN_VLC_BITS   8

Definition at line 45 of file h264.c.

Referenced by decode_init_vlc(), and decode_residual().

#define CHROMA_DC_TOTAL_ZEROS_VLC_BITS   3

Definition at line 48 of file h264.c.

Referenced by decode_init_vlc(), and decode_residual().

#define COEFF_TOKEN_VLC_BITS   8

Definition at line 46 of file h264.c.

Referenced by decode_init_vlc(), and decode_residual().

#define interlaced_dct   interlaced_dct_is_a_bad_name

Definition at line 39 of file h264.c.

#define LIST_NOT_USED   -1

Definition at line 201 of file h264.c.

Referenced by decode_mb_cabac(), decode_mb_cavlc(), fill_caches(), and write_back_motion().

#define LOAD_LEFT_EDGE

Value:

const int l0= src[-1+0*stride];\
    const int l1= src[-1+1*stride];\
    const int l2= src[-1+2*stride];\
    const int l3= src[-1+3*stride];\

Definition at line 1899 of file h264.c.

Referenced by pred4x4_down_left_svq3_c(), pred4x4_down_right_c(), pred4x4_horizontal_down_c(), pred4x4_horizontal_up_c(), and pred4x4_vertical_right_c().

#define LOAD_TOP_EDGE

Value:

const int t0= src[ 0-1*stride];\
    const int t1= src[ 1-1*stride];\
    const int t2= src[ 2-1*stride];\
    const int t3= src[ 3-1*stride];\

Definition at line 1905 of file h264.c.

Referenced by pred4x4_down_left_c(), pred4x4_down_left_svq3_c(), pred4x4_down_right_c(), pred4x4_horizontal_down_c(), pred4x4_vertical_left_c(), and pred4x4_vertical_right_c().

#define LOAD_TOP_RIGHT_EDGE

Value:

const int t4= topright[0];\
    const int t5= topright[1];\
    const int t6= topright[2];\
    const int t7= topright[3];\

Definition at line 1893 of file h264.c.

Referenced by pred4x4_down_left_c(), and pred4x4_vertical_left_c().

#define LUMA_DC_BLOCK_INDEX   25

Definition at line 42 of file h264.c.

Referenced by decode_mb_cavlc(), and decode_residual().

#define MAX_MMCO_COUNT   66

Definition at line 55 of file h264.c.

Referenced by decode_ref_pic_marking().

#define MAX_PPS_COUNT   256

Definition at line 53 of file h264.c.

#define MAX_SPS_COUNT   32

Definition at line 52 of file h264.c.

#define mb_intra   mb_intra_isnt_initalized_see_mb_type

Definition at line 40 of file h264.c.

#define NAL_DPA   2

Definition at line 146 of file h264.c.

Referenced by decode_nal_units().

#define NAL_DPB   3

Definition at line 147 of file h264.c.

Referenced by decode_nal_units().

#define NAL_DPC   4

Definition at line 148 of file h264.c.

Referenced by decode_nal_units().

#define NAL_FILTER_DATA   10

Definition at line 154 of file h264.c.

Referenced by decode_nal_units().

#define NAL_IDR_SLICE   5

Definition at line 149 of file h264.c.

Referenced by decode_nal_units(), decode_ref_pic_marking(), decode_slice_header(), and init_poc().

#define NAL_PICTURE_DELIMITER   9

Definition at line 153 of file h264.c.

Referenced by decode_nal_units().

#define NAL_PPS   8

Definition at line 152 of file h264.c.

Referenced by decode_nal_units().

#define NAL_SEI   6

Definition at line 150 of file h264.c.

Referenced by decode_nal_units().

#define NAL_SLICE   1

Definition at line 145 of file h264.c.

Referenced by decode_nal_units().

#define NAL_SPS   7

Definition at line 151 of file h264.c.

Referenced by decode_nal_units().

#define PART_NOT_AVAILABLE   -2

#define PL (  )     const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;

Definition at line 2317 of file h264.c.

Referenced by reverse_dc_prediction().

#define PREDICT_8x8_DC (  ) 

Value:

int y; \
    for( y = 0; y < 8; y++ ) { \
        ((uint32_t*)src)[0] = \
        ((uint32_t*)src)[1] = v; \
        src += stride; \
    }

Definition at line 2346 of file h264.c.

Referenced by pred8x8l_128_dc_c(), pred8x8l_dc_c(), pred8x8l_left_dc_c(), and pred8x8l_top_dc_c().

#define PREDICT_8x8_LOAD_LEFT

Value:

const int l0 = ((has_topleft ? SRC(-1,-1) : SRC(-1,0)) \
                     + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \
    PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \
    const int l7 = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2

Definition at line 2319 of file h264.c.

Referenced by pred8x8l_dc_c(), pred8x8l_down_right_c(), pred8x8l_horizontal_c(), pred8x8l_horizontal_down_c(), pred8x8l_horizontal_up_c(), pred8x8l_left_dc_c(), and pred8x8l_vertical_right_c().

#define PREDICT_8x8_LOAD_TOP

Value:

const int t0 = ((has_topleft ? SRC(-1,-1) : SRC(0,-1)) \
                     + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \
    PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \
    const int t7 = ((has_topright ? SRC(8,-1) : SRC(7,-1)) \
                     + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2

Definition at line 2327 of file h264.c.

Referenced by pred8x8l_dc_c(), pred8x8l_down_left_c(), pred8x8l_down_right_c(), pred8x8l_horizontal_down_c(), pred8x8l_top_dc_c(), pred8x8l_vertical_c(), pred8x8l_vertical_left_c(), and pred8x8l_vertical_right_c().

#define PREDICT_8x8_LOAD_TOPLEFT   const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2

#define PREDICT_8x8_LOAD_TOPRIGHT

Value:

int t8, t9, t10, t11, t12, t13, t14, t15; \
    if(has_topright) { \
        PTR(8) PTR(9) PTR(10) PTR(11) PTR(12) PTR(13) PTR(14) \
        t15 = (SRC(14,-1) + 3*SRC(15,-1) + 2) >> 2; \
    } else t8=t9=t10=t11=t12=t13=t14=t15= SRC(7,-1);

Definition at line 2336 of file h264.c.

Referenced by pred8x8l_down_left_c(), and pred8x8l_vertical_left_c().

#define PT (  )     const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;

Definition at line 2325 of file h264.c.

#define PTR (  )     t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;

Definition at line 2334 of file h264.c.

#define ROW (  ) 

Value:

((uint32_t*)(src+y*stride))[0] =\
               ((uint32_t*)(src+y*stride))[1] = 0x01010101 * l##y

Referenced by pred8x8l_horizontal_c().

#define RUN7_VLC_BITS   6

Definition at line 50 of file h264.c.

Referenced by decode_init_vlc(), and decode_residual().

#define RUN_VLC_BITS   3

Definition at line 49 of file h264.c.

Referenced by decode_init_vlc(), and decode_residual().

#define SRC ( x,
 )     src[(x)+(y)*stride]

#define stride   16

#define T (  )     (x>>2) | ((x<<2) & 0xF)

#define TOTAL_ZEROS_VLC_BITS   9

Definition at line 47 of file h264.c.

Referenced by decode_init_vlc(), and decode_residual().

#define XCHG ( a,
b,
t,
xchg   ) 

Value:

t= a;\
if(xchg)\
    a= b;\
b= t;

#define XCHG ( a,
b,
t,
xchg   ) 

Value:

t= a;\
if(xchg)\
    a= b;\
b= t;

Referenced by xchg_mb_border(), and xchg_pair_border().


Enumeration Type Documentation

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 119 of file h264.c.


Function Documentation

static int alloc_tables ( H264Context h  )  [static]

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

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

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 877 of file h264.c.

References av_log(), AV_LOG_ERROR, MpegEncContext::avctx, DC_128_PRED, H264Context::intra4x4_pred_mode_cache, LEFT_DC_PRED, H264Context::left_samples_available, MpegEncContext::mb_x, MpegEncContext::mb_y, H264Context::s, s, scan8, TOP_DC_PRED, and H264Context::top_samples_available.

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

Here is the call graph for this function:

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 913 of file h264.c.

References av_log(), AV_LOG_ERROR, MpegEncContext::avctx, DC_128_PRED8x8, LEFT_DC_PRED8x8, H264Context::left_samples_available, MpegEncContext::mb_x, MpegEncContext::mb_y, H264Context::s, s, TOP_DC_PRED8x8, and H264Context::top_samples_available.

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

Here is the call graph for this function:

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

Definition at line 1674 of file h264.c.

References a, b, c, dequant_coeff, e, and stride.

Referenced by hl_decode_mb().

static void common_init ( H264Context h  )  [static]

void compute_mb_neighboors ( H264Context h  )  [inline]

static int decode_cabac_b_mb_sub_type ( H264Context h  )  [static]

Definition at line 5375 of file h264.c.

References H264Context::cabac, H264Context::cabac_state, and get_cabac().

Referenced by decode_mb_cabac().

Here is the call graph for this function:

static int decode_cabac_field_decoding_flag ( H264Context h  )  [static]

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

static int decode_cabac_mb_cbp_chroma ( H264Context h  )  [static]

Definition at line 5321 of file h264.c.

References H264Context::cabac, H264Context::cabac_state, get_cabac(), and H264Context::left_cbp.

Referenced by decode_mb_cabac().

Here is the call graph for this function:

static int decode_cabac_mb_cbp_luma ( H264Context h  )  [static]

static int decode_cabac_mb_chroma_pre_mode ( H264Context h  )  [static]

static int decode_cabac_mb_dqp ( H264Context h  )  [static]

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

Definition at line 5217 of file h264.c.

References H264Context::cabac, H264Context::cabac_state, and get_cabac().

Referenced by decode_mb_cabac().

Here is the call graph for this function:

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

Definition at line 5424 of file h264.c.

References H264Context::cabac, H264Context::cabac_state, get_cabac(), get_cabac_bypass(), and scan8.

Referenced by decode_mb_cabac().

Here is the call graph for this function:

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

Definition at line 5396 of file h264.c.

References B_TYPE, H264Context::cabac, H264Context::cabac_state, H264Context::direct_cache, get_cabac(), scan8, and H264Context::slice_type.

Referenced by decode_mb_cabac().

Here is the call graph for this function:

static int decode_cabac_mb_skip ( H264Context h  )  [static]

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

Definition at line 5392 of file h264.c.

References H264Context::cabac, H264Context::cabac_state, get_cabac(), and H264Context::neighbor_transform_size.

Referenced by decode_mb_cabac().

Here is the call graph for this function:

static int decode_cabac_mb_type ( H264Context h  )  [static]

static int decode_cabac_p_mb_sub_type ( H264Context h  )  [static]

Definition at line 5366 of file h264.c.

References H264Context::cabac, H264Context::cabac_state, and get_cabac().

Referenced by decode_mb_cabac().

Here is the call graph for this function:

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

static int decode_end ( AVCodecContext avctx  )  [static]

Definition at line 7730 of file h264.c.

References free_tables(), MPV_common_end(), AVCodecContext::priv_data, and H264Context::s.

Here is the call graph for this function:

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

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

Definition at line 6830 of file h264.c.

References MpegEncContext::gb, get_bits(), get_bits1(), get_ue_golomb(), H264Context::s, and s.

Referenced by decode_vui_parameters().

Here is the call graph for this function:

static int decode_init ( AVCodecContext avctx  )  [static]

static void decode_init_vlc ( H264Context h  )  [static]

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 5662 of file h264.c.

References av_log(), AV_LOG_ERROR, MpegEncContext::avctx, b_mb_type_info, b_sub_mb_type_info, B_TYPE, CABACContext::bytestream, CABACContext::bytestream_end, c, H264Context::cabac, CABAC_BITS, IMbInfo::cbp, H264Context::cbp_table, check_intra4x4_pred_mode(), check_intra_pred_mode(), chroma_dc_scan, H264Context::chroma_pred_mode, H264Context::chroma_pred_mode_table, H264Context::chroma_qp, PPS::chroma_qp_index_offset, DSPContext::clear_blocks, compute_mb_neighboors(), MpegEncContext::current_picture, decode_cabac_b_mb_sub_type(), decode_cabac_field_decoding_flag(), decode_cabac_mb_cbp_chroma(), decode_cabac_mb_cbp_luma(), decode_cabac_mb_chroma_pre_mode(), decode_cabac_mb_dqp(), decode_cabac_mb_intra4x4_pred_mode(), decode_cabac_mb_mvd(), decode_cabac_mb_ref(), decode_cabac_mb_skip(), decode_cabac_mb_transform_size(), decode_cabac_mb_type(), decode_cabac_p_mb_sub_type(), decode_cabac_residual(), decode_mb_skip(), H264Context::dequant4_coeff, H264Context::dequant8_coeff, SPS::direct_8x8_inference_flag, H264Context::direct_cache, MpegEncContext::dsp, ff_init_cabac_decoder(), H264Context::field_scan, H264Context::field_scan_q0, fill_caches(), fill_rectangle(), H264Context::frame_num, get_chroma_qp(), get_dct8x8_allowed(), i_mb_type_info, I_TYPE, H264Context::intra16x16_pred_mode, H264Context::intra4x4_pred_mode_cache, IS_16X16, IS_16X8, IS_8X16, IS_8x8DCT, IS_DIR, IS_DIRECT, IS_INTER, IS_INTERLACED, IS_INTRA, IS_INTRA16x16, IS_INTRA4x4, IS_INTRA_PCM, IS_SUB_4X4, IS_SUB_4X8, IS_SUB_8X4, IS_SUB_8X8, H264Context::last_qscale_diff, LIST_NOT_USED, CABACContext::low, luma_dc_field_scan, luma_dc_zigzag_scan, H264Context::mb_aff_frame, H264Context::mb_field_decoding_flag, MpegEncContext::mb_stride, MB_TYPE_16x16, MB_TYPE_16x8, MB_TYPE_8x8DCT, MB_TYPE_INTERLACED, MpegEncContext::mb_x, MpegEncContext::mb_y, H264Context::non_zero_count, p_mb_type_info, p_sub_mb_type_info, P_TYPE, pack16to32(), PMbInfo::partition_count, PICT_FRAME, MpegEncContext::picture_structure, H264Context::pps, pred(), pred_16x8_motion(), pred_8x16_motion(), pred_direct_motion(), pred_intra_mode(), IMbInfo::pred_mode, pred_motion(), H264Context::prev_mb_skipped, MpegEncContext::qscale, H264Context::ref_count, H264Context::s, s, scan8, SI_TYPE, H264Context::slice_num, H264Context::slice_table, H264Context::slice_type, H264Context::sps, H264Context::sub_mb_type, tprintf, PPS::transform_8x8_mode, IMbInfo::type, PMbInfo::type, write_back_intra_pred_mode(), write_back_motion(), write_back_non_zero_count(), H264Context::zigzag_scan, zigzag_scan8x8, and H264Context::zigzag_scan_q0.

Referenced by decode_slice().

Here is the call graph for this function:

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 4613 of file h264.c.

References align_get_bits(), av_get_pict_type_char(), av_log(), AV_LOG_ERROR, MpegEncContext::avctx, b_mb_type_info, b_sub_mb_type_info, B_TYPE, buf, IMbInfo::cbp, check_intra4x4_pred_mode(), check_intra_pred_mode(), CHROMA_DC_BLOCK_INDEX, chroma_dc_scan, H264Context::chroma_pred_mode, chroma_qp, H264Context::chroma_qp, PPS::chroma_qp_index_offset, DSPContext::clear_blocks, MpegEncContext::current_picture, decode_mb_skip(), decode_residual(), H264Context::dequant4_coeff, H264Context::dequant8_coeff, SPS::direct_8x8_inference_flag, MpegEncContext::dsp, H264Context::field_scan, H264Context::field_scan_q0, fill_caches(), fill_rectangle(), H264Context::frame_num, MpegEncContext::gb, get_bits(), get_bits1(), get_chroma_qp(), get_dct8x8_allowed(), get_se_golomb(), get_te0_golomb(), get_ue_golomb(), golomb_to_inter_cbp, golomb_to_intra4x4_cbp, i_mb_type_info, I_TYPE, H264Context::inter_gb_ptr, H264Context::intra16x16_pred_mode, H264Context::intra4x4_pred_mode_cache, H264Context::intra_gb_ptr, IS_16X16, IS_16X8, IS_8X16, IS_8x8DCT, IS_DIR, IS_DIRECT, IS_INTER, IS_INTERLACED, IS_INTRA, IS_INTRA16x16, IS_INTRA4x4, IS_INTRA_PCM, IS_REF0, IS_SUB_4X4, IS_SUB_4X8, IS_SUB_8X4, IS_SUB_8X8, LIST_NOT_USED, LUMA_DC_BLOCK_INDEX, luma_dc_field_scan, luma_dc_zigzag_scan, H264Context::mb_aff_frame, H264Context::mb_field_decoding_flag, MpegEncContext::mb_skip_run, MpegEncContext::mb_stride, MB_TYPE_16x16, MB_TYPE_16x8, MB_TYPE_8x8DCT, MB_TYPE_INTERLACED, MpegEncContext::mb_x, MpegEncContext::mb_y, H264Context::non_zero_count, p_mb_type_info, p_sub_mb_type_info, P_TYPE, pack16to32(), PMbInfo::partition_count, PICT_FRAME, MpegEncContext::picture_structure, H264Context::pps, pred_16x8_motion(), pred_8x16_motion(), pred_direct_motion(), pred_intra_mode(), IMbInfo::pred_mode, pred_motion(), H264Context::prev_mb_skipped, MpegEncContext::qscale, H264Context::ref_count, H264Context::s, s, scan8, show_bits(), SI_TYPE, H264Context::slice_num, H264Context::slice_table, H264Context::slice_type, SP_TYPE, H264Context::sps, H264Context::sub_mb_type, tprintf, PPS::transform_8x8_mode, IMbInfo::type, PMbInfo::type, write_back_intra_pred_mode(), write_back_motion(), write_back_non_zero_count(), H264Context::zigzag_scan, zigzag_scan8x8_cavlc, and H264Context::zigzag_scan_q0.

Referenced by decode_slice().

Here is the call graph for this function:

static void decode_mb_skip ( H264Context h  )  [static]

static uint8_t* decode_nal ( H264Context h,
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 1441 of file h264.c.

References av_fast_realloc(), H264Context::nal_ref_idc, H264Context::nal_unit_type, H264Context::rbsp_buffer, and H264Context::rbsp_buffer_size.

Referenced by decode_nal_units().

Here is the call graph for this function:

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

Definition at line 7207 of file h264.c.

References av_log(), AV_LOG_DEBUG, AV_LOG_ERROR, MpegEncContext::avctx, AVDISCARD_ALL, AVDISCARD_BIDIR, AVDISCARD_NONKEY, AVDISCARD_NONREF, B_TYPE, CODEC_FLAG_LOW_DELAY, MpegEncContext::current_picture_ptr, MpegEncContext::data_partitioning, AVCodecContext::debug, decode_nal(), decode_picture_parameter_set(), decode_rbsp_trailing(), decode_seq_parameter_set(), decode_slice(), decode_slice_header(), execute_ref_pic_marking(), FF_DEBUG_STARTCODE, ff_er_frame_end(), MpegEncContext::flags, H264Context::frame_num, H264Context::frame_num_offset, MpegEncContext::gb, AVCodecContext::has_b_frames, MpegEncContext::hurry_up, I_TYPE, idr(), init_get_bits(), H264Context::inter_gb, H264Context::inter_gb_ptr, H264Context::intra_gb, H264Context::intra_gb_ptr, H264Context::is_avc, MpegEncContext::low_delay, H264Context::mmco, H264Context::mmco_index, MPV_frame_end(), NAL_DPA, NAL_DPB, NAL_DPC, NAL_FILTER_DATA, NAL_IDR_SLICE, H264Context::nal_length_size, NAL_PICTURE_DELIMITER, NAL_PPS, H264Context::nal_ref_idc, NAL_SEI, NAL_SLICE, NAL_SPS, H264Context::nal_unit_type, NULL, MpegEncContext::pict_type, H264Context::poc_lsb, H264Context::poc_msb, H264Context::prev_frame_num, H264Context::prev_frame_num_offset, H264Context::prev_poc_lsb, H264Context::prev_poc_msb, H264Context::redundant_pic_count, H264Context::s, s, AVCodecContext::skip_frame, H264Context::slice_num, and H264Context::slice_type.

Referenced by decode_frame().

Here is the call graph for this function:

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

static int decode_rbsp_trailing ( uint8_t *  src  )  [static]

identifies the exact end of the bitstream

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

Definition at line 1577 of file h264.c.

References r, and tprintf.

Referenced by decode_nal_units().

static int decode_ref_pic_list_reordering ( H264Context h  )  [static]

static int decode_ref_pic_marking ( H264Context h  )  [static]

static int decode_residual ( H264Context h,
GetBitContext gb,
DCTELEM block,
int  n,
const uint8_t *  scantable,
const uint16_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 4428 of file h264.c.

References ABS, av_log(), AV_LOG_ERROR, MpegEncContext::avctx, CHROMA_DC_BLOCK_INDEX, CHROMA_DC_COEFF_TOKEN_VLC_BITS, CHROMA_DC_TOTAL_ZEROS_VLC_BITS, COEFF_TOKEN_VLC_BITS, get_bits(), get_bits1(), get_level_prefix(), get_vlc2(), level, LUMA_DC_BLOCK_INDEX, MpegEncContext::mb_x, MpegEncContext::mb_y, pred_non_zero_count(), run, RUN7_VLC_BITS, RUN_VLC_BITS, H264Context::s, s, scan8, VLC::table, TOTAL_ZEROS_VLC_BITS, and tprintf.

Referenced by decode_mb_cavlc().

Here is the call graph for this function:

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

static int decode_slice ( H264Context h  )  [static]

static int decode_slice_header ( H264Context h  )  [static]

decodes a slice header. this will allso call MPV_common_init() and frame_start() as needed

Definition at line 4123 of file h264.c.

References alloc_tables, av_get_pict_type_char(), av_log(), AV_LOG_DEBUG, AV_LOG_ERROR, MpegEncContext::avctx, AVDISCARD_ALL, AVDISCARD_BIDIR, AVDISCARD_NONKEY, AVDISCARD_NONREF, H264Context::b8_stride, H264Context::b_stride, B_TYPE, PPS::cabac, H264Context::cabac_init_idc, H264Context::chroma_qp, PPS::chroma_qp_index_offset, MpegEncContext::context_initialized, SPS::crop_bottom, SPS::crop_left, SPS::crop_right, SPS::crop_top, H264Context::curr_pic_num, MpegEncContext::current_picture, MpegEncContext::current_picture_ptr, H264Context::deblocking_filter, PPS::deblocking_filter_parameters_present, AVCodecContext::debug, decode_ref_pic_list_reordering(), decode_ref_pic_marking(), SPS::delta_pic_order_always_zero_flag, H264Context::delta_poc, H264Context::delta_poc_bottom, AVRational::den, H264Context::direct_spatial_mv_pred, MpegEncContext::dropable, MpegEncContext::dsp, FF_DEBUG_PICT_INFO, ff_h264_idct_add_c(), Picture::field_poc, H264Context::field_scan, field_scan, H264Context::field_scan_q0, fill_default_ref_list(), SPS::frame_mbs_only_flag, H264Context::frame_num, Picture::frame_num, frame_start(), free_tables(), MpegEncContext::gb, get_bits(), get_bits1(), get_chroma_qp(), get_se_golomb(), get_ue_golomb(), DSPContext::h264_idct_add, AVCodecContext::height, MpegEncContext::height, I_TYPE, implicit_weight_table(), init_poc(), PPS::init_qp, H264Context::last_qscale_diff, SPS::log2_max_frame_num, SPS::log2_max_poc_lsb, H264Context::max_pic_num, SPS::mb_aff, H264Context::mb_aff_frame, SPS::mb_height, MpegEncContext::mb_height, PPS::mb_slice_group_map_type, SPS::mb_width, MpegEncContext::mb_width, MpegEncContext::mb_x, MpegEncContext::mb_y, memcpy, MPV_common_end(), MPV_common_init(), NAL_IDR_SLICE, H264Context::nal_ref_idc, H264Context::nal_unit_type, SPS::num_units_in_tick, P_TYPE, PPS::pic_order_present, PICT_FRAME, PICT_TOP_FIELD, MpegEncContext::pict_type, MpegEncContext::picture_structure, H264Context::poc_lsb, SPS::poc_type, H264Context::pps, H264Context::pps_buffer, pred_weight_table(), MpegEncContext::qscale, PPS::redundant_pic_cnt_present, H264Context::redundant_pic_count, PPS::ref_count, H264Context::ref_count, MpegEncContext::resync_mb_x, MpegEncContext::resync_mb_y, H264Context::s, s, AVCodecContext::sample_aspect_ratio, SPS::sar, SI_TYPE, AVCodecContext::skip_loop_filter, H264Context::slice_alpha_c0_offset, H264Context::slice_beta_offset, PPS::slice_group_count, H264Context::slice_num, H264Context::slice_type, H264Context::slice_type_fixed, SP_TYPE, H264Context::sps, H264Context::sps_buffer, PPS::sps_id, T, AVCodecContext::time_base, SPS::time_scale, SPS::timing_info_present_flag, SPS::transform_bypass, H264Context::use_weight, H264Context::use_weight_chroma, PPS::weighted_bipred_idc, PPS::weighted_pred, AVCodecContext::width, MpegEncContext::width, zigzag_scan, H264Context::zigzag_scan, and H264Context::zigzag_scan_q0.

Referenced by decode_nal_units().

Here is the call graph for this function:

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

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

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

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

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

Definition at line 995 of file h264.c.

References PART_NOT_AVAILABLE, and tprintf.

Referenced by pred_8x16_motion(), and pred_motion().

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

static int fill_default_ref_list ( H264Context h  )  [static]

static void fill_rectangle ( void *  vp,
int  w,
int  h,
int  stride,
uint32_t  val,
int  size 
) [inline, static]

fill a rectangle.

Parameters:
h height of the rectangle, should be a constant
w width of the rectangle, should be a constant
size the size of val (1 or 4), should be a constant

Definition at line 380 of file h264.c.

References STRIDE_ALIGN.

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]

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

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

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

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

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

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

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

finds the end of the current frame in the bitstream.

Returns:
the position of the first byte of the next frame, or -1

Definition at line 7119 of file h264.c.

References END_NOT_FOUND, ParseContext::frame_start_found, MpegEncContext::parse_context, H264Context::s, ParseContext::state, and tprintf.

Referenced by decode_frame(), h264_parse(), and jpeg_parse().

static void flush_dpb ( AVCodecContext avctx  )  [static]

Definition at line 3802 of file h264.c.

References MpegEncContext::current_picture_ptr, H264Context::delayed_output_pic, H264Context::delayed_pic, idr(), NULL, AVCodecContext::priv_data, and H264Context::s.

Here is the call graph for this function:

static void frame_start ( H264Context h  )  [static]

static void free_tables ( H264Context h  )  [static]

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

Definition at line 5463 of file h264.c.

References H264Context::left_cbp, and scan8.

Referenced by decode_cabac_residual().

static int get_chroma_qp ( int  chroma_qp_index_offset,
int  qscale 
) [inline, static]

gets the chroma qp.

Definition at line 1722 of file h264.c.

References chroma_qp.

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

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 7358 of file h264.c.

References CODEC_FLAG_TRUNCATED, MpegEncContext::flags, ParseContext::last_index, and MpegEncContext::parse_context.

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

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

Definition at line 4391 of file h264.c.

References av_log(), AV_LOG_DEBUG, buf, CLOSE_READER, get_bits_count(), GET_CACHE, LAST_SKIP_BITS, NULL, OPEN_READER, and UPDATE_CACHE.

Referenced by decode_residual().

Here is the call graph for this function:

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

idct tranforms the 16 dc values and dequantize them.

Parameters:
qp quantization parameter

Definition at line 1594 of file h264.c.

References dequant_coeff, offset, and stride.

Referenced by hl_decode_mb().

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

Definition at line 7160 of file h264.c.

References ff_combine_frame(), find_frame_end(), NULL, MpegEncContext::parse_context, AVCodecParserContext::priv_data, and H264Context::s.

Here is the call graph for this function:

static int h264_split ( AVCodecContext avctx,
const uint8_t *  buf,
int  buf_size 
) [static]

Definition at line 7182 of file h264.c.

static void hl_decode_mb ( H264Context h  )  [static]

Definition at line 3219 of file h264.c.

References DSPContext::add_pixels4, DSPContext::add_pixels8, DSPContext::avg_h264_chroma_pixels_tab, DSPContext::avg_h264_qpel_pixels_tab, backup_mb_border(), backup_pair_border(), DSPContext::biweight_h264_pixels_tab, H264Context::block_offset, chroma_dc_dequant_idct_c(), H264Context::chroma_pred_mode, chroma_qp, H264Context::chroma_qp, CODEC_FLAG_GRAY, MpegEncContext::codec_id, CODEC_ID_H264, MpegEncContext::current_picture, H264Context::deblocking_filter, MpegEncContext::decode, DIAG_DOWN_LEFT_PRED, MpegEncContext::dsp, MpegEncContext::encoding, fill_caches(), filter_mb(), MpegEncContext::flags, DSPContext::h264_idct8_add, DSPContext::h264_idct_add, h264_luma_dc_dequant_idct_c(), hl_motion(), idct_add(), H264Context::intra16x16_pred_mode, H264Context::intra4x4_pred_mode_cache, IS_8x8DCT, IS_INTRA, IS_INTRA4x4, IS_INTRA_PCM, MpegEncContext::linesize, H264Context::mb_aff_frame, H264Context::mb_field_decoding_flag, MpegEncContext::mb_stride, MpegEncContext::mb_x, MpegEncContext::mb_y, NULL, H264Context::pred16x16, H264Context::pred4x4, H264Context::pred8x8, H264Context::pred8x8l, DSPContext::put_h264_chroma_pixels_tab, DSPContext::put_h264_qpel_pixels_tab, MpegEncContext::qscale, H264Context::s, s, scan8, H264Context::sps, svq3_add_idct_c(), svq3_luma_dc_dequant_idct_c(), H264Context::topleft_samples_available, H264Context::topright_samples_available, tprintf, SPS::transform_bypass, MpegEncContext::uvlinesize, VERT_LEFT_PRED, DSPContext::weight_h264_pixels_tab, xchg_mb_border(), and xchg_pair_border().

Referenced by decode_slice(), and svq3_decode_frame().

Here is the call graph for this function:

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]

static void idr ( H264Context h  )  [static]

instantaneous decoder refresh.

Definition at line 3783 of file h264.c.

References H264Context::long_ref, H264Context::long_ref_count, NULL, H264Context::short_ref, H264Context::short_ref_count, and unreference_pic().

Referenced by decode_nal_units(), and flush_dpb().

Here is the call graph for this function:

static void implicit_weight_table ( H264Context h  )  [static]

static int init_poc ( H264Context h  )  [static]

static void init_pred_ptrs ( H264Context h  )  [static]

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]

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 2710 of file h264.c.

References H264Context::implicit_weight, mc_part_std(), mc_part_weighted(), scan8, and H264Context::use_weight.

Referenced by hl_motion().

Here is the call graph for this function:

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 2609 of file h264.c.

References MpegEncContext::mb_x, MpegEncContext::mb_y, mc_dir_part(), H264Context::ref_list, H264Context::s, s, scan8, and MpegEncContext::uvlinesize.

Referenced by mc_part().

Here is the call graph for this function:

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]

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

static void pred16x16_128_dc_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2129 of file h264.c.

Referenced by init_pred_ptrs().

static void pred16x16_dc_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2075 of file h264.c.

Referenced by init_pred_ptrs().

static void pred16x16_horizontal_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2064 of file h264.c.

Referenced by init_pred_ptrs().

static void pred16x16_left_dc_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2096 of file h264.c.

Referenced by init_pred_ptrs().

static void pred16x16_plane_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2180 of file h264.c.

References pred16x16_plane_compat_c().

Referenced by init_pred_ptrs().

Here is the call graph for this function:

static void pred16x16_plane_compat_c ( uint8_t *  src,
int  stride,
const int  svq3 
) [inline, static]

Definition at line 2140 of file h264.c.

References a, b, cm, cropTbl, and MAX_NEG_CROP.

Referenced by pred16x16_plane_c(), and pred16x16_plane_svq3_c().

static void pred16x16_top_dc_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2113 of file h264.c.

Referenced by init_pred_ptrs().

static void pred16x16_vertical_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2049 of file h264.c.

References a, b, and c.

Referenced by init_pred_ptrs().

static void pred4x4_128_dc_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 1885 of file h264.c.

Referenced by init_pred_ptrs().

static void pred4x4_dc_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 1857 of file h264.c.

Referenced by init_pred_ptrs().

static void pred4x4_down_left_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 1934 of file h264.c.

References LOAD_TOP_EDGE, LOAD_TOP_RIGHT_EDGE, t0, t1, t2, t3, t4, t5, t6, and t7.

Referenced by init_pred_ptrs().

static void pred4x4_down_right_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 1911 of file h264.c.

References LOAD_LEFT_EDGE, LOAD_TOP_EDGE, t0, t1, t2, and t3.

Referenced by init_pred_ptrs().

static void pred4x4_horizontal_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 1850 of file h264.c.

Referenced by init_pred_ptrs().

static void pred4x4_horizontal_down_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 2025 of file h264.c.

References __attribute__(), LOAD_LEFT_EDGE, LOAD_TOP_EDGE, t0, t1, t2, and t3.

Referenced by init_pred_ptrs().

Here is the call graph for this function:

static void pred4x4_horizontal_up_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 2004 of file h264.c.

References LOAD_LEFT_EDGE.

Referenced by init_pred_ptrs().

static void pred4x4_left_dc_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 1867 of file h264.c.

Referenced by init_pred_ptrs().

static void pred4x4_top_dc_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 1876 of file h264.c.

Referenced by init_pred_ptrs().

static void pred4x4_vertical_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 1842 of file h264.c.

References a.

Referenced by init_pred_ptrs().

static void pred4x4_vertical_left_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 1981 of file h264.c.

References __attribute__(), LOAD_TOP_EDGE, LOAD_TOP_RIGHT_EDGE, t0, t1, t2, t3, t4, t5, t6, and t7.

Referenced by init_pred_ptrs().

Here is the call graph for this function:

static void pred4x4_vertical_right_c ( uint8_t *  src,
uint8_t *  topright,
int  stride 
) [static]

Definition at line 1957 of file h264.c.

References __attribute__(), LOAD_LEFT_EDGE, LOAD_TOP_EDGE, t0, t1, t2, and t3.

Referenced by init_pred_ptrs().

Here is the call graph for this function:

static void pred8x8_128_dc_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2204 of file h264.c.

Referenced by init_pred_ptrs().

static void pred8x8_dc_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2258 of file h264.c.

Referenced by init_pred_ptrs().

static void pred8x8_horizontal_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2195 of file h264.c.

Referenced by init_pred_ptrs().

static void pred8x8_left_dc_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2213 of file h264.c.

Referenced by init_pred_ptrs().

static void pred8x8_plane_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2283 of file h264.c.

References a, b, cm, cropTbl, and MAX_NEG_CROP.

Referenced by init_pred_ptrs().

static void pred8x8_top_dc_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2235 of file h264.c.

Referenced by init_pred_ptrs().

static void pred8x8_vertical_c ( uint8_t *  src,
int  stride 
) [static]

Definition at line 2184 of file h264.c.

References a, and b.

Referenced by init_pred_ptrs().

static void pred8x8l_128_dc_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2354 of file h264.c.

References PREDICT_8x8_DC.

Referenced by init_pred_ptrs().

static void pred8x8l_dc_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2370 of file h264.c.

References PREDICT_8x8_DC, PREDICT_8x8_LOAD_LEFT, PREDICT_8x8_LOAD_TOP, t0, t1, t2, t3, t4, t5, t6, and t7.

Referenced by init_pred_ptrs().

static void pred8x8l_down_left_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2401 of file h264.c.

References PREDICT_8x8_LOAD_TOP, PREDICT_8x8_LOAD_TOPRIGHT, SRC, t0, t1, t10, t11, t12, t2, t3, t4, t5, t6, t7, t8, and t9.

Referenced by init_pred_ptrs().

static void pred8x8l_down_right_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2421 of file h264.c.

References PREDICT_8x8_LOAD_LEFT, PREDICT_8x8_LOAD_TOP, PREDICT_8x8_LOAD_TOPLEFT, SRC, t0, t1, t2, t3, t4, t5, t6, and t7.

Referenced by init_pred_ptrs().

static void pred8x8l_horizontal_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2378 of file h264.c.

References PREDICT_8x8_LOAD_LEFT, and ROW.

Referenced by init_pred_ptrs().

static void pred8x8l_horizontal_down_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2471 of file h264.c.

References PREDICT_8x8_LOAD_LEFT, PREDICT_8x8_LOAD_TOP, PREDICT_8x8_LOAD_TOPLEFT, SRC, t0, t1, t2, t3, t4, t5, and t6.

Referenced by init_pred_ptrs().

static void pred8x8l_horizontal_up_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2526 of file h264.c.

References PREDICT_8x8_LOAD_LEFT, and SRC.

Referenced by init_pred_ptrs().

static void pred8x8l_left_dc_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2358 of file h264.c.

References PREDICT_8x8_DC, and PREDICT_8x8_LOAD_LEFT.

Referenced by init_pred_ptrs().

static void pred8x8l_top_dc_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2364 of file h264.c.

References PREDICT_8x8_DC, PREDICT_8x8_LOAD_TOP, t0, t1, t2, t3, t4, t5, t6, and t7.

Referenced by init_pred_ptrs().

static void pred8x8l_vertical_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2386 of file h264.c.

References PREDICT_8x8_LOAD_TOP, t0, t1, t2, t3, t4, t5, t6, and t7.

Referenced by init_pred_ptrs().

static void pred8x8l_vertical_left_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 2499 of file h264.c.

References PREDICT_8x8_LOAD_TOP, PREDICT_8x8_LOAD_TOPRIGHT, SRC, t0, t1, t10, t11, t12, t2, t3, t4, t5, t6, t7, t8, and t9.

Referenced by init_pred_ptrs().

static void pred8x8l_vertical_right_c ( uint8_t *  src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]