diff options
author | Oleg Oshmyan <chortos@inbox.lv> | 2020-10-29 18:31:57 +0200 |
---|---|---|
committer | Oleg Oshmyan <chortos@inbox.lv> | 2020-10-29 18:31:57 +0200 |
commit | 71595ab9d13ba024cc80b93802bf53072ff4f5aa (patch) | |
tree | 54527f9c438cde49540b49ae01f07741a86d3db9 | |
parent | 41f044de3b34d0b406f155559cd71b827f5a27ac (diff) | |
download | libass-71595ab9d13ba024cc80b93802bf53072ff4f5aa.tar.bz2 libass-71595ab9d13ba024cc80b93802bf53072ff4f5aa.tar.xz |
ass_utils: round double_to_d* properly
-rw-r--r-- | libass/ass_utils.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libass/ass_utils.h b/libass/ass_utils.h index d85ae9b..1108c90 100644 --- a/libass/ass_utils.h +++ b/libass/ass_utils.h @@ -141,7 +141,7 @@ static inline double d6_to_double(int x) } static inline int double_to_d6(double x) { - return (int) (x * 64); + return lrint(x * 64); } static inline double d16_to_double(int x) { @@ -149,7 +149,7 @@ static inline double d16_to_double(int x) } static inline int double_to_d16(double x) { - return (int) (x * 0x10000); + return lrint(x * 0x10000); } static inline double d22_to_double(int x) { @@ -157,7 +157,7 @@ static inline double d22_to_double(int x) } static inline int double_to_d22(double x) { - return (int) (x * 0x400000); + return lrint(x * 0x400000); } #define FNV1_32A_INIT 0x811c9dc5U |