Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
aom-rav1e
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
aom-rav1e
Commits
6b9cb8c4
Commit
6b9cb8c4
authored
Mar 21, 2016
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some ANS helpers needed to replace the vpx bool coder with pure ANS.
Change-Id: I32b63fca020c410cef16e93379b4e6e281ccbccd
parent
2613b5e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
vp10/common/ans.h
vp10/common/ans.h
+16
-0
vp10/encoder/buf_ans.h
vp10/encoder/buf_ans.h
+12
-0
No files found.
vp10/common/ans.h
View file @
6b9cb8c4
...
...
@@ -230,6 +230,18 @@ static INLINE int uabs_read_bit(struct AnsDecoder *ans) {
return
s
;
}
static
INLINE
int
uabs_read_literal
(
struct
AnsDecoder
*
ans
,
int
bits
)
{
int
literal
=
0
,
bit
;
assert
(
bits
<
31
);
// TODO(aconverse): Investigate ways to read/write literals faster,
// e.g. 8-bit chunks.
for
(
bit
=
bits
-
1
;
bit
>=
0
;
bit
--
)
literal
|=
uabs_read_bit
(
ans
)
<<
bit
;
return
literal
;
}
struct
rans_sym
{
AnsP8
prob
;
AnsP8
cum_prob
;
// not-inclusive
...
...
@@ -327,6 +339,10 @@ static INLINE int ans_read_init(struct AnsDecoder *const ans,
static
INLINE
int
ans_read_end
(
struct
AnsDecoder
*
const
ans
)
{
return
ans
->
state
==
l_base
;
}
static
INLINE
int
ans_reader_has_error
(
const
struct
AnsDecoder
*
const
ans
)
{
return
ans
->
state
<
l_base
&&
ans
->
buf_offset
==
0
;
}
#undef ANS_DIVREM
#ifdef __cplusplus
}
// extern "C"
...
...
vp10/encoder/buf_ans.h
View file @
6b9cb8c4
...
...
@@ -81,6 +81,18 @@ static INLINE void buf_ans_flush(const struct BufAnsCoder *const c,
}
}
static
INLINE
void
buf_uabs_write_bit
(
struct
BufAnsCoder
*
c
,
int
bit
)
{
buf_uabs_write
(
c
,
bit
,
128
);
}
static
INLINE
void
buf_uabs_write_literal
(
struct
BufAnsCoder
*
c
,
int
literal
,
int
bits
)
{
int
bit
;
assert
(
bits
<
31
);
for
(
bit
=
bits
-
1
;
bit
>=
0
;
bit
--
)
buf_uabs_write_bit
(
c
,
1
&
(
literal
>>
bit
));
}
#ifdef __cplusplus
}
// extern "C"
#endif // __cplusplus
...
...
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