aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-06-22 18:52:27 +0100
committerMans Rullgard <mans@mansr.com>2012-06-23 22:14:21 +0100
commit0b6f9736355f0a561b7e744e38699af88513bfab (patch)
tree85d29d6bd4189ce1b26a3920e1afcf74886604aa /libavcodec
parentfe07c9c6b5a870b8f2ffcfac649228b4d76e9505 (diff)
downloadffmpeg-0b6f9736355f0a561b7e744e38699af88513bfab.tar.gz
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/h264_cabac.c6
-rw-r--r--libavcodec/x86/h264_i386.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index 08a6a5b15d..2bf08b5221 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -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
diff --git a/libavcodec/x86/h264_i386.h b/libavcodec/x86/h264_i386.h
index 10ea32e0b8..c0033b7ff3 100644
--- a/libavcodec/x86/h264_i386.h
+++ b/libavcodec/x86/h264_i386.h
@@ -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){