~ubuntu-branches/debian/experimental/libav/experimental

« back to all changes in this revision

Viewing changes to libavutil/mathematics.c

  • Committer: Package Import Robot
  • Author(s): Reinhard Tartler
  • Date: 2014-01-18 15:46:55 UTC
  • mfrom: (1.1.24)
  • Revision ID: package-import@ubuntu.com-20140118154655-iz6u00yevkat1jqi
Tags: 6:10~alpha2-1
New Upstream release 10_alpha2. This upstream git snapshot has too many
changes to list here, cf. to the upstream Changelog:
http://git.libav.org/?p=libav.git;a=blob;f=Changelog;hb=refs/tags/v10_alpha2

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 * miscellaneous math routines and tables
24
24
 */
25
25
 
26
 
#include <assert.h>
27
26
#include <stdint.h>
28
27
#include <limits.h>
29
28
 
58
57
 
59
58
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
60
59
    int64_t r=0;
61
 
    assert(c > 0);
62
 
    assert(b >=0);
63
 
    assert((unsigned)rnd<=5 && rnd!=4);
 
60
 
 
61
    if (c <= 0 || b < 0 || rnd == 4 || rnd > 5)
 
62
        return INT64_MIN;
64
63
 
65
64
    if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1));
66
65