Logo Search packages:      
Sourcecode: blender version File versions

h264.c File Reference


Detailed Description

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

Definition in file h264.c.

#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"

Go to the source code of this file.

Classes

struct  H264Context
struct  MMCO
struct  PPS
struct  SPS

Defines

#define ALLOW_INTERLACE
#define CHROMA_DC_BLOCK_INDEX   26
#define CHROMA_DC_COEFF_TOKEN_VLC_BITS   8
#define CHROMA_DC_TOTAL_ZEROS_VLC_BITS   3
#define COEFF_TOKEN_VLC_BITS   8
#define DECODE_SIGNIFICANCE(coefs, sig_off, last_off)
#define FRAME_MBAFF   h->mb_aff_frame
#define interlaced_dct   interlaced_dct_is_a_bad_name
#define LIST_NOT_USED   -1
#define LOAD_LEFT_EDGE
#define LOAD_TOP_EDGE
#define LOAD_TOP_RIGHT_EDGE
#define LUMA_DC_BLOCK_INDEX   25
#define MAP_F2F(idx, mb_type)
#define MAP_F2F(idx, mb_type)
#define MAP_MVS
#define MAX_MMCO_COUNT   66
#define MAX_PPS_COUNT   256
#define MAX_SPS_COUNT   32
#define MB_FIELD   h->mb_field_decoding_flag
#define mb_intra   mb_intra_isnt_initalized_see_mb_type
#define MB_MBAFF   h->mb_mbaff
#define MB_TYPE_16x16_OR_INTRA   (MB_TYPE_16x16|MB_TYPE_INTRA4x4|MB_TYPE_INTRA16x16|MB_TYPE_INTRA_PCM)
#define NAL_AUD   9
#define NAL_AUXILIARY_SLICE   19
#define NAL_DPA   2
#define NAL_DPB   3
#define NAL_DPC   4
#define NAL_END_SEQUENCE   10
#define NAL_END_STREAM   11
#define NAL_FILLER_DATA   12
#define NAL_IDR_SLICE   5
#define NAL_PPS   8
#define NAL_SEI   6
#define NAL_SLICE   1
#define NAL_SPS   7
#define NAL_SPS_EXT   13
#define PART_NOT_AVAILABLE   -2
#define PL(y)   const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
#define PREDICT_8x8_DC(v)
#define PREDICT_8x8_LOAD_LEFT
#define PREDICT_8x8_LOAD_TOP
#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
#define PT(x)   const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
#define PTR(x)   t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
#define ROW(y)
#define RUN7_VLC_BITS   6
#define RUN_VLC_BITS   3
#define SET_DIAG_MV(MV_OP, REF_OP, X4, Y4)
#define SRC(x, y)   src[(x)+(y)*stride]
#define stride   16
#define T(x)   (x>>3) | ((x&7)<<3)
#define T(x)   (x>>2) | ((x<<2) & 0xF)
#define TOTAL_ZEROS_VLC_BITS   9
#define XCHG(a, b, t, xchg)
#define XCHG(a, b, t, xchg)

Enumerations

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

Functions

static int alloc_tables (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 backup_pair_border (H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize)
static int check_intra4x4_pred_mode (H264Context *h)
static int check_intra_pred_mode (H264Context *h, int mode)
static void chroma_dc_dequant_idct_c (DCTELEM *block, int qp, int qmul)
static void common_init (H264Context *h)
static void compute_mb_neighbors (H264Context *h)
static int decode_cabac_b_mb_sub_type (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_cbp_chroma (H264Context *h)
static int decode_cabac_mb_cbp_luma (H264Context *h)
static int decode_cabac_mb_chroma_pre_mode (H264Context *h)
static int decode_cabac_mb_dqp (H264Context *h)
static int decode_cabac_mb_intra4x4_pred_mode (H264Context *h, int pred_mode)
static int decode_cabac_mb_mvd (H264Context *h, int list, int n, int l)
static int decode_cabac_mb_ref (H264Context *h, int list, int n)
static int decode_cabac_mb_skip (H264Context *h, int mb_x, int mb_y)
static int decode_cabac_mb_transform_size (H264Context *h)
static int decode_cabac_mb_type (H264Context *h)
static int decode_cabac_p_mb_sub_type (H264Context *h)
static int decode_cabac_residual (H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff)
static int decode_end (AVCodecContext *avctx)
static int decode_frame (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size)
static void decode_hrd_parameters (H264Context *h, SPS *sps)
static int decode_init (AVCodecContext *avctx)
static void decode_init_vlc (H264Context *h)
static int decode_mb_cabac (H264Context *h)
static int decode_mb_cavlc (H264Context *h)
static void decode_mb_skip (H264Context *h)
static uint8_t * decode_nal (H264Context *h, uint8_t *src, int *dst_length, int *consumed, int length)
static int decode_nal_units (H264Context *h, uint8_t *buf, int buf_size)
static int decode_picture_parameter_set (H264Context *h, int bit_length)
static int decode_rbsp_trailing (uint8_t *src)
static int decode_ref_pic_list_reordering (H264Context *h)
static int decode_ref_pic_marking (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)
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 int decode_sei (H264Context *h)
static int decode_seq_parameter_set (H264Context *h)
static int decode_slice (H264Context *h)
static int decode_slice_header (H264Context *h)
static int decode_unregistered_user_data (H264Context *h, int size)
static int decode_vui_parameters (H264Context *h, SPS *sps)
static void direct_dist_scale_factor (H264Context *const h)
static void direct_ref_list_init (H264Context *const h)
static int execute_ref_pic_marking (H264Context *h, MMCO *mmco, int mmco_count)
static int fetch_diagonal_mv (H264Context *h, const int16_t **C, int i, int list, int part_width)
static void fill_caches (H264Context *h, int mb_type, int for_deblock)
static int fill_default_ref_list (H264Context *h)
static int fill_mbaff_ref_list (H264Context *h)
static always_inline void fill_rectangle (void *vp, int w, int h, int stride, uint32_t val, int size)
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_edgech (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_edgeh (H264Context *h, uint8_t *pix, int stride, int bS[4], int qp)
static void filter_mb_edgev (H264Context *h, uint8_t *pix, int stride, int bS[4], int qp)
static void filter_mb_mbaff_edgecv (H264Context *h, uint8_t *pix, int stride, int bS[8], int qp[2])
static void filter_mb_mbaff_edgev (H264Context *h, uint8_t *pix, int stride, int bS[8], int qp[2])
static int find_frame_end (H264Context *h, const uint8_t *buf, int buf_size)
static void flush_dpb (AVCodecContext *avctx)
static int frame_start (H264Context *h)
static void free_tables (H264Context *h)
static int get_cabac_cbf_ctx (H264Context *h, int cat, int idx)
static int get_chroma_qp (int chroma_qp_index_offset, int qscale)
static int get_consumed_bytes (MpegEncContext *s, int pos, int buf_size)
static int get_dct8x8_allowed (H264Context *h)
static int get_level_prefix (GetBitContext *gb)
static void h264_luma_dc_dequant_idct_c (DCTELEM *block, int qp, int qmul)
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 void hl_decode_mb (H264Context *h)
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 idr (H264Context *h)
static void implicit_weight_table (H264Context *h)
static void init_dequant4_coeff_table (H264Context *h)
static void init_dequant8_coeff_table (H264Context *h)
static void init_dequant_tables (H264Context *h)
static int init_poc (H264Context *h)
static void init_pred_ptrs (H264Context *h)
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 (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 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 always_inline uint32_t pack16to32 (int a, int b)
static void pred16x16_128_dc_c (uint8_t *src, int stride)
static void pred16x16_dc_c (uint8_t *src, int stride)
static void pred16x16_horizontal_c (uint8_t *src, int stride)
static void pred16x16_left_dc_c (uint8_t *src, int stride)
static void pred16x16_plane_c (uint8_t *src, int stride)
static void pred16x16_plane_compat_c (uint8_t *src, int stride, const int svq3)
static void pred16x16_top_dc_c (uint8_t *src, int stride)
static void pred16x16_vertical_c (uint8_t *src, int stride)
static void pred4x4_128_dc_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_down_left_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_horizontal_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 pred4x4_horizontal_up_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_vertical_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_vertical_right_c (uint8_t *src, uint8_t *topright, int stride)
static void pred8x8_128_dc_c (uint8_t *src, int stride)
static void pred8x8_dc_c (uint8_t *src, int stride)
static void pred8x8_horizontal_c (uint8_t *src, int stride)
static void pred8x8_left_dc_c (uint8_t *src, int stride)
static void pred8x8_plane_c (uint8_t *src, int stride)
static void pred8x8_top_dc_c (uint8_t *src, int stride)
static void pred8x8_vertical_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_dc_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_horizontal_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_horizontal_up_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_vertical_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_vertical_right_c (uint8_t *src, int has_topleft, int has_topright, int stride)
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_direct_motion (H264Context *const h, int *mb_type)
static int pred_intra_mode (H264Context *h, int n)
static void pred_motion (H264Context *const h, int n, int part_width, int list, int ref, int *const mx, int *const my)
static int pred_non_zero_count (H264Context *h, int n)
static void pred_pskip_motion (H264Context *const h, int *const mx, int *const my)
static int pred_weight_table (H264Context *h)
static void predict_field_decoding_flag (H264Context *h)
static void prefetch_motion (H264Context *h, int list)
static void print_long_term (H264Context *h)
static void print_short_term (H264Context *h)
static int quantize_c (DCTELEM *block, uint8_t *scantable, int qscale, int intra, int seperate_dc)
static Pictureremove_long (H264Context *h, int i)
static Pictureremove_short (H264Context *h, int frame_num)
static void svq3_add_idct_c (uint8_t *dst, DCTELEM *block, int stride, int qp, int dc)
static void svq3_luma_dc_dequant_idct_c (DCTELEM *block, int qp)
static void unreference_pic (H264Context *h, Picture *pic)
static void write_back_intra_pred_mode (H264Context *h)
static void write_back_motion (H264Context *h, int mb_type)
static void write_back_non_zero_count (H264Context *h)
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 xchg_pair_border (H264Context *h, uint8_t *src_y, uint8_t *src_cb, uint8_t *src_cr, int linesize, int uvlinesize, int xchg)

Variables

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


Generated by  Doxygen 1.6.0   Back to index