libavutil/mathematics.h File Reference

#include <stdint.h>
#include <math.h>
#include "common.h"
#include "rational.h"

Go to the source code of this file.

Defines

#define M_E   2.7182818284590452354
#define M_LN2   0.69314718055994530942
#define M_LN10   2.30258509299404568402
#define M_PI   3.14159265358979323846
#define M_SQRT1_2   0.70710678118654752440

Enumerations

enum  AVRounding {
  AV_ROUND_ZERO = 0, AV_ROUND_INF = 1, AV_ROUND_DOWN = 2, AV_ROUND_UP = 3,
  AV_ROUND_NEAR_INF = 5
}

Functions

int64_t av_const av_gcd (int64_t a, int64_t b)
int64_t av_rescale (int64_t a, int64_t b, int64_t c) av_const
 Rescales a 64-bit integer with rounding to nearest.
int64_t av_rescale_rnd (int64_t a, int64_t b, int64_t c, enum AVRounding) av_const
 Rescales a 64-bit integer with specified rounding.
int64_t av_rescale_q (int64_t a, AVRational bq, AVRational cq) av_const
 Rescales a 64-bit integer by 2 rational numbers.


Define Documentation

#define M_E   2.7182818284590452354

Definition at line 30 of file mathematics.h.

Referenced by get_qscale(), and Process().

#define M_LN10   2.30258509299404568402

Definition at line 36 of file mathematics.h.

Referenced by ff_acelp_decode_gain_code().

#define M_LN2   0.69314718055994530942

Definition at line 33 of file mathematics.h.

Referenced by encode_block(), and encode_init().

#define M_PI   3.14159265358979323846

#define M_SQRT1_2   0.70710678118654752440

Definition at line 42 of file mathematics.h.

Referenced by dca_subsubframe(), and nelly_decode_block().


Enumeration Type Documentation

enum AVRounding

Enumerator:
AV_ROUND_ZERO  Round toward zero.
AV_ROUND_INF  Round away from zero.
AV_ROUND_DOWN  Round toward -infinity.
AV_ROUND_UP  Round toward +infinity.
AV_ROUND_NEAR_INF  Round to nearest and halfway cases away from zero.

Definition at line 45 of file mathematics.h.


Function Documentation

int64_t av_const av_gcd ( int64_t  a,
int64_t  b 
)

int64_t av_rescale ( int64_t  a,
int64_t  b,
int64_t  c 
) const

int64_t av_rescale_q ( int64_t  a,
AVRational  bq,
AVRational  cq 
) const

int64_t av_rescale_rnd ( int64_t  a,
int64_t  b,
int64_t  c,
enum  AVRounding 
) const

Rescales a 64-bit integer with specified rounding.

A simple a*b/c isn't possible as it can overflow.

Definition at line 64 of file mathematics.c.

Referenced by av_nearer_q(), av_rescale(), av_rescale_q(), av_rescale_rnd(), dv_write_pack(), ff_nut_reset_ts(), gxf_write_media_preamble(), mov_write_edts_tag(), mov_write_mvhd_tag(), mov_write_tkhd_tag(), rtp_write_header(), and write_packet().


Generated on Fri Oct 26 02:35:46 2012 for FFmpeg by  doxygen 1.5.8