#include "put_bits.h"
#include <assert.h>
#include "libavutil/x86_cpu.h"
Go to the source code of this file.
Data Structures | |
struct | CABACContext |
Defines | |
#define | CABAC_BITS 16 |
#define | CABAC_MASK ((1<<CABAC_BITS)-1) |
#define | BRANCHLESS_CABAC_DECODER 1 |
#define | LOW "0" |
#define | RANGE "4" |
#define | BYTESTART "12" |
#define | BYTE "16" |
#define | BYTEEND "20" |
#define | BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp, tmpbyte) |
#define | BRANCHLESS_GET_CABAC(ret, cabac, statep, low, lowword, range, tmp, tmpbyte) |
Functions | |
void | ff_init_cabac_encoder (CABACContext *c, uint8_t *buf, int buf_size) |
void | ff_init_cabac_decoder (CABACContext *c, const uint8_t *buf, int buf_size) |
void | ff_init_cabac_states (CABACContext *c) |
static void | put_cabac_bit (CABACContext *c, int b) |
static void | renorm_cabac_encoder (CABACContext *c) |
static void | refill (CABACContext *c) |
static void | renorm_cabac_decoder (CABACContext *c) |
static void | renorm_cabac_decoder_once (CABACContext *c) |
static av_always_inline int | get_cabac_inline (CABACContext *c, uint8_t *const state) |
static int av_noinline av_unused | get_cabac_noinline (CABACContext *c, uint8_t *const state) |
static int av_unused | get_cabac (CABACContext *c, uint8_t *const state) |
static int av_unused | get_cabac_bypass (CABACContext *c) |
static av_always_inline int | get_cabac_bypass_sign (CABACContext *c, int val) |
static int av_unused | get_cabac_terminate (CABACContext *c) |
Variables | |
uint8_t | ff_h264_mlps_state [4 *64] |
uint8_t | ff_h264_lps_range [4 *2 *64] |
rangeTabLPS | |
uint8_t | ff_h264_mps_state [2 *64] |
transIdxMPS | |
uint8_t | ff_h264_lps_state [2 *64] |
transIdxLPS | |
const uint8_t | ff_h264_norm_shift [512] |
Definition in file cabac.h.
#define BRANCHLESS_GET_CABAC | ( | ret, | |||
cabac, | |||||
statep, | |||||
low, | |||||
lowword, | |||||
range, | |||||
tmp, | |||||
tmpbyte | ) |
Value:
"movzbl "statep" , "ret" \n\t"\ "mov "range" , "tmp" \n\t"\ "and $0xC0 , "range" \n\t"\ "movzbl "MANGLE(ff_h264_lps_range)"("ret", "range", 2), "range" \n\t"\ "sub "range" , "tmp" \n\t"\ BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp, tmpbyte)\ "movzbl " MANGLE(ff_h264_norm_shift) "("range"), %%ecx \n\t"\ "shl %%cl , "range" \n\t"\ "movzbl "MANGLE(ff_h264_mlps_state)"+128("ret"), "tmp" \n\t"\ "mov "tmpbyte" , "statep" \n\t"\ "shl %%cl , "low" \n\t"\ "test "lowword" , "lowword" \n\t"\ " jnz 1f \n\t"\ "mov "BYTE"("cabac"), %%"REG_c" \n\t"\ "movzwl (%%"REG_c") , "tmp" \n\t"\ "bswap "tmp" \n\t"\ "shr $15 , "tmp" \n\t"\ "sub $0xFFFF , "tmp" \n\t"\ "add $2 , %%"REG_c" \n\t"\ "mov %%"REG_c" , "BYTE "("cabac") \n\t"\ "lea -1("low") , %%ecx \n\t"\ "xor "low" , %%ecx \n\t"\ "shr $15 , %%ecx \n\t"\ "movzbl " MANGLE(ff_h264_norm_shift) "(%%ecx), %%ecx \n\t"\ "neg %%ecx \n\t"\ "add $7 , %%ecx \n\t"\ "shl %%cl , "tmp" \n\t"\ "add "tmp" , "low" \n\t"\ "1: \n\t"
Referenced by decode_significance_8x8_x86(), decode_significance_x86(), and get_cabac_inline().
#define BRANCHLESS_GET_CABAC_UPDATE | ( | ret, | |||
cabac, | |||||
statep, | |||||
low, | |||||
lowword, | |||||
range, | |||||
tmp, | |||||
tmpbyte | ) |
Value:
"mov "tmp" , %%ecx \n\t"\ "shl $17 , "tmp" \n\t"\ "cmp "low" , "tmp" \n\t"\ "cmova %%ecx , "range" \n\t"\ "sbb %%ecx , %%ecx \n\t"\ "and %%ecx , "tmp" \n\t"\ "sub "tmp" , "low" \n\t"\ "xor %%ecx , "ret" \n\t"
#define BYTE "16" |
Referenced by get_cabac_bypass(), get_cabac_bypass_sign(), and get_cabac_inline().
#define BYTEEND "20" |
#define BYTESTART "12" |
#define CABAC_BITS 16 |
Definition at line 36 of file cabac.h.
Referenced by ff_h264_decode_mb_cabac(), get_cabac_bypass(), get_cabac_bypass_sign(), get_cabac_inline(), get_cabac_terminate(), and refill().
#define CABAC_MASK ((1<<CABAC_BITS)-1) |
Definition at line 37 of file cabac.h.
Referenced by get_cabac_bypass(), get_cabac_bypass_sign(), get_cabac_inline(), refill(), renorm_cabac_decoder(), and renorm_cabac_decoder_once().
#define LOW "0" |
#define RANGE "4" |
void ff_init_cabac_decoder | ( | CABACContext * | c, | |
const uint8_t * | buf, | |||
int | buf_size | |||
) |
buf_size | size of buf in bits |
Definition at line 134 of file cabac.c.
Referenced by decode_slice(), and ff_h264_decode_mb_cabac().
void ff_init_cabac_encoder | ( | CABACContext * | c, | |
uint8_t * | buf, | |||
int | buf_size | |||
) |
void ff_init_cabac_states | ( | CABACContext * | c | ) |
static int av_unused get_cabac | ( | CABACContext * | c, | |
uint8_t *const | state | |||
) | [static] |
Definition at line 587 of file cabac.h.
Referenced by decode_cabac_b_mb_sub_type(), decode_cabac_mb_intra4x4_pred_mode(), decode_cabac_mb_mvd(), decode_cabac_mb_ref(), decode_cabac_p_mb_sub_type(), and decode_cabac_residual_internal().
static int av_unused get_cabac_bypass | ( | CABACContext * | c | ) | [static] |
Definition at line 591 of file cabac.h.
Referenced by decode_cabac_mb_mvd(), and decode_cabac_residual_internal().
static av_always_inline int get_cabac_bypass_sign | ( | CABACContext * | c, | |
int | val | |||
) | [static] |
Definition at line 639 of file cabac.h.
Referenced by decode_cabac_mb_mvd(), and decode_cabac_residual_internal().
static av_always_inline int get_cabac_inline | ( | CABACContext * | c, | |
uint8_t *const | state | |||
) | [static] |
static int av_noinline av_unused get_cabac_noinline | ( | CABACContext * | c, | |
uint8_t *const | state | |||
) | [static] |
Definition at line 583 of file cabac.h.
Referenced by decode_cabac_field_decoding_flag(), decode_cabac_intra_mb_type(), decode_cabac_mb_cbp_chroma(), decode_cabac_mb_cbp_luma(), decode_cabac_mb_chroma_pre_mode(), decode_cabac_mb_skip(), and ff_h264_decode_mb_cabac().
static int av_unused get_cabac_terminate | ( | CABACContext * | c | ) | [static] |
Definition at line 690 of file cabac.h.
Referenced by decode_cabac_intra_mb_type(), and decode_slice().
static void put_cabac_bit | ( | CABACContext * | c, | |
int | b | |||
) | [inline, static] |
static void refill | ( | CABACContext * | c | ) | [static] |
Definition at line 263 of file cabac.h.
Referenced by get_cabac_bypass(), get_cabac_bypass_sign(), get_rac(), renorm_cabac_decoder(), and renorm_cabac_decoder_once().
static void renorm_cabac_decoder | ( | CABACContext * | c | ) | [inline, static] |
static void renorm_cabac_decoder_once | ( | CABACContext * | c | ) | [inline, static] |
Definition at line 302 of file cabac.h.
Referenced by get_cabac_inline(), and get_cabac_terminate().
static void renorm_cabac_encoder | ( | CABACContext * | c | ) | [inline, static] |
uint8_t ff_h264_lps_range[4 *2 *64] |
rangeTabLPS
Definition at line 53 of file cabac.c.
Referenced by ff_init_cabac_states(), and get_cabac_inline().
uint8_t ff_h264_lps_state[2 *64] |
transIdxLPS
Definition at line 54 of file cabac.c.
Referenced by ff_init_cabac_states(), and get_cabac_inline().
uint8_t ff_h264_mlps_state[4 *64] |
Definition at line 52 of file cabac.c.
Referenced by ff_init_cabac_states(), and get_cabac_inline().
uint8_t ff_h264_mps_state[2 *64] |
transIdxMPS
Definition at line 55 of file cabac.c.
Referenced by ff_init_cabac_states(), and get_cabac_inline().
const uint8_t ff_h264_norm_shift[512] |