Libav
Main Page
Related Pages
Modules
Data Structures
Files
Examples
File List
Globals
libavcodec
x86
vp56_arith.h
Go to the documentation of this file.
1
24
#ifndef AVCODEC_X86_VP56_ARITH_H
25
#define AVCODEC_X86_VP56_ARITH_H
26
27
#if HAVE_INLINE_ASM && HAVE_FAST_CMOV
28
#define vp56_rac_get_prob vp56_rac_get_prob
29
static
av_always_inline
int
vp56_rac_get_prob
(
VP56RangeCoder
*c,
uint8_t
prob)
30
{
31
unsigned
int
code_word =
vp56_rac_renorm
(c);
32
unsigned
int
high = c->
high
;
33
unsigned
int
low = 1 + (((high - 1) * prob) >> 8);
34
unsigned
int
low_shift = low << 16;
35
int
bit = 0;
36
37
__asm__(
38
"subl %4, %1 \n\t"
39
"subl %3, %2 \n\t"
40
"leal (%2, %3), %3 \n\t"
41
"setae %b0 \n\t"
42
"cmovb %4, %1 \n\t"
43
"cmovb %3, %2 \n\t"
44
:
"+q"
(bit),
"+r"
(high),
"+r"
(code_word),
"+r"
(low_shift)
45
:
"r"
(low)
46
);
47
48
c->
high
= high;
49
c->
code_word
= code_word;
50
return
bit;
51
}
52
#endif
53
54
#endif
/* AVCODEC_X86_VP56_ARITH_H */
VP56RangeCoder::code_word
unsigned int code_word
Definition:
vp56.h:90
uint8_t
uint8_t
Definition:
audio_convert.c:194
vp56_rac_get_prob
#define vp56_rac_get_prob
Definition:
vp56.h:243
vp56_rac_renorm
static av_always_inline unsigned int vp56_rac_renorm(VP56RangeCoder *c)
Definition:
vp56.h:219
VP56RangeCoder
Definition:
vp56.h:84
av_always_inline
#define av_always_inline
Definition:
attributes.h:40
VP56RangeCoder::high
int high
Definition:
vp56.h:85
Generated on Thu Jun 4 2015 18:34:50 for Libav by
1.8.8