Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
d222f6e3
Commit
d222f6e3
authored
Jul 01, 2013
by
Jason Garrett-Glaser
Committed by
Luca Barbato
Jul 04, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cabac: x86 version of get_cabac_bypass
Signed-off-by:
Luca Barbato
<
lu_zero@gentoo.org
>
parent
41006698
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
1 deletion
+42
-1
cabac_functions.h
libavcodec/cabac_functions.h
+2
-1
cabac.h
libavcodec/x86/cabac.h
+40
-0
No files found.
libavcodec/cabac_functions.h
View file @
d222f6e3
...
...
@@ -113,6 +113,7 @@ static int av_unused get_cabac(CABACContext *c, uint8_t * const state){
return
get_cabac_inline
(
c
,
state
);
}
#ifndef get_cabac_bypass
static
int
av_unused
get_cabac_bypass
(
CABACContext
*
c
){
int
range
;
c
->
low
+=
c
->
low
;
...
...
@@ -128,7 +129,7 @@ static int av_unused get_cabac_bypass(CABACContext *c){
return
1
;
}
}
#endif
#ifndef get_cabac_bypass_sign
static
av_always_inline
int
get_cabac_bypass_sign
(
CABACContext
*
c
,
int
val
){
...
...
libavcodec/x86/cabac.h
View file @
d222f6e3
...
...
@@ -229,5 +229,45 @@ static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
return
val
;
}
#define get_cabac_bypass get_cabac_bypass_x86
static
av_always_inline
int
get_cabac_bypass_x86
(
CABACContext
*
c
)
{
x86_reg
tmp
;
int
res
;
__asm__
volatile
(
"movl %c6(%2), %k1
\n\t
"
"movl %c3(%2), %%eax
\n\t
"
"shl $17, %k1
\n\t
"
"add %%eax, %%eax
\n\t
"
"sub %k1, %%eax
\n\t
"
"cltd
\n\t
"
"and %%edx, %k1
\n\t
"
"add %k1, %%eax
\n\t
"
"inc %%edx
\n\t
"
"test %%ax, %%ax
\n\t
"
"jnz 1f
\n\t
"
"mov %c4(%2), %1
\n\t
"
"subl $0xFFFF, %%eax
\n\t
"
"movzwl (%1), %%ecx
\n\t
"
"bswap %%ecx
\n\t
"
"shrl $15, %%ecx
\n\t
"
"addl %%ecx, %%eax
\n\t
"
"cmp %c5(%2), %1
\n\t
"
"jge 1f
\n\t
"
"add"
OPSIZE
" $2, %c4(%2)
\n\t
"
"1:
\n\t
"
"movl %%eax, %c3(%2)
\n\t
"
:
"=&d"
(
res
),
"=&r"
(
tmp
)
:
"r"
(
c
),
"i"
(
offsetof
(
CABACContext
,
low
)),
"i"
(
offsetof
(
CABACContext
,
bytestream
)),
"i"
(
offsetof
(
CABACContext
,
bytestream_end
)),
"i"
(
offsetof
(
CABACContext
,
range
))
:
"%eax"
,
"%ecx"
,
"memory"
);
return
res
;
}
#endif
/* HAVE_INLINE_ASM */
#endif
/* AVCODEC_X86_CABAC_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment