Browse Source

av_d2q() documentation

Originally committed as revision 2522 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 21 years ago
parent
commit
bf63eb4bba
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/rational.c

+ 4
- 0
libavcodec/rational.c View File

@@ -51,6 +51,10 @@ AVRational av_sub_q(AVRational b, AVRational c){
return b;
}

/**
* Converts a double precission floating point number to a AVRational.
* @param max the maximum allowed numerator and denominator
*/
AVRational av_d2q(double d, int max){
AVRational a;
int exponent= FFMAX( (int)(log(ABS(d) + 1e-20)/log(2)), 0);


Loading…
Cancel
Save