mathematics.c File Reference


Detailed Description

Miscellaneous math routines and tables.

Definition in file mathematics.c.

Go to the source code of this file.

Functions

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

Variables

const uint8_t ff_sqrt_tab [128]
const uint8_t ff_log2_tab [256]


Function Documentation

int64_t ff_gcd ( int64_t  a,
int64_t  b 
)

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 52 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(), and rtp_write_header().

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 
)

main ( void   ) 

Definition at line 116 of file mathematics.c.


Variable Documentation

const uint8_t ff_sqrt_tab[128]

Initial value:

{
        0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
        5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
        9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11
}

Definition at line 29 of file mathematics.c.

Referenced by ff_sqrt().

const uint8_t ff_log2_tab[256]

Initial value:

{
        0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
        5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
        6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
        6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
}

Definition at line 36 of file mathematics.c.

Referenced by av_log2(), av_log2_16bit(), decode_frame(), and seq_decode_op1().


Generated on Sat Dec 18 05:15:53 2010 for MythTV by  doxygen 1.5.5