libavutil/mathematics.h File Reference

#include "rational.h"

Go to the source code of this file.

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_rescale (int64_t a, int64_t b, int64_t c)
 rescale a 64bit integer with rounding to nearest.
int64_t av_rescale_rnd (int64_t a, int64_t b, int64_t c, enum AVRounding)
 rescale a 64bit integer with specified rounding.
int64_t av_rescale_q (int64_t a, AVRational bq, AVRational cq)
 rescale a 64bit integer by 2 rational numbers.


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 26 of file mathematics.h.


Function Documentation

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

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

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

rescale a 64bit integer with specified rounding.

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

Definition at line 56 of file mathematics.c.

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


Generated on Fri Oct 3 22:47:01 2008 for ffmpeg by  doxygen 1.5.6