aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/x86/cabac.h
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-07-29 01:50:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-07-29 01:50:53 +0200
commit2dd2abe391ccf1b9140c6eea95767b5a8c503ddd (patch)
tree0b3886285001ed05025bd4a338f3a5105d0c7a8b /libavcodec/x86/cabac.h
parent4105443872be75a8d1141facc43b54641304c722 (diff)
parent2a11952f457658d58303c8e5b4e10fb4599eef4f (diff)
downloadffmpeg-2dd2abe391ccf1b9140c6eea95767b5a8c503ddd.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: h263dec: Propagate AV_LOG_ERRORs from slice decoding through frame decoding with sufficient error recognition x86: cabac: don't load/store context values in asm H.264: optimize CABAC x86 asm for Atom vp3/theora: flush after seek. doc/fftools-common-opts: wording fixes missing from the previous commit. doc: document using AVOptions in fftools. cmdutils: add codec_opts parameter to setup_find_stream_info_opts() cmdutils: clarify documentation for filter_codec_opts() cmdutils: clarify documentation for setup_find_stream_info_opts() lavf: add forgotten attribute_deprecated to av_find_stream_info() Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/x86/cabac.h')
-rw-r--r--libavcodec/x86/cabac.h27
1 files changed, 10 insertions, 17 deletions
diff --git a/libavcodec/x86/cabac.h b/libavcodec/x86/cabac.h
index 52bea9c53d..ae3f4b6e9e 100644
--- a/libavcodec/x86/cabac.h
+++ b/libavcodec/x86/cabac.h
@@ -34,8 +34,8 @@
"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"
+ "xor %%ecx , "ret" \n\t"\
+ "sub "tmp" , "low" \n\t"
#else /* HAVE_FAST_CMOV */
#define BRANCHLESS_GET_CABAC_UPDATE(ret, cabac, statep, low, lowword, range, tmp)\
"mov "tmp" , %%ecx \n\t"\
@@ -62,21 +62,20 @@
"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"\
+ "mov "tmpbyte" , "statep" \n\t"\
"test "lowword" , "lowword" \n\t"\
" jnz 1f \n\t"\
"mov "byte"("cabac"), %%"REG_c" \n\t"\
+ "add $2 , "byte "("cabac") \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"\
+ "bswap "tmp" \n\t"\
+ "shr $15 , "tmp" \n\t"\
"movzbl " MANGLE(ff_h264_norm_shift) "(%%ecx), %%ecx \n\t"\
+ "sub $0xFFFF , "tmp" \n\t"\
"neg %%ecx \n\t"\
"add $7 , %%ecx \n\t"\
"shl %%cl , "tmp" \n\t"\
@@ -88,19 +87,13 @@
static av_always_inline int get_cabac_inline_x86(CABACContext *c,
uint8_t *const state)
{
- int bit, low, range, tmp;
+ int bit, tmp;
__asm__ volatile(
- "movl %a6(%5), %2 \n\t"
- "movl %a7(%5), %1 \n\t"
BRANCHLESS_GET_CABAC("%0", "%5", "(%4)", "%1", "%w1", "%2",
- "%3", "%b3", "%a8")
- "movl %2, %a6(%5) \n\t"
- "movl %1, %a7(%5) \n\t"
-
- :"=&r"(bit), "=&r"(low), "=&r"(range), "=&q"(tmp)
+ "%3", "%b3", "%a6")
+ :"=&r"(bit), "+&r"(c->low), "+&r"(c->range), "=&q"(tmp)
:"r"(state), "r"(c),
- "i"(offsetof(CABACContext, range)), "i"(offsetof(CABACContext, low)),
"i"(offsetof(CABACContext, bytestream))
: "%"REG_c, "memory"
);