summaryrefslogtreecommitdiffstats
path: root/libavutil/rational.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'd12b5b2f135aade4099f4b26b0fe678656158c13'Derek Buitenhuis2016-05-111-116/+0
|\ | | | | | | | | | | | | | | * commit 'd12b5b2f135aade4099f4b26b0fe678656158c13': build: Split test programs off into separate files Some conversions done by: James Almer <jamrial@gmail.com> Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | lavu/rational: add more info regarding floor(x+0.5) usageGanesh Ajjanagadde2016-02-291-1/+2
| | | | | | | | | | | | | | | | Add some more verbose info regarding why the imprecise and slow floor(x+0.5) hack is used; helpful for future maintenance. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanag@gmail.com>
* | avutil/rational: Test av_rescale_rnd() with combinations of "special" valuesMichael Niedermayer2015-12-021-0/+44
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | avutil/rational: use frexp rather than ad-hoc log to get floating point exponentGanesh Ajjanagadde2015-10-301-2/+2
| | | | | | | | | | | | | | | | This simplifies and cleans up the code. Furthermore, it is much faster due to absence of the slow log computation. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* | avutil: Add av_q2intfloat()Michael Niedermayer2015-05-261-0/+48
| | | | | | | | | | | | | | This function allows writing AVRationals as IEEE floats without the need of platform dependant float operations Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/rational: Check that av_reduce() returns values within the requested maxMichael Niedermayer2014-12-291-0/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/rational: av_add_stable() test codeMichael Niedermayer2014-01-041-0/+30
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avutil/rational: avoid llrint() and rint()Michael Niedermayer2013-07-041-2/+3
| | | | | | | | | | | | | | | | This should workaround issues with these functions on ia64 and sparc64 Fixes Ticket2713 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_d2q: Add a special case for |value| > MAX and |value| < 1/MAXMichael Niedermayer2013-05-311-0/+2
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_d2q: Avoid llrint(), its not correctly implemented in old netbsdMichael Niedermayer2013-05-261-1/+1
| | | | | | | | | | | | This should fix some fate failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_d2q: fix rounding for negative valuesMichael Niedermayer2013-05-251-1/+1
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | av_d2q: Fix infinity checkMichael Niedermayer2013-05-251-1/+1
| | | | | | | | | | | | | | | | The old check would fail on huge but not infinite values and the later code could then fail to handle them correctly in some cases. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'd46c588f3cb1963a00e990ceaf4ba9ffa05a716d'Michael Niedermayer2013-05-161-1/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | * commit 'd46c588f3cb1963a00e990ceaf4ba9ffa05a716d': Remove commented-out #includes h263dec: Remove broken and disabled debug cruft vc1: Reindent INIT_LUT(), align backslashes Conflicts: libavcodec/vc1.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Remove commented-out #includesDiego Biurrun2013-05-151-1/+0
| |
| * libavutil: Remove pointless rational test program.Diego Biurrun2012-03-261-25/+0
| |
* | replace av_log(0, by av_log(NULL,Michael Niedermayer2012-11-231-2/+2
| | | | | | | | | | | | The first parameter is a pointer and NULL is more correct Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | rational: test add/sub tooMichael Niedermayer2012-11-011-1/+4
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-12-051-48/+62
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: adpcmenc: cosmetics: pretty-printing ac3dec: cosmetics: pretty-printing yuv4mpeg: cosmetics: pretty-printing shorten: remove dead initialization roqvideodec: set AVFrame reference before reget_buffer. bmp: fix some 1bit samples. latmdec: add fate test for audio config change oma: PCM support oma: better format detection with small probe buffer oma: clearify ambiguous if condition wavpack: Properly clip samples during lossy decode Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c. Cleaned pixdesc.c file in libavutil zmbv.c: coding style clean-up. xan.c: coding style clean-up. mpegvideo.c: code cleanup - first 500 lines. Conflicts: Changelog libavcodec/adpcmenc.c libavcodec/bmp.c libavcodec/zmbv.c libavutil/log.c libavutil/pixdesc.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Code clean-up for crc.c, lfg.c, log.c, random_see.d, rational.c and tree.c.Yordan Makariev2011-12-031-48/+62
| | | | | | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* | Merge remote-tracking branch 'qatar/master'Michael Niedermayer2011-06-301-1/+3
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * qatar/master: rational-test: Add proper main() declaration to fix gcc warnings. configure: Add vdpau and dxva2 to configure results output. Remove unused, never built libavutil/pca.[ch] matroskadec: forward parsing errors to caller. av_find_stream_info: simplify EAGAIN handling. aacenc: Fix determination of Mid/Side Mode. psymodel: Remove the single channel analysis function aacenc: Implement dummy channel group analysis that just calls the single channel analysis for each channel. psymodel: Add channels and channel groups to the psymodel. ARM: remove check for PLD instruction fate: move amr[nw]b test rules into separate files ogg: fix double free when finding length of small chained oggs. swscale: implement >8bit scaling support. build: fix creation of tools dir with make 3.81 build: Mark all-yes Makefile target as phony. pixfmt: fix YUV422/444 wrong endian comment build: create output directories as needed Add new yuv444 pixfmts to avcodec_align_dimensions2 Conflicts: Makefile configure libavutil/pca.c libavutil/pca.h libavutil/pixfmt.h libswscale/swscale.c libswscale/utils.c libswscale/x86/swscale_template.c tests/ref/lavfi/pixdesc tests/ref/lavfi/pixfmts_copy tests/ref/lavfi/pixfmts_null tests/ref/lavfi/pixfmts_scale tests/ref/lavfi/pixfmts_vflip Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * rational-test: Add proper main() declaration to fix gcc warnings.Diego Biurrun2011-06-301-1/+3
| |
| * Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-191-4/+4
|/ | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Add selftest code for av_cmp_q().Michael Niedermayer2010-10-051-0/+20
| | | | Originally committed as revision 25339 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Make av_d2q() manage the case in which the value to convert is inf.Stefano Sabatini2010-10-041-0/+2
| | | | Originally committed as revision 25332 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Avoid cast of double nan to int.Stefano Sabatini2010-10-021-2/+4
| | | | | | It may cause exceptions on some platform. Originally committed as revision 25311 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Rename libavutil/assert.h to avassert.hMåns Rullgård2010-10-011-1/+1
| | | | | | This avoids conflicts with the system assert.h. Originally committed as revision 25284 to svn://svn.ffmpeg.org/ffmpeg/trunk
* av_assert() system.Michael Niedermayer2010-09-301-2/+2
| | | | | | | With this the developer can now choose if he wants an assert always enabled or at which compile time assert level. This can thus replace the #define NDEBUG hacks Originally committed as revision 25278 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Convert NaN to 0/0 in av_d2qDavid Conrad2010-05-241-0/+2
| | | | | | | This fixes aspect ratio calculation for encoding from files with 0/0 stored, common with ogg/theora Originally committed as revision 23280 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove explicit filename from Doxygen @file commands.Diego Biurrun2010-04-201-1/+1
| | | | | | | | Passing an explicit filename to this command is only necessary if the documentation in the @file block refers to a file different from the one the block resides in. Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Use full internal pathname in doxygen @file directives.Diego Biurrun2009-02-011-1/+1
| | | | | | | Otherwise doxygen complains about ambiguous filenames when files exist under the same name in different subdirectories. Originally committed as revision 16912 to svn://svn.ffmpeg.org/ffmpeg/trunk
* cosmetics: Use 'num' instead of 'nom' as abbreviation for numerator.Diego Biurrun2009-02-011-11/+11
| | | | Originally committed as revision 16910 to svn://svn.ffmpeg.org/ffmpeg/trunk
* spelling/grammar/consistency review part IDiego Biurrun2009-01-281-2/+2
| | | | Originally committed as revision 16840 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Directly #include a bunch of indirectly #included headers.Diego Biurrun2009-01-241-0/+1
| | | | Originally committed as revision 16748 to svn://svn.ffmpeg.org/ffmpeg/trunk
* export gcd function as av_gcd()Aurelien Jacobs2009-01-171-2/+2
| | | | Originally committed as revision 16653 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Implement av_nearer_q() and av_find_nearest_q_idx() functions.Stefano Sabatini2008-09-251-0/+25
| | | | Originally committed as revision 15415 to svn://svn.ffmpeg.org/ffmpeg/trunk
* license header consistency cosmeticsDiego Biurrun2007-07-051-1/+0
| | | | Originally committed as revision 9484 to svn://svn.ffmpeg.org/ffmpeg/trunk
* move doxy comments from rational.c to rational.h and add some new commentsDujardin Bernard2007-02-261-16/+0
| | | | | | patch by Dujardin Bernard %dujardin P iut A numericable P fr% Originally committed as revision 8132 to svn://svn.ffmpeg.org/ffmpeg/trunk
* fix av_reduce() with things like 1/0 and 0/0Michael Niedermayer2007-01-091-3/+5
| | | | Originally committed as revision 7431 to svn://svn.ffmpeg.org/ffmpeg/trunk
* fix overflow and remove wrong commentMichael Niedermayer2006-11-301-2/+1
| | | | Originally committed as revision 7187 to svn://svn.ffmpeg.org/ffmpeg/trunk
* return optimal fractionMichael Niedermayer2006-11-301-1/+9
| | | | | | based on a patch by Uoti Urpala Originally committed as revision 7186 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Rename ABS macro to FFABS.Diego Biurrun2006-10-111-3/+3
| | | | Originally committed as revision 6666 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change license headers to say 'FFmpeg' instead of 'this program/this library'Diego Biurrun2006-10-071-4/+6
| | | | | | and fix GPL/LGPL version mismatches. Originally committed as revision 6577 to svn://svn.ffmpeg.org/ffmpeg/trunk
* simplifyMichael Niedermayer2006-07-201-5/+4
| | | | Originally committed as revision 5802 to svn://svn.ffmpeg.org/ffmpeg/trunk
* for floats fabs is better & smaller then ABSMichael Niedermayer2006-07-201-1/+1
| | | | Originally committed as revision 5801 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Update licensing information: The FSF changed postal address.Diego Biurrun2006-01-121-1/+1
| | | | Originally committed as revision 4842 to svn://svn.ffmpeg.org/ffmpeg/trunk
* COSMETICS: Remove all trailing whitespace.Diego Biurrun2005-12-171-5/+5
| | | | Originally committed as revision 4749 to svn://svn.ffmpeg.org/ffmpeg/trunk
* libavutil: Utility code from libavcodec moved to a separate library.Alexander Strasser2005-08-011-0/+110
Originally committed as revision 4489 to svn://svn.ffmpeg.org/ffmpeg/trunk
OpenPOWER on IntegriCloud