Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cox <jc@kynesim.co.uk>2016-01-20 20:56:30 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2016-01-22 04:38:41 +0300
commit5115d8326e8eba707ee3048930674e2f9058d913 (patch)
tree41723ca8e8667fd8975c48139e02b6823182cd1b /libavcodec/cabac_functions.h
parent48f80831bad87addf40b6496210817ea0efc85af (diff)
cabac_functions: Count zeros with ctz if it is fast
When refilling the low bit buffer after get_cabac count the bits with ctz if the processor has a fast version. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/cabac_functions.h')
-rw-r--r--libavcodec/cabac_functions.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/cabac_functions.h b/libavcodec/cabac_functions.h
index 31c919bd71..42841c7e08 100644
--- a/libavcodec/cabac_functions.h
+++ b/libavcodec/cabac_functions.h
@@ -76,9 +76,12 @@ static inline void renorm_cabac_decoder_once(CABACContext *c){
static void refill2(CABACContext *c){
int i;
unsigned x;
-
+#if !HAVE_FAST_CLZ
x= c->low ^ (c->low-1);
i= 7 - ff_h264_norm_shift[x>>(CABAC_BITS-1)];
+#else
+ i = ff_ctz(c->low) - CABAC_BITS;
+#endif
x= -CABAC_MASK;