Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
23f06041
Commit
23f06041
authored
Oct 21, 2016
by
Yaowu Xu
Committed by
Gerrit Code Review
Oct 21, 2016
Browse files
Merge "Fix encoder crash when --enable-daala-ec" into nextgenv2
parents
d56df2f9
e1466ad4
Changes
1
Hide whitespace changes
Inline
Side-by-side
av1/encoder/bitstream.c
View file @
23f06041
...
...
@@ -694,6 +694,9 @@ static void pack_mb_tokens(aom_writer *w, const TOKENEXTRA **tp,
aom_tree_index
index
=
0
;
#if !CONFIG_RANS
const
struct
av1_token
*
const
coef_encoding
=
&
av1_coef_encodings
[
token
];
#if CONFIG_DAALA_EC
int
i
=
0
;
#endif
int
coef_value
=
coef_encoding
->
value
;
int
coef_length
=
coef_encoding
->
len
;
#endif // !CONFIG_RANS
...
...
@@ -720,6 +723,34 @@ static void pack_mb_tokens(aom_writer *w, const TOKENEXTRA **tp,
CATEGORY6_TOKEN
-
ONE_TOKEN
+
1
);
}
}
#else
#if CONFIG_DAALA_EC
/* skip one or two nodes */
if
(
p
->
skip_eob_node
)
{
coef_length
-=
p
->
skip_eob_node
;
i
=
2
*
p
->
skip_eob_node
;
}
// TODO(jbb): expanding this can lead to big gains. It allows
// much better branch prediction and would enable us to avoid numerous
// lookups and compares.
// If we have a token that's in the constrained set, the coefficient tree
// is split into two treed writes. The first treed write takes care of the
// unconstrained nodes. The second treed write takes care of the
// constrained nodes.
if
(
token
>=
TWO_TOKEN
&&
token
<
EOB_TOKEN
)
{
int
len
=
UNCONSTRAINED_NODES
-
p
->
skip_eob_node
;
int
bits
=
coef_value
>>
(
coef_length
-
len
);
aom_write_tree_bits
(
w
,
av1_coef_tree
,
p
->
context_tree
,
bits
,
len
,
i
);
coef_value
&=
(
1
<<
(
coef_length
-
len
))
-
1
;
aom_write_tree
(
w
,
av1_coef_con_tree
,
av1_pareto8_full
[
p
->
context_tree
[
PIVOT_NODE
]
-
1
],
coef_value
,
coef_length
-
len
,
0
);
}
else
{
aom_write_tree_bits
(
w
,
av1_coef_tree
,
p
->
context_tree
,
coef_value
,
coef_length
,
i
);
}
#else
/* skip one or two nodes */
if
(
p
->
skip_eob_node
)
...
...
@@ -741,6 +772,7 @@ static void pack_mb_tokens(aom_writer *w, const TOKENEXTRA **tp,
}
}
}
#endif
#endif // CONFIG_RANS
if
(
extra_bits_av1
->
base_val
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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