Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PoroCYon
oidos
Commits
57c22524
Commit
57c22524
authored
Apr 22, 2017
by
Aske Simon Christensen
Browse files
Allow overflowing rounding in quantization
parent
9a1030e6
Changes
1
Hide whitespace changes
Inline
Side-by-side
synth/src/oidos_generate.rs
View file @
57c22524
...
...
@@ -86,7 +86,7 @@ fn quantize(value: f32, level: f32) -> f32 {
let
mask
=
!
bit
+
1
;
let
add
=
bit
>>
1
;
let
mut
bits
=
unsafe
{
transmute
::
<
f32
,
u32
>
(
value
)
};
bits
=
(
bits
+
add
)
&
mask
;
bits
=
bits
.wrapping_add
(
add
)
&
mask
;
if
bits
==
0x80000000
{
bits
=
0x00000000
;
}
...
...
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