libavcodec/h264_cabac.c File Reference

H.264 / AVC / MPEG4 part10 cabac decoding. More...

#include "internal.h"
#include "dsputil.h"
#include "avcodec.h"
#include "h264.h"
#include "h264data.h"
#include "h264_mvpred.h"
#include "golomb.h"
#include "cabac.h"
#include <assert.h>

Go to the source code of this file.

Defines

#define CABAC   1
#define DECODE_CABAC_MB_MVD(h,list,n)
#define CABAC_ON_STACK
#define CC   &cc
#define DECODE_SIGNIFICANCE(coefs, sig_off, last_off)

Functions

void ff_h264_init_cabac_states (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_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_p_mb_sub_type (H264Context *h)
static int decode_cabac_b_mb_sub_type (H264Context *h)
static int decode_cabac_mb_ref (H264Context *h, int list, int n)
static int decode_cabac_mb_mvd (H264Context *h, int ctxbase, int amvd, int *mvda)
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, 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)
int ff_h264_decode_mb_cabac (H264Context *h)
 decodes a macroblock

Variables

static const int8_t cabac_context_init_I [460][2]
static const int8_t cabac_context_init_PB [3][460][2]


Detailed Description

H.264 / AVC / MPEG4 part10 cabac decoding.

Author:
Michael Niedermayer <michaelni@gmx.at>

Definition in file h264_cabac.c.


Define Documentation

#define CABAC   1

Definition at line 28 of file h264_cabac.c.

#define CABAC_ON_STACK

#define CC   &cc

#define DECODE_CABAC_MB_MVD ( h,
list,
 ) 

Value:

{\
    int amvd0 = h->mvd_cache[list][scan8[n] - 1][0] +\
                h->mvd_cache[list][scan8[n] - 8][0];\
    int amvd1 = h->mvd_cache[list][scan8[n] - 1][1] +\
                h->mvd_cache[list][scan8[n] - 8][1];\
\
    mx += decode_cabac_mb_mvd( h, 40, amvd0, &mpx );\
    my += decode_cabac_mb_mvd( h, 47, amvd1, &mpy );\
}

Definition at line 948 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

#define DECODE_SIGNIFICANCE ( coefs,
sig_off,
last_off   ) 

Value:

for(last= 0; last < coefs; last++) { \
            uint8_t *sig_ctx = significant_coeff_ctx_base + sig_off; \
            if( get_cabac( CC, sig_ctx )) { \
                uint8_t *last_ctx = last_coeff_ctx_base + last_off; \
                index[coeff_count++] = last; \
                if( get_cabac( CC, last_ctx ) ) { \
                    last= max_coeff; \
                    break; \
                } \
            } \
        }\
        if( last == max_coeff -1 ) {\
            index[coeff_count++] = last;\
        }

Referenced by decode_cabac_residual_internal().


Function Documentation

DECLARE_ASM_CONST ( ,
uint8_t  ,
last_coeff_flag_offset_8x8   
)

static int decode_cabac_b_mb_sub_type ( H264Context h  )  [static]

Definition at line 867 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

static int decode_cabac_field_decoding_flag ( H264Context h  )  [static]

Definition at line 708 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

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

Definition at line 720 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

static int decode_cabac_mb_cbp_chroma ( H264Context h  )  [static]

Definition at line 839 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

static int decode_cabac_mb_cbp_luma ( H264Context h  )  [static]

Definition at line 823 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

static int decode_cabac_mb_chroma_pre_mode ( H264Context h  )  [static]

Definition at line 799 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

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

Definition at line 786 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

static int decode_cabac_mb_mvd ( H264Context h,
int  ctxbase,
int  amvd,
int *  mvda 
) [static]

Definition at line 912 of file h264_cabac.c.

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

Definition at line 884 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

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

Definition at line 750 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

static int decode_cabac_p_mb_sub_type ( H264Context h  )  [static]

Definition at line 858 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

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

Definition at line 1174 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

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]

Definition at line 993 of file h264_cabac.c.

Referenced by decode_cabac_residual_dc(), and decode_cabac_residual_nondc().

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 1178 of file h264_cabac.c.

Referenced by ff_h264_decode_mb_cabac().

int ff_h264_decode_mb_cabac ( H264Context h  ) 

decodes a macroblock

decodes a CABAC coded macroblock

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

Definition at line 1186 of file h264_cabac.c.

Referenced by decode_slice().

void ff_h264_init_cabac_states ( H264Context h  ) 

Definition at line 688 of file h264_cabac.c.

Referenced by decode_slice().

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

Definition at line 959 of file h264_cabac.c.

Referenced by decode_cabac_residual_internal().


Variable Documentation

const int8_t cabac_context_init_I[460][2] [static]

Definition at line 48 of file h264_cabac.c.

Referenced by ff_h264_init_cabac_states().

const int8_t cabac_context_init_PB[3][460][2] [static]

Definition at line 217 of file h264_cabac.c.

Referenced by ff_h264_init_cabac_states().


Generated on Fri Oct 26 02:36:52 2012 for FFmpeg by  doxygen 1.5.8