2 * Copyright (c) 2019 The WebM project authors. All Rights Reserved.
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
11 #ifndef VPX_VPX_UTIL_VPX_TIMESTAMP_H_
12 #define VPX_VPX_UTIL_VPX_TIMESTAMP_H_
20 // Rational Number with an int64 numerator
21 typedef struct vpx_rational64 {
22 int64_t num; // fraction numerator
23 int den; // fraction denominator
24 } vpx_rational64_t; // alias for struct vpx_rational64_t
26 static INLINE int gcd(int64_t a, int b) {
39 static INLINE void reduce_ratio(vpx_rational64_t *ratio) {
40 const int denom = gcd(ratio->num, ratio->den);
49 #endif // VPX_VPX_UTIL_VPX_TIMESTAMP_H_