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
de3a8f23
Commit
de3a8f23
authored
Jun 15, 2016
by
Yaowu Xu
Browse files
vpx_dsp/quantize.c: fix ubsan warnings
BUG=webm:1219 Change-Id: I0c80271c6b78adf40aa7a4cac9e6b431d56958cb
parent
e5e998a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
vpx_dsp/quantize.c
View file @
de3a8f23
...
...
@@ -53,7 +53,7 @@ void vpx_highbd_quantize_dc(const tran_low_t *coeff_ptr,
const
int
coeff_sign
=
(
coeff
>>
31
);
const
int
abs_coeff
=
(
coeff
^
coeff_sign
)
-
coeff_sign
;
const
int64_t
tmp
=
abs_coeff
+
round_ptr
[
0
];
const
u
int
32_t
abs_qcoeff
=
(
u
int
32_t
)((
tmp
*
quant
)
>>
16
);
const
int
abs_qcoeff
=
(
int
)((
tmp
*
quant
)
>>
16
);
qcoeff_ptr
[
0
]
=
(
tran_low_t
)((
abs_qcoeff
^
coeff_sign
)
-
coeff_sign
);
dqcoeff_ptr
[
0
]
=
qcoeff_ptr
[
0
]
*
dequant_ptr
;
if
(
abs_qcoeff
)
...
...
@@ -109,7 +109,7 @@ void vpx_highbd_quantize_dc_32x32(const tran_low_t *coeff_ptr,
const
int
coeff_sign
=
(
coeff
>>
31
);
const
int
abs_coeff
=
(
coeff
^
coeff_sign
)
-
coeff_sign
;
const
int64_t
tmp
=
abs_coeff
+
ROUND_POWER_OF_TWO
(
round_ptr
[
0
],
1
);
const
u
int
32_t
abs_qcoeff
=
(
u
int
32_t
)((
tmp
*
quant
)
>>
15
);
const
int
abs_qcoeff
=
(
int
)((
tmp
*
quant
)
>>
15
);
qcoeff_ptr
[
0
]
=
(
tran_low_t
)((
abs_qcoeff
^
coeff_sign
)
-
coeff_sign
);
dqcoeff_ptr
[
0
]
=
qcoeff_ptr
[
0
]
*
dequant_ptr
/
2
;
if
(
abs_qcoeff
)
...
...
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