Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
a1ac9728
Commit
a1ac9728
authored
Oct 12, 2016
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Import the aom_read/write_symbol abstractions from aom/master
Change-Id: I0b255c05108c3b97e74df1b59c34111c9e9a5770
parent
91e4e604
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
6 deletions
+39
-6
aom_dsp/bitreader.h
aom_dsp/bitreader.h
+14
-0
aom_dsp/bitwriter.h
aom_dsp/bitwriter.h
+18
-0
aom_dsp/prob.h
aom_dsp/prob.h
+3
-0
av1/decoder/detokenize.c
av1/decoder/detokenize.c
+2
-1
av1/encoder/bitstream.c
av1/encoder/bitstream.c
+2
-5
No files found.
aom_dsp/bitreader.h
View file @
a1ac9728
...
...
@@ -104,6 +104,20 @@ static INLINE int aom_read_tree(aom_reader *r, const aom_tree_index *tree,
return
aom_read_tree_bits
(
r
,
tree
,
probs
);
}
static
INLINE
int
aom_read_symbol
(
aom_reader
*
r
,
const
aom_cdf_prob
*
cdf
,
int
nsymbs
)
{
#if CONFIG_ANS
(
void
)
nsymbs
;
return
rans_read
(
r
,
cdf
);
#else
(
void
)
r
;
(
void
)
cdf
;
(
void
)
nsymbs
;
assert
(
0
&&
"Unsupported bitreader operation"
);
return
-
1
;
#endif
}
#ifdef __cplusplus
}
// extern "C"
#endif
...
...
aom_dsp/bitwriter.h
View file @
a1ac9728
...
...
@@ -86,6 +86,24 @@ static INLINE void aom_write_tree(aom_writer *w, const aom_tree_index *tree,
aom_write_tree_bits
(
w
,
tree
,
probs
,
bits
,
len
,
i
);
}
static
INLINE
void
aom_write_symbol
(
aom_writer
*
w
,
int
symb
,
const
aom_cdf_prob
*
cdf
,
int
nsymbs
)
{
#if CONFIG_ANS
struct
rans_sym
s
;
(
void
)
nsymbs
;
assert
(
cdf
);
s
.
cum_prob
=
cdf
[
symb
];
s
.
prob
=
cdf
[
symb
+
1
]
-
s
.
cum_prob
;
buf_rans_write
(
w
,
&
s
);
#else
(
void
)
w
;
(
void
)
symb
;
(
void
)
cdf
;
(
void
)
nsymbs
;
assert
(
0
&&
"Unsupported bitwriter operation"
);
#endif
}
#ifdef __cplusplus
}
// extern "C"
#endif
...
...
aom_dsp/prob.h
View file @
a1ac9728
...
...
@@ -23,6 +23,9 @@ extern "C" {
typedef
uint8_t
aom_prob
;
// TODO(negge): Rename this aom_prob once we remove vpxbool.
typedef
uint16_t
aom_cdf_prob
;
#define MAX_PROB 255
#define aom_prob_half ((aom_prob)128)
...
...
av1/decoder/detokenize.c
View file @
a1ac9728
...
...
@@ -166,7 +166,8 @@ static int decode_coefs(const MACROBLOCKD *xd, PLANE_TYPE type,
}
#if CONFIG_ANS
cdf
=
&
coef_cdfs
[
band
][
ctx
];
token
=
ONE_TOKEN
+
rans_read
(
r
,
*
cdf
);
token
=
ONE_TOKEN
+
aom_read_symbol
(
r
,
*
cdf
,
CATEGORY6_TOKEN
-
ONE_TOKEN
+
1
);
INCREMENT_COUNT
(
ONE_TOKEN
+
(
token
>
ONE_TOKEN
));
switch
(
token
)
{
case
ONE_TOKEN
:
...
...
av1/encoder/bitstream.c
View file @
a1ac9728
...
...
@@ -657,11 +657,8 @@ static void pack_mb_tokens(aom_writer *w, const TOKENEXTRA **tp,
aom_write
(
w
,
t
!=
ZERO_TOKEN
,
p
->
context_tree
[
1
]);
if
(
t
!=
ZERO_TOKEN
)
{
struct
rans_sym
s
;
const
rans_lut
*
token_cdf
=
p
->
token_cdf
;
s
.
cum_prob
=
(
*
token_cdf
)[
t
-
ONE_TOKEN
];
s
.
prob
=
(
*
token_cdf
)[
t
-
ONE_TOKEN
+
1
]
-
s
.
cum_prob
;
buf_rans_write
(
w
,
&
s
);
aom_write_symbol
(
w
,
t
-
ONE_TOKEN
,
*
p
->
token_cdf
,
CATEGORY6_TOKEN
-
ONE_TOKEN
+
1
);
}
}
#else
...
...
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