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
cfa83fd8
Commit
cfa83fd8
authored
Oct 26, 2016
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ans: Use BufAnsCoder in the ANS test
Change-Id: I3da3d48ade0286d430fa22aebe1c3fc8d3a68995
parent
2a1b3af3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
test/ans_test.cc
test/ans_test.cc
+18
-13
No files found.
test/ans_test.cc
View file @
cfa83fd8
...
...
@@ -20,7 +20,7 @@
#include "test/acm_random.h"
#include "aom_dsp/ansreader.h"
#include "aom_dsp/
answriter
.h"
#include "aom_dsp/
buf_ans
.h"
namespace
{
typedef
std
::
vector
<
std
::
pair
<
uint8_t
,
bool
>
>
PvVec
;
...
...
@@ -48,16 +48,18 @@ PvVec abs_encode_build_vals(int iters) {
}
bool
check_uabs
(
const
PvVec
&
pv_vec
,
uint8_t
*
buf
)
{
AnsCoder
a
;
ans_write_init
(
&
a
,
buf
);
BufAnsCoder
a
;
aom_buf_ans_alloc
(
&
a
,
NULL
,
100
);
buf_ans_write_init
(
&
a
,
buf
);
std
::
clock_t
start
=
std
::
clock
();
for
(
PvVec
::
const_reverse_iterator
it
=
pv_vec
.
rbegin
();
it
!=
pv_vec
.
rend
();
++
it
)
{
uabs_write
(
&
a
,
it
->
second
,
256
-
it
->
first
);
for
(
PvVec
::
const_iterator
it
=
pv_vec
.
begin
();
it
!=
pv_vec
.
end
();
++
it
)
{
buf_uabs_write
(
&
a
,
it
->
second
,
256
-
it
->
first
);
}
buf_ans_flush
(
&
a
);
std
::
clock_t
enc_time
=
std
::
clock
()
-
start
;
int
offset
=
ans_write_end
(
&
a
);
int
offset
=
buf_ans_write_end
(
&
a
);
aom_buf_ans_free
(
&
a
);
bool
okay
=
true
;
AnsDecoder
d
;
if
(
ans_read_init
(
&
d
,
buf
,
offset
))
return
false
;
...
...
@@ -112,18 +114,21 @@ void rans_build_dec_tab(const struct rans_sym sym_tab[],
bool
check_rans
(
const
std
::
vector
<
int
>
&
sym_vec
,
const
rans_sym
*
const
tab
,
uint8_t
*
buf
)
{
AnsCoder
a
;
ans_write_init
(
&
a
,
buf
);
BufAnsCoder
a
;
aom_buf_ans_alloc
(
&
a
,
NULL
,
100
);
buf_ans_write_init
(
&
a
,
buf
);
aom_cdf_prob
dec_tab
[
kRansSymbols
];
rans_build_dec_tab
(
tab
,
dec_tab
);
std
::
clock_t
start
=
std
::
clock
();
for
(
std
::
vector
<
int
>::
const_
reverse_iterator
it
=
sym_vec
.
r
begin
();
it
!=
sym_vec
.
r
end
();
++
it
)
{
rans_write
(
&
a
,
&
tab
[
*
it
]);
for
(
std
::
vector
<
int
>::
const_
iterator
it
=
sym_vec
.
begin
();
it
!=
sym_vec
.
end
();
++
it
)
{
buf_
rans_write
(
&
a
,
&
tab
[
*
it
]);
}
buf_ans_flush
(
&
a
);
std
::
clock_t
enc_time
=
std
::
clock
()
-
start
;
int
offset
=
ans_write_end
(
&
a
);
int
offset
=
buf_ans_write_end
(
&
a
);
aom_buf_ans_free
(
&
a
);
bool
okay
=
true
;
AnsDecoder
d
;
if
(
ans_read_init
(
&
d
,
buf
,
offset
))
return
false
;
...
...
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