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
9ac1f7d7
Commit
9ac1f7d7
authored
Aug 19, 2016
by
Nathan E. Egge
Committed by
Yaowu Xu
Oct 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create aom_cdf_prob type for 16-bit probabilities.
Change-Id: I33899eca44300037816c9f20c965aa8311a1ef52
parent
45741e93
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
22 deletions
+22
-22
aom_dsp/daalaboolreader.h
aom_dsp/daalaboolreader.h
+2
-2
aom_dsp/daalaboolwriter.h
aom_dsp/daalaboolwriter.h
+2
-2
aom_dsp/prob.c
aom_dsp/prob.c
+11
-9
aom_dsp/prob.h
aom_dsp/prob.h
+2
-2
av1/common/entropymode.h
av1/common/entropymode.h
+5
-7
No files found.
aom_dsp/daalaboolreader.h
View file @
9ac1f7d7
...
...
@@ -52,7 +52,7 @@ static INLINE int daala_read_tree_bits(daala_reader *r,
const
aom_prob
*
probs
)
{
aom_tree_index
i
=
0
;
do
{
uint16_t
cdf
[
16
];
aom_cdf_prob
cdf
[
16
];
aom_tree_index
index
[
16
];
int
path
[
16
];
int
dist
[
16
];
...
...
@@ -66,7 +66,7 @@ static INLINE int daala_read_tree_bits(daala_reader *r,
return
-
i
;
}
static
INLINE
int
daala_read_symbol
(
daala_reader
*
r
,
const
uint16_t
*
cdf
,
static
INLINE
int
daala_read_symbol
(
daala_reader
*
r
,
const
aom_cdf_prob
*
cdf
,
int
nsymbs
)
{
return
od_ec_decode_cdf_q15
(
&
r
->
ec
,
cdf
,
nsymbs
,
"aom"
);
}
...
...
aom_dsp/daalaboolwriter.h
View file @
9ac1f7d7
...
...
@@ -46,7 +46,7 @@ static INLINE void daala_write_tree_bits(daala_writer *w,
aom_tree_index
root
;
root
=
i
;
do
{
uint16_t
cdf
[
16
];
aom_cdf_prob
cdf
[
16
];
aom_tree_index
index
[
16
];
int
path
[
16
];
int
dist
[
16
];
...
...
@@ -79,7 +79,7 @@ static INLINE void daala_write_tree_bits(daala_writer *w,
}
static
INLINE
void
daala_write_symbol
(
daala_writer
*
w
,
int
symb
,
const
uint16_t
*
cdf
,
int
nsymbs
)
{
const
aom_cdf_prob
*
cdf
,
int
nsymbs
)
{
od_ec_encode_cdf_q15
(
&
w
->
ec
,
symb
,
cdf
,
nsymbs
);
}
...
...
aom_dsp/prob.c
View file @
9ac1f7d7
...
...
@@ -68,7 +68,7 @@ struct tree_node {
int
len
;
int
l
;
int
r
;
uint16_t
pdf
;
aom_cdf_prob
pdf
;
};
/* Compute the probability of this node in Q23 */
...
...
@@ -96,7 +96,8 @@ static int tree_node_cmp(tree_node a, tree_node b) {
/* Given a Q15 probability for symbol subtree rooted at tree[n], this function
computes the probability of each symbol (defined as a node that has no
children). */
static
uint16_t
tree_node_compute_probs
(
tree_node
*
tree
,
int
n
,
uint16_t
pdf
)
{
static
aom_cdf_prob
tree_node_compute_probs
(
tree_node
*
tree
,
int
n
,
aom_cdf_prob
pdf
)
{
if
(
tree
[
n
].
l
==
0
)
{
/* This prevents probability computations in Q15 that underflow from
producing a symbol that has zero probability. */
...
...
@@ -106,15 +107,15 @@ static uint16_t tree_node_compute_probs(tree_node *tree, int n, uint16_t pdf) {
}
else
{
/* We process the smaller probability first, */
if
(
tree
[
n
].
prob
<
128
)
{
uint16_t
lp
;
uint16_t
rp
;
aom_cdf_prob
lp
;
aom_cdf_prob
rp
;
lp
=
(((
uint32_t
)
pdf
)
*
tree
[
n
].
prob
+
128
)
>>
8
;
lp
=
tree_node_compute_probs
(
tree
,
tree
[
n
].
l
,
lp
);
rp
=
tree_node_compute_probs
(
tree
,
tree
[
n
].
r
,
lp
>
pdf
?
0
:
pdf
-
lp
);
return
lp
+
rp
;
}
else
{
uint16_t
rp
;
uint16_t
lp
;
aom_cdf_prob
rp
;
aom_cdf_prob
lp
;
rp
=
(((
uint32_t
)
pdf
)
*
(
256
-
tree
[
n
].
prob
)
+
128
)
>>
8
;
rp
=
tree_node_compute_probs
(
tree
,
tree
[
n
].
r
,
rp
);
lp
=
tree_node_compute_probs
(
tree
,
tree
[
n
].
l
,
rp
>
pdf
?
0
:
pdf
-
rp
);
...
...
@@ -123,8 +124,9 @@ static uint16_t tree_node_compute_probs(tree_node *tree, int n, uint16_t pdf) {
}
}
static
int
tree_node_extract
(
tree_node
*
tree
,
int
n
,
int
symb
,
uint16_t
*
pdf
,
aom_tree_index
*
index
,
int
*
path
,
int
*
len
)
{
static
int
tree_node_extract
(
tree_node
*
tree
,
int
n
,
int
symb
,
aom_cdf_prob
*
pdf
,
aom_tree_index
*
index
,
int
*
path
,
int
*
len
)
{
if
(
tree
[
n
].
l
==
0
)
{
pdf
[
symb
]
=
tree
[
n
].
pdf
;
if
(
index
!=
NULL
)
index
[
symb
]
=
tree
[
n
].
index
;
...
...
@@ -138,7 +140,7 @@ static int tree_node_extract(tree_node *tree, int n, int symb, uint16_t *pdf,
}
int
tree_to_cdf
(
const
aom_tree_index
*
tree
,
const
aom_prob
*
probs
,
aom_tree_index
root
,
uint16_t
*
cdf
,
aom_tree_index
*
index
,
aom_tree_index
root
,
aom_cdf_prob
*
cdf
,
aom_tree_index
*
index
,
int
*
path
,
int
*
len
)
{
tree_node
symb
[
2
*
16
-
1
];
int
nodes
;
...
...
aom_dsp/prob.h
View file @
9ac1f7d7
...
...
@@ -98,11 +98,11 @@ void aom_tree_merge_probs(const aom_tree_index *tree, const aom_prob *pre_probs,
#if CONFIG_DAALA_EC
int
tree_to_cdf
(
const
aom_tree_index
*
tree
,
const
aom_prob
*
probs
,
aom_tree_index
root
,
uint16_t
*
cdf
,
aom_tree_index
*
ind
,
aom_tree_index
root
,
aom_cdf_prob
*
cdf
,
aom_tree_index
*
ind
,
int
*
pth
,
int
*
len
);
static
INLINE
void
av1_tree_to_cdf
(
const
aom_tree_index
*
tree
,
const
aom_prob
*
probs
,
uint16_t
*
cdf
)
{
const
aom_prob
*
probs
,
aom_cdf_prob
*
cdf
)
{
aom_tree_index
index
[
16
];
int
path
[
16
];
int
dist
[
16
];
...
...
av1/common/entropymode.h
View file @
9ac1f7d7
...
...
@@ -54,9 +54,6 @@ typedef struct frame_contexts {
aom_prob
partition_prob
[
PARTITION_CONTEXTS
][
EXT_PARTITION_TYPES
-
1
];
#else
aom_prob
partition_prob
[
PARTITION_CONTEXTS
][
PARTITION_TYPES
-
1
];
#endif
#if CONFIG_DAALA_EC
uint16_t
partition_cdf
[
PARTITION_CONTEXTS
][
PARTITION_TYPES
];
#endif
av1_coeff_probs_model
coef_probs
[
TX_SIZES
][
PLANE_TYPES
];
#if CONFIG_ANS || CONFIG_DAALA_EC
...
...
@@ -135,10 +132,11 @@ typedef struct frame_contexts {
aom_prob
switchable_restore_prob
[
RESTORE_SWITCHABLE_TYPES
-
1
];
#endif // CONFIG_LOOP_RESTORATION
#if CONFIG_DAALA_EC
uint16_t
switchable_interp_cdf
[
SWITCHABLE_FILTER_CONTEXTS
]
[
SWITCHABLE_FILTERS
];
uint16_t
intra_ext_tx_cdf
[
EXT_TX_SIZES
][
TX_TYPES
][
TX_TYPES
];
uint16_t
inter_ext_tx_cdf
[
EXT_TX_SIZES
][
TX_TYPES
];
aom_cdf_prob
partition_cdf
[
PARTITION_CONTEXTS
][
PARTITION_TYPES
];
aom_cdf_prob
switchable_interp_cdf
[
SWITCHABLE_FILTER_CONTEXTS
][
SWITCHABLE_FILTERS
];
aom_cdf_prob
intra_ext_tx_cdf
[
EXT_TX_SIZES
][
TX_TYPES
][
TX_TYPES
];
aom_cdf_prob
inter_ext_tx_cdf
[
EXT_TX_SIZES
][
TX_TYPES
];
#endif
}
FRAME_CONTEXT
;
...
...
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