Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
52128c58
Commit
52128c58
authored
Apr 04, 2013
by
Dmitry Kovalev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplifying get_delta_q function.
Change-Id: I3a1e9cc5c3ed5be01ff75a84a6c82ec02c75af9c
parent
ccc0577a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
15 deletions
+11
-15
vp9/decoder/vp9_decodframe.c
vp9/decoder/vp9_decodframe.c
+11
-15
No files found.
vp9/decoder/vp9_decodframe.c
View file @
52128c58
...
...
@@ -901,22 +901,18 @@ static void decode_mb(VP9D_COMP *pbi, MACROBLOCKD *xd,
#endif
}
static
int
get_delta_q
(
vp9_reader
*
r
,
int
*
dq
)
{
const
int
old_value
=
*
dq
;
static
int
get_delta_q
(
vp9_reader
*
bc
,
int
prev
,
int
*
q_update
)
{
int
ret_val
=
0
;
if
(
vp9_read_bit
(
bc
))
{
ret_val
=
vp9_read_literal
(
bc
,
4
);
if
(
vp9_read_bit
(
bc
))
ret_val
=
-
ret_val
;
if
(
vp9_read_bit
(
r
))
{
// Update bit
int
value
=
vp9_read_literal
(
r
,
4
);
if
(
vp9_read_bit
(
r
))
// Sign bit
value
=
-
value
;
*
dq
=
value
;
}
// Trigger a quantizer update if the delta-q value has changed
if
(
ret_val
!=
prev
)
*
q_update
=
1
;
return
ret_val
;
return
old_value
!=
*
dq
;
}
#ifdef PACKET_TESTING
...
...
@@ -1716,9 +1712,9 @@ int vp9_decode_frame(VP9D_COMP *pbi, const uint8_t **p_data_end) {
pc
->
base_qindex
=
vp9_read_literal
(
&
header_bc
,
QINDEX_BITS
);
// AC 1st order Q = default
pc
->
y1dc_delta_q
=
get_delta_q
(
&
header_bc
,
pc
->
y1dc_delta_q
,
&
q_update
);
pc
->
uvdc_delta_q
=
get_delta_q
(
&
header_bc
,
pc
->
uvdc_delta_q
,
&
q_update
);
pc
->
uvac_delta_q
=
get_delta_q
(
&
header_bc
,
pc
->
uvac_delta_q
,
&
q_update
);
q_update
=
get_delta_q
(
&
header_bc
,
&
pc
->
y1dc_delta_q
)
|
get_delta_q
(
&
header_bc
,
&
pc
->
uvdc_delta_q
)
|
get_delta_q
(
&
header_bc
,
&
pc
->
uvac_delta_q
);
if
(
q_update
)
vp9_init_de_quantizer
(
pbi
);
...
...
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