FFmpeg
Data Structures | Functions
rational.h File Reference
libavutil » Mathematics » AVRational
#include <stdint.h>
#include <limits.h>
#include "attributes.h"

Go to the source code of this file.

Data Structures

struct   AVRational
  Rational number (pair of numerator and denominator). More...
 

Functions

static AVRational  av_make_q (int num, int den)
  Create an AVRational. More...
 
static int  av_cmp_q (AVRational a, AVRational b)
  Compare two rationals. More...
 
  Convert an AVRational to a double. More...
 
int  av_reduce (int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
  Reduce a fraction. More...
 
  Multiply two rationals. More...
 
  Divide one rational by another. More...
 
  Add two rationals. More...
 
  Subtract one rational from another. More...
 
  Invert a rational. More...
 
  Convert a double precision floating point number to a rational. More...
 
  Find which of the two rationals is closer to another rational. More...
 
int  av_find_nearest_q_idx (AVRational q, const AVRational *q_list)
  Find the value in a list of rationals nearest a given reference rational. More...
 
uint32_t  av_q2intfloat (AVRational q)
  Convert an AVRational to a IEEE 32-bit float expressed in fixed-point format. More...
 
  Return the best rational so that a and b are multiple of it. More...
 

Detailed Description

Utilities for rational number calculation.

Author
Michael Niedermayer micha.nosp@m.elni.nosp@m.@gmx..nosp@m.at

Definition in file rational.h.


Generated on Sat Oct 18 2025 19:24:18 for FFmpeg by   doxygen 1.8.17

AltStyle によって変換されたページ (->オリジナル) /