From 1fb9b2a2832444935c4c2fd5679266b0629d1bfd Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 24 May 2015 14:19:57 +0200 Subject: avutil: Add av_q2intfloat() This function allows writing AVRationals as IEEE floats without the need of platform dependant float operations Signed-off-by: Michael Niedermayer --- libavutil/rational.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libavutil/rational.h') diff --git a/libavutil/rational.h b/libavutil/rational.h index 7439701db2..2897469680 100644 --- a/libavutil/rational.h +++ b/libavutil/rational.h @@ -159,6 +159,13 @@ int av_nearer_q(AVRational q, AVRational q1, AVRational q2); */ int av_find_nearest_q_idx(AVRational q, const AVRational* q_list); +/** + * Converts a AVRational to a IEEE 32bit float. + * + * The float is returned in a uint32_t and its value is platform indepenant. + */ +uint32_t av_q2intfloat(AVRational q); + /** * @} */ -- cgit v1.2.3