h264: use asm cabac reader under a generic condition

This removes a dependency on implementation details from generic
code and allows easy addition of the equivalent optimisation for
other architectures than x86.

Signed-off-by: Mans Rullgard <mans@mansr.com>
This commit is contained in:
Mans Rullgard 2012-06-22 18:52:27 +01:00
parent fe07c9c6b5
commit 0b6f973635
2 changed files with 5 additions and 3 deletions

View File

@ -1652,14 +1652,14 @@ decode_cabac_residual_internal(H264Context *h, DCTELEM *block,
index[coeff_count++] = last;\
}
const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD];
#if ARCH_X86 && HAVE_7REGS
coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index,
#ifdef decode_significance
coeff_count = decode_significance_8x8(CC, significant_coeff_ctx_base, index,
last_coeff_ctx_base, sig_off);
} else {
if (is_dc && chroma422) { // dc 422
DECODE_SIGNIFICANCE(7, sig_coeff_offset_dc[last], sig_coeff_offset_dc[last]);
} else {
coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index,
coeff_count = decode_significance(CC, max_coeff, significant_coeff_ctx_base, index,
last_coeff_ctx_base-significant_coeff_ctx_base);
}
#else

View File

@ -37,6 +37,7 @@
//FIXME use some macros to avoid duplicating get_cabac (cannot be done yet
//as that would make optimization work hard)
#if HAVE_7REGS
#define decode_significance decode_significance_x86
static int decode_significance_x86(CABACContext *c, int max_coeff,
uint8_t *significant_coeff_ctx_base,
int *index, x86_reg last_off){
@ -105,6 +106,7 @@ static int decode_significance_x86(CABACContext *c, int max_coeff,
return coeff_count;
}
#define decode_significance_8x8 decode_significance_8x8_x86
static int decode_significance_8x8_x86(CABACContext *c,
uint8_t *significant_coeff_ctx_base,
int *index, uint8_t *last_coeff_ctx_base, const uint8_t *sig_off){